/* ==========================================================================
   main.css  -  SmartDietChoices premium design system
   Light editorial content, dark navy header + footer, blue accent.
   Depends on tokens.css. Vanilla CSS, no build step.
   ========================================================================== */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* clip decorative glows/bleeds; does not create a scroll container (sticky header + inner
     .table-wrap scrolling stay intact) so the page never scrolls horizontally. */
  overflow-x: clip;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.14;
  color: var(--heading);
  letter-spacing: -0.02em;
}
h1 { font-size: var(--step-3); font-weight: 300; }
h1 b, h1 .hl { font-weight: 600; color: var(--blue); }
h2 { font-size: var(--step-2); margin-top: var(--s7); }
h3 { font-size: var(--step-1); margin-top: var(--s6); }
p + p { margin-top: var(--s4); }

a { color: var(--blue); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--blue-deep); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}
/* focus inside the dark header stays visible against navy */
.site-header :focus-visible { outline-color: #fff; }

/* numbers: Poppins, tabular */
.mono, .v-number, .v-stat .n, .data-table td.num, .eyebrow {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: #fff; padding: var(--s3) var(--s4);
  border-radius: 0 0 var(--radius-input) 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- Layout wrappers ---- */
.wrap { max-width: var(--main-max); margin: 0 auto; padding: 0 var(--s5); }
.wrap-wide { max-width: var(--wrap-max); }

/* two-column tool layout */
.tool-layout { max-width: var(--wrap-max); margin: 0 auto; padding: 0 var(--s5); }
@media (min-width: 1024px) {
  .tool-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--main-max)) var(--sidebar-w);
    gap: var(--s7); justify-content: center; align-items: start;
  }
  .tool-sidebar { position: sticky; top: 84px; }
}
.calc-layout { display: block; }
@media (min-width: 1200px) {
  .tool-layout {
    grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
    max-width: 1320px; gap: var(--s6);
  }
  .calc-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s5); align-items: start;
  }
  .calc-layout > .calc { margin: 0; }
  .calc-layout > .target-panel { margin: 0; position: sticky; top: 84px; }
}

/* ==========================================================================
   Header / nav  -  dark frosted navy, light mega panel
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 27, 48, 0.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); min-height: 64px; padding-top: var(--s3); padding-bottom: var(--s3);
}
.brand {
  display: flex; align-items: center; gap: var(--s3);
  font-family: var(--font-display); font-weight: 500; font-size: 1.05rem;
  letter-spacing: -0.01em; text-decoration: none; color: #fff; white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand .mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--grad-accent-135); color: #fff;
  font-family: var(--font-display); font-weight: 600; font-size: 0.78rem;
  box-shadow: 0 4px 12px -2px rgba(46, 124, 214, 0.4);
}
.nav-list { display: flex; align-items: center; gap: var(--s5); list-style: none; padding: 0; margin: 0; }
.nav-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  text-decoration: none; font-weight: 400; font-size: 0.9rem; color: #C0D2E4;
  background: none; border: none; font-family: inherit; cursor: pointer; padding: 0;
  transition: color 0.15s var(--ease);
}
.nav-link:hover { color: #fff; }
.mega-trigger .chev { transition: transform 0.15s var(--ease); }
.has-mega.open .mega-trigger .chev { transform: rotate(180deg); }
.nav-cta {
  display: inline-block;
  background: var(--grad-accent); color: #fff; text-decoration: none;
  padding: 0.6rem 1.35rem; border-radius: var(--radius-pill);
  font-weight: 500; font-size: 0.82rem; white-space: nowrap;
  box-shadow: 0 6px 18px -4px rgba(46, 124, 214, 0.55);
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}
.nav-cta:hover { background: var(--blue-deep); color: #fff; transform: translateY(-1px); }

/* mega menu: light floating panel below the nav */
.has-mega { position: static; }
.mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--white); border-top: 1px solid var(--line);
  border-radius: 0 0 20px 20px; box-shadow: var(--shadow-l);
}
.mega::before {
  content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px;
}
.mega[hidden] { display: none; }
.mega-inner {
  max-width: var(--wrap-max); margin: 0 auto; padding: var(--s6) var(--s5) var(--s5);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s6);
}
.mega-head {
  display: flex; align-items: center; gap: var(--s2);
  font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  font-weight: 600; color: var(--blue); margin-bottom: var(--s3);
}
.mega-head svg { color: var(--blue); }
.mega-col ul { list-style: none; padding: 0; margin: 0; }
.mega-col li + li { margin-top: 2px; }
.mega-col a {
  display: block; text-decoration: none; color: var(--ink); font-weight: 500;
  font-size: 0.9rem; padding: 0.4rem 0.6rem; border-radius: var(--radius-input);
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.mega-col a:hover { background: var(--soft); color: var(--blue); }
.mega-foot { border-top: 1px solid var(--hair); }
.mega-foot a {
  display: flex; align-items: center; gap: 0.4rem; justify-content: center;
  max-width: var(--wrap-max); margin: 0 auto; padding: var(--s4);
  text-decoration: none; font-weight: 500; color: var(--blue);
}
.mega-foot a:hover { color: var(--blue-deep); }
.mega-foot svg { transition: transform 0.15s var(--ease); }
.mega-foot a:hover svg { transform: translateX(3px); }

.nav-toggle {
  display: none; background: none; border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-input); padding: 0.5rem 0.7rem;
  color: #fff; cursor: pointer;
}
.nav-toggle-bars { display: block; width: 20px; }
.nav-toggle-bars span { display: block; height: 2px; background: currentColor; border-radius: 2px; }
.nav-toggle-bars span + span { margin-top: 4px; }

