/* ---------- Self-hosted web fonts (SIL Open Font License 1.1, see fonts/OFL-*.txt) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/barlow-condensed-800-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/barlow-condensed-800-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Metric-matched fallbacks: no re-wrap or jump when the web fonts swap in ----------
   Measured in Chromium against the real fonts (sample of headings and numbers):
   Barlow Condensed 800 = Arial Narrow x 0.93 = Arial x 0.66; Inter = Arial x 1.04. */
@font-face { font-family: "Barlow Fallback"; font-weight: 600 800; src: local("Arial Narrow Bold"), local("ArialNarrow-Bold"); size-adjust: 93%; ascent-override: 107.5%; descent-override: 21.5%; line-gap-override: 0%; }
@font-face { font-family: "Barlow Fallback Wide"; font-weight: 600 800; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"); size-adjust: 66%; ascent-override: 151%; descent-override: 30%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; font-weight: 100 549; src: local("Arial"), local("ArialMT"), local("Helvetica"); size-adjust: 105%; ascent-override: 92.4%; descent-override: 22.9%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; font-weight: 550 900; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"); size-adjust: 102%; ascent-override: 95.1%; descent-override: 23.5%; line-gap-override: 0%; }

/* ---------- Tokens ---------- */
:root {
  --bg: #0b0d10; --surface: #14171c; --surface-2: #1b1f26; --surface-3: #262b34; --border: #252a33;
  --text: #eef1f5; --muted: #8d96a5; --faint: #858e9e;
  --accent: #b6f23f; --accent-ink: #0b0d10; --accent-soft: rgba(182, 242, 63, .12);
  --good: #34d399; --good-ink: #0b0d10; --good-soft: rgba(52, 211, 153, .13); --warn: #fbbf24; --bad: #f87171; --bad-ink: #0b0d10; --bad-soft: rgba(248, 113, 113, .12);
  --protein: #60a5fa; --carbs: #fbbf24; --fat: #f472b6; --water: #38bdf8;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .4);
  --nav-h: 64px;
  /* Type, spacing and touch (design plan, 2026-10-23) */
  --font-display: "Barlow Condensed", "Barlow Fallback", "Barlow Fallback Wide", ui-sans-serif, system-ui, sans-serif;
  --font: Inter, "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 32px; --fs-num: 44px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --tap: 44px;
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f1f3f5; --surface-3: #e3e6eb; --border: #e3e6ea;
  --text: #11151a; --muted: #5b6472; --faint: #646d7b;
  --accent: #3d7300; --accent-ink: #ffffff; --accent-soft: rgba(61, 115, 0, .1);
  --good: #059669; --good-ink: #ffffff; --good-soft: rgba(5, 150, 105, .1); --warn: #d97706; --bad: #dc2626; --bad-ink: #ffffff; --bad-soft: rgba(220, 38, 38, .08);
  --protein: #2563eb; --carbs: #d97706; --fat: #db2777; --water: #0284c7;
  --shadow: 0 10px 28px rgba(16, 24, 40, .1);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f1f3f5; --surface-3: #e3e6eb; --border: #e3e6ea;
    --text: #11151a; --muted: #5b6472; --faint: #646d7b;
    --accent: #3d7300; --accent-ink: #ffffff; --accent-soft: rgba(61, 115, 0, .1);
    --good: #059669; --good-ink: #ffffff; --good-soft: rgba(5, 150, 105, .1); --warn: #d97706; --bad: #dc2626; --bad-ink: #ffffff; --bad-soft: rgba(220, 38, 38, .08);
    --protein: #2563eb; --carbs: #d97706; --fat: #db2777; --water: #0284c7;
    --shadow: 0 10px 28px rgba(16, 24, 40, .1);
    color-scheme: light;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: var(--fs-md)/1.45 var(--font);
  font-feature-settings: "tnum" 1; /* tabular numbers everywhere: sets, macros and timers line up */
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--ring); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.center-x { justify-content: center; }
.pad { padding: 20px 8px; }
.grow { flex: 1; min-width: 0; }
.mono { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.wrap > .grow { flex: 1 1 150px; } /* wrap to the next line instead of squeezing labels */
.gap { gap: 10px; } .gap-sm { gap: 8px; } .gap-xs { gap: 4px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }

/* ---------- Layout ---------- */
#app { max-width: 760px; margin: 0 auto; padding: 20px 16px calc(var(--nav-h) + 110px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 4px 0 2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.section-head h2 { font-size: 18px; }
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 8px 2px 0; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border);
}
.tabbar .brand { display: none; }
.tab { flex: 1; min-height: var(--tap); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: var(--fs-xs); font-weight: 600; }
.tab.active { color: var(--accent); }
button.tab { background: none; border: 0; font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; padding: 0; }
.quick-dot { width: 40px; height: 26px; margin: -3px 0; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; } /* -3px keeps the label on the same baseline as the other tabs */
.quick-dot svg { width: 20px; height: 20px; }
.tab.quick { color: var(--text); }

