:root {
  --ivory: #FDFBF7;
  --sage: #E2EAD9;
  --forest: #2C4A3E;
  --amber: #D97706;
  --muted: #718096;
  --body-text: #4A5568;
  --line: #DCE3D3;
  --danger: #B3261E;
}

/* Dashboard themes (2026-09-16) — user-chosen accent palettes, applied via
   data-app-theme on <body>, NOT #app: body's own `color: var(--forest)`
   rule (line ~44) is what most text actually inherits its color from —
   .brand/.g-name/etc. never declare color themselves — and CSS inheritance
   passes down the already-COMPUTED value, not a live var() reference. An
   override scoped to #app (a body descendant) never reaches back up to
   change what body itself computed, so text would silently stay the old
   theme's color while only elements with their own explicit `color: var()`
   (buttons, pills, card titles) actually changed. Confirmed by comparing
   getComputedStyle(#app) vs getComputedStyle(.brand) before fixing this.
   Only the brand tokens (forest/sage/amber/line) vary; ivory/muted/body-
   text/danger stay constant across every theme so contrast and readability
   never depend on which one a tester picked. "forest" is the default and
   needs no override block. "ocean" is free; "sunrise" and "berry" are
   gated behind isPremium (see wireCustomize in app.js). */
body[data-app-theme="ocean"] {
  --sage: #DCEEF0;
  --forest: #1E4A52;
  --amber: #E0895C;
  --line: #C9DEE0;
}
body[data-app-theme="sunrise"] {
  --sage: #F5E3D3;
  --forest: #7A3E2B;
  --amber: #B45309;
  --line: #E8D2BC;
}
body[data-app-theme="berry"] {
  --sage: #EDE0EA;
  --forest: #4A2545;
  --amber: #C2185B;
  --line: #E0CFE0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ivory);
  color: var(--forest);
  font-family: 'Inter', -apple-system, sans-serif;
  min-height: 100vh;
  min-height: 100dvh; /* see .screen below for why dvh matters here */
  /* Safety net (2026-09-17) — a translated string or long dish name
     shouldn't ever be able to force the whole page to scroll sideways;
     individual components should wrap instead. This is the backstop, not
     the fix, for any one that's missed. */
  overflow-x: hidden;
}
#app { max-width: 100%; }

body {
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ivory);
  position: relative;
  padding-bottom: 40px;
}

/* Desktop / tablet testers: the phone-width layout is intentional (this is a
   mobile app prototype), but stretched edge-to-edge on a wide monitor it reads
   as broken rather than deliberate. Frame it like a device instead. */
@media (min-width: 720px) {
  body {
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--sage) 0%, var(--ivory) 420px);
    padding: 48px 24px;
  }

  #app {
    height: min(860px, calc(100vh - 96px));
    overflow-y: auto;
    border-radius: 28px;
    box-shadow: 0 30px 60px -20px rgba(44, 74, 62, 0.35), 0 0 0 1px rgba(44, 74, 62, 0.06);
    scrollbar-width: thin;
  }

  #app::-webkit-scrollbar { width: 8px; }
  #app::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--forest);
  margin: 0 0 8px;
}

p { margin: 0 0 12px; line-height: 1.3; }

.screen {
  padding: 32px 24px 24px;
  min-height: 100vh;
  /* 100vh on mobile is the *layout* viewport, which on Android Chrome (and
     some other browsers) doesn't shrink when the on-screen keyboard opens —
     so a screen sized to 100vh can end up taller than what's actually
     visible once the keyboard is up, pushing the submit button below the
     fold and forcing a scroll just to reach it while filling out a form.
     100dvh tracks the real visible viewport, keyboard included. */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 720px) {
  /* #app is a fixed-height framed card here (see above), not the raw
     viewport — fill that box instead of 100vh so a short screen's
     bottom-pinned button sits at the card's own bottom, not a phantom
     full-viewport height that forces an extra scroll to reach it. */
  .screen { min-height: 100%; }
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 600;
  margin-bottom: 12px;
}

.headline { font-size: 26px; font-weight: 700; }
.subhead { font-style: italic; color: var(--muted); font-size: 14.5px; }
.body-copy { font-size: 14px; color: var(--body-text); }

.spacer { flex: 1; }