@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--white); border-top: 1px solid var(--line);
    box-shadow: var(--shadow-l);
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: var(--s3) var(--s5); }
  .nav-list > li { border-top: 1px solid var(--hair); }
  .nav-list > li:first-child { border-top: none; }
  /* links render on the white mobile panel: use dark ink */
  .nav-link { display: flex; justify-content: space-between; width: 100%; padding: var(--s4) 0; color: var(--ink); }
  .nav-link:hover { color: var(--blue); }
  .nav-cta { display: inline-block; margin: var(--s4) 0; text-align: center; }
  .mega {
    position: static; box-shadow: none; border-top: none; border-radius: 0;
    background: var(--tint); margin-bottom: var(--s3);
  }
  .mega-inner { grid-template-columns: 1fr 1fr; gap: var(--s4); padding: var(--s4); }
  .mega-foot a { justify-content: flex-start; padding: var(--s3) var(--s4); }
}
@media (max-width: 560px) {
  .mega-inner { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Breadcrumb / badge / answer block
   ========================================================================== */
.breadcrumb { margin: var(--s5) 0 var(--s4); font-size: 0.72rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; padding: 0; color: var(--mute); }
.breadcrumb li + li::before { content: "\203A"; margin-right: var(--s2); color: var(--mute); }
.breadcrumb a { color: var(--mute); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb [aria-current] { color: var(--slate); font-weight: 500; }

.badge {
  display: inline-block;
  background: var(--soft); color: var(--blue);
  font-weight: 600; font-size: 0.62rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.4rem 0.9rem; border-radius: var(--radius-pill);
  margin-bottom: var(--s3);
}

.answer-block {
  font-size: 1rem; font-weight: 300; line-height: 1.7;
  color: var(--slate); margin: var(--s4) 0 var(--s5);
  padding-left: var(--s4); border-left: 3px solid var(--blue);
}
.answer-block strong { color: var(--ink); font-weight: 500; }

/* ==========================================================================
   Calculator card
   ========================================================================== */
.calc {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-m);
  padding: var(--s5);
  margin: var(--s5) 0;
}
.calc-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4);
}
.calc-top h2 { margin: 0; font-size: var(--step-1); font-weight: 600; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; } }
.field.full { grid-column: 1 / -1; }
.field label {
  display: block; font-weight: 500; font-size: 0.7rem;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate);
  margin-bottom: var(--s2);
}
.field .hint { display: inline; font-weight: 400; color: var(--mute); font-size: 0.72rem; letter-spacing: 0; text-transform: none; }

input[type="number"], input[type="text"], input[type="time"], select, textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input);
  padding: 0.65rem 0.85rem;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input[type="number"] { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 124, 214, 0.15);
}
textarea { min-height: 160px; resize: vertical; font-family: var(--font-mono); font-size: 0.9rem; }
.dual-input { display: flex; gap: var(--s2); }

.calc[data-unit="metric"] [data-when="imperial"],
.calc[data-unit="imperial"] [data-when="metric"] { display: none; }

.muted { color: var(--slate); font-size: 0.92rem; }

/* segmented pill controls */
.seg, .unit-toggle {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  background: var(--soft); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 4px;
}
.seg { margin-top: var(--s2); }
.seg button, .unit-toggle button {
  font: inherit; font-weight: 500; font-size: 0.82rem;
  color: var(--slate); background: none; border: none; cursor: pointer;
  padding: 0.4rem 0.95rem; border-radius: var(--radius-pill);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.seg button[aria-pressed="true"], .unit-toggle button[aria-pressed="true"] {
  background: var(--grad-accent); color: #fff;
}
.seg button:hover[aria-pressed="false"], .unit-toggle button:hover[aria-pressed="false"] { color: var(--blue); }

/* ==========================================================================
   Target Panel  -  signature element, now light
   ========================================================================== */
.target-panel {
  position: relative;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-l);
  padding: var(--s6) var(--s5);
  margin: var(--s5) 0;
  overflow: hidden;
}
.target-panel::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(95, 169, 232, 0.06), transparent 45%);
  pointer-events: none;
}
.target-panel > * { position: relative; z-index: 1; }
.target-panel[hidden] { display: none; }

