/* =========================================================
   ChrysoKit — Global Styles
   Aesthetic: refined editorial warmth
   Palette: terracotta / cream / beige / sage (no blue/purple)
   ========================================================= */

:root {
  /* Brand palette */
  --primary: #D4A373;
  --primary-dark: #B8895E;
  --primary-darker: #8F6A44;
  --secondary-bg: #FAEDCD;
  --page-bg: #FEFAE0;
  --text: #2C2C2C;
  --text-muted: #6B6B6B;
  --text-subtle: #9A9A9A;
  --success: #CCD5AE;
  --success-dark: #A8B288;
  --success-darker: #7E8B66;
  --border: #E9E9E9;
  --border-warm: #E8DFCA;
  --white: #FFFFFF;
  --danger: #C97B63;
  --warning: #E0A458;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Shadows — warm-tinted for cohesion */
  --shadow-xs: 0 1px 2px rgba(60, 42, 24, 0.04);
  --shadow-sm: 0 1px 3px rgba(60, 42, 24, 0.06), 0 1px 2px rgba(60, 42, 24, 0.04);
  --shadow: 0 4px 10px rgba(60, 42, 24, 0.06), 0 2px 4px rgba(60, 42, 24, 0.04);
  --shadow-md: 0 8px 20px rgba(60, 42, 24, 0.08), 0 4px 8px rgba(60, 42, 24, 0.04);
  --shadow-lg: 0 16px 36px rgba(60, 42, 24, 0.10), 0 6px 12px rgba(60, 42, 24, 0.05);
  --shadow-focus: 0 0 0 3px rgba(212, 163, 115, 0.28);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --t-fast: 140ms var(--ease);
  --t: 220ms var(--ease);
  --t-slow: 380ms var(--ease);

  /* Layout */
  --container: 1200px;
  --header-h: 68px;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--page-bg);
  /* Subtle warm radial atmosphere — adds depth without noise */
  background-image:
    radial-gradient(1200px 600px at 90% -10%, rgba(212, 163, 115, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(204, 213, 174, 0.14), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
}

img, svg { display: block; max-width: 100%; }

a {
  color: var(--primary-darker);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--text); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection {
  background: var(--primary);
  color: var(--white);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

main { flex: 1; }

/* Focus-visible accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(254, 250, 224, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border-warm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--primary-darker); }
.logo-mark {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--page-bg);
  font-weight: 800;
  font-size: 1rem;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08), var(--shadow-xs);
}
.logo-text span { color: var(--primary-darker); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: right var(--t);
}
.main-nav a:hover { color: var(--primary-darker); }
.main-nav a:hover::after { right: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: var(--radius-sm);
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  transition: background-color var(--t), color var(--t), transform var(--t-fast), box-shadow var(--t);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-xs), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
  box-shadow: var(--shadow), inset 0 -1px 0 rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border-color: var(--border-warm);
}
.btn-secondary:hover {
  background: var(--secondary-bg);
  border-color: var(--primary);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-warm);
}
.btn-ghost:hover {
  background: var(--secondary-bg);
  border-color: var(--primary);
}

.btn-block { width: 100%; }

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-md); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.btn-icon {
  padding: 9px;
  border-radius: var(--radius-sm);
}
.btn-icon svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(60px, 10vw, 110px) 0 48px;
  text-align: center;
  position: relative;
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-warm);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 22px;
  backdrop-filter: blur(6px);
}
.hero .eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success-dark);
  box-shadow: 0 0 0 3px rgba(168, 178, 136, 0.25);
}

.hero h1 {
  max-width: 820px;
  margin: 0 auto 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--primary-darker);
  background: linear-gradient(180deg, transparent 62%, rgba(212, 163, 115, 0.28) 62%);
  padding: 0 4px;
}

.hero .subhead {
  max-width: 620px;
  margin: 0 auto 40px;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.55;
}

.search-wrap {
  max-width: 540px;
  margin: 0 auto;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 15px 52px 15px 52px;
  border: 1px solid var(--border-warm);
  border-radius: 999px;
  background: var(--white);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t), box-shadow var(--t);
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}
.search-wrap .search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
  display: flex;
}
.search-wrap .search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  padding: 6px;
  border-radius: 50%;
  display: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.search-wrap .search-clear:hover { background: var(--secondary-bg); color: var(--text); }
.search-wrap.has-value .search-clear { display: flex; }

/* ---------- Section ---------- */
.section { padding: clamp(48px, 8vw, 80px) 0; }

.section-header {
  text-align: center;
  margin-bottom: 40px;
}
.section-header h2 { margin-bottom: 10px; }
.section-header p { color: var(--text-muted); }

/* ---------- Tool Grid ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.tool-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(212,163,115,0.10), transparent 50%);
  opacity: 0;
  transition: opacity var(--t);
  pointer-events: none;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.tool-card:hover::before { opacity: 1; }

.tool-card > * { position: relative; z-index: 1; }

.icon-wrap {
  width: 44px;
  height: 44px;
  background: var(--secondary-bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-darker);
  transition: background var(--t), transform var(--t);
}
.icon-wrap svg { width: 22px; height: 22px; }
.tool-card:hover .icon-wrap {
  background: var(--primary);
  color: var(--white);
  transform: rotate(-4deg) scale(1.05);
}

.tool-card h3 { font-size: 1.1rem; }
.tool-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
  line-height: 1.5;
}
.tool-card .btn { align-self: flex-start; }

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 50px 20px;
  background: var(--white);
  border: 1px dashed var(--border-warm);
  border-radius: var(--radius-lg);
}

/* ---------- Tool Page ---------- */
.tool-page { padding: 40px 0 72px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-darker); }
.breadcrumb svg { width: 14px; height: 14px; }

.tool-header {
  max-width: 780px;
  margin: 0 auto 36px;
  text-align: center;
}
.tool-header .tool-icon {
  width: 60px; height: 60px;
  background: var(--secondary-bg);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-darker);
  margin-bottom: 18px;
}
.tool-header .tool-icon svg { width: 28px; height: 28px; }
.tool-header h1 { margin-bottom: 10px; font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
.tool-header p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.tool-card-lg {
  max-width: 780px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow);
}