.btn-primary, .btn-secondary {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 24px;
  padding: 16px 24px;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
}
.btn-primary {
  background: var(--forest);
  color: var(--ivory);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-secondary {
  background: transparent;
  color: var(--forest);
  border: 1.5px solid var(--forest);
}
.btn-primary:active, .btn-secondary:active { transform: scale(0.98); }

.btn-row { display: flex; gap: 12px; }
.btn-row .btn-secondary { width: auto; flex: 0 0 auto; padding-left: 20px; padding-right: 20px; }
.btn-row .btn-primary { flex: 1; }

.track-learn-more {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--forest);
  text-decoration: underline;
  margin-top: 6px;
  cursor: pointer;
}
.track-explainer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line, #DCE3D3);
}
.track-explainer .k {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 8px 0 2px;
}
.track-explainer .k:first-child { margin-top: 0; }
.track-explainer p { font-size: 12.5px; margin: 0; color: var(--body-text); }

.target-cards { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.target-card {
  background: var(--sage);
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.target-card.selected { border-color: var(--forest); }
.target-card .t-label { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.target-card .t-desc { font-size: 12.5px; color: var(--body-text); }

.quiz-question { margin-bottom: 22px; }
.quiz-question .target-cards { margin: 8px 0 0; gap: 8px; }
.quiz-question .target-card { padding: 12px 16px; }
.quiz-recommended-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ivory, #FDFBF7);
  background: var(--forest);
  padding: 3px 9px;
  border-radius: 100px;
  margin-bottom: 8px;
}

.input-group { margin-bottom: 16px; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.lang-switch label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lang-switch select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--ivory);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--forest);
}

/* Side-by-side field packing — two input-groups per row, 16px gap, no
   trailing empty column on wide screens; collapses to one column under 360px. */
.field-row { display: flex; gap: 16px; }
.field-row .input-group { flex: 1; min-width: 0; }
@media (max-width: 360px) {
  .field-row { flex-direction: column; gap: 0; }
}
.input-group label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.input-group input, .input-group select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--ivory);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--forest);
}
.input-group input:focus, .input-group select:focus { outline: 2px solid var(--forest); }

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--sage);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0;
}
.checkbox-row input { margin-top: 3px; }
.checkbox-row label { font-size: 11.5px; color: var(--body-text); line-height: 1.5; }