.v-micro {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--s3);
}
.v-label {
  font-weight: 500; font-size: 0.6rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute);
}
.v-live { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 500; font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; }
.v-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); display: inline-block; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .v-live i { animation: none; } }

.v-number {
  font-family: var(--font-mono); font-weight: 600;
  font-size: var(--step-target); line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.035em;
  color: var(--blue-deep); /* fallback before gradient clip */
  background: linear-gradient(120deg, #1E63B8, #5FA9E8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: var(--s2);
}
.v-number .unit {
  font-size: 0.28em; font-weight: 400; color: var(--mute);
  -webkit-text-fill-color: var(--mute); margin-left: 0.4rem; letter-spacing: 0;
}
.v-say { margin-top: var(--s3); font-size: 0.95rem; font-weight: 300; color: var(--slate); line-height: 1.65; }
.v-say strong, .v-say .hl { color: var(--blue); font-weight: 500; }
.v-warn {
  margin-top: var(--s4); padding: var(--s3) var(--s4);
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: var(--radius-input);
  color: #B4530E; font-size: 0.9rem;
}
.v-warn strong { color: #9A4409; }
.v-viz { margin-top: var(--s5); }
.v-viz svg { width: 100%; }
.v-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--s3); margin-top: var(--s5);
}
.v-stat {
  background: var(--grad-chip);
  border: 1px solid var(--hair);
  border-radius: var(--radius-chip);
  padding: var(--s3) var(--s4);
}
.v-stat .k { font-size: 0.56rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); font-weight: 500; }
.v-stat .n { font-weight: 600; font-size: 1rem; margin-top: 3px; color: var(--ink); letter-spacing: -0.01em; }
.v-actions { display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s5); }

/* schedule table rendered inside the panel (calorie cycling) */
.panel-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; color: var(--ink); }
.panel-table th, .panel-table td { padding: var(--s2) var(--s3); text-align: left; border-bottom: 1px solid var(--hair); }
.panel-table thead th {
  font-weight: 500; font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--mute);
  background: var(--tint);
}
.panel-table td.num, .panel-table th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.panel-table tr.hi td { color: var(--blue); font-weight: 600; }

.copy-btn, .share-btn {
  font: inherit; font-weight: 500; font-size: 0.88rem; cursor: pointer;
  padding: 0.6rem 1.3rem; border-radius: var(--radius-pill);
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.copy-btn { background: var(--white); color: var(--blue); border: 1.5px solid var(--blue); }
.copy-btn:hover { background: var(--blue); color: #fff; }
.copy-btn.done { background: var(--blue); color: #fff; }
.share-btn { background: none; color: var(--slate); border: 1.5px solid var(--line); }
.share-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ==========================================================================
   Prose / supporting copy
   ========================================================================== */
.prose { margin-top: var(--s6); }
.prose p { margin-top: var(--s4); color: var(--ink); font-weight: 400; }
.prose ul, .prose ol { padding-left: 1.4rem; margin-top: var(--s4); }
.prose li + li { margin-top: var(--s2); }
.prose h2 b, .prose h3 b { font-weight: 600; }

.lead { font-size: var(--step-1); font-weight: 300; color: var(--slate); margin-top: var(--s3); }

/* sources / references block */
.sources { margin-top: var(--s7); }
.sources h2 { font-size: var(--step-1); }
.sources ol, .sources ul { padding-left: 1.25rem; margin-top: var(--s3); }
.sources li { font-size: 0.85rem; font-weight: 400; color: var(--slate); margin-top: var(--s2); line-height: 1.6; }
.sources li + li { margin-top: var(--s2); }
.sources a { color: var(--blue); }
.sources a:hover { color: var(--blue-deep); }
.source-note { font-size: 0.8rem; color: var(--mute); margin-top: var(--s3); }

/* ---- Guides ---- */
.wrap.guide { max-width: 760px; }
.guide-meta {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center;
  margin: var(--s3) 0 var(--s5); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--mute);
}
.guide-meta .sep { color: var(--line); }
.guide-lead { font-size: var(--step-1); font-weight: 300; color: var(--slate); line-height: 1.7; margin: var(--s3) 0 0; }
/* calculator CTA block (on guides + build-injected on calculators) */
.guide-cta {
  background: var(--tint); border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: var(--radius-card); padding: var(--s5); margin: var(--s6) 0;
}
.guide-cta-k { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--blue); margin: 0; }
.guide-cta-t { margin: var(--s2) 0 0; font-size: var(--step-1); font-weight: 600; }
.guide-cta-t a { color: var(--ink); }
.guide-cta-t a:hover { color: var(--blue); }
.guide-cta-d { font-weight: 300; color: var(--slate); font-size: 0.9rem; line-height: 1.7; margin: var(--s2) 0 var(--s4); }
.guide-cta .btn-pill { margin-top: var(--s1); }
/* formula block */
.formula {
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius-input);
  padding: var(--s4) var(--s5); margin: var(--s4) 0; font-family: var(--font-mono);
  font-size: 0.92rem; color: var(--ink); font-variant-numeric: tabular-nums; overflow-x: auto;
}
.formula .var { color: var(--blue-deep); font-weight: 500; }
/* guides hub */
.guides-hub .dir-group { break-inside: avoid; }
.guide-card-note { font-weight: 300; color: var(--mute); font-size: 0.78rem; margin-top: 2px; }