.how-to {
  max-width: 780px;
  margin: 40px auto 0;
  padding: 28px 32px;
  background: var(--secondary-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-warm);
}
.how-to h2 { font-size: 1.25rem; margin-bottom: 12px; }
.how-to ol, .how-to ul { padding-left: 20px; color: var(--text); }
.how-to li { margin-bottom: 6px; }
.how-to li::marker { color: var(--primary-darker); }

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}
.field label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  letter-spacing: -0.005em;
}
.field label .meta {
  color: var(--text-muted);
  font-weight: 500;
}

.text-input,
.field input[type="text"],
.field input[type="number"],
.field input[type="email"],
.field input[type="url"],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color var(--t), box-shadow var(--t);
}

.text-input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.field textarea {
  min-height: 180px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}

.field .helper {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  margin: 8px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: var(--shadow);
  transition: transform var(--t-fast);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: var(--shadow);
}

/* Checkboxes (pill style) */
.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 9px 14px;
  background: var(--white);
  border: 1px solid var(--border-warm);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.check-item:hover { border-color: var(--primary); }
.check-item input {
  accent-color: var(--primary);
  width: 15px; height: 15px;
  cursor: pointer;
}
.check-item:has(input:checked) {
  background: var(--secondary-bg);
  border-color: var(--primary);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--page-bg);
  border: 1px solid var(--border-warm);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  overflow-x: auto;
}
.tab {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.tab-panel { display: none; animation: fadeIn var(--t-slow); }
.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Outputs ---------- */
.output-box {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--page-bg);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  word-break: break-all;
}
.output-box .val { flex: 1; line-height: 1.5; }

.strength-bar {
  margin-top: 18px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0%;
  background: var(--danger);
  transition: width var(--t-slow), background-color var(--t-slow);
  border-radius: 4px;
}
.strength-label {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.result {
  margin-top: 22px;
  padding: 22px;
  background: var(--secondary-bg);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  animation: fadeIn var(--t-slow);
}
.result-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  font-weight: 600;
}
.result-big {
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.result-sub { color: var(--text-muted); font-size: 0.92rem; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.stat-card {
  background: var(--secondary-bg);
  padding: 16px 14px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border-warm);
  transition: transform var(--t-fast);
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-darker);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Timer */
.timer-wrap { text-align: center; padding: 10px 0; }
.timer-mode {
  display: inline-block;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  padding: 5px 14px;
  background: var(--secondary-bg);
  border-radius: 999px;
  margin-bottom: 8px;
}
.timer-display {
  font-size: clamp(4.5rem, 13vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 12px 0 20px;
}
.timer-ring {
  width: clamp(240px, 50vw, 320px);
  height: clamp(240px, 50vw, 320px);
  margin: 0 auto 10px;
  position: relative;
}
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring .ring-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.timer-ring .ring-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke var(--t);
}
.timer-ring.is-break .ring-fg { stroke: var(--success-dark); }
.timer-ring .ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.timer-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.mode-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  border-top: 1px dashed var(--border-warm);
  padding-top: 20px;
}
.session-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.session-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--t);
}
.session-dot.done { background: var(--primary); }