.vendor-link-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vendor-link-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 999px;
  padding: 4px 10px;
  text-decoration: none;
  white-space: nowrap;
}
.vendor-link-pill:hover { background: var(--amber); color: var(--surface, #fff); }

/* Home / orientation screen */
.home-steps { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.home-step { display: flex; gap: 14px; align-items: flex-start; }
.home-step-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--forest);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.home-step p { margin: 0; font-size: 13.5px; color: var(--body-text); line-height: 1.5; padding-top: 3px; }
.home-step p strong { color: var(--forest); }

.home-features { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.home-features-label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); display: block; margin-bottom: 12px; }
.home-features-grid { display: flex; flex-direction: column; gap: 12px; }
.home-feature { display: flex; gap: 12px; align-items: flex-start; }
.home-feature-icon { flex-shrink: 0; font-size: 18px; line-height: 1.4; }
.home-feature-title { font-size: 13.5px; font-weight: 700; color: var(--forest); }
.home-feature-body { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* Dashboard */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 12px;
  gap: 10px;
}
.topbar .brand {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
}
.topbar .tagline {
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
/* Language switcher lives here now, above the aura ring, so it's the very
   first control a new (or demoing) tester sees — Gen-Z UX pattern: put the
   thing they'll actually reach for at the top, not buried in Settings. */
.topbar-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.topbar-right .lang-switch { margin-bottom: 0; }
.topbar-right .lang-switch label { display: none; }
.topbar-right .lang-switch select { font-size: 11.5px; padding: 4px 8px; }
.aura-ring {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 10px;
  color: var(--forest);
  border: 2.5px solid var(--amber);
  background: rgba(226,234,217,0.6);
  transition: border-color 0.3s;
}
.aura-ring.high { border-color: #4C9A6C; }
.aura-ring.mid { border-color: var(--amber); }
.aura-ring.low { border-color: #B3261E; }

.greeting { padding: 8px 20px 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.greeting .g-name { font-size: 17px; font-weight: 700; }
.greeting .g-sub { font-size: 13px; color: var(--muted); }
.greeting-utils { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex-shrink: 1; min-width: 0; max-width: 42%; padding-top: 4px; }
.greeting-util-link { font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: underline; cursor: pointer; white-space: normal; text-align: left; }

.streak-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px 16px;
  font-size: 12.5px;
  color: var(--body-text);
}
.streak-row span { background: var(--sage); padding: 5px 10px; border-radius: 100px; white-space: nowrap; }
/* Customize sits in the stat-pill row itself, not tucked into a link list —
   same pill shape as the streak/log/track badges so it reads as one more
   thing you can tap, not a footnote. Amber fill (vs. the neutral sage of
   the read-only stats) is what marks it as the one actionable pill here. */
.streak-pill-action {
  background: var(--amber);
  color: var(--ivory);
  border: none;
  padding: 5px 12px;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
/* Bite Timer pill (2026-09-17) — same tappable-pill shape as Customize, but
   forest instead of amber so the two actionable pills in this row read as
   distinct actions, not a repeated one. */
.streak-pill-action.timer-pill { background: var(--forest); }

.macro-card {
  margin: 0 20px 16px;
  background: var(--sage);
  border-radius: 16px;
  padding: 16px 18px;
}
.macro-card .m-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }

/* This week's plan */
.plan-card { margin: 0 20px 16px; background: var(--ivory); border: 1.5px solid var(--forest); border-radius: 16px; padding: 16px 18px; }
.plan-card .m-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--forest); font-weight: 700; margin-bottom: 10px; }
.plan-courses { display: flex; flex-direction: column; gap: 10px; }
.plan-course { background: var(--sage); border-radius: 12px; padding: 12px 14px; }
.plan-course-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.plan-course-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.plan-course-window { text-transform: none; letter-spacing: normal; font-weight: 400; opacity: 0.7; margin-left: 6px; }
.plan-swap {
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600; color: var(--forest);
  background: transparent; border: 1px solid var(--forest); border-radius: 100px;
  padding: 3px 10px; cursor: pointer;
}
.plan-dish-name { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.plan-bought-badge { font-size: 10px; font-weight: 600; color: var(--muted); background: var(--ivory); border-radius: 100px; padding: 2px 8px; vertical-align: middle; }

/* EU allergen labeling (2026-09-12) — Milk only, real data. High-visibility
   for a confirmed allergen (the point of the badge); deliberately quieter
   for "not yet verified" so it reads as a known gap, not a warning. */
.eu-allergen-badge {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.3; color: #fff;
  background: #B3261E; border-radius: 6px; padding: 3px 9px; margin: 4px 0 6px; max-width: 100%;
}
.eu-allergen-unverified {
  display: inline-block; font-size: 10.5px; font-style: italic; line-height: 1.3; color: var(--muted);
  margin: 2px 0 6px; max-width: 100%;
}
.plan-dish-meta { font-size: 11px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; margin-bottom: 8px; }
.plan-accompaniment { font-size: 11.5px; color: var(--forest); font-weight: 600; margin-bottom: 8px; }
.plan-log-btn { width: auto; padding: 7px 16px; font-size: 12px; }
.plan-note { font-size: 11px; color: var(--muted); margin: 10px 0 0; }

.i18n-notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 11.5px;
  color: var(--amber, #B15A2C);
  background: rgba(177, 90, 44, 0.08);
  border: 1px solid rgba(177, 90, 44, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 10px 0;
  line-height: 1.5;
}
.i18n-notice .icon { flex-shrink: 0; }
.course-toggle-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.course-toggle-label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 8px; }
.course-toggle-group { display: flex; gap: 8px; flex-wrap: wrap; }
.course-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--forest);
  background: var(--sage); border-radius: 100px;
  padding: 6px 12px 6px 10px; cursor: pointer;
}
.course-toggle input { margin: 0; }

/* Full week plan */
.week-plan-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.week-day-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--sage); }
.week-day-row.is-today { background: var(--forest); }
.week-day-row.is-today .week-day-label,
.week-day-row.is-today .week-day-course { color: var(--ivory); }
.week-day-label { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 700; color: var(--forest); white-space: nowrap; padding-top: 2px; }
.week-day-dishes { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.week-day-course { font-size: 12px; color: var(--forest); }

/* Weekly recap — tier resolved from real check-in data, blueprint section 07 */
.path-card { display: flex; flex-direction: column; gap: 10px; }
.path-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--muted); }
.path-item.done { color: var(--forest); }
.path-item.due { color: var(--amber); font-weight: 600; }
.path-icon { flex: 0 0 auto; line-height: 1.4; }