.key-facts {
  background: var(--tint);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-card);
  padding: var(--s5);
  margin: var(--s5) 0;
}
.key-facts h2, .key-facts h3 { margin-top: 0; font-size: var(--step-1); }
.key-facts ul { list-style: none; padding: 0; margin-top: var(--s3); }
.key-facts li { padding-left: 1.6rem; position: relative; margin-top: var(--s3); font-weight: 500; }
.key-facts li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--blue);
}

.worked-example {
  background: var(--white); border: 1px solid var(--line);
  border-left: 3px solid var(--blue); border-radius: var(--radius-input);
  padding: var(--s4) var(--s5); margin: var(--s5) 0;
}
.worked-example .we-title {
  font-weight: 600; font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--blue); margin-bottom: var(--s2);
}

.callout {
  border-radius: var(--radius-input); padding: var(--s4) var(--s5); margin: var(--s5) 0;
  background: var(--tint); border: 1px solid var(--line); border-left: 3px solid var(--blue);
}
.callout.warn {
  background: rgba(249, 115, 22, 0.08); border-color: rgba(249, 115, 22, 0.3);
  border-left-color: var(--warm);
}

/* data tables */
.table-wrap { overflow-x: auto; margin: var(--s5) 0; }
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-input); overflow: hidden; font-size: 0.95rem;
}
.data-table caption {
  text-align: left; font-weight: 600; padding: var(--s3) var(--s4);
  background: var(--white); border-bottom: 1px solid var(--line);
}
.data-table th, .data-table td { padding: var(--s3) var(--s4); text-align: left; border-bottom: 1px solid var(--hair); }
.data-table thead th {
  background: var(--tint); font-weight: 500; font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.num { text-align: right; font-weight: 500; }

/* FAQ: floating cards with plus chips (site-wide, JS-free accordion) */
.faq { margin-top: var(--s7); }
.faq details {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 16px; padding: 0; margin-top: var(--s3);
  box-shadow: var(--shadow-s); transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.faq details:hover { border-color: var(--sky); box-shadow: var(--shadow-m); }
.faq summary {
  cursor: pointer; font-weight: 500; font-size: 0.95rem; padding: var(--s4) var(--s5);
  list-style: none; position: relative; padding-right: calc(var(--s5) + 2rem);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: var(--s4); top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--soft); color: var(--blue);
  display: grid; place-items: center; font-weight: 500; font-size: 1.1rem;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 var(--s5) var(--s4); color: var(--ink); font-weight: 400; }

/* ==========================================================================
   Related tools
   ========================================================================== */
.related-module {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow-s);
  padding: var(--s5); margin-bottom: var(--s5);
}
.related-module h2 {
  margin: 0 0 var(--s4); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--blue);
}
.related-module a {
  display: block; text-decoration: none;
  padding: var(--s3); border-radius: var(--radius-input);
  transition: background 0.15s var(--ease);
}
.related-module a:hover { background: var(--soft); }
.related-module .rt-name { display: block; font-weight: 500; color: var(--ink); font-size: 0.92rem; }
.related-module .rt-note { display: block; font-size: 0.8rem; color: var(--slate); margin-top: 2px; }

.related { margin-top: var(--s7); }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s4); }
@media (max-width: 560px) { .related-grid { grid-template-columns: 1fr; } }
.related-grid a {
  display: block; text-decoration: none;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-input); padding: var(--s4);
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.related-grid a:hover { border-color: var(--sky); transform: translateY(-2px); box-shadow: var(--shadow-m); }
.related-grid .rt-name { display: block; font-weight: 500; color: var(--ink); }
.related-grid .rt-note { display: block; font-size: 0.85rem; color: var(--slate); margin-top: 2px; }