@media (min-width: 900px) {
  .shell { padding-left: 232px; }
  .tabbar { inset: 0 auto 0 0; width: 232px; height: auto; flex-direction: column; padding: 22px 14px; gap: 4px; border-top: 0; border-right: 1px solid var(--border); }
  .tabbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--fs-xl); letter-spacing: -.02em; padding: 4px 12px 22px; color: var(--accent); }
  .tabbar .brand span { color: var(--text); }
  .tab { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: 14px; }
  .tab:hover { background: var(--surface-2); color: var(--text); }
  .tabbar .brand { order: -2; }
  .tab.quick { order: -1; margin-bottom: 8px; padding: 8px 14px; font-size: 14px; }
  .quick-dot { width: 30px; height: 30px; margin: 0; border-radius: 10px; }
  .tab.active { background: var(--accent-soft); color: var(--accent); }
  #app { padding: 32px 24px 120px; }
  #floating { left: 232px !important; bottom: 20px !important; }
  #toast-root { left: 232px; bottom: 24px; }
  body:has(#floating > *) #toast-root { bottom: 84px; }
  h1 { font-size: 30px; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; }
/* Layered cards: a hairline top highlight and a soft drop, so surfaces stack instead of sitting flat. */
.card { box-shadow: inset 0 1px 0 rgb(255 255 255 / .045), 0 1px 2px rgb(0 0 0 / .18), 0 10px 24px -16px rgb(0 0 0 / .45); }
.card.flat { background: var(--surface-2); border-color: transparent; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card.hero { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }
.card.hero h2 { font-size: 20px; }
.card.hero p { color: var(--muted); }
.link-row { color: inherit; text-decoration: none; }
a.card:hover, .link-row:hover { border-color: var(--surface-3); }

.link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; padding: 0; min-height: 24px; } /* WCAG 2.5.8 minimum */
.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; }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.ex-name { display: inline-flex; align-items: center; min-height: 32px; }
.ex-meta .link { min-height: 36px; }
.link.back { color: var(--muted); font-size: 13px; margin-bottom: 6px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--tap); padding: 0 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 14px;
  text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s;
}
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.06); }
/* Depth: the lime CTA gets a soft top highlight, a slightly deeper base and a lime glow (text contrast only rises). */
.btn.primary { background: linear-gradient(180deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 86%, #000) 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), inset 0 -1px 0 rgb(0 0 0 / .18), 0 6px 18px -8px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 86%, #000) 100%); }
.btn.primary:active:not(:disabled) { box-shadow: inset 0 2px 4px rgb(0 0 0 / .2); }
.btn.ghost { background: transparent; }
/* Tonal: an accent action that isn't the screen's one loud CTA (e.g. "Start routine" on every card). */
.btn.tonal { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.btn.tonal:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.btn.danger { color: var(--bad); }
.btn.danger:not(.ghost) { background: var(--bad); color: var(--bad-ink); border-color: transparent; }
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.btn.danger.ghost:hover { background: var(--bad-soft); }
.btn.block { display: flex; width: 100%; }
.btn.lg { height: 50px; font-size: 15px; border-radius: 14px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }

.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); text-decoration: none; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn.boxed { background: var(--surface-2); border: 1px solid var(--border); width: 42px; height: 42px; color: var(--text); }
.icon-btn.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; width: 36px; height: 36px; }
.icon-btn.tonal { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, transparent); width: 36px; height: 36px; }
.icon-btn.danger { color: var(--bad); }