/* Dashboard customization card */
.customize-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: block; margin: 14px 0 8px; }
.customize-label:first-child { margin-top: 0; }
.shopping-list-items { margin: 0; padding-left: 18px; }
.shopping-list-items li { font-size: 13.5px; color: var(--body-text); margin-bottom: 6px; }
.theme-swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-swatch {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.theme-swatch.selected { border-color: var(--forest); }
.theme-swatch .swatch-fill { width: 32px; height: 32px; border-radius: 50%; }
.theme-swatch .swatch-lock {
  position: absolute; bottom: -2px; right: -2px;
  font-size: 11px;
  background: var(--ivory);
  border-radius: 50%;
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}
.nickname-input-row { margin-top: 4px; }
.premium-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 100px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Premium upgrade modal — reuses the walkthrough-backdrop pattern */
.premium-modal-card { text-align: center; }
.premium-modal-card .headline { font-size: 20px; }
.premium-perks { text-align: left; margin: 14px 0; padding: 0; list-style: none; }
.premium-perks li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--body-text); margin-bottom: 8px; }
.premium-perks li::before { content: "✦"; color: var(--amber); flex: 0 0 auto; }

/* Ask Laghva */
.ask-laghva-card { border-color: var(--forest); }
.ask-laghva-input {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--forest);
  background: var(--ivory);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  box-sizing: border-box;
}
.ask-laghva-input:focus { outline: 2px solid var(--forest); }
.ask-laghva-response {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--sage);
  border-radius: 12px;
  font-size: 13px;
  color: var(--body-text);
  line-height: 1.5;
  white-space: pre-wrap;
}
.ask-laghva-response.error { background: rgba(179,38,30,0.1); color: var(--danger); }

/* PWA install banner + iOS instructions sheet */
.install-banner {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--sage);
  border-radius: 16px;
  text-align: center;
}
.install-banner-icon { font-size: 22px; display: block; margin-bottom: 6px; }
.install-banner-text { font-size: 13px; color: var(--body-text); margin: 0 0 12px; line-height: 1.5; }
.install-banner-actions { display: flex; align-items: center; justify-content: center; gap: 14px; }
.install-banner-btn { width: auto; padding: 10px 22px; }
.install-banner-dismiss { font-size: 12px; color: var(--muted); text-decoration: underline; cursor: pointer; }

.ios-install-steps { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ios-install-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--body-text); line-height: 1.5; }
.ios-step-icon { flex: 0 0 auto; margin-top: 2px; color: var(--forest); }
.ios-step-num {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--ivory);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.recap-card { border-color: var(--amber); }
.recap-days { font-size: 13px; color: var(--forest); margin: 0 0 8px; }
.recap-tier { background: rgba(226,234,217,0.5); border-radius: 12px; padding: 10px 14px; }
.recap-tier-badge { font-size: 11.5px; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: 0.03em; }
.recap-tier-note { font-size: 12px; color: var(--forest); margin: 4px 0 0; }
.recap-encourage { font-size: 12.5px; color: var(--muted); margin: 0; }

/* Weekly check-in */
.checkin-question { margin-bottom: 14px; }
.checkin-question:last-of-type { margin-bottom: 0; }
.checkin-question-label { font-size: 12.5px; font-weight: 600; color: var(--forest); display: block; margin-bottom: 8px; }
.checkin-pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.checkin-pill {
  font-family: 'Inter', sans-serif; font-size: 11.5px; font-weight: 600; color: var(--forest);
  background: var(--ivory); border: 1.5px solid var(--line); border-radius: 100px;
  padding: 6px 12px; cursor: pointer;
}
.checkin-pill.active { background: var(--forest); color: var(--ivory); border-color: var(--forest); }

/* Swap picker sheet */
.picker-dish-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.picker-dish-row {
  background: rgba(226,234,217,0.5); border-radius: 14px; padding: 12px 16px; cursor: pointer;
  border: 1.5px solid transparent;
}
.picker-dish-row:active { border-color: var(--forest); }
.picker-dish-row.is-current { background: var(--sage); border-color: var(--forest); }
.picker-current-badge { font-size: 10px; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: 0.03em; }
.macro-bar-row { margin-bottom: 10px; }
.macro-bar-row:last-child { margin-bottom: 0; }
.macro-bar-label { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.macro-bar-track { height: 8px; border-radius: 4px; background: rgba(44,74,62,0.12); overflow: hidden; }
.macro-bar-fill { height: 100%; background: var(--forest); border-radius: 4px; transition: width 0.3s; }
.macro-bar-fill.over { background: var(--danger); }

.browse-divider { margin: 22px 20px 4px; padding-top: 18px; border-top: 2px dashed var(--line); }
.browse-divider-title { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 700; color: var(--forest); text-transform: uppercase; letter-spacing: 0.04em; }
.browse-divider-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

.track-tabs {
  display: flex;
  gap: 8px;
  padding: 0 20px 14px;
  overflow-x: auto;
}
.track-tab {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 100px;
  background: var(--ivory);
  border: 1.5px solid var(--line);
  color: var(--body-text);
  white-space: nowrap;
  cursor: pointer;
}
.track-tab.active { background: var(--forest); color: var(--ivory); border-color: var(--forest); }

.region-section { padding: 0 20px; }
.region-section h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 18px 0 8px;
}
.dish-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(226,234,217,0.5);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.dish-row > div:first-child { flex: 1 1 180px; min-width: 0; }
.dish-row .d-name { font-size: 14px; font-weight: 600; }
.dish-row .d-kcal { font-size: 11px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
.trigger-btn {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ivory);
  background: var(--forest);
  border: none;
  padding: 8px 14px;
  border-radius: 100px;
  cursor: pointer;
  white-space: normal;
  text-align: left;
  max-width: 100%;
  flex-shrink: 0;
}