/* ==========================================================================
   Ad slots  -  placeholder state only; heights fixed (zero CLS)
   ========================================================================== */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  margin: var(--s5) auto;
  background: var(--grad-adslot);
  border: 1px solid var(--hair);
  border-radius: var(--radius-chip);
  overflow: hidden; position: relative;
}
.ad-slot::before {
  content: "Advertisement";
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: #AEBECD; font-weight: 500;
}
.ad-slot img, .ad-slot iframe, .ad-slot ins { position: relative; width: auto; max-width: 100%; height: auto; }

.ad-slot[data-ad-slot="header-leaderboard"],
.ad-slot[data-ad-slot="footer-banner"] { width: 100%; max-width: 728px; height: 106px; }
@media (max-width: 767px) {
  .ad-slot[data-ad-slot="header-leaderboard"],
  .ad-slot[data-ad-slot="footer-banner"] { max-width: 320px; height: 116px; }
}
.ad-slot[data-ad-slot="in-content-1"] { width: 100%; height: 296px; }
.ad-slot[data-ad-slot="sidebar-mrec"] { width: 300px; height: 266px; }
.ad-slot[data-ad-slot="sidebar-sky"] { width: 300px; height: 616px; position: sticky; top: 84px; }
@media (max-width: 1023px) {
  .ad-slot[data-ad-slot="sidebar-mrec"],
  .ad-slot[data-ad-slot="sidebar-sky"] { display: none; }
}

/* ==========================================================================
   Homepage  -  matches homepage-premium-final.html section by section
   ========================================================================== */
.eyebrow, .hp-eyebrow {
  font-weight: 600; font-size: 0.62rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--blue);
  display: inline-block;
}

/* pill + text-link buttons (shared) */
.btn-pill {
  display: inline-block; background: var(--blue); color: #fff; text-decoration: none;
  font-weight: 500; font-size: 0.85rem; padding: 0.85rem 1.75rem; border-radius: var(--radius-pill);
  box-shadow: 0 10px 24px -8px rgba(46, 124, 214, 0.5);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn-pill:hover { background: var(--blue-deep); color: #fff; transform: translateY(-1px); }
.btn-pill.mint { background: var(--grad-accent); }
.btn-pill.mint:hover { background: var(--blue-deep); }
.text-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--blue); font-weight: 500; text-decoration: none;
}
.text-link:hover { color: var(--blue-deep); }
.text-link svg { transition: transform 0.15s var(--ease); }
.text-link:hover svg { transform: translateX(3px); }

/* section rhythm */
.hp-section { margin: var(--s8) 0; }
.hp-section:first-child { margin-top: 0; }
.signature-section { margin: var(--s8) 0; }
.hp-title { font-size: var(--step-2); font-weight: 300; margin: 0; letter-spacing: -0.02em; }
.hp-title b, .hp-title .hl { font-weight: 600; color: var(--blue); }
.hp-kicker { margin: 0 0 var(--s6); max-width: 60ch; }
.hp-kicker .hp-eyebrow { margin-bottom: var(--s2); }
.hp-lead { font-weight: 300; color: var(--slate); max-width: 60ch; margin: var(--s3) 0 0; }

/* 1. Hero */
.hero-split {
  position: relative;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s7);
  align-items: center; padding: var(--s8) 0 calc(var(--s8) + var(--s5));
}
.hero-split::before {
  content: ""; position: absolute; top: -40px; right: 0;
  width: min(560px, 72vw); height: min(560px, 72vw);
  background: radial-gradient(closest-side, rgba(95, 169, 232, 0.14), transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero-copy { position: relative; z-index: 1; max-width: 34rem; }
.hero-copy .hp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 7px 15px; font-size: 0.68rem; letter-spacing: 0.02em; font-weight: 500;
  color: var(--slate); text-transform: none; box-shadow: var(--shadow-s); margin-bottom: var(--s4);
}
.hero-copy .hp-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.hero-copy h1 {
  font-size: clamp(2.4rem, 1.6rem + 3.4vw, 3.4rem); font-weight: 300;
  letter-spacing: -0.025em; line-height: 1.12; margin: 0; color: var(--heading);
}
.hero-copy h1 .hl { color: var(--blue); font-weight: 600; }
.hero-lead { font-weight: 300; font-size: 1rem; color: var(--slate); line-height: 1.8; margin: var(--s5) 0 0; max-width: 46ch; }
.hero-cta { display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap; margin-top: var(--s6); }

/* hero result panel: light, matches the Target Panel sample */
.hero-panel {
  position: relative; z-index: 1;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-l); padding: var(--s6); overflow: hidden;
}
.hero-panel::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(95, 169, 232, 0.06), transparent 45%); pointer-events: none;
}
.hero-panel > * { position: relative; z-index: 1; }
.hp-pmicro { display: flex; justify-content: space-between; align-items: center; }
.hero-panel .hp-plabel {
  font-weight: 500; font-size: 0.6rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--mute);
}
.hp-plive { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 500; font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; }
.hp-plive i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); display: inline-block; animation: pulse 2s ease-in-out infinite; }
.hero-panel .hp-num {
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(3rem, 2.4rem + 2vw, 4rem); line-height: 1; letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums; margin-top: var(--s3);
  color: var(--blue-deep);
  background: linear-gradient(120deg, #1E63B8, #5FA9E8);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-panel .hp-num span { font-size: 0.24em; font-weight: 400; color: var(--mute); -webkit-text-fill-color: var(--mute); margin-left: 0.4rem; letter-spacing: 0; }
.hero-panel .hp-verdict { color: var(--slate); font-weight: 300; font-size: 0.9rem; line-height: 1.6; margin: var(--s3) 0 0; }
.hero-panel .hp-verdict strong { color: var(--blue); font-weight: 500; }
.hero-panel .hp-spark { margin-top: var(--s4); }
.hero-panel .hp-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s5); }
.hero-panel .hp-chip { background: var(--grad-chip); border: 1px solid var(--hair); border-radius: var(--radius-chip); padding: var(--s3); }
.hero-panel .hp-chip .k { font-size: 0.56rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); font-weight: 500; }
.hero-panel .hp-chip .v { font-weight: 600; font-size: 0.95rem; color: var(--ink); margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; gap: var(--s6); padding: var(--s7) 0 var(--s6); }
  .hero-copy { max-width: none; }
}