.input {
  width: 100%; height: var(--tap); padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 16px; min-width: 0; /* 16px stops iOS zooming on focus */
}
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input:focus { outline: none; border-color: var(--accent); }
.input:user-invalid { border-color: var(--bad); }
.input:disabled { opacity: .55; }
.input.big { height: 50px; font-size: 18px; font-weight: 700; }
input[type="date"].input { width: auto; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field em { font-style: normal; color: var(--faint); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form.grid-2, .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.micro-line { flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.micro-line strong { color: var(--text); }
.micro-line small { color: var(--faint); }
.micro-prev { grid-column: 1 / -1; margin: 0; }
@media (max-width: 480px) { .form.grid-2 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; min-height: var(--tap); }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.toggle:has(input:disabled) { opacity: .5; }

.search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; border: 0; background: none; outline: none; color: var(--text); font-size: 15px; min-width: 0; }
.search-row { display: flex; gap: 8px; align-items: center; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip.static { height: 28px; display: inline-flex; align-items: center; color: var(--text); font-variant-numeric: tabular-nums; }
.chip.dim { color: var(--faint); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }

.seg { display: flex; padding: 3px; background: var(--surface-2); border-radius: 12px; gap: 2px; }
.seg button { flex: 1; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }

/* ---------- Stats and bars ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); }
.stat-grid.four { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-grid.flat .stat { background: var(--surface-2); border-color: transparent; }
.stat strong { font-size: 19px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: 12px; color: var(--muted); }
.stat-grid.compact .stat { padding: 10px 12px; }
.stat-grid.compact .stat strong { font-size: 17px; }
@media (max-width: 420px) { .stat strong { font-size: 16px; } .stat-grid.four { grid-template-columns: repeat(2, 1fr); } }

.today-grid { display: flex; align-items: center; gap: 18px; }
@media (max-width: 400px) { .today-grid { flex-direction: column; align-items: stretch; } }
.kcal-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.kcal-line strong { color: var(--text); }
.macros { display: flex; flex-direction: column; gap: 10px; }
.macro-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.macro-top strong { color: var(--text); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; transition: width .4s ease; }
.bar.water i { background: var(--water); }
/* Water as glasses (250 ml each) filling up. */
.glasses { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; }
.glasses svg { flex-shrink: 0; }
.g-glass { fill: none; stroke: var(--surface-3); stroke-width: 1.6; stroke-linejoin: round; }
.glasses svg.full .g-glass, .glasses svg:has(.g-water) .g-glass { stroke: color-mix(in srgb, var(--water) 70%, var(--surface-3)); }
.g-water { fill: var(--water); opacity: .85; }
.water-minus { margin-left: auto; }
.unlock { display: grid; gap: 6px; margin-top: 10px; }
.unlock .bar { margin-bottom: 4px; }
.hint { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.hint.good { color: var(--good); }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 10px; font-size: 13px; }
.hbar strong { text-align: right; font-variant-numeric: tabular-nums; }

.chart { display: block; max-width: 100%; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .ref { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 5; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-empty { height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 24px; text-align: center;
  color: var(--muted); font-size: 13px; border: 1px dashed var(--border); border-radius: 12px; }
.chart-empty svg { width: 28px; height: 28px; color: var(--accent); opacity: .8; }

/* ---------- Home ---------- */
.checkin-card { display: flex; flex-direction: row; align-items: center; gap: 12px; width: 100%; text-align: left; color: var(--text); border-color: var(--accent); font: inherit; cursor: pointer; }
.checkin-card small { display: block; color: var(--muted); font-size: 12px; }
.checkin-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.resume { flex-direction: row; align-items: center; gap: 12px; border-color: var(--accent); color: var(--text); }
.resume small { display: block; color: var(--muted); font-size: 12px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 1.8s infinite; flex-shrink: 0; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.routine-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.routine-chip { text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
@media (hover: hover) { .routine-chip:hover { border-color: var(--accent); } }
.routine-chip small { color: var(--muted); font-size: 12px; }
.weight-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.big-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.delta { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.delta.down { color: var(--good); background: var(--good-soft); }
.delta.up { color: var(--warn); }
.pr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pr-list li, .pr-list li > a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.pr-list li > svg, .pr-list li > a > svg { color: var(--warn); }
.pr-list li span { display: flex; flex-direction: column; }
.pr-list small { color: var(--muted); font-size: 12px; }
.pr-list:not(.compact) li { padding: 8px 10px; background: var(--surface-2); border-radius: 12px; }
.pr-card h2 { color: var(--warn); }
.pr-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-weight: 700; font-size: 12px; }

/* ---------- Train ---------- */
.routine-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.routine-card .ex-summary { flex: 1; }
.ex-summary { color: var(--muted); font-size: 13px; line-height: 1.55; }
.workout-card { color: inherit; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.meta-row span { display: inline-flex; align-items: center; gap: 4px; }
.program-list { display: flex; flex-direction: column; gap: 12px; }
.plain { margin: 0; padding-left: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.plain strong { color: var(--text); }
.empty { text-align: center; padding: 28px 16px; border: 1px dashed var(--surface-3); border-radius: var(--radius); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty p { color: var(--muted); font-size: 14px; max-width: 360px; }
.empty-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); margin-bottom: 2px; }
.empty-mark svg { width: 22px; height: 22px; }
.empty .btn, .empty .row { margin-top: 6px; }

/* ---------- Active workout ---------- */
.active-head { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; margin: -8px 0 0; }
.title-input { flex: 1; min-width: 0; background: transparent; border: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; padding: 4px 0; border-bottom: 1px solid transparent; }
.title-input:focus { outline: none; border-bottom-color: var(--accent); }
.ex-card { gap: 8px; }
.card.ss { border-left: 3px solid var(--protein); position: relative; }
.ss-tag { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--protein); }
.set-row.next-up .cell { border-color: var(--protein); }
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ex-name { font-weight: 750; font-size: 16px; color: var(--accent); text-decoration: none; }
.ex-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.ex-meta .link { font-size: 13px; gap: 4px; }
.notes { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 4px 0; }
.notes:focus { outline: none; color: var(--text); }
/* Progression target stays visible; the reason sits behind a native disclosure ("Think less"). */
.prog-hint { font-size: 13px; color: var(--muted); margin: 0; }
.prog-hint summary { display: flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; list-style: none; width: fit-content; border-radius: 8px; }
.prog-hint summary::-webkit-details-marker { display: none; }
.prog-hint svg { width: 15px; height: 15px; color: var(--good); flex-shrink: 0; }
.prog-hint strong { color: var(--text); font-weight: 650; }
.prog-hint .why { font-size: 12px; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; }
.prog-hint[open] .why { display: none; }
.prog-hint p { margin: 0 0 4px 21px; line-height: 1.45; }
.pin-note { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; margin: 0; }
.pin-note .notes { flex: 1; min-width: 0; color: var(--text); }
.pin-note .notes::placeholder { color: var(--muted); }
.pin-note.static { color: var(--text); background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.pin-note.static svg { color: var(--accent); flex-shrink: 0; }
.set-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 72px 60px 48px; gap: 6px; align-items: center; padding: 3px; border-radius: 12px; transition: background .15s; }
.set-row.routine { grid-template-columns: 38px 1fr 1fr 36px; }
.set-row.head { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; text-align: center; padding-bottom: 0; }
.set-row.head span:nth-child(2) { text-align: left; }
.set-row.head svg { margin: 0 auto; width: 14px; }
.set-row.done { background: var(--good-soft); }
.set-type { height: var(--tap); border-radius: 10px; border: 0; background: var(--surface-2); font-weight: 750; font-size: 13px; display: grid; place-items: center; color: var(--text); }
.set-type .rpe { display: block; font-size: 9px; font-weight: 650; color: var(--muted); line-height: 1; margin-top: 1px; }
.set-type:has(.rpe) { align-content: center; gap: 0; line-height: 1.1; }
.set-type.t-warmup { color: var(--warn); }
.set-type.t-drop { color: var(--protein); }
.set-type.t-failure { color: var(--bad); }
.set-row.done .set-type { background: transparent; }
.prev { min-height: var(--tap); border: 0; background: none; color: var(--faint); font-size: 13px; text-align: left; padding: 0 2px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.prev:not(:disabled):hover { color: var(--text); }
.cell { width: 100%; height: var(--tap); border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); text-align: center; font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.01em; font-variant-numeric: tabular-nums; min-width: 0; }
.cell::placeholder { color: var(--faint); font-weight: 600; }
.cell:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.cell.sm { width: 64px; height: 30px; display: inline-block; }
.set-row.done .cell { background: transparent; }
.check { height: var(--tap); border-radius: 12px; border: 0; background: var(--surface-2); color: var(--faint); display: grid; place-items: center; }
.check.on { background: var(--good); color: var(--good-ink); }
/* Set ticked: the check pops and a ring pulses out once (off under reduced motion). */
.check.pop { position: relative; animation: check-pop .32s cubic-bezier(.3,1.6,.5,1); }
.check.pop::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 var(--good); animation: check-ring .55s ease-out forwards; pointer-events: none; }
@keyframes check-pop { 0% { transform: scale(.82); } 100% { transform: scale(1); } }
@keyframes check-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 70%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.inline-field { display: inline-flex; align-items: center; gap: 6px; }
.set-list { display: flex; flex-direction: column; gap: 4px; }
.set-line { display: flex; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; }
.set-line .set-type { width: 30px; height: 28px; }

.plates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.plate { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px; border-radius: 8px; font-weight: 800; font-size: 13px; background: var(--surface-3); }
.plate.p25, .plate.p45 { background: #dc2626; color: #fff; height: 64px; }
.plate.p20, .plate.p35 { background: #2563eb; color: #fff; height: 58px; }
.plate.p15 { background: #ca8a04; color: #fff; height: 52px; }
.plate.p10 { background: #16a34a; color: #fff; height: 46px; }
.plate-out { margin-top: 12px; }

/* ---------- Floating pills ---------- */
#floating { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px); z-index: 25; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
#floating > * { pointer-events: auto; box-shadow: var(--shadow); }
.rest-pill { position: relative; overflow: hidden; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--accent); width: min(420px, 100%); }
.rest-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); transition: width .5s linear; z-index: 0; }
.rest-pill > :not(.rest-bar) { position: relative; z-index: 1; }
.rest-label { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--accent); }
.rest-label strong { color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; }
.rest-pill button { height: 34px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--surface-2); font-weight: 700; font-size: 13px; }
.rest-pill .skip { background: var(--accent); color: var(--accent-ink); }
.workout-pill { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); width: min(420px, 100%); text-decoration: none; color: var(--text); font-weight: 600; }
.workout-pill .go { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; }

/* ---------- Diet ---------- */
.date-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.date-nav .center { display: flex; flex-direction: column; align-items: center; }
.meal { gap: 6px; }
.food-row, .food-pick, .ex-pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; margin: 0 -10px; width: calc(100% + 20px); border: 0; background: none; text-align: left; border-radius: 10px; }
.food-row:hover, .food-pick:hover, .ex-pick:hover { background: var(--surface-2); }
.fname { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname .tag { height: 18px; font-size: 10px; vertical-align: 1px; }
.fsub { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.fkcal { font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.meal-pick { display: flex; align-items: center; gap: 4px; }
.meal-pick .food-pick { flex: 1; min-width: 0; width: auto; margin: 0; }
.meal-pick .fsub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fkcal small { color: var(--muted); font-size: 11px; font-weight: 500; }
.add-line { border: 1px dashed var(--surface-3); background: none; border-radius: 10px; height: 40px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; }
.add-line:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list.card { padding: 6px 16px; gap: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; width: 100%; max-width: 440px; margin: 0 auto; }
.cal-h { font-size: 11px; font-weight: 700; color: var(--faint); padding-bottom: 2px; }
.cal-day { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; max-height: 48px; }
a.cal-day:hover { background: var(--surface-2); }
.cal-day.trained { background: var(--accent-soft); color: var(--text); }
.cal-day.trained::before { content: ''; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cal-day.fed::after { content: ''; position: absolute; bottom: 5px; left: 30%; right: 30%; height: 3px; border-radius: 2px; background: var(--carbs); }
.cal-day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-key { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; }
.cal-key .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cal-key .dot.trained { background: var(--accent); }
.cal-key .dot.fed { background: var(--carbs); border-radius: 2px; height: 3px; width: 12px; margin-left: 8px; }
.ob-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 4px; }
.ob-dots i { width: 28px; height: 4px; border-radius: 2px; background: var(--surface-2); }
.ob-dots i.on { background: var(--accent); }
.ob-q { font-size: 20px; margin: 6px 0 4px; }
.ob-q.small-q { font-size: 15px; margin-top: 4px; }
.ob-choices { display: grid; gap: 8px; }
.ob-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ob-choice small { color: var(--muted); font-size: 13px; }
.ob-choice.on { border-color: var(--accent); background: var(--accent-soft); }
.ob-first { display: grid; gap: 8px; }
.recap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.recap-list li { display: flex; gap: 12px; align-items: flex-start; }
.recap-list li > svg { flex: none; width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
.recap-list li > span { display: flex; flex-direction: column; gap: 2px; }
.recap-list small { color: var(--muted); font-size: 13px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item svg { color: var(--faint); }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
details.more .list { margin-top: 6px; }

/* ---------- Modals ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.modal:focus { outline: none; }
.backdrop.closing { animation: fade .15s ease reverse forwards; }
.modal { background: var(--surface); width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .2s cubic-bezier(.2, .8, .3, 1); padding-bottom: env(safe-area-inset-bottom); border: 1px solid var(--border); }
.modal.tall { height: 92dvh; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 18px; }
.modal-head h2 { font-size: 17px; }
.modal-body { overflow-y: auto; padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; overscroll-behavior: contain; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.modal-foot.sticky { position: sticky; bottom: -18px; background: var(--surface); padding: 12px 0 18px; margin-bottom: -18px; }
@media (min-width: 640px) {
  .backdrop { align-items: center; padding: 24px; }
  .modal { width: 520px; border-radius: 20px; max-height: 86vh; }
  .modal.small { width: 400px; }
  .modal.tall { height: 80vh; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
.confirm-msg { color: var(--muted); }
.sheet { display: flex; flex-direction: column; gap: 2px; }
.sheet-item { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 12px; border: 0; border-radius: 12px; background: none; text-align: left; font-weight: 600; }
.sheet-item span { flex: 1; }
.sheet-item:hover { background: var(--surface-2); }
.sheet-item.danger { color: var(--bad); }
.sheet-item.on { color: var(--accent); }
.picker-head { display: flex; flex-direction: column; gap: 10px; position: sticky; top: -4px; background: var(--surface); z-index: 2; padding: 4px 0 6px; }
.picker-list { display: flex; flex-direction: column; flex: 1; }
.ex-pick.on { background: var(--accent-soft); }
.pick-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.ex-pick.on .pick-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.icon-btn.fav.on { color: var(--warn); }
.icon-btn.fav.on svg { fill: currentColor; }
.amt-food h3 { font-size: 18px; margin-bottom: 4px; }
.amt-row { display: flex; gap: 10px; }
.amt-row .qty { width: 120px; }
.amt-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; display: flex; flex-direction: column; }
.tile strong { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile span { font-size: 11px; color: var(--muted); }
.tile.kcal strong { color: var(--accent); }
.summary { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.summary .stat-grid { width: 100%; }
.summary .pr-list { width: 100%; text-align: left; }
.summary-badge { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.summary-badge svg { width: 30px; height: 30px; }
.summary h3 { font-size: 20px; }
/* Finished-workout sheet: progress vs last time, PRs as gold medal rows (same language as the share card). */
.summary-badge.hero-pose { width: 112px; height: 112px; border-radius: 32px; position: relative; isolation: isolate; color: var(--accent); background: transparent; }
.summary-badge.hero-pose::before { content: ""; position: absolute; inset: -24px; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 28%, transparent), transparent 75%); }
.summary-badge.hero-pose svg { width: 96px; height: 96px; }
.summary-badge.hero-pose.jump svg { animation: hero-jump .9s cubic-bezier(.3, .7, .4, 1); }
@keyframes hero-jump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-22px) scale(1.06); } 55% { transform: translateY(0) scale(1.04, .94); } 75% { transform: translateY(-6px); } 100% { transform: none; } }
.pr-more { width: 100%; text-align: left; }
.pr-more summary { cursor: pointer; list-style: none; min-height: 32px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; font-size: 13px; }
.pr-more summary::-webkit-details-marker { display: none; }
.pr-more[open] summary { display: none; }
.vs-last { display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 0; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.vs-last strong { color: var(--text); }
.vs-last.up { background: var(--good-soft); }
.vs-last.up strong, .vs-last.up svg { color: var(--good); }
.vs-last svg { width: 15px; height: 15px; flex-shrink: 0; }
.pr-list.medals li { background: color-mix(in srgb, var(--warn) 10%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.medal { width: 30px; height: 30px; border-radius: 50%; background: var(--warn); color: #1a1300; display: grid; place-items: center; flex-shrink: 0; font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.pr-val { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: color-mix(in srgb, var(--warn) 62%, var(--text)); letter-spacing: .01em; }
.scanner { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 30% 12%; border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }

/* ---------- Toasts ---------- */
/* Toasts dock at the bottom, above the tab bar (and above the rest/workout pill when it shows), so they never cover a page heading. */
#toast-root { position: fixed; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); left: 0; right: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 420px; }
.toast.show { opacity: 1; transform: none; }
body:has(#floating > *) #toast-root { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 74px); }
.toast.pr { background: var(--warn); color: #1a1300; }
.toast-action { pointer-events: auto; margin-left: 6px; padding: 4px 10px; border-radius: 8px; border: 0; background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; font: inherit; font-weight: 750; cursor: pointer; }
.toast-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--ring); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Home: compact fuel strip (the full ring lives on Diet) ---------- */
.fuel-nums { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.fuel-num { display: flex; flex-direction: column; gap: 2px; }
.fuel-num .big-num { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.fuel-num .big-num small { font-size: var(--fs-md); font-weight: 700; color: var(--muted); }
.fuel-num .big-num.protein { color: var(--protein); }
.fuel-num span { color: var(--muted); font-size: var(--fs-sm); }
.fuel-bars { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin: var(--sp-2) 0; }
.fuel-bar { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.fuel-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.fuel-bar.protein i { background: var(--protein); }
.fuel-strip .good { color: var(--good); display: inline-flex; align-items: center; gap: 3px; }
.fuel-strip .good svg { width: 14px; height: 14px; }

/* ---------- Display type: Barlow Condensed for big numbers, page titles and the wordmark ---------- */
h1, .big-num, .stat strong, .tabbar .brand span, .fuel-num .big-num, .cell, .rest-label strong, .workout-pill strong {
  font-family: var(--font-display); font-feature-settings: "tnum" 1, "lnum" 1;
}
h1 { font-size: 34px; font-weight: 800; letter-spacing: -.005em; text-transform: none; }
.big-num { font-weight: 800; letter-spacing: 0; }
.stat strong { font-size: 26px; font-weight: 800; letter-spacing: 0; }
.fuel-num .big-num { font-size: 44px; letter-spacing: 0; }
.cell { font-size: 20px; font-weight: 700; letter-spacing: .01em; }
.tabbar .brand span { font-size: 24px; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; }

/* ---------- Home hero: twin arc gauges ---------- */
.fuel-hero { position: relative; overflow: hidden; isolation: isolate; }
.fuel-hero::before { content: ""; position: absolute; inset: -40% -20% auto; height: 260px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); opacity: .7; }
.gauges { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); justify-items: center; width: 100%; max-width: 420px; margin-inline: auto; }
.gauge { position: relative; width: 100%; max-width: 168px; aspect-ratio: 1; }
.gauge svg { width: 100%; height: 100%; transform: rotate(135deg); overflow: visible; }
.gauge circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.g-track { stroke: var(--surface-3); }
.g-value { stroke: var(--accent); transition: stroke-dasharray .6s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 45%, transparent)); }
.gauge.protein .g-value { stroke: var(--protein); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--protein) 45%, transparent)); }
.g-inner { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; align-items: baseline; text-align: center; gap: 0 2px; }
.g-inner .big-num { font-size: 42px; line-height: 1; }
.gauge.protein .g-inner .big-num { color: var(--protein); }
.g-inner small { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--muted); }
.g-inner span { flex-basis: 100%; color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.fuel-sub { text-align: center; }
.fuel-sub .good { color: var(--good); display: inline-flex; align-items: center; gap: 3px; }
.fuel-sub .good svg { width: 14px; height: 14px; }
@media (min-width: 640px) { .g-inner .big-num { font-size: 48px; } }
/* Diet uses the same gauge beside the macro bars. */
.today-grid .day-gauge { flex: 0 0 150px; max-width: 150px; }
.today-grid .day-gauge .big-num { font-size: 38px; }
@media (max-width: 400px) { .today-grid .day-gauge { align-self: center; flex-basis: auto; width: 168px; max-width: 168px; } }

/* ---------- Routine identity: kind glyphs ---------- */
.kind-glyph { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  color: var(--accent); background: var(--accent-soft); }
.kind-glyph svg { width: 26px; height: 26px; }
.k-pull .kind-glyph, .kind-glyph.k-pull { color: var(--protein); background: color-mix(in srgb, var(--protein) 14%, transparent); }
.k-legs .kind-glyph, .kind-glyph.k-legs { color: var(--carbs); background: color-mix(in srgb, var(--carbs) 14%, transparent); }
.k-core .kind-glyph, .kind-glyph.k-core { color: var(--fat); background: color-mix(in srgb, var(--fat) 14%, transparent); }
.k-cardio .kind-glyph, .kind-glyph.k-cardio { color: var(--water); background: color-mix(in srgb, var(--water) 14%, transparent); }
.routine-chip { gap: 6px; padding: 14px; transition: border-color .15s, transform .15s; }
.routine-chip:active { transform: scale(.98); }
.routine-chip strong { font-size: var(--fs-lg); }
.routine-chip { position: relative; }
.routine-chip .last-done { position: absolute; top: 14px; right: 12px; font-size: 11px; font-weight: 600; color: var(--muted); }
/* Phones: an odd last routine spans the row instead of leaving a hole. */
/* Phones: routines as compact one-line rows (glyph, name, count, when), so Today's fuel sits higher. */
@media (max-width: 639px) {
  .routine-chips { grid-template-columns: 1fr; gap: 6px; }
  .routine-chip { flex-direction: row; align-items: center; gap: 12px; padding: 8px 12px; min-height: 56px; }
  .routine-chip .kind-glyph { width: 36px; height: 36px; border-radius: 10px; }
  .routine-chip .kind-glyph svg { width: 24px; height: 24px; }
  .routine-chip strong { font-size: var(--fs-md); }
  .routine-chip .last-done { position: static; order: 5; margin-left: auto; }
  .routine-chip .next-tag { order: 4; margin: 0 0 0 auto; align-self: center; }
  .routine-chip small { white-space: nowrap; }
  .routine-chip.is-next .last-done { display: none; }
}
/* One accent word in the greeting (the Runna idea), on-brand lime. */
.accent-word { color: var(--accent); }
.routine-card .card-head { gap: 12px; justify-content: flex-start; }
.routine-card h3 small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Celebration: workout finished (mascot jump + confetti; js skips it under reduced motion) ---------- */
.celebrate { position: fixed; left: 50%; top: 38%; width: 0; height: 0; z-index: 200; pointer-events: none; }
.celebrate-mascot { position: absolute; left: -28px; top: -96px; color: var(--accent); filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 60%, transparent));
  animation: mascot-jump 1.2s cubic-bezier(.3,.7,.4,1) forwards; }
.confetti { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; background: var(--c); opacity: 0; animation: confetti-burst 1.3s cubic-bezier(.15,.7,.3,1) forwards; }
.confetti.circle { border-radius: 50%; width: 8px; height: 8px; }
.confetti.tri { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
@keyframes mascot-jump {
  0% { transform: translateY(30px) scale(.6); opacity: 0; }
  25% { transform: translateY(-36px) scale(1.08); opacity: 1; }
  45% { transform: translateY(0) scale(1, .92); }
  60% { transform: translateY(-10px) scale(1); }
  80% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(0); opacity: 0; }
}
@keyframes confetti-burst {
  0% { transform: translate(0, 0) rotate(0) scale(.4); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 120px)) rotate(var(--rot)) scale(1); opacity: 0; }
}