/* Bottom sheet */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(44,74,62,0.4);
  display: flex; align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.sheet-backdrop.hidden { display: none; }
.sheet {
  width: 100%; max-width: 480px;
  background: var(--ivory);
  border-radius: 24px 24px 0 0;
  padding: 24px 24px 28px;
  max-height: 80vh;
  overflow-y: auto;
}
.sheet h3 { font-size: 20px; }
.sheet .sheet-region { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--amber); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.sheet .sheet-body { font-size: 14px; color: var(--body-text); line-height: 1.6; margin-bottom: 18px; }
.sheet .cite-row {
  display: flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: var(--muted);
  margin-bottom: 18px;
}
.sheet .cite-row .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--forest); }

.toast {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: var(--forest);
  color: var(--ivory);
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 13px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.toast.show { opacity: 1; }

.timer-modal {
  position: fixed; inset: 0;
  background: var(--forest);
  color: var(--ivory);
  z-index: 60;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 24px;
}
.timer-modal.hidden { display: none; }
.timer-ring {
  width: 160px; height: 160px;
  border-radius: 50%;
  border: 6px solid var(--amber);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 700;
  margin-bottom: 20px;
}

.walkthrough-backdrop {
  position: fixed; inset: 0;
  background: rgba(44,74,62,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 70;
  padding: 20px;
}
.walkthrough-backdrop.hidden { display: none; }
.walkthrough-card {
  width: 100%; max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--ivory);
  border-radius: 20px;
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
}
.walkthrough-top { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.walkthrough-close {
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  line-height: 1;
  padding: 4px;
}
.walkthrough-progress-track {
  height: 4px;
  background: var(--line);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 18px;
}
.walkthrough-progress-fill {
  height: 100%;
  background: var(--forest);
  transition: width 0.25s ease;
}
.walkthrough-slide .headline { font-size: 21px; margin-top: 4px; }
.walkthrough-tracks { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.walkthrough-track-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.walkthrough-track-row.current { background: var(--sage); border-color: var(--forest); }
.wt-track-emoji { font-size: 18px; line-height: 1.4; }
.wt-track-name { font-size: 13.5px; font-weight: 700; color: var(--forest); }
.wt-track-desc { font-size: 12px; color: var(--body-text); margin: 2px 0 0; }
.walkthrough-checklist { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.walkthrough-check-item { display: flex; gap: 10px; align-items: flex-start; }
.walkthrough-check-item span {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--ivory);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.walkthrough-check-item p { font-size: 13px; color: var(--body-text); margin: 0; }

.reset-link {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  padding: 20px;
  text-decoration: underline;
  cursor: pointer;
}

.progress-dots { display: flex; gap: 6px; margin-bottom: 24px; }
.progress-dots span { width: 24px; height: 4px; border-radius: 2px; background: var(--line); }
.progress-dots span.done { background: var(--forest); }

/* Persistent page identifier (2026-09-12) — lives outside #app so a screen
   re-render never wipes it. Tapping it copies the exact screen id + URL,
   so a tester can paste one line straight into feedback instead of trying
   to describe "the page after the quiz." */
#page-badge {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 60;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: rgba(253, 251, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 9px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s, border-color 0.15s;
}
#page-badge:active { color: var(--forest); border-color: var(--forest); }
#page-badge.copied { color: var(--forest); border-color: var(--forest); }

@media (prefers-color-scheme: dark) {
  /* Prototype intentionally single-theme (matches the app's own light UI system, section 05.6) */
}