/* 2. Popular calculators */
.pop-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); margin-top: var(--s5); }
@media (max-width: 820px) { .pop-row { grid-template-columns: 1fr; } }
.pop-tile {
  position: relative; display: block; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--white); padding: var(--s6); box-shadow: var(--shadow-m); overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.pop-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-l); }
.pop-tile.featured::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-accent);
}
.pop-tile .pop-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
  color: var(--blue); background: var(--soft); border-radius: var(--radius-pill); padding: 5px 12px;
}
.pop-tile h3 { margin: var(--s4) 0 0; font-size: 1.2rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.pop-tile p { font-weight: 300; color: var(--slate); margin: var(--s2) 0 0; font-size: 0.9rem; line-height: 1.75; }
.pop-tile .pop-go { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: var(--s5); color: var(--blue); font-weight: 500; font-size: 0.85rem; }
.pop-tile .pop-go svg { transition: transform 0.15s var(--ease); }
.pop-tile:hover .pop-go svg { transform: translateX(3px); }

.pop-links {
  margin-top: var(--s5); background: var(--white); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-s); overflow: hidden;
}
.pop-link {
  display: grid; grid-template-columns: minmax(0, 16rem) 1fr auto; align-items: center;
  gap: var(--s4); padding: var(--s4) var(--s5); text-decoration: none;
  border-bottom: 1px solid var(--hair); transition: background 0.2s var(--ease);
}
.pop-link:last-child { border-bottom: none; }
.pop-link:hover { background: #F8FBFE; }
.pop-link .pl-name { font-weight: 500; color: var(--ink); font-size: 0.92rem; }
.pop-link .pl-desc { font-weight: 300; color: var(--mute); font-size: 0.82rem; }
.pop-link .pl-arrow {
  width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--blue);
  display: grid; place-items: center; flex-shrink: 0; justify-self: end;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.pop-link:hover .pl-arrow { background: var(--blue); color: #fff; }
@media (max-width: 640px) {
  .pop-link { grid-template-columns: 1fr auto; }
  .pop-link .pl-desc { grid-column: 1 / -1; grid-row: 2; }
}

/* 3. Calculators by goal: white cards, two columns at wide widths */
.tool-directory { margin: 0; display: grid; grid-template-columns: 1fr; gap: var(--s5); }
@media (min-width: 900px) { .tool-directory { grid-template-columns: 1fr 1fr; gap: var(--s6); } }
.dir-group {
  margin: 0; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: var(--s6); box-shadow: var(--shadow-s);
}
.dir-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 0; margin-bottom: var(--s2); border: none;
}
.dir-head h2 { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.dir-count {
  font-size: 0.62rem; font-weight: 500; color: var(--blue); background: var(--soft);
  border-radius: var(--radius-pill); padding: 4px 11px; letter-spacing: 0.08em;
  text-transform: uppercase; white-space: nowrap;
}
.dir-lead {
  font-weight: 300; color: var(--slate); font-size: 0.82rem; line-height: 1.7;
  margin: 0 0 var(--s2); padding-bottom: var(--s3); border-bottom: 1px solid var(--hair);
}
.dir-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: var(--s3); padding: var(--s3) var(--s1); text-decoration: none;
  border-bottom: 1px solid var(--hair); transition: background 0.15s var(--ease);
}
.dir-row:last-child { border-bottom: none; }
.dir-row:hover { background: #F8FBFE; }
.dir-name { font-weight: 500; color: var(--ink); font-size: 0.9rem; }
.dir-note { font-weight: 300; color: var(--mute); font-size: 0.78rem; grid-column: 1 / -1; grid-row: 2; margin-top: 2px; }
.dir-arrow { color: var(--sky); display: inline-flex; transition: transform 0.15s var(--ease), color 0.15s var(--ease); }
.dir-row:hover .dir-arrow { color: var(--blue); transform: translateX(2px); }

/* 4. Signature feature: Calorie Cycling on a light tint band */
.signature {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--s7); align-items: center;
  background: var(--grad-tint); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--s7) var(--s6); box-shadow: var(--shadow-m);
}
.signature::before {
  content: ""; position: absolute; bottom: -120px; left: -80px;
  width: 380px; height: 380px;
  background: radial-gradient(closest-side, rgba(46, 124, 214, 0.1), transparent 70%);
}
.signature > * { position: relative; z-index: 1; }
.signature .sig-eyebrow {
  color: var(--blue); font-weight: 600; font-size: 0.62rem;
  letter-spacing: 0.22em; text-transform: uppercase;
}
.signature h2 { margin: var(--s2) 0 0; color: var(--heading); font-size: var(--step-2); font-weight: 300; letter-spacing: -0.02em; }
.signature h2 b, .signature h2 .hl { font-weight: 600; color: var(--blue); }
.signature p { color: var(--slate); font-weight: 300; line-height: 1.8; margin: var(--s4) 0 var(--s5); max-width: 42ch; }