/* ---------- Chart headers: big number first (MacroFactor idea), then the chart ---------- */
.chart-stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin-top: -4px; }
.chart-stat .big-num { font-size: 34px; line-height: 1; }
.chart-stat small { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--muted); }
.chart-stat .chip-stat { margin-left: auto; align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; }

/* ---------- Diet summary: macro columns with big numbers, notes in a quiet footer ---------- */
.macros.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.macro-num { display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.macro-num .big-num { font-size: 28px; line-height: 1; }
.macro-num small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar.thick { height: 10px; margin: 8px 0 6px; }
.macro-name { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.macro-name i { width: 8px; height: 8px; border-radius: 50%; }
.day-card .kcal-line { margin-bottom: var(--sp-4); }
.day-notes { border-top: 1px solid var(--border); margin-top: var(--sp-2); padding-top: var(--sp-2); }
.day-notes .hint { margin-top: 6px; font-size: 12.5px; line-height: 1.45; }
.day-notes .hint.good, .day-notes .hint .link { font-size: 13px; }

/* ---------- Workout: next set highlighted, tighter exercise header, exercise glyph ---------- */
.set-row.next, .set-row.next-up { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.set-row.next .set-type { color: var(--accent); }
.set-row.next-up .cell { border-color: transparent; }
.ex-card { gap: 4px; }
.ex-card > .set-row.head { margin-top: 8px; }
.ex-card > .btn { margin-top: 4px; }
.ex-name { display: inline-flex; align-items: center; gap: 10px; }
.kind-glyph.sm { width: 32px; height: 32px; border-radius: 10px; }
.kind-glyph.sm svg { width: 22px; height: 22px; }
.ex-card .notes { padding: 2px 0; }

/* ---------- First run: the mascot greets you; one loud CTA (Set up) ---------- */
.card.hero.welcome { position: relative; overflow: hidden; isolation: isolate; }
.hero-art { position: absolute; top: 14px; right: 14px; width: 84px; height: 84px; display: grid; place-items: center; color: var(--accent); z-index: -1; }
.hero-art::before { content: ""; position: absolute; inset: -30px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent 75%); }
.hero-art svg { position: relative; width: 72px; height: 72px; animation: hero-bob 3.2s ease-in-out infinite; }
@keyframes hero-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.card.hero.welcome h2 { font-family: var(--font-display); font-size: 30px; line-height: 1.05; padding-right: 96px; text-transform: uppercase; letter-spacing: .01em; }
.card.hero.welcome > p:first-of-type { padding-right: 72px; }
@media (min-width: 640px) { .card.hero.welcome > p:first-of-type { padding-right: 110px; } .hero-art { width: 110px; height: 110px; } .hero-art svg { width: 96px; height: 96px; } }

/* Search box: one focus ring on the wrapper, not a second one on the input. */
.search:focus-within { border-color: transparent; box-shadow: var(--ring); }
.search input:focus-visible { box-shadow: none; }

/* ---------- Onboarding goal glyphs; Profile identity header ---------- */
.ob-choice.has-ic { flex-direction: row; align-items: center; gap: 12px; }
.ob-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex-shrink: 0; }
.ob-choice.on .ob-ic { background: var(--accent); color: var(--accent-ink); }
.ob-txt { display: flex; flex-direction: column; gap: 2px; }
.me-head { display: flex; align-items: center; justify-content: flex-start; gap: 16px; }
.me-avatar { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; flex-shrink: 0; color: var(--accent);
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 22%, transparent), var(--surface) 72%); border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .05); }
.me-avatar svg { width: 44px; height: 44px; }
.me-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.me-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.me-chip strong { color: var(--text); }
.me-chip svg { width: 14px; height: 14px; color: var(--accent); }