/* QR */
#qrcode {
  display: flex;
  justify-content: center;
  min-height: 40px;
  margin: 22px 0 16px;
}
#qrcode img, #qrcode canvas {
  border-radius: var(--radius);
  border: 1px solid var(--border-warm);
  background: var(--white);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.qr-empty {
  padding: 50px 20px;
  background: var(--page-bg);
  border: 1px dashed var(--border-warm);
  border-radius: var(--radius);
  color: var(--text-subtle);
  text-align: center;
  font-size: 0.9rem;
  width: 100%;
}

/* Item list (discount calculator) */
.item-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  background: var(--page-bg);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius);
  font-size: 0.93rem;
  animation: fadeIn var(--t-slow);
}
.item-row .remove {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.item-row .remove:hover { background: rgba(201, 123, 99, 0.1); }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  margin-top: 14px;
  background: var(--secondary-bg);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.05rem;
}
.total-row .label { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.total-row .value { color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* Currency swap */
.swap-wrap {
  display: flex;
  justify-content: center;
  margin: 2px 0;
}
.swap-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), transform var(--t), border-color var(--t);
  color: var(--text);
}
.swap-btn:hover {
  background: var(--secondary-bg);
  border-color: var(--primary);
  transform: rotate(180deg);
}
.swap-btn svg { width: 18px; height: 18px; }

.rate-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.rate-meta::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success-dark);
}

/* BMI scale */
.bmi-scale {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-warm);
}
.bmi-bar {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(to right,
    #E0A458 0%, #E0A458 18.5%,
    #CCD5AE 18.5%, #CCD5AE 50%,
    #D4A373 50%, #D4A373 75%,
    #C97B63 75%, #C97B63 100%);
  overflow: visible;
}
.bmi-marker {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 26px;
  background: var(--text);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left var(--t-slow);
  box-shadow: 0 0 0 3px var(--white);
}
.bmi-legend {
  display: grid;
  grid-template-columns: 18.5fr 31.5fr 25fr 25fr;
  gap: 2px;
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Article pages ---------- */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 0;
}
.article h1 { margin-bottom: 24px; }
.article .meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.article h2 {
  margin-top: 36px;
  margin-bottom: 14px;
  font-size: 1.35rem;
}
.article p, .article li { color: var(--text); margin-bottom: 12px; }
.article ul, .article ol { padding-left: 22px; margin-bottom: 16px; }
.article ul li::marker { color: var(--primary); }

/* 404 */
.error-page {
  text-align: center;
  padding: 120px 24px 100px;
}
.error-page .code {
  font-size: clamp(5rem, 20vw, 10rem);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 20px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Ad placeholder */
.ad-slot {
  max-width: 728px;
  margin: 48px auto;
  min-height: 90px;
  background: var(--white);
  border: 1px dashed var(--border-warm);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-warm);
  padding: 32px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--primary-darker); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: var(--text);
  color: var(--page-bg);
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t), transform var(--t);
  z-index: 100;
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.toast svg { width: 16px; height: 16px; }
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reveal on load */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { animation: rise 600ms var(--ease) both; }
.reveal-1 { animation-delay: 80ms; }
.reveal-2 { animation-delay: 160ms; }
.reveal-3 { animation-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .container { padding: 0 20px; }

  .nav-toggle { display: flex; }

  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--page-bg);
    border-bottom: 1px solid var(--border-warm);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
    display: none;
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a, .main-nav .btn {
    padding: 14px 24px;
    border-radius: 0;
    text-align: left;
    width: 100%;
    justify-content: flex-start;
  }
  .main-nav a::after { display: none; }
  .main-nav .btn {
    margin: 8px 24px;
    width: calc(100% - 48px);
    justify-content: center;
  }

  .row, .row-3 { grid-template-columns: 1fr; }

  .tool-card-lg { padding: 24px 20px; border-radius: var(--radius-lg); }
  .how-to { padding: 24px 22px; }

  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .section { padding: 40px 0; }
  .tool-grid { grid-template-columns: 1fr; }
  .btn { padding: 10px 16px; font-size: 0.9rem; }
  .btn-lg { padding: 12px 22px; }
}