.cycle-viz { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: var(--s5); box-shadow: var(--shadow-m); }
.cycle-caption {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.56rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mute); font-weight: 500; margin-bottom: var(--s4);
}
.cycle-caption strong { color: var(--blue); font-weight: 600; }
.cycle-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s2); align-items: end; height: 120px; margin: 0; padding: 0; }
.cycle-bars li { list-style: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: var(--s2); }
.cycle-bar { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #E1EDF9, #D6E6F6); }
.cycle-bars li.high .cycle-bar { background: linear-gradient(180deg, #5FA9E8, #2E7CD6); box-shadow: 0 6px 14px -4px rgba(46, 124, 214, 0.4); }
.cycle-day { font-size: 0.56rem; color: var(--mute); font-weight: 400; }
.cycle-avg { position: relative; margin-top: var(--s4); border-top: 1px solid var(--hair); padding-top: var(--s3); font-size: 0.66rem; font-weight: 300; color: var(--mute); line-height: 1.6; }
@media (max-width: 820px) { .signature { grid-template-columns: 1fr; gap: var(--s6); padding: var(--s6) var(--s5); } }

/* 5. How it works: white step cards with gradient number coins */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); margin-top: var(--s5); }
.step { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: var(--s6); box-shadow: var(--shadow-s); }
.step .step-n {
  width: 34px; height: 34px; border-radius: 50%; background: var(--grad-accent-135);
  color: #fff; font-weight: 600; font-size: 0.75rem; display: grid; place-items: center;
  box-shadow: 0 6px 14px -4px rgba(46, 124, 214, 0.4);
}
.step h3 { margin: var(--s4) 0 var(--s2); font-size: 1rem; font-weight: 600; color: var(--ink); }
.step p { font-weight: 300; color: var(--slate); font-size: 0.85rem; line-height: 1.75; margin: 0; }
.steps-note { font-weight: 300; color: var(--mute); font-size: 0.82rem; margin: var(--s5) 0 0; }
.steps-note a { color: var(--blue); border-bottom: 1px solid var(--soft); }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; gap: var(--s5); } }

/* 6. Trust & methods: white card */
.trust-panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--s7) var(--s6);
  margin: var(--s8) 0; box-shadow: var(--shadow-m);
}
.trust-split { display: grid; grid-template-columns: 1fr 1.05fr; gap: var(--s7); align-items: start; }
.trust-split h2 { margin: 0; font-size: var(--step-2); font-weight: 300; letter-spacing: -0.02em; max-width: 18ch; }
.trust-split h2 b, .trust-split h2 .hl { font-weight: 600; color: var(--blue); }
.trust-split .trust-copy p { font-weight: 300; color: var(--slate); line-height: 1.85; margin: var(--s4) 0 0; max-width: 48ch; }
.trust-split .trust-links { display: flex; gap: var(--s5); flex-wrap: wrap; margin-top: var(--s5); }
.evidence { list-style: none; padding: 0; margin: 0; }
.evidence-row { border-top: 1px solid var(--hair); padding: var(--s4) 0; }
.evidence-row:first-child { border-top: none; padding-top: 0; }
.evidence-row .ev-k { font-weight: 500; color: var(--ink); font-size: 0.9rem; }
.evidence-row .ev-v { font-weight: 300; color: var(--mute); font-size: 0.82rem; line-height: 1.65; margin-top: 3px; }
@media (max-width: 820px) { .trust-split { grid-template-columns: 1fr; gap: var(--s6); } }