/* History cards carry the same kind glyph; big stat numbers shrink on narrow tiles instead of truncating. */
.wc-title { display: flex; align-items: center; gap: 10px; }
@media (max-width: 420px) { .stat-grid.three .stat strong { font-size: clamp(16px, 6.2vw, 26px); text-overflow: clip; } }
@media (max-width: 360px) { .stat-grid.three .stat { padding: 10px; } .stat-grid.three .stat strong { font-size: 5.6vw; } }

/* ---------- Desktop (1200 px+): a real dashboard instead of a stretched phone column ---------- */
@media (min-width: 1200px) {
  #app { max-width: 1160px; padding-left: 40px; padding-right: 40px; }
  #app[data-view="home"], #app[data-view="progress"] {
    --cols: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; grid-auto-flow: row dense;
  }
  #app[data-view="home"] > :is(.page-head, .checkin-card, .welcome, .resume, .stat-grid),
  #app[data-view="progress"] > :is(.page-head, .section-head), #app[data-view="progress"] > .section-head + * { grid-column: 1 / -1; }
  #app[data-view="home"] > .card, #app[data-view="progress"] > .card { height: 100%; }
  /* Home: Train and Today's fuel side by side, both full height of the row. */
  #app[data-view="home"] .gauge { max-width: 190px; }
  /* Diet: the day summary stays in view on the left while you log meals on the right. */
  #app[data-view="diet"] { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
  #app[data-view="diet"] > :is(.page-head, .date-nav) { grid-column: 1 / -1; }
  #app[data-view="diet"] > .day-card { grid-column: 1; grid-row: 3 / span 40; position: sticky; top: 24px; }
  #app[data-view="diet"] > :not(.page-head, .date-nav, .day-card) { grid-column: 2; }
  #app[data-view="diet"] .today-grid { flex-direction: column; align-items: stretch; }
  #app[data-view="diet"] .today-grid .day-gauge { align-self: center; flex-basis: auto; width: 200px; max-width: 200px; }
}