/* homepage FAQ heading can center via inline style in markup; nothing extra needed */

/* ==========================================================================
   Footer  -  premium dark
   ========================================================================== */
.site-footer {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--navy), var(--navy-deep));
  color: #B9CCDF; margin-top: var(--s8); padding: 0;
  font-size: 0.92rem;
}
.site-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #2E7CD6 30%, #5FA9E8 70%, transparent);
}
.site-footer::after {
  content: ""; position: absolute; top: -160px; right: -120px;
  width: 520px; height: 520px; max-width: 80vw;
  background: radial-gradient(closest-side, rgba(95, 169, 232, 0.12), transparent 70%);
  pointer-events: none;
}
.site-footer .wrap, .site-footer .wrap-wide { position: relative; z-index: 1; }
.f-top {
  display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr 1fr; gap: var(--s6);
  padding: var(--s7) 0 var(--s6);
}
.f-brand .f-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--grad-accent-135); color: #fff; font-weight: 600; font-size: 0.85rem;
  box-shadow: 0 4px 12px -2px rgba(46, 124, 214, 0.4);
}
.f-brand .f-nm { display: flex; align-items: center; gap: 11px; font-weight: 500; font-size: 1.05rem; color: #fff; letter-spacing: -0.01em; }
.f-brand p { font-size: 0.9rem; font-weight: 300; color: #AEC2D6; line-height: 1.8; margin-top: var(--s4); max-width: 280px; }
.f-trust { display: flex; flex-direction: column; gap: 9px; margin-top: var(--s4); }
.f-trust span { font-size: 0.82rem; font-weight: 400; color: #B4C8DC; }
.f-trust span::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #5FA9E8; margin-right: 9px; vertical-align: 2px; }

.f-col h3 {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: #7FBBEF; font-weight: 600; margin: 0 0 var(--s4);
}
.f-col ul { list-style: none; padding: 0; margin: 0; }
.f-col a {
  display: block; font-size: 0.875rem; font-weight: 400; color: #C3D5E8;
  line-height: 2.1; text-decoration: none; transition: color 0.15s var(--ease), transform 0.15s var(--ease);
}
.f-col a:hover { color: #fff; transform: translateX(2px); }

.f-note {
  padding: 0 0 var(--s5); font-size: 0.8rem; font-weight: 300;
  color: #A4B9CE; line-height: 1.85; max-width: none;
}
.f-note a { color: #C3D5E8; }
.f-note a:hover { color: #fff; }
.f-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--s5) 0 var(--s6);
  display: flex; justify-content: space-between; align-items: center; gap: var(--s5);
}
.f-copy { flex: 0 1 auto; min-width: 0; font-size: 0.8rem; font-weight: 300; color: #AEC2D6; }
.f-copy a { color: #C3D5E8; }
.f-copy a:hover { color: #fff; }
.f-legal { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: var(--s5); font-size: 0.8rem; font-weight: 400; }
/* wide desktop: copyright + legal links each on a single row */
@media (min-width: 1121px) {
  .f-copy { white-space: nowrap; }
  .f-legal { flex-wrap: nowrap; white-space: nowrap; }
}
.f-legal a { color: #C3D5E8; text-decoration: none; }
.f-legal a:hover { color: #fff; }

@media (max-width: 940px) {
  .f-top { grid-template-columns: 1fr 1fr; gap: var(--s5); }
  .f-brand { grid-column: 1 / -1; }
  .f-bottom { flex-direction: column; align-items: flex-start; }
  .f-legal { flex-wrap: wrap; white-space: normal; }
  .f-copy { white-space: normal; }
}
@media (max-width: 480px) {
  .f-top { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   404
   ========================================================================== */
.notfound { text-align: left; padding: var(--s8) 0; }
.notfound .code {
  font-family: var(--font-mono); font-weight: 600; font-size: 5rem; line-height: 1;
  letter-spacing: -0.03em;
  color: var(--blue-deep);
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Utility
   ========================================================================== */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}
.recipe-flag { color: var(--warm); font-weight: 600; }

/* small screens: keep everything usable at 360px */
@media (max-width: 400px) {
  .wrap, .tool-layout { padding: 0 var(--s4); }
  .calc { padding: var(--s4); }
  .target-panel { padding: var(--s5) var(--s4); }
  .seg button, .unit-toggle button { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
  .signature, .trust-panel { padding: var(--s5) var(--s4); }
}