/* ---------- Motion: cards rise in with a short stagger when you change screen ---------- */
@media (prefers-reduced-motion: no-preference) {
  #app.enter > * { animation: rise .34s cubic-bezier(.2, .8, .2, 1) both; }
  #app.enter > :nth-child(2) { animation-delay: 30ms; }
  #app.enter > :nth-child(3) { animation-delay: 60ms; }
  #app.enter > :nth-child(4) { animation-delay: 90ms; }
  #app.enter > :nth-child(5) { animation-delay: 120ms; }
  #app.enter > :nth-child(n+6) { animation-delay: 150ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .card:is(a, button):hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
  .card:is(a, button) { transition: border-color .15s, transform .15s; }
  .card:is(a, button):active { transform: scale(.99); }
}

/* ---------- Home: tiny visuals on stat tiles, up-next routine, bodyweight sparkline ---------- */
.stat-viz .stat { position: relative; }
.viz { display: flex; margin-top: 8px; height: 18px; align-items: flex-end; }
.viz.dots { gap: 5px; align-items: center; }
.viz.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
.viz.dots i.on { background: var(--accent); }
.viz.dots i.now { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px color-mix(in srgb, var(--accent) 60%, transparent); }
.viz.days { gap: 4px; }
.viz.days i { flex: 1; max-width: 14px; border-radius: 3px; background: var(--surface-3); }
.viz.days i.on { background: var(--accent); }
.viz.days i.today:not(.on) { background: color-mix(in srgb, var(--accent) 35%, var(--surface-3)); }
.viz.vs { flex-direction: column; align-items: stretch; justify-content: center; gap: 4px; }
.viz.vs i { display: block; height: 6px; border-radius: 99px; min-width: 4px; }
.viz.vs i.v-prev { background: var(--surface-3); }
.viz.vs i.v-cur { background: var(--accent); }
.up-next { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 4px; padding: 10px 12px; min-height: var(--tap); border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.up-next > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.up-next small { color: var(--muted); font-size: 12px; }
.up-next strong { font-size: var(--fs-md); }
.up-go { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; font-size: 13px; }
.up-go svg { width: 14px; height: 14px; }
.spark { margin-top: 4px; }
@media (max-width: 639px) { .wide-only { display: none; } }

/* Date inputs: Chrome focuses the inner field, so :focus-visible never matches; ring on any focus. */
input[type="date"]:focus, input[type="date"]:focus-within { outline: none; box-shadow: var(--ring); }
/* Up next: on phones the chip itself is marked (saves a row, keeps Today's fuel higher); the full row shows on desktop. */
.routine-chip.is-next { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.next-tag { align-self: flex-start; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent) !important; font-weight: 700; font-size: 11px !important; }
.up-next { display: none; }
@media (min-width: 1200px) { .up-next { display: flex; } .next-tag { display: none; } }
/* Food search rows: protein per serving stands out; one-tap add on the right. */
.food-line .fp { font-weight: 700; color: var(--protein); }
.quick-add { flex-shrink: 0; width: 40px !important; height: 40px !important; }
/* Inputs: one ring on focus, not a lime border plus a ring. */
.input:focus-visible { border-color: transparent; }
/* Progress exercise rows: est. 1RM over the last 8 sessions. */
.nowrap { white-space: nowrap; }
/* Train: routine cards list the first exercises as lines, then when and how long last time. */
.rc-exercises { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; flex: 1; }
.rc-exercises li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-exercises li:not(.muted)::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 0 10px 2px 2px; vertical-align: middle; }
.rc-exercises li.muted { padding-left: 18px; font-size: 13px; }
.rc-meta { margin: 0; font-size: 12px; color: var(--muted); }
.meal-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
/* Diet: each meal's protein next to its kcal (protein is the number people chase). */
.meal-p { font-size: 12px; font-weight: 700; color: var(--protein); background: color-mix(in srgb, var(--protein) 12%, transparent); border-radius: 999px; padding: 2px 8px; margin-left: 2px; white-space: nowrap; }
.ex-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.ex-spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
@media (max-width: 639px) { .e1rm-label { display: none; } }

/* Diet: fruit & veg counter. Eat page (moved from the life coach site's Body > Food). */
.bar.veg i { background: var(--good); }
.veg-card .bar { margin: 8px 0 4px; }
.eat-today .chip.static, .eat-photo .card-head h2, .eat-calc summary h2 { display: inline-flex; align-items: center; gap: 6px; }
.eat-again { margin-top: 12px; }
.eat-again .chips { margin-top: 6px; }
.eat-verdict { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.eat-verdict li.good { color: var(--good); }
.eat-verdict svg { width: 14px; height: 14px; vertical-align: -2px; }
.eat-photo .row, .eat-photo .field, .eat-cook .chips, .eat-fridge, .eat-recipes { margin-top: 10px; }
.eat-photo label.btn { cursor: pointer; }
.eat-reply { min-height: 76px; resize: vertical; font: inherit; line-height: 1.4; }
.eat-items { margin-top: 12px; display: grid; gap: 8px; }
.eat-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.eat-item .grow { min-width: 0; }
.eat-num { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.eat-num .input { width: 68px; height: 36px; padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; }
.eat-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.eat-items select.input { width: auto; flex: 1; min-width: 120px; }
.tag.eat-less { background: var(--bad-soft); color: var(--bad-ink); }
.tag.eat-more { background: var(--accent-soft); color: var(--accent); }
.tag.eat-same { background: var(--good-soft); color: var(--good-ink); }
.eat-calc summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.eat-calc summary::-webkit-details-marker, .eat-recipe summary::-webkit-details-marker { display: none; }
.eat-table { width: 100%; border-collapse: collapse; margin: 10px 0 6px; font-size: 14px; }
.eat-table td { padding: 7px 0; border-top: 1px solid var(--border); }
.eat-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.eat-recipes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.eat-photo .hint, .eat-cook .hint, .eat-calc .hint, .veg-card .hint { display: block; }   /* .hint is a flex row elsewhere; these carry inline bold text */
.eat-recipe { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.eat-recipe summary { display: flex; padding: 10px 12px; cursor: pointer; list-style: none; min-width: 0; }
.eat-recipe summary .grow { min-width: 0; }
.eat-recipe[open] summary .fname, .eat-recipe[open] summary .fsub { white-space: normal; }
.eat-recipe-body { padding: 0 12px 12px; font-size: 14px; line-height: 1.5; }
.eat-recipe-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 4px; }
.eat-recipe-body ul, .eat-recipe-body ol { margin: 0; padding-left: 20px; }
.eat-recipe-body .btn { margin-top: 12px; }
/* The week line is two sentences on two lines: one long line sat at the wrap edge and re-wrapped when the web font swapped in. */
.week-line { display: block; }
.week-line > span:first-child { display: block; }
