/* Heritage Plate: a warm food-and-health editorial look. No build step.
   Light "linen and paprika", dark "roasted cumin". Every colour is a token;
   components never use literals. Text pairs are checked for WCAG AA. */

/* ---------- fonts (self-hosted, SIL OFL; see fonts/OFL-*.txt) ---------- */
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/fraunces-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: "Fraunces"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/fraunces-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: "Fraunces"; font-style: italic; font-weight: 400 600; font-display: swap;
  src: url("fonts/fraunces-italic-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: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/figtree-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: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/figtree-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;
}

:root {
  /* colour: linen and paprika */
  --bg: #f7f1e7;
  --surface: #fffdf8;
  --surface-warm: #fbf5ea;
  --ink: #211a15;
  --muted: #5d5047;
  --line: #e8ddcc;
  --line-strong: #cbb89c;
  --accent: #a33d18;          /* paprika */
  --accent-strong: #7e2e10;
  --accent-soft: #f7e4d6;
  --saffron: #d9962b;
  --saffron-soft: #fbefd6;
  --green: #276044;           /* curry leaf */
  --green-bar: #3b875e;
  --green-soft: #e2efe5;
  --warn-ink: #77500a;
  --warn-soft: #fbefd6;
  --error-ink: #9b1c1c;
  --error-soft: #fbe8e6;
  --focus: #1d5fbf;
  /* component colours */
  --on-accent: #ffffff;
  --on-green: #ffffff;
  --on-ink: #ffffff;
  --on-fam: #ffffff;
  --fam-1: #a33d18; --fam-2: #276044; --fam-3: #2a4a7a; --fam-4: #77500a;
  --chip: #efe6d7;
  --field: #fffdf8;
  --field-line: #9a866e;       /* input borders: 3:1 against field and page */
  --paper: #fffaf0;
  --placeholder: #7a695b;
  --green-ink: #1c4630;
  --green-muted: #3a5a45;
  --error-line: #e5a5a5;
  --track: #ece2d3;
  --bar-before: #c4ab88;
  --strike: #a8916f;
  --skel-a: #efe6d8; --skel-b: #f8f2e8;
  --spin-track: #efd29a;
  --on-accent-faint: rgba(255, 255, 255, .35);
  --brand-plate: #fffdf8; --brand-rim: #a33d18; --brand-dish: #f4dfc2; --brand-leaf: #2e6b4b;
  --glass: rgba(247, 241, 231, .88);
  --grain: radial-gradient(1200px 500px at 85% -10%, rgba(217, 150, 43, .14), transparent 60%),
           radial-gradient(900px 420px at -10% 0%, rgba(163, 61, 24, .07), transparent 60%);
  --shadow: 0 1px 1px rgba(60, 40, 20, .04), 0 2px 6px rgba(60, 40, 20, .04), 0 12px 32px -12px rgba(60, 40, 20, .12);
  --shadow-sm: 0 1px 2px rgba(60, 40, 20, .14);
  --shadow-lg: 0 10px 30px rgba(30, 20, 10, .22);
  --ring: 0 0 0 1px var(--line);
  color-scheme: light;
  /* spacing scale (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  /* type scale (1.2 minor third around a 17px body) */
  --t-xs: .8125rem;   /* 13px: small labels, never body */
  --t-sm: .9375rem;   /* 15px: meta */
  --t-base: 1.0625rem;/* 17px: body */
  --t-md: 1.25rem;    /* 20px */
  --t-lg: 1.75rem;    /* 28px */
  --t-xl: 2.5rem;     /* 40px */
  --radius: 20px;
  --radius-sm: 12px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

/* Dark: roasted cumin, warm deep brown rather than black. Accent and green are
   lifted so text on dark surfaces stays AA; fills that carry text use dark ink.
   The same token set is repeated for the system preference and for data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16110d; --surface: #211a15; --surface-warm: #261e18; --ink: #f4ebdf; --muted: #c1b09d;
    --line: #362b23; --line-strong: #574738;
    --accent: #f0976b; --accent-strong: #f7b08a; --accent-soft: #3f2619;
    --saffron: #e3a74c; --saffron-soft: #33281a;
    --green: #8dd3a6; --green-bar: #5db07f; --green-soft: #1c3125;
    --warn-ink: #f2c674; --warn-soft: #362a17; --error-ink: #ffa094; --error-soft: #3e201c; --focus: #8fb8ff;
    --on-accent: #16110d; --on-green: #0f2418; --on-ink: #16110d; --on-fam: #16110d;
    --fam-1: #ec9a70; --fam-2: #8dd3a6; --fam-3: #a3c0f2; --fam-4: #e8c06e;
    --chip: #30261e; --field: #1b1511; --field-line: #7d6a57; --paper: #2a211a; --placeholder: #a8968a;
    --green-ink: #d3ecd9; --green-muted: #aed0b8; --error-line: #7a3a33;
    --track: #33291f; --bar-before: #75614c; --strike: #8a7560;
    --skel-a: #221b15; --skel-b: #30261d; --spin-track: #5a4520; --on-accent-faint: rgba(22, 17, 13, .35);
    --brand-plate: #2a211a; --brand-rim: #f0976b; --brand-dish: #4a3a2b; --brand-leaf: #8dd3a6;
    --glass: rgba(22, 17, 13, .86);
    --grain: radial-gradient(1200px 500px at 85% -10%, rgba(227, 167, 76, .10), transparent 60%),
             radial-gradient(900px 420px at -10% 0%, rgba(240, 151, 107, .06), transparent 60%);
    --shadow: 0 0 0 1px #30261e, 0 12px 32px -12px rgba(0, 0, 0, .55);
    --shadow-sm: 0 0 0 1px #4a3b2f, 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-lg: 0 0 0 1px #4a3b2f, 0 10px 30px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16110d; --surface: #211a15; --surface-warm: #261e18; --ink: #f4ebdf; --muted: #c1b09d;
  --line: #362b23; --line-strong: #574738;
  --accent: #f0976b; --accent-strong: #f7b08a; --accent-soft: #3f2619;
  --saffron: #e3a74c; --saffron-soft: #33281a;
  --green: #8dd3a6; --green-bar: #5db07f; --green-soft: #1c3125;
  --warn-ink: #f2c674; --warn-soft: #362a17; --error-ink: #ffa094; --error-soft: #3e201c; --focus: #8fb8ff;
  --on-accent: #16110d; --on-green: #0f2418; --on-ink: #16110d; --on-fam: #16110d;
  --fam-1: #ec9a70; --fam-2: #8dd3a6; --fam-3: #a3c0f2; --fam-4: #e8c06e;
  --chip: #30261e; --field: #1b1511; --field-line: #7d6a57; --paper: #2a211a; --placeholder: #a8968a;
  --green-ink: #d3ecd9; --green-muted: #aed0b8; --error-line: #7a3a33;
  --track: #33291f; --bar-before: #75614c; --strike: #8a7560;
  --skel-a: #221b15; --skel-b: #30261d; --spin-track: #5a4520; --on-accent-faint: rgba(22, 17, 13, .35);
  --brand-plate: #2a211a; --brand-rim: #f0976b; --brand-dish: #4a3a2b; --brand-leaf: #8dd3a6;
  --glass: rgba(22, 17, 13, .86);
  --grain: radial-gradient(1200px 500px at 85% -10%, rgba(227, 167, 76, .10), transparent 60%),
           radial-gradient(900px 420px at -10% 0%, rgba(240, 151, 107, .06), transparent 60%);
  --shadow: 0 0 0 1px #30261e, 0 12px 32px -12px rgba(0, 0, 0, .55);
  --shadow-sm: 0 0 0 1px #4a3b2f, 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg: 0 0 0 1px #4a3b2f, 0 10px 30px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- base ---------- */
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: var(--t-base); line-height: 1.6;
  color: var(--ink); background: var(--bg); background-image: var(--grain); background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--ink); margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
b, strong { font-weight: 650; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
::selection { background: var(--saffron-soft); color: var(--ink); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 760px) { .wrap { padding: 0 var(--s6); } }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: var(--s3); top: -60px; z-index: 50; background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: 8px; font-weight: 650; }
.skip:focus { top: var(--s3); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
[tabindex="-1"]:focus { outline: none; }
.muted { color: var(--muted); }
.hint { color: var(--muted); max-width: 62ch; }
.eyebrow {
  font-family: var(--sans); font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-strong); margin-bottom: var(--s2);
}

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--line); }
.top-inner { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: center; gap: var(--s3); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1.3125rem; letter-spacing: -.01em; min-height: 44px; white-space: nowrap; }
@media (max-width: 400px) { .brand { font-size: 1.1875rem; gap: 8px; } .brand-mark { width: 30px; height: 30px; } }
.brand-mark { width: 34px; height: 34px; }
.bm-plate { fill: var(--brand-plate); stroke: var(--brand-rim); }
.bm-dish { fill: var(--brand-dish); }
.bm-leaf { fill: var(--brand-leaf); }
.bm-vein { stroke: var(--brand-dish); fill: none; }
.top-end { display: inline-flex; align-items: center; gap: var(--s2); }
.theme-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -6px; padding: 0;
  border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.theme-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.theme-btn svg { width: 22px; height: 22px; display: none; }
.theme-btn[data-mode="system"] .ic-system, .theme-btn[data-mode="light"] .ic-light, .theme-btn[data-mode="dark"] .ic-dark { display: block; }
/* ---------- hero ---------- */
.hero { padding: var(--s5) 0 var(--s4); }
.hero-grid { display: grid; gap: var(--s6); align-items: center; }
.hero h1 { font-size: clamp(2.375rem, 9.5vw, 3.75rem); font-weight: 600; line-height: 1.04; letter-spacing: -.025em; font-variation-settings: "opsz" 144; }
.hero h1 .accent { display: inline-block; color: var(--accent); font-style: italic; font-weight: 500; }
.lede { margin-top: var(--s3); font-size: 1.125rem; line-height: 1.55; color: var(--muted); max-width: 36ch; }
.hero-facts { list-style: none; margin: var(--s4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.hero-facts li {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: var(--t-sm); font-weight: 600; color: var(--ink);
}
.hero-facts svg { width: 16px; height: 16px; fill: none; stroke: var(--green); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* example card: three real results that take turns (app.js setupRotator), so the value shows before any click.
   Only the plain backing layer is tilted. The card that carries text is never rotated: Chrome painted dark
   boxes behind text lines on the rotated, shadowed layer. */
.hero-card { margin: 0 12px 12px 0; position: relative; }
.hero-card::before {
  content: ""; position: absolute; inset: 14px -12px -12px 14px; border-radius: 24px;
  background: var(--paprika-soft, var(--accent-soft)); transform: rotate(-2.5deg);
}
.hero-card .ex-card, .hero-card > div {
  position: relative; padding: var(--s5); border-radius: 24px;
  background: var(--surface); box-shadow: var(--shadow);
}
.ex-stage { display: grid; }
.ex-slide {
  grid-area: 1 / 1; min-width: 0; opacity: 0; visibility: hidden; transform: translateX(14px);
  transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
.ex-slide.was-on { transform: translateX(-14px); }
.ex-slide.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .45s ease .1s, transform .45s ease .1s, visibility 0s; }
.ex-why { font-size: 1.0625rem; margin-top: calc(var(--s2) * -1); }
.ex-try-h { margin-top: var(--s3); font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.ex-try { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.ex-try li { padding: 4px 12px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); font-weight: 650; font-size: var(--t-sm); }
.ex-care .verdict { font-size: var(--t-sm); padding: 3px 12px 3px 4px; gap: 6px; }
.ex-care .v-icon { width: 20px; height: 20px; font-size: .75rem; }
.ex-days { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ex-days li { display: grid; place-items: center; height: 34px; border-radius: 10px; background: var(--green-soft); color: var(--green-ink); font-size: var(--t-xs); font-weight: 750; }
.ex-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin: var(--s3) -10px -12px; }
.ex-dots { display: flex; }
.ex-dot, .ex-pause {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
}
.ex-dot::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--line-strong); transition: width .2s, background .2s; }
.ex-dot[aria-pressed="true"]::before { width: 24px; background: var(--paprika, var(--accent)); }
.ex-dot:hover::before { background: var(--muted); }
.ex-dot[aria-pressed="true"]:hover::before { background: var(--paprika-strong, var(--accent-strong)); }
.ex-pause:hover { color: var(--ink); background: var(--chip); }
.ex-pause svg { width: 18px; height: 18px; }
.ex-pause .ic-play, .ex-rot.is-paused .ex-pause .ic-pause { display: none; }
.ex-rot.is-paused .ex-pause .ic-play { display: block; }
.hc-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.hc-kicker { font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hc-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.2; margin: var(--s2) 0 var(--s4); }
.hc-swap { display: flex; gap: var(--s2); align-items: flex-start; margin-top: var(--s4); padding-top: var(--s4); border-top: 1px dashed var(--line-strong); font-size: var(--t-sm); }
.hc-swap .tick { flex: none; }
.hero-card figcaption { margin-top: var(--s3); font-size: var(--t-xs); color: var(--muted); }
@media (min-width: 760px) { .lede { font-size: 1.1875rem; margin-top: var(--s4); } .hero-facts { margin-top: var(--s5); } }
@media (min-width: 860px) {
  .hero { padding: var(--s8) 0 var(--s7); }
  .hero-grid { grid-template-columns: 1.25fr 1fr; gap: var(--s8); }
  .hero-card { margin: 0; }
}

/* ---------- flow sections ---------- */
.flow { display: grid; gap: var(--s7); padding-top: var(--s5); padding-bottom: var(--s8); }
.step-sec { scroll-margin-top: 76px; }
.sec-title { font-size: var(--t-lg); margin-bottom: var(--s4); letter-spacing: -.015em; }
@media (min-width: 760px) { .sec-title { font-size: 2rem; } }
.sec-sub { color: var(--muted); margin: calc(var(--s2) * -1) 0 var(--s4); max-width: 60ch; }
.reveal:not([hidden]) { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- families ---------- */
.families { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 600px) { .families { grid-template-columns: 1fr 1fr; gap: var(--s4); } }
.family {
  display: flex; align-items: center; gap: var(--s4); text-align: left; width: 100%; min-height: 92px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: var(--s4) var(--s4) var(--s4) var(--s4); cursor: pointer; font: inherit; color: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.family:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.family[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.family.is-loading { cursor: progress; }
.avatar {
  flex: none; display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; color: var(--on-fam); background: var(--fam-1);
}
.avatar.fam-2 { background: var(--fam-2); }
.avatar.fam-3 { background: var(--fam-3); }
.avatar.fam-4 { background: var(--fam-4); }
.family-text { flex: 1; display: grid; gap: 1px; min-width: 0; }
.family-name { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; line-height: 1.2; }
.family-meta { font-weight: 600; }
.family-sub { color: var(--muted); font-size: var(--t-sm); }
.family-check {
  flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  color: var(--on-accent); font-weight: 700; border: 1.5px solid var(--line-strong);
}
.family[aria-pressed="true"] .family-check { background: var(--accent); border-color: var(--accent); }
.family.is-loading .family-check { border-color: transparent; }
.skeleton { min-height: 92px; background: linear-gradient(90deg, var(--skel-a), var(--skel-b), var(--skel-a)); background-size: 200% 100%; animation: shimmer 1.4s infinite; box-shadow: none; border: 0; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.start-own { margin-top: var(--s3); }

.focus-hint { margin-top: var(--s3); color: var(--muted); }

.field { display: grid; gap: 6px; }
.field-label { font-weight: 650; font-size: var(--t-sm); }
select, input[type="text"], input[type="number"], textarea {
  font: inherit; color: var(--ink); background-color: var(--field); border: 1.5px solid var(--field-line);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: 48px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
select:hover, input[type="text"]:hover, textarea:hover { border-color: var(--muted); }
select:focus-visible, input[type="text"]:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
select {
  appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 20px center, right 14px center; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
textarea::placeholder, input::placeholder { color: var(--placeholder); opacity: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font: inherit; font-weight: 650; min-height: 48px; padding: 10px 22px; border-radius: 999px; letter-spacing: .005em;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-quiet { background: var(--surface); color: var(--accent-strong); border-color: var(--field-line); }
.btn-quiet:hover:not(:disabled) { border-color: var(--accent); }
.btn-wide { width: 100%; min-height: 58px; font-size: 1.125rem; }
@media (min-width: 760px) { .btn-wide { width: auto; min-width: 320px; } }
.btn-small { min-height: 44px; padding: 8px 18px; font-size: var(--t-sm); }
.btn-link { background: none; border: 0; color: var(--accent-strong); font: inherit; font-weight: 650; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: pointer; min-height: 44px; padding: 0 2px; }
.btn-link:hover { text-decoration-thickness: 2.5px; }
.btn-link.danger { color: var(--error-ink); font-weight: 600; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; opacity: .92; }
.btn.btn-done, .btn.btn-done:disabled { background: var(--green-soft); color: var(--green); opacity: 1; cursor: default; box-shadow: none; transform: none; }
@keyframes pulse { 50% { opacity: .35; } }

.action-bar { margin-top: var(--s5); }
.action-bar + .progress-line, .action-bar + #planOut { margin-top: var(--s4); }

/* ---------- messages and waiting ---------- */
.msg { margin-top: var(--s3); }
.msg:empty { display: none; }
.msg.ok { color: var(--green); font-weight: 600; }
.msg.error { color: var(--error-ink); background: var(--error-soft); padding: 12px 16px; border-radius: var(--radius-sm); border-left: 4px solid var(--error-ink); }
.msg.warn { color: var(--warn-ink); background: var(--warn-soft); padding: 12px 16px; border-radius: var(--radius-sm); border-left: 4px solid var(--saffron); }
.msg.working, .working { display: flex; gap: 10px; align-items: center; color: var(--warn-ink); font-weight: 600; }
.working { margin-top: var(--s3); }
.dots::after { content: "…"; display: inline-block; animation: pulse 1.2s infinite; }
.secs { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--spin-track); border-top-color: var(--warn-ink); animation: spin .9s linear infinite; flex: none; }
.btn-primary .spinner { border-color: var(--on-accent-faint); border-top-color: var(--on-accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.progress-line { margin-top: var(--s4); font-weight: 600; color: var(--warn-ink); display: grid; gap: var(--s2); max-width: 480px; }
.progress-line.done { color: var(--green); }
.progress-line.has-fail { color: var(--error-ink); }
.prog-bar { display: block; height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.prog-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--saffron); transition: width .4s ease; min-width: 8px; }

/* ---------- summary ---------- */
.summary {
  margin-top: var(--s5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5);
  padding: var(--s5); border-radius: var(--radius); background: var(--green-soft); color: var(--green-ink);
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; position: relative; overflow: hidden;
}
.summary::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  border: 22px solid var(--green-bar); opacity: .12; pointer-events: none;
}
.summary-big { font-family: var(--serif); font-size: clamp(2.5rem, 10vw, 3.25rem); font-weight: 600; color: var(--green); line-height: .95; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: lining-nums; }
.summary-text { font-weight: 650; font-size: 1.125rem; line-height: 1.35; flex: 1 1 200px; }
.summary-text .muted { font-weight: 500; font-size: var(--t-sm); color: var(--green-muted); }

/* ---------- dish cards ---------- */
.dish-list { display: grid; gap: var(--s4); grid-template-columns: 1fr; align-items: start; margin-top: var(--s5); }
@media (min-width: 760px) { .dish-list { grid-template-columns: 1fr 1fr; gap: var(--s5); } }
.empty {
  padding: var(--s6) var(--s5); border-radius: var(--radius); background: var(--surface-warm); border: 1.5px dashed var(--line-strong);
  text-align: center; color: var(--muted); display: grid; gap: var(--s3); justify-items: center; grid-column: 1 / -1;
}
.empty-icon { width: 48px; height: 48px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); }
.empty-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty b { color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1.125rem; }

.dish { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; animation: fade .3s ease both; border: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
.dish.is-adapted { border-color: transparent; }
.dish.is-adapted .dish-main { box-shadow: inset 0 4px 0 var(--green-bar); }
.dish-main { padding: var(--s5) var(--s5) var(--s4); }
.dish-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); min-height: 30px; }
.dish-meal { color: var(--muted); font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.dish h3 { font-size: 1.5rem; line-height: 1.2; margin: var(--s1) 0 var(--s4); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px; font-size: var(--t-sm); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag-win { background: var(--green); color: var(--on-green); }
.tag-quiet { background: var(--chip); color: var(--muted); font-weight: 600; }

.nums { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2); font-family: var(--serif); font-weight: 600; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.nums-was { color: var(--muted); font-size: 1.375rem; font-weight: 500; text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--strike); }
.nums-arrow { color: var(--muted); font-family: var(--sans); font-weight: 400; font-size: 1.125rem; }
.nums-now { color: var(--green); font-size: 2.5rem; letter-spacing: -.02em; }
.nums-now.plain { color: var(--ink); }
.nums-unit { font-size: 1.25rem; font-weight: 500; margin-left: 2px; letter-spacing: 0; }
.nums-label { color: var(--muted); font-size: var(--t-sm); margin-top: 6px; }
/* before / now bars: two labelled rows so the change reads at a glance */
.cmp { display: grid; gap: 6px; margin-top: var(--s4); font-size: var(--t-xs); font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.cmp-row { display: grid; grid-template-columns: 52px 1fr 72px; gap: var(--s2); align-items: center; }
.cmp-v { text-align: right; white-space: nowrap; }
.cmp-bar { display: block; height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.cmp-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--bar-before); }
.cmp-row.is-now { color: var(--green); }
.cmp-row.is-now .cmp-bar > span { background: var(--green-bar); animation: shrink .9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes shrink { from { width: 100%; background: var(--bar-before); } }
.bar { display: block; height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; margin-top: var(--s3); }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--green-bar); animation: shrink .7s ease-out both; }
.dish-main [data-adapt] { margin-top: var(--s4); width: 100%; }
@media (min-width: 760px) { .dish-main [data-adapt] { width: auto; } }
/* waiting on a dish: the number shimmers while the model works */
.dish[aria-busy="true"] .nums-now { background: linear-gradient(90deg, var(--skel-a), var(--skel-b), var(--skel-a)); background-size: 200% 100%; animation: shimmer 1.4s infinite; color: transparent; border-radius: 8px; }
.dish[aria-busy="true"] .working { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--saffron-soft); }
.dish[aria-busy="true"] [data-adapt] { display: none; }
.working-sub { display: block; font-weight: 500; font-size: var(--t-sm); color: var(--muted); }

.more { border-top: 1px solid var(--line); }
.more > summary {
  cursor: pointer; padding: 0 var(--s5); min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  font-weight: 650; color: var(--accent-strong); list-style: none; transition: background .15s;
}
.more > summary:hover { background: var(--surface-warm); }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:focus-visible { outline-offset: -3px; border-radius: 0; }
.more-body { padding: var(--s1) var(--s5) var(--s5); display: grid; gap: var(--s4); }
.more[open] .more-body { animation: rise .3s ease both; }
.more-h { font-family: var(--sans); font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: calc(var(--s3) * -1); }
.quote { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.125rem; line-height: 1.5; padding-left: var(--s4); border-left: 3px solid var(--saffron); }

.changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: swap; }
.changes li { display: grid; grid-template-columns: 28px 1fr; gap: var(--s3); align-items: start; padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-weight: 600; line-height: 1.45; }
.changes li:first-child { padding-top: 0; }
.changes li:last-child { border-bottom: 0; padding-bottom: 0; }
.tick { width: 28px; height: 28px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; margin-top: -2px; }
.changes .why { display: block; color: var(--muted); font-size: var(--t-sm); font-weight: 400; margin-top: 3px; line-height: 1.5; }
.tip { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--saffron-soft); border-left: 4px solid var(--saffron); }
.tip b { color: var(--warn-ink); }

.sub { border-top: 1px solid var(--line); }
.sub > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); font-weight: 650; color: var(--accent-strong); list-style: none; }
.sub > summary::-webkit-details-marker { display: none; }
.sub[open] > summary { margin-bottom: var(--s2); }
.ing-list, .src-list { list-style: none; margin: 0; padding: 0; }
.ing-list li, .src-list li { display: flex; justify-content: space-between; gap: var(--s3); padding: 8px 0; border-bottom: 1px dotted var(--line-strong); }
.ing-list li:last-child, .src-list li:last-child { border-bottom: 0; }
.ing-g { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.ing-was { color: var(--muted); font-size: var(--t-sm); font-weight: 400; text-decoration: line-through; margin-right: 8px; }
.ing-new { display: inline-block; color: var(--green); background: var(--green-soft); font-weight: 700; font-size: var(--t-xs); margin-left: 8px; padding: 0 8px; border-radius: 999px; vertical-align: 1px; }
.ing-gone { color: var(--muted); text-decoration: line-through; }
.ing-unc { display: inline-block; color: var(--warn-ink); background: var(--warn-soft); font-size: var(--t-xs); font-weight: 650; margin-left: 8px; padding: 0 8px; border-radius: 999px; vertical-align: 1px; }
.src-list { font-size: var(--t-sm); margin-top: var(--s3); }
.src-id { color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nut-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: var(--t-sm); }
.nut-table th, .nut-table td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.nut-table th:first-child, .nut-table td:first-child { text-align: left; padding-left: 0; }
.nut-table th:last-child, .nut-table td:last-child { padding-right: 0; }
.nut-table thead th { color: var(--muted); font-weight: 700; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; border-bottom-color: var(--line-strong); }
.nut-table td:last-child { font-weight: 650; }
.nut-table .down { color: var(--green); }
.small-print { font-size: var(--t-sm); color: var(--muted); margin-top: var(--s2); }
.more-body > .btn-link { justify-self: start; }

.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--field); border: 1.5px solid var(--field-line); border-radius: 999px; padding: 0 4px 0 16px; }
.stepper-label { font-weight: 600; margin-right: 2px; }
.stepper input { width: 44px; min-height: 44px; border: 0; text-align: center; padding: 4px; background: transparent; -moz-appearance: textfield; font-weight: 650; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.4rem; color: var(--accent-strong); cursor: pointer; border-radius: 50%; }
.stepper-btn:hover { background: var(--accent-soft); }

/* ---------- week ---------- */
#planOut { display: grid; gap: var(--s5); }
#planOut:empty { display: none; }
#planOut > .msg, #planOut > .working, #planOut > .hint { margin: 0; }
.letter {
  position: relative; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  padding: var(--s5) var(--s5) var(--s5) calc(var(--s5) + 6px); display: grid; gap: var(--s3); justify-items: start;
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}
@media (min-width: 760px) { .letter { padding: var(--s6) var(--s7) var(--s6) calc(var(--s7) + 6px); } .letter::after { display: block; } }
.letter::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--saffron); }
.letter::after {
  display: none; content: "\201C"; position: absolute; right: var(--s5); top: var(--s3); font-family: var(--serif); font-size: 7rem; line-height: .8;
  color: var(--saffron); opacity: .22; pointer-events: none;
}
.letter-label { font-family: var(--sans); font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--warn-ink); }
.letter-label .muted { font-weight: 600; }
.letter-text { font-family: var(--serif); font-size: 1.25rem; font-weight: 400; line-height: 1.55; white-space: pre-line; max-width: 58ch; position: relative; }
@media (min-width: 760px) { .letter-text { font-size: 1.5rem; } }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--chip); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] {
  flex: 1 0 auto; min-height: 44px; padding: 0 var(--s4); border: 0; background: none; cursor: pointer; border-radius: 999px;
  font: inherit; font-size: var(--t-sm); font-weight: 650; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s;
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--accent-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
@media (min-width: 760px) { .tabs { display: inline-flex; justify-self: start; } .tabs [role="tab"] { flex: 0 0 auto; padding: 0 var(--s5); } }
.count { display: inline-block; min-width: 24px; padding: 0 7px; border-radius: 999px; background: var(--bg); font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 2px; }
.tab-panel { margin-top: calc(var(--s5) * -1 + var(--s4)); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s2) var(--s5) var(--s4); }
.tab-panel:focus-visible { outline-offset: 4px; }

.days { list-style: none; margin: 0; padding: 0; }
.day { padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.day:last-child { border-bottom: 0; }
.day-name { font-size: 1.25rem; margin-bottom: var(--s2); }
.day-meals { margin: 0; display: grid; gap: 8px; }
.day-meals div { display: grid; grid-template-columns: 88px 1fr; gap: var(--s3); }
.day-meals dt { color: var(--muted); font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding-top: 4px; }
.day-meals dd { margin: 0; font-weight: 500; line-height: 1.4; }
@media (min-width: 760px) {
  .day { display: grid; grid-template-columns: 136px 1fr; gap: var(--s4); align-items: start; }
  .day-name { margin: 0; padding-top: 16px; }
  .day-meals { grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
  .day-meals div { display: grid; grid-template-columns: 1fr; gap: 4px; }
  .day-meals dt { padding: 0; }
}
.none { color: var(--muted); font-style: italic; }
.orig { display: inline-block; font-size: var(--t-xs); font-weight: 650; color: var(--warn-ink); background: var(--warn-soft); border-radius: 999px; padding: 0 8px; vertical-align: 1px; }

.panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) 0 var(--s2); }
.shop-group { margin-top: var(--s4); }
.shop-group h4 { font-family: var(--sans); font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: 2px; }
.shop { list-style: none; margin: 0; padding: 0; }
@media (min-width: 600px) { .shop { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s6); } }
.shop label { display: flex; align-items: center; gap: var(--s3); min-height: 48px; cursor: pointer; border-bottom: 1px dotted var(--line-strong); }
.shop input { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.shop input:checked + .shop-item { color: var(--muted); text-decoration: line-through; }
.shop-item { flex: 1; display: flex; justify-content: space-between; gap: var(--s2); }
.shop-qty { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.tips { margin: 0; padding: var(--s3) 0 var(--s1); list-style: none; display: grid; gap: var(--s3); counter-reset: tip; }
.tips li { counter-increment: tip; display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); align-items: start; }
.tips li::before {
  content: counter(tip); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--saffron-soft); color: var(--warn-ink); font-family: var(--serif); font-weight: 600; font-size: .95rem;
}

/* plan skeleton: shown while Nemotron plans the week so the page already has its shape */
.plan-skel { display: grid; gap: var(--s4); }
.plan-skel span { display: block; border-radius: var(--radius); background: linear-gradient(90deg, var(--skel-a), var(--skel-b), var(--skel-a)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.plan-skel .sk-letter { height: 168px; }
.plan-skel .sk-tabs { height: 52px; width: min(100%, 420px); border-radius: 999px; }
.plan-skel .sk-row { height: 56px; border-radius: var(--radius-sm); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: var(--s5) 0 var(--s7); color: var(--muted); background: var(--surface-warm); }
.disclaimer { font-size: var(--t-sm); }
.disclaimer b { color: var(--ink); }
.tiers { display: grid; gap: var(--s3); margin-bottom: var(--s4); }
@media (min-width: 760px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
.tier { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; }
.tier-name { font-weight: 700; color: var(--ink); }
.tier-job { font-size: var(--t-sm); }
.tier code, .trace code { font-size: var(--t-xs); word-break: break-all; color: var(--ink); }
.tier-count { font-size: var(--t-sm); color: var(--green); font-weight: 650; }
.hood-sub { font-family: var(--sans); font-size: var(--t-sm); margin-bottom: var(--s2); color: var(--ink); }
.trace { margin: 0 0 var(--s3); padding-left: 22px; display: grid; gap: var(--s2); max-height: 320px; overflow: auto; font-size: var(--t-sm); }
.tflag { color: var(--warn-ink); }

.toast {
  position: fixed; left: 50%; bottom: 20px; translate: -50% 0; z-index: 40;
  background: var(--ink); color: var(--on-ink); padding: 12px 22px; border-radius: 999px; font-weight: 600;
  box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); animation: rise .2s ease both;
}
.toast:not([hidden]) { display: flex; align-items: center; gap: var(--s3); }
.toast { width: max-content; }
/* Stay clear of the sticky bars at the bottom, so the Undo never covers their buttons. */
body:has(#readyBar:not([hidden])) .toast, body:has(.dish-actions.is-sticky:not([hidden])) .toast { bottom: 150px; }
.toast-btn { flex: none; min-height: 44px; padding: 0 6px; margin: -10px -10px -10px 0; border: 0; background: transparent; color: var(--on-ink); font: inherit; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.toast-btn:focus-visible { outline: 3px solid var(--on-ink); outline-offset: 0; border-radius: 6px; }
.cb-stale { margin-bottom: var(--s4); }


/* ---------- hero actions ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.btn-cta { min-height: 56px; font-size: 1.125rem; padding: 12px 26px; }
.btn-cta svg { width: 22px; height: 22px; }
@media (max-width: 520px) { .cta-row .btn-cta { width: 100%; } }
.btn-outline { background: transparent; color: var(--accent-strong); border-color: var(--accent); }
.btn-outline:hover:not(:disabled) { background: var(--accent-soft); }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: var(--s2); color: var(--accent-strong); font-weight: 650; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.trust { margin-top: var(--s3); color: var(--muted); font-size: var(--t-sm); }

/* ---------- welcome back ---------- */
#resume:empty { display: none; }
.resume {
  margin-top: var(--s5); padding: var(--s4) var(--s5); border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5);
  border-left: 6px solid var(--green-bar); animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}
.resume-text { flex: 1 1 220px; }
.resume-title { font-size: 1.5rem; }
.resume-text p { color: var(--muted); }
.resume-btns { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
@media (max-width: 520px) { .resume-btns .btn { flex: 1 1 100%; } }

/* ---------- sample families row ---------- */
.samples { scroll-margin-top: var(--s4); }
.flow > *, .hero-grid > * { min-width: 0; }
.row-title { font-size: 1.5rem; }
.row-sub { color: var(--muted); margin: 2px 0 var(--s4); }
@media (max-width: 599px) {
  .families { grid-auto-flow: column; grid-auto-columns: 84%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px var(--s3); margin: 0 -2px; overscroll-behavior-x: contain; }
  .families > * { scroll-snap-align: start; }
}

/* ---------- composer ---------- */
.composer {
  display: grid; gap: var(--s4); padding: var(--s5); border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); scroll-margin-top: var(--s4);
}
@media (min-width: 760px) { .composer { padding: var(--s6) var(--s7); } }
.composer-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.composer-head .sec-title { margin: 0; }
.mic-wrap { display: grid; justify-items: center; text-align: center; gap: var(--s2); padding: var(--s2) 0; }
.mic { display: grid; justify-items: center; gap: var(--s3); background: none; border: 0; padding: var(--s2); cursor: pointer; font: inherit; color: var(--ink); border-radius: var(--radius); }
.mic-circle {
  position: relative; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); transition: background .15s, transform .15s;
}
.mic-circle svg { width: 32px; height: 32px; }
.mic:hover .mic-circle { background: var(--accent-strong); transform: scale(1.04); }
.mic-label { font-weight: 650; font-size: 1.125rem; }
.mic-example { color: var(--muted); font-style: italic; font-family: var(--serif); max-width: 40ch; }
.mic-hint { color: var(--muted); font-size: var(--t-sm); max-width: 48ch; }
.mic-hint:empty { display: none; }
.is-listening .mic-circle::before, .is-listening .mic-circle::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--accent); opacity: .6; animation: ring 1.6s ease-out infinite;
}
.is-listening .mic-circle::after { animation-delay: .8s; }
@keyframes ring { from { transform: scale(.9); opacity: .7; } to { transform: scale(1.35); opacity: 0; } }
.is-listening .mic-label { color: var(--accent-strong); }
@media (prefers-reduced-motion: reduce) { .is-listening .mic-circle { outline: 4px solid var(--accent); outline-offset: 4px; } }
.composer-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.goal { border: 0; margin: 0; padding: 0; min-width: 0; }
.goal-legend { font-weight: 650; padding: 0; margin-bottom: var(--s2); }
.style > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.style > summary::-webkit-details-marker { display: none; }
.style-change { color: var(--accent-strong); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; white-space: pre; }
.style-change-wrap { white-space: pre; }
.style[open] .style-change-wrap { visibility: hidden; }
.fields { display: grid; gap: var(--s3); padding: var(--s3) var(--s4) var(--s4); margin-top: var(--s1); background: var(--surface-warm); border: 1px solid var(--line); border-radius: var(--radius-sm); }
@media (min-width: 760px) { .fields { grid-template-columns: 1.4fr 1fr; } }
.composer-go .btn-wide { width: 100%; }
.composer .msg { margin-top: 0; }

/* ---------- dishes ---------- */
.step-sec { scroll-margin-top: var(--s4); }
.sec-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: calc(var(--s2) * -1) 0 var(--s2); }
.goal-inline { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.goal-inline legend { float: left; padding: 0; margin-right: var(--s2); font-weight: 600; color: var(--muted); }
.pick-sm .pick-opt span { min-height: 40px; padding: 6px 12px; }
.action-inline { margin-top: var(--s4); }
.dish-serves { color: var(--muted); font-size: var(--t-sm); margin: calc(var(--s3) * -1) 0 var(--s4); }
.nums-2 { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px var(--s4); font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.nums-2 b { color: var(--green); font-weight: 650; }
.n2-was { text-decoration: line-through; text-decoration-color: var(--strike); }
.when-open { display: none; }
.more[open] .when-open { display: inline; }
.more[open] .when-closed { display: none; }
.more-body { gap: var(--s5); }
.rc-block { display: grid; gap: var(--s2); }
.rc-h { font-family: var(--sans); font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.rc-h-note { text-transform: none; letter-spacing: 0; font-weight: 600; }
.ing-list li { justify-content: flex-start; gap: var(--s3); }
.ing-amt { flex: none; min-width: 64px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ing-name { flex: 1; }
.ing-hm { color: var(--muted); }
.ing-was { color: var(--muted); font-size: var(--t-sm); margin-left: 4px; }
.ing-list .is-gone { color: var(--muted); }
.ing-gone-tag { font-size: var(--t-xs); font-weight: 650; margin-left: 6px; }
.method { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: var(--s3); }
.method li { counter-increment: step; position: relative; padding-left: 40px; font-size: var(--t-base); line-height: 1.6; }
.method li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--chip); color: var(--ink); font-weight: 700; font-size: var(--t-sm); font-variant-numeric: tabular-nums;
}
.method li.is-swap::after { content: ""; position: absolute; left: 22px; top: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 2px var(--surface); }
.rc-legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--t-sm); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--saffron); flex: none; }
.portion { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green-ink); border-left: 4px solid var(--green-bar); }
.portion-h { font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green); margin-bottom: 2px; }
.facts { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--saffron-soft); border: 1px solid var(--line); }
.facts-h { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 600; font-size: 1.125rem; color: var(--ink); margin-bottom: var(--s2); }
.facts-h svg { width: 22px; height: 22px; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.facts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.facts li + li { border-top: 1px dashed var(--line-strong); padding-top: var(--s3); }
.facts-src { font-size: var(--t-sm); color: var(--muted); margin-top: 4px; }
.facts-src a { color: var(--accent-strong); }
.rc-more { display: grid; }
.rc-more .sub:last-child { border-bottom: 1px solid var(--line); }
.sub-body { display: grid; gap: var(--s3); padding-bottom: var(--s3); }
.rc-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.dish-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1.5px; text-underline-offset: 4px; min-height: 32px; }
.dish-link:hover { color: var(--accent-strong); text-decoration-color: currentColor; }

/* ask about this dish */
.ask { display: grid; gap: var(--s2); padding: var(--s4); border-radius: var(--radius-sm); background: var(--surface-warm); border: 1px solid var(--line); }
.ask .rc-h { color: var(--accent-strong); }
.ask-row { display: flex; gap: var(--s2); }
.ask-row input { flex: 1; min-width: 0; }
.ask-row .btn { flex: none; min-height: 48px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { font: inherit; font-size: var(--t-sm); font-weight: 600; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--field-line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-strong); }
.chip:disabled, .ask input:disabled { opacity: .55; cursor: not-allowed; }
.ask .msg { margin-top: 0; }
.asked { margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--accent-soft); display: grid; gap: 4px; justify-items: start; }
.asked-q { font-weight: 600; }
.asked-k { color: var(--accent-strong); }
.asked-a { color: var(--ink); }
.asked .btn-link { min-height: 36px; font-size: var(--t-sm); }
/* asks stack: each is a removable pill */
.ask-pills { list-style: none; margin: 2px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ask-pill { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 40px; padding: 2px 2px 2px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--field-line); font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.ask-pill > span { min-width: 0; overflow-wrap: anywhere; }
.ask-x { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--accent-strong); font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.ask-x:hover:not(:disabled) { background: var(--accent-soft); }
.ask-x:disabled { opacity: .55; cursor: not-allowed; }

/* bottom actions under the dishes; sticky on phones */
.dish-actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.dish-actions .btn { min-height: 52px; }
@media (max-width: 759px) {
  .dish-actions .btn { flex: 1 1 0; padding-left: 10px; padding-right: 10px; white-space: nowrap; font-size: var(--t-sm); }
  .dish-actions.is-sticky {
    position: sticky; bottom: 0; z-index: 15; margin: 0 calc(var(--s4) * -1); padding: var(--s3) var(--s4) max(var(--s3), env(safe-area-inset-bottom));
    background: var(--glass); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-top: 1px solid var(--line);
  }
}

/* ---------- week ---------- */
.who { display: grid; gap: var(--s3); padding: var(--s4) var(--s5); border-radius: var(--radius); background: var(--surface-warm); border: 1px solid var(--line); }
.who-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.who-title .muted { font-family: var(--sans); font-size: var(--t-sm); font-weight: 500; }
.who-sub { color: var(--muted); margin-top: calc(var(--s2) * -1); }
.who-fields { display: grid; gap: var(--s3); }
@media (min-width: 600px) { .who-fields { grid-template-columns: 1fr 1fr; } }
.who-btns { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.tab-panel.is-note { padding: 0; background: none; box-shadow: none; }
.tab-panel.is-note .letter { animation: none; }
.letter-btns { display: flex; flex-wrap: wrap; gap: var(--s2); }
.week-tips { padding: var(--s4) 0 var(--s2); border-top: 1px solid var(--line); display: grid; gap: var(--s3); }
.day-name { font-size: 1.25rem; }
.shop-group h3 { font-family: var(--sans); font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: 2px; }
.ready-bar {
  position: sticky; bottom: 0; z-index: 15; margin-top: var(--s5); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4);
  padding: var(--s3) var(--s4) max(var(--s3), env(safe-area-inset-bottom)); border-radius: var(--radius) var(--radius) 0 0;
  background: var(--glass); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border: 1px solid var(--line); border-bottom: 0;
}
.ready-text { display: flex; align-items: center; gap: var(--s2); font-weight: 650; font-family: var(--serif); font-size: 1.125rem; }
.ready-text .tick { margin: 0; }
.ready-btns { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 520px) {
  .ready-bar { gap: var(--s2); padding-top: var(--s2); }
  .ready-text { font-size: 1rem; }
  .ready-text .tick { width: 22px; height: 22px; font-size: .75rem; }
  .ready-btns { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .ready-btns .btn { flex: 1 1 auto; padding-left: 8px; padding-right: 8px; white-space: nowrap; font-size: .875rem; }
}

/* ---------- the family cookbook ---------- */
.cb-view { display: none; }
.cb-open #flowView, .cb-open .foot { display: none; }
.cb-open .cb-view { display: block; }
.cb-wrap { padding-top: var(--s5); padding-bottom: var(--s8); max-width: 860px; }
.cb-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3); padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.cb-btns { display: flex; flex-wrap: wrap; gap: var(--s2); }
.cb-cover { padding: var(--s7) 0 var(--s5); }
.cb-cover h2 { font-size: clamp(2.25rem, 8vw, 3.25rem); letter-spacing: -.02em; }
.cb-line { margin-top: var(--s2); font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--accent-strong); }
.cb-dish { padding: var(--s5) 0; border-top: 1px solid var(--line-strong); display: grid; gap: var(--s4); }
.cb-dish h3 { font-size: 1.75rem; }
.cb-kicker { font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: calc(var(--s3) * -1); }
.cb-focus { font-weight: 650; color: var(--green); }
.cb-cols { display: grid; gap: var(--s5); }
.cb-cols > div { display: grid; gap: var(--s2); align-content: start; }
@media (min-width: 760px) { .cb-cols { grid-template-columns: 1fr 1.3fr; } }
.cb-why ul, .cb-facts ul { margin: var(--s2) 0 0; padding-left: 20px; display: grid; gap: var(--s2); }
.cb-src { color: var(--muted); font-size: var(--t-sm); word-break: break-word; }
.cb-sec { padding: var(--s5) 0; border-top: 1px solid var(--line-strong); }
.cb-sec h3 { font-size: 1.5rem; margin-bottom: var(--s4); }
.cb-week { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.cb-week th, .cb-week td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cb-week thead th { font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cb-week-sec { overflow-x: auto; }
.cb-shop { display: grid; gap: var(--s4); }
@media (min-width: 600px) { .cb-shop { grid-template-columns: 1fr 1fr; } }
.cb-shop ul { list-style: none; margin: 4px 0 0; padding: 0; }
.cb-shop li { display: flex; justify-content: space-between; gap: var(--s3); padding: 4px 0; border-bottom: 1px dotted var(--line-strong); font-variant-numeric: tabular-nums; }
.cb-note-text { font-family: var(--serif); font-size: 1.625rem; line-height: 1.5; white-space: pre-line; }
.cb-noplan { color: var(--muted); padding: var(--s5) 0; }
.cb-foot { border-top: 1px solid var(--line-strong); padding-top: var(--s4); color: var(--muted); font-size: var(--t-sm); }

/* ---------- footer ---------- */
.foot { padding: var(--s4) 0 var(--s6); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2) var(--s5); }

/* ---------- how it works ---------- */
.how {
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.how::backdrop { background: rgba(20, 14, 10, .55); }
.how-inner { padding: var(--s5); display: grid; gap: var(--s4); }
@media (min-width: 760px) { .how-inner { padding: var(--s6); } }
.how-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.how-head h2 { font-size: 1.75rem; }
.how-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.how-x svg { width: 20px; height: 20px; }
.how-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.how-rows li { display: grid; grid-template-columns: 36px 1fr; gap: var(--s3); align-items: start; }
.how-n { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; }
.how-rows b { display: block; }
.how-sub { display: block; color: var(--muted); font-size: var(--t-sm); }
.how-numbers { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green-ink); font-weight: 600; }
.how-why { display: grid; gap: var(--s2); color: var(--muted); }
.how-why h3 { font-size: 1.125rem; color: var(--ink); }
.how-mode { color: var(--warn-ink); background: var(--warn-soft); padding: 10px 14px; border-radius: var(--radius-sm); font-size: var(--t-sm); margin-bottom: var(--s3); }
.how-mode:empty { display: none; }

/* ---------- plan my week: entry links ---------- */
.hero-week { margin-top: var(--s1); color: var(--muted); }
.hero-week .btn-link { min-height: 44px; }
.composer-skip { color: var(--muted); text-align: center; font-size: var(--t-sm); }
.composer-skip .btn-link { font-size: var(--t-sm); }

/* ---------- the intake (a short chat with a dietitian, not a form) ---------- */
.intake {
  display: grid; gap: var(--s5); padding: var(--s5) var(--s4); border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); scroll-margin-top: var(--s4); border-top: 6px solid var(--green-bar);
}
@media (min-width: 760px) { .intake { padding: var(--s6) var(--s7); } }
.intake-head .sec-title { margin-bottom: var(--s2); }
.intake-sub { color: var(--muted); max-width: 60ch; }
.intake-form { display: grid; gap: var(--s5); }
.q { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--s2); }
.q-h { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.25; padding: 0; color: var(--ink); }
.opt { font-family: var(--sans); font-size: var(--t-sm); font-weight: 500; color: var(--muted); margin-left: 4px; }
.q-help { color: var(--muted); font-size: var(--t-sm); max-width: 60ch; }
.q-help:empty { display: none; }
.q-two { display: grid; gap: var(--s3); }
@media (min-width: 600px) { .q-two { grid-template-columns: 1fr 1fr; } }

.pick { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pick-opt { position: relative; display: inline-flex; }
.pick-opt input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.pick-opt span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--field-line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: var(--t-sm); line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s;
}
.pick-opt:hover input:not(:checked) + span { border-color: var(--accent); }
.pick-opt input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.pick-opt input:checked + span::before { content: "✓"; font-weight: 700; }
.pick-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.target { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-warm); padding: 0 var(--s4); gap: 0; }
.target > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 56px; }
.target > summary::-webkit-details-marker { display: none; }
.target > summary:focus-visible { outline-offset: 2px; }
.target-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.target-title { font-weight: 650; color: var(--accent-strong); }
.target .opt { margin: 0; }
.chev { flex: none; width: 10px; height: 10px; border-right: 2px solid var(--accent-strong); border-bottom: 2px solid var(--accent-strong); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.target[open] .chev { transform: rotate(-135deg) translate(-2px, -2px); }
.target-body { display: grid; gap: var(--s4); padding: var(--s1) 0 var(--s4); }
.q-sub { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--s2); }
.q-sub legend { padding: 0; margin-bottom: var(--s2); }
.unit-in { position: relative; display: inline-flex; align-items: center; width: 6.75rem; }
.unit-in.sm { width: 4.75rem; }
.unit-in input { padding-right: 34px; -moz-appearance: textfield; }
.unit-in input::-webkit-inner-spin-button, .unit-in input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.unit-in > span { position: absolute; right: 12px; color: var(--muted); font-size: var(--t-sm); pointer-events: none; }
.field-num .unit-in { width: 7.5rem; }
.field-num .unit-in input { padding-right: 52px; }
.conv { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.conv-or { color: var(--muted); font-size: var(--t-sm); }

.q-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); }
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--s3); min-height: 48px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; left: 0; top: 50%; width: 52px; height: 32px; margin: -16px 0 0; opacity: 0; cursor: pointer; }
.switch-track { position: relative; flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--track); border: 1.5px solid var(--field-line); transition: background .2s, border-color .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--green); border-color: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: var(--on-green); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.stepper-unit { font-weight: 600; margin: 0 2px; }
.intake-go { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
@media (max-width: 759px) { .intake-go .btn-wide { width: 100%; } .intake-go .btn-link { margin: 0 auto; } }
.intake .msg { margin: 0; }

/* ---------- planning: calm progress with honest stages ---------- */
.planning { display: grid; gap: var(--s4); padding: var(--s5); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); animation: rise .35s ease both; }
@media (min-width: 760px) { .planning { padding: var(--s6); } }
.planning-title { font-size: 1.375rem; line-height: 1.3; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.stages li { display: grid; grid-template-columns: 28px 1fr; gap: var(--s3); align-items: center; color: var(--muted); }
.stage-mark { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.stages li.is-now { color: var(--ink); font-weight: 650; }
.stages li.is-now .stage-mark { border-color: var(--spin-track); border-top-color: var(--warn-ink); animation: spin .9s linear infinite; }
.stages li.is-done { color: var(--ink); }
.stages li.is-done .stage-mark { background: var(--green); border-color: var(--green); color: var(--on-green); animation: none; }
.stages li.is-done .stage-mark::before { content: "✓"; }
.planning-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.planning-foot .secs { margin-left: 4px; }
@media (prefers-reduced-motion: reduce) { .stages li.is-now .stage-mark { border-color: var(--warn-ink); border-width: 3px; } }
.plan-err { display: grid; gap: var(--s2); }
.plan-err-btns { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }

/* ---------- the week: summary ---------- */
.wk-summary {
  display: grid; gap: var(--s4); padding: var(--s5); border-radius: var(--radius); background: var(--green-soft); color: var(--green-ink);
  position: relative; overflow: hidden; animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}
.wk-summary::after { content: ""; position: absolute; right: -50px; top: -50px; width: 180px; height: 180px; border-radius: 50%; border: 24px solid var(--green-bar); opacity: .12; pointer-events: none; }
@media (min-width: 760px) { .wk-summary { padding: var(--s6); grid-template-columns: 1.1fr 1fr; align-items: end; column-gap: var(--s6); } .wk-who, .wk-foot { grid-column: 1 / -1; } }
.wk-who { font-weight: 650; font-size: var(--t-sm); color: var(--green-muted); position: relative; }
.wk-big { font-family: var(--serif); font-weight: 600; font-size: clamp(2.25rem, 9vw, 3.25rem); line-height: 1; letter-spacing: -.02em; color: var(--green); font-variant-numeric: lining-nums tabular-nums; }
.wk-about { font-size: .5em; font-weight: 500; letter-spacing: 0; color: var(--green-ink); margin-right: 4px; }
.wk-unit { font-size: .45em; font-weight: 500; letter-spacing: 0; color: var(--green-ink); }
.wk-target { margin-top: var(--s2); font-weight: 600; }
.wk-stats { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--s3); position: relative; }
.stat { padding: var(--s3); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.stat dt { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat dd { margin: 2px 0 0; font-size: var(--t-sm); color: var(--muted); }
.stat dd b { font-family: var(--serif); font-size: 1.375rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-sub { display: block; font-weight: 600; }
.stat-sub.is-low { color: var(--warn-ink); }
.wk-foot { font-size: var(--t-sm); color: var(--green-muted); }
.wk-notes { display: grid; grid-template-columns: 24px 1fr; gap: var(--s3); padding: var(--s4); border-radius: var(--radius-sm); background: var(--surface-warm); border: 1px solid var(--line); }
.wk-notes svg { width: 22px; height: 22px; margin-top: 2px; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wk-notes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.wk-notes li + li { border-top: 1px dashed var(--line-strong); padding-top: var(--s2); }

/* ---------- the week: days ---------- */
.tab-panel.is-meals { background: none; box-shadow: none; padding: 0; }
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: var(--s3); }
.day-chip {
  min-height: 44px; padding: 0; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface);
  font: inherit; font-size: var(--t-sm); font-weight: 650; color: var(--muted); cursor: pointer;
}
.day-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.day-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.days-grid { display: grid; gap: var(--s4); }
.day-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s4) var(--s4) var(--s3); display: grid; gap: var(--s2); align-content: start; }
.day-h { font-size: 1.375rem; }
@media (max-width: 759px) { .day-card:not(.is-current) { display: none; } }
@media (min-width: 760px) {
  .day-chips { display: none; }
  .days-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .day-h { font-size: 1.25rem; }
}
.meals { list-style: none; margin: 0; padding: 0; display: grid; }
.meal { padding: var(--s3) 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.meal-top { display: flex; justify-content: space-between; gap: var(--s2); font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.meal-kcal { letter-spacing: 0; text-transform: none; font-size: var(--t-sm); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meal-name { font-weight: 650; line-height: 1.35; color: var(--ink); }
.meal .dish-link.meal-name { font-weight: 650; text-align: left; min-height: 32px; }
.meal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); font-size: var(--t-sm); color: var(--muted); }
.tag-fam, .tag-sug { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: var(--t-xs); font-weight: 700; }
.tag-fam { background: var(--green-soft); color: var(--green); }
.tag-sug { background: var(--chip); color: var(--muted); }
.meal-more > summary { list-style: none; cursor: pointer; display: grid; gap: 4px; min-height: 44px; border-radius: 6px; }
.meal-more > summary::-webkit-details-marker { display: none; }
.meal-open { color: var(--accent-strong); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.meal-more .when-open { display: none; }
.meal-more[open] .when-open { display: inline; }
.meal-more[open] .when-closed { display: none; }
.meal-body { display: grid; gap: var(--s2); margin-top: var(--s2); padding: var(--s3); border-radius: var(--radius-sm); background: var(--surface-warm); font-size: var(--t-sm); }
.meal-body .ing-list li { padding: 4px 0; }
.meal-body .ing-amt { min-width: 52px; }
.meal-how { font-size: var(--t-base); line-height: 1.5; color: var(--ink); }
.day-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px var(--s2); padding-top: var(--s2); font-variant-numeric: tabular-nums; }
.day-total-l { font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.day-key { font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
@media (max-width: 520px) { .wk-actions .btn { flex: 1 1 100%; } .wk-actions .btn-link { margin: 0 auto; } }

.check-row { display: flex; align-items: center; gap: var(--s3); min-height: 44px; cursor: pointer; font-weight: 600; }
.check-row input { width: 22px; height: 22px; accent-color: var(--green); flex: none; margin: 0; }
.wk-body { margin-top: 4px; font-size: var(--t-sm); color: var(--green-ink); }
.wk-notes-body { display: grid; gap: var(--s2); min-width: 0; }
.wk-notes-h { font-family: var(--sans); font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.wk-notes-rest li:first-child { border-top: 1px dashed var(--line-strong); padding-top: var(--s2); }
.wk-notes-toggle { justify-self: start; }
.stepper-label, .stepper-unit { white-space: nowrap; }
.unit-in { width: 6rem; }
.unit-in.sm { width: 4.25rem; }
.unit-in input { padding-left: 10px; padding-right: 28px; }
.unit-in > span { right: 10px; }

/* ---------- several health issues, suggested dishes ---------- */
.cond-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: calc(var(--s2) * -1) 0 var(--s3); }
.cond-tag { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: var(--t-xs); font-weight: 650; }
.tag-suggest { background: var(--saffron-soft); color: var(--warn-ink); border: 1px solid var(--saffron); }
.why-fits { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--saffron-soft); border-left: 4px solid var(--saffron); }
.why-fits .portion-h { color: var(--warn-ink); }
.composer.is-suggest .composer-skip { display: none; }
.credit { font-size: var(--t-sm); color: var(--muted); }
.how-disclaimer { font-size: var(--t-sm); color: var(--muted); }
.how-disclaimer b { color: var(--ink); }

/* ---------- cookbook: the week ---------- */
.cb-target { font-weight: 650; margin: calc(var(--s2) * -1) 0 var(--s3); }
.cb-num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cb-legend { margin-top: var(--s2); color: var(--muted); font-size: var(--t-sm); }
.cb-notes { margin: var(--s3) 0 0; padding-left: 20px; display: grid; gap: var(--s1); color: var(--muted); font-size: var(--t-sm); }
.cb-h-sub { font-family: var(--sans); font-size: var(--t-sm); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.how-target { color: var(--muted); font-size: var(--t-sm); }
@media print {
  .cb-week { font-size: 9.5pt; }
  .cb-target, .cb-legend, .cb-notes, .cb-h-sub { color: #000 !important; }
}

/* ---------- print: the cookbook only, black on white ---------- */
@media print {
  @page { margin: 16mm; }
  :root { --ink: #000; --muted: #333; --line: #bbb; --line-strong: #888; --green: #000; --green-ink: #000; --accent-strong: #000; --surface: #fff; --bg: #fff; }
  html, body { background: #fff !important; color: #000 !important; }
  body { background-image: none !important; font-size: 11pt; }
  .skip, .top, .foot, #flowView, .toast, .how, .cb-toolbar, .no-print, .preview-banner { display: none !important; }
  .cb-view { display: block !important; }
  .cb-wrap { max-width: none; padding: 0; }
  .cb-cover { padding: 0 0 12pt; }
  .cb-dish { break-before: page; border-top: 0; padding-top: 0; }
  .cb-sec { break-before: page; border-top: 0; }
  .cb-sec + .cb-sec.cb-note { break-before: page; }
  .portion { background: none; border-left: 3px solid #000; color: #000; }
  .cb-focus, .portion-h, .cb-line, .rc-h { color: #000 !important; }
  .ing-list li, .cb-shop li { border-bottom-color: #ccc; }
  .method li::before { background: none; border: 1px solid #000; }
  a { color: #000; }
  * { box-shadow: none !important; animation: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .hero-card > div, .hero-card::before, .ex-slide, .ex-slide.was-on { transform: none; }
}
@media (forced-colors: active) {
  .tag, .btn, .chip { border: 1px solid CanvasText; }
  .cmp-bar > span, .prog-bar > span { background: Highlight !important; }
}

/* ---------- very narrow phones (320–380 px): nothing scrolls sideways ---------- */
.stepper { max-width: 100%; min-width: 0; }
.ready-btns { min-width: 0; max-width: 100%; }
@media (max-width: 380px) {
  .stepper { gap: 0; padding-left: 12px; }
  .stepper-btn { width: 40px; height: 44px; }
  .stepper input { width: 34px; }
  .ready-btns { flex-wrap: wrap; }
  .ready-btns .btn { flex: 1 1 auto; }
}

/* =====================================================================
   Heritage: umbrella home, Plate | Care switch, and Heritage Care.
   Care swaps the accent for curry-leaf green (the existing --green tokens,
   AA in light and dark); Plate keeps paprika. --paprika keeps Plate's
   accent reachable inside Care (the Swap pill).
   ===================================================================== */
:root { --paprika: var(--accent); --paprika-soft: var(--accent-soft); --paprika-strong: var(--accent-strong); }
/* Set on <body>, not :root, so --paprika above keeps Plate's colour inside Care. */
html[data-side="care"] > body, body[data-side="care"], .care-scope {
  --accent: var(--green); --accent-strong: var(--green-ink); --accent-soft: var(--green-soft);
  --on-accent: var(--on-green); --brand-rim: var(--green);
}

/* Which side shows. <html data-side> is set by the inline script in <head> before first paint, so the
   right side is the first thing drawn; care.js keeps <html> and <body> in step. No attribute (no JS): home. */
[data-side="home"] #flowView, [data-side="home"] #careView,
[data-side="plate"] #homeView, [data-side="plate"] #careView,
[data-side="care"] #homeView, [data-side="care"] #flowView,
html:not([data-side]) #careView { display: none; } /* no early script (an old cached page): still show Plate */
.cb-open #homeView, .cb-open #careView { display: none !important; }
[data-side="care"] .side-plate, html:not([data-side="care"]) .side-care { display: none; }

/* header switch */
.top-inner { flex-wrap: wrap; }
.side-switch {
  display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--chip);
  margin-left: auto; min-width: 0;
}
.side-switch a {
  display: inline-flex; align-items: baseline; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 10px 18px;
  border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 650; line-height: 1.5; white-space: nowrap;
  transition: background .15s, color .15s;
}
.side-switch a:hover { color: var(--ink); }
.side-switch .sw-sub { font-weight: 500; font-size: var(--t-xs); }
.side-switch a[aria-current="page"] { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow-sm); }
.side-switch a[data-side-link="care"][aria-current="page"] { color: var(--green-ink); }
.side-switch a[data-side-link="plate"][aria-current="page"] { color: var(--paprika-strong); }
.top-end { order: 2; }
.side-switch { order: 1; }
@media (max-width: 519px) {
  .top-inner { padding-bottom: var(--s2); row-gap: 0; }
  .side-switch { order: 3; width: 100%; margin: 0; }
  .side-switch a { padding: 8px 10px; }
}
@media (max-width: 359px) { .side-switch .sw-sub { display: none; } }

/* umbrella home */
.home-hero { padding-bottom: var(--s7); }
.home-hero h1 { max-width: 18ch; }
.home-grid { display: grid; gap: var(--s6); align-items: center; }
.home-ex { display: none; }
@media (min-width: 860px) {
  .home-grid { grid-template-columns: 1.25fr 1fr; gap: var(--s8); }
  .home-ex { display: block; }
}
/* the 3 steps, so the whole idea lands in a few seconds */
.steps3 { list-style: none; margin: var(--s5) 0 0; padding: 0; display: grid; gap: var(--s3); max-width: 40ch; }
.steps3 li { display: flex; gap: var(--s3); align-items: flex-start; }
.s3-n {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-weight: 750; font-size: 1rem; line-height: 1;
}
.steps3 b { display: block; font-size: 1.125rem; line-height: 1.3; margin-top: 3px; }
.s3-sub { display: block; color: var(--muted); font-size: var(--t-base); line-height: 1.4; }
.steps-mini { list-style: none; margin: var(--s4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px var(--s4); font-size: var(--t-sm); font-weight: 650; color: var(--ink); }
.steps-mini li { display: inline-flex; align-items: center; gap: 8px; }
.sm-n {
  flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong); font-size: .8125rem; font-weight: 800; line-height: 1;
}
@media (max-width: 519px) { .steps-mini { flex-direction: column; } }
.door-sub { font-family: var(--sans); font-size: var(--t-sm); font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.home-sample { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-top: var(--s5); }
.home-sample-sub { color: var(--muted); font-size: var(--t-sm); }
@media (max-width: 520px) { .home-sample .btn { width: 100%; } }

/* input guardrail: shown right under the field that was sent */
.guard-slot:empty { display: none; }
.guard-slot { margin-top: var(--s2); }
.guard {
  display: grid; gap: 4px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--warn-ink); border-left: 4px solid var(--saffron); font-weight: 600;
}
.guard-ex { font-weight: 500; }
.guard .btn-link { min-height: 32px; text-align: left; overflow-wrap: anywhere; }
.guard-support {
  display: grid; gap: var(--s2); padding: var(--s4) var(--s5); border-radius: var(--radius-sm);
  background: var(--surface-warm); color: var(--ink); border: 1.5px solid var(--line-strong); border-left: 6px solid var(--focus);
}
.guard-support .guard-msg { font-family: var(--serif); font-size: 1.1875rem; line-height: 1.45; }
.guard-lines { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-weight: 600; }
.diet-note { margin-top: var(--s2); }
.mic-hint.is-novoice { color: var(--warn-ink); background: var(--warn-soft); padding: 6px 12px; border-radius: 8px; font-weight: 600; }
.home-hero h1 .accent { color: var(--accent); }
.home-lede { max-width: 46ch; }
.doors { display: grid; gap: var(--s4); margin-top: var(--s6); }
@media (min-width: 700px) { .doors { grid-template-columns: 1fr 1fr; gap: var(--s5); } }
.door {
  display: grid; gap: var(--s2); align-content: start; padding: var(--s5); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-top: 5px solid var(--accent);
}
.door h2 { font-size: var(--t-lg); }
.door p { color: var(--muted); font-size: 1.125rem; max-width: 32ch; margin-bottom: var(--s3); }
.door .btn { justify-self: start; }
@media (max-width: 520px) { .door .btn { justify-self: stretch; width: 100%; } }
.door-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.door-icon svg { width: 24px; height: 24px; }

/* Care layout */
.care-wrap { padding-top: var(--s5); padding-bottom: var(--s8); display: grid; gap: var(--s5); max-width: 880px; }
.care-wrap > * { min-width: 0; }
.care-head h1 { font-size: clamp(2.125rem, 8.5vw, 3.25rem); line-height: 1.06; letter-spacing: -.02em; }
.care-head h1 .accent { color: var(--accent); font-style: italic; font-weight: 500; }
.care-head .care-h1 { font-size: clamp(1.875rem, 7vw, 2.5rem); }
.care-head .lede { max-width: 48ch; }
.care-back { justify-self: start; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.care-box textarea { min-height: 96px; }
.care-row { display: grid; gap: var(--s2); }
.care-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.care-fs legend { padding: 0; margin-bottom: var(--s2); }
.chip-row { gap: var(--s2); }
.chip-btn, .chip-add {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--field-line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  font-size: var(--t-sm); cursor: pointer; text-align: left; transition: border-color .15s, background .15s;
}
.chip-btn:hover, .chip-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.chip-add { border-style: dashed; color: var(--accent-strong); }
.quick-add { display: inline-flex; gap: var(--s2); align-items: center; flex-wrap: wrap; max-width: 100%; }
.quick-add input { width: 160px; min-height: 44px; }
.care-ex-line { margin-top: calc(var(--s2) * -1); }
.care-more { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); align-items: center; }
.care-more .text-link { margin-top: 0; }
.care-disclaimer { color: var(--muted); font-size: var(--t-sm); border-top: 1px solid var(--line); padding-top: var(--s3); }
.care-sample { margin-top: calc(var(--s2) * -1); }
.care-add-row { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* waiting */
.care-wait { display: grid; gap: var(--s3); }
.care-wait .working { margin: 0; }
.care-skel { display: grid; gap: var(--s3); padding: var(--s5); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.care-skel span { display: block; height: 18px; border-radius: 999px; background: linear-gradient(90deg, var(--skel-a), var(--skel-b), var(--skel-a)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.care-skel .sk-a { width: 34%; height: 30px; }
.care-skel .sk-b { width: 88%; }
.care-skel .sk-c { width: 64%; }
.care-error { display: grid; gap: var(--s3); justify-items: start; padding: var(--s4) var(--s5); border-radius: var(--radius-sm); background: var(--error-soft); color: var(--error-ink); border-left: 4px solid var(--error-ink); }

/* results */
.care-result:empty { display: none; }
.care-result { scroll-margin-top: var(--s4); }
.care-result-inner { display: grid; gap: var(--s4); }
.care-for { color: var(--muted); overflow-wrap: anywhere; }
.care-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s5); display: grid; gap: var(--s3); min-width: 0; animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }
@media (max-width: 400px) { .care-card { padding: var(--s4); } }
.care-card .rc-h { margin-top: var(--s2); }
.care-p { max-width: 64ch; }
.care-h2 { font-size: var(--t-lg); }
.care-h3 { font-size: 1.375rem; }
.verdict-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.verdict {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px 6px 8px; border-radius: 999px; font-weight: 750;
  font-size: 1.0625rem; line-height: 1.2; border: 2px solid transparent; white-space: nowrap;
}
.v-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: .875rem; font-weight: 800; line-height: 1; }
.v-keep { background: var(--green-soft); color: var(--green-ink); border-color: var(--green); }
.v-keep .v-icon { background: var(--green); color: var(--on-green); }
.v-care { background: var(--saffron-soft); color: var(--warn-ink); border-color: var(--saffron); }
.v-care .v-icon { background: var(--warn-ink); color: var(--surface); }
.v-swap { background: transparent; color: var(--paprika-strong); border-color: var(--paprika); }
.v-swap .v-icon { background: var(--paprika); color: var(--surface); }
.v-stop { background: var(--error-soft); color: var(--error-ink); border-color: var(--error-ink); }
.v-stop .v-icon { background: var(--error-ink); color: var(--surface); }
.evidence-word { color: var(--muted); font-weight: 600; font-size: var(--t-sm); }
.safety-rule { justify-self: start; color: var(--error-ink); font-weight: 700; font-size: var(--t-sm); }
.safety-rule span { margin-right: 6px; }
.remedy-name { font-size: clamp(1.5rem, 6vw, 2rem); line-height: 1.2; overflow-wrap: anywhere; }
.ing-cards { display: grid; gap: var(--s3); }
@media (min-width: 700px) { .ing-cards { grid-template-columns: 1fr 1fr; } }
.ing-card { padding: var(--s4); border-radius: var(--radius-sm); background: var(--surface-warm); border: 1px solid var(--line); border-left: 4px solid var(--green-bar); display: grid; gap: 6px; align-content: start; min-width: 0; overflow-wrap: anywhere; }
.ing-name { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; line-height: 1.25; }
.ing-strength { display: inline-block; font-family: var(--sans); font-size: var(--t-sm); font-weight: 700; color: var(--green-ink); background: var(--green-soft); padding: 1px 10px; border-radius: 999px; }
.ing-meta { font-size: var(--t-sm); color: var(--muted); }
.ing-meta b { color: var(--ink); }
.ing-why { font-style: italic; }
.ing-preg { font-size: var(--t-sm); color: var(--warn-ink); background: var(--warn-soft); padding: 6px 10px; border-radius: 8px; }
.doctor-notes { margin: 0; padding: var(--s3) var(--s4) var(--s3) calc(var(--s4) + 18px); border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn-ink); font-weight: 600; display: grid; gap: 4px; }
.care-callout { padding: var(--s4) var(--s5); border-radius: var(--radius-sm); background: var(--surface-warm); border: 1.5px solid var(--line-strong); border-left: 6px solid var(--focus); display: grid; gap: 6px; }
.care-callout ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.callout-h { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; color: var(--ink); display: flex; gap: 8px; align-items: baseline; }
.care-callout-warn { border-left-color: var(--saffron); }
.care-callout-danger { border-left-color: var(--error-ink); background: var(--error-soft); }
.care-callout-danger .callout-h { color: var(--error-ink); }
.checked-badge { justify-self: start; max-width: 100%; }
.checked-badge > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 16px; border-radius: 999px; cursor: pointer;
  background: var(--green-soft); color: var(--green-ink); font-weight: 700; font-size: var(--t-sm); list-style: none;
}
.checked-badge > summary::-webkit-details-marker { display: none; }
.checked-badge ul { margin: var(--s2) 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: var(--t-sm); overflow-wrap: anywhere; }
.ai-badge { justify-self: start; padding: 6px 14px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: var(--t-sm); font-weight: 600; }
.care-letter { padding: var(--s5); border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.care-letter-text { font-family: var(--serif); font-size: 1.375rem; line-height: 1.5; white-space: pre-line; margin-top: var(--s2); }
.care-actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
@media (max-width: 520px) { .care-actions .btn { width: 100%; } .care-actions .btn-link { margin: 0 auto; } }

/* care plan: people */
.care-people { display: grid; gap: var(--s4); }
.care-empty { grid-column: auto; }
.person { margin: 0; animation: none; }
.person-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.person-title { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.person-title .avatar { width: 44px; height: 44px; border-radius: 14px; font-size: 1.25rem; }
.person-name { font-family: var(--serif); font-weight: 600; font-size: 1.375rem; line-height: 1.2; overflow-wrap: anywhere; display: block; }
.person-sub { display: block; color: var(--muted); font-size: var(--t-sm); }
.person-grid { display: grid; gap: var(--s3); }
@media (min-width: 600px) { .person-grid { grid-template-columns: 1.6fr 1fr; } }
.person-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.person-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.person-fs legend { padding: 0; margin-bottom: var(--s2); }
.person textarea { min-height: 72px; }
.opt { font-weight: 500; color: var(--muted); font-size: var(--t-xs); }
.routine-grid { display: grid; gap: var(--s4); }
@media (min-width: 700px) { .routine-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.routine-slot { min-width: 0; }
.routine { margin: var(--s2) 0 0; padding-left: 22px; display: grid; gap: var(--s2); }
.step-product { font-weight: 650; }
.step-active { color: var(--muted); }
.step-tip { display: block; font-size: var(--t-sm); color: var(--muted); }
.person-summary { color: var(--muted); }
.why-these > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; color: var(--accent-strong); }
.why-these[open] > summary { margin-bottom: var(--s3); }
.why-these .checked-badge { margin-top: var(--s3); }
.shop-list { list-style: none; margin: 0; padding: 0; display: grid; }
.shop-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px var(--s3); padding: 10px 0; border-bottom: 1px dotted var(--line-strong); }
.shop-main { min-width: 0; overflow-wrap: anywhere; }
.shop-for { color: var(--muted); font-size: var(--t-sm); }

/* label check */
.label-fit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-weight: 600; }
.label-cols { display: grid; gap: var(--s4); }
@media (min-width: 700px) { .label-cols { grid-template-columns: 1fr 1fr; } }
.label-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s3); }
.label-list li { padding: var(--s3); border-radius: var(--radius-sm); background: var(--surface-warm); border: 1px solid var(--line); overflow-wrap: anywhere; }
.label-sub { display: block; font-size: var(--t-sm); color: var(--muted); }
.pos { font-size: var(--t-xs); font-weight: 650; color: var(--muted); }
.tag-high { display: inline-block; font-size: var(--t-xs); font-weight: 750; color: var(--warn-ink); background: var(--warn-soft); border: 1px solid var(--saffron); padding: 0 8px; border-radius: 999px; }
.label-note { font-size: var(--t-sm); }

/* family book: Care pages */
.cb-care h3 { margin-bottom: var(--s2); }
.cb-person { padding: var(--s4) 0; border-top: 1px solid var(--line); display: grid; gap: var(--s3); }
.cb-person h4 { font-size: 1.5rem; }
.cb-person .cb-kicker { margin-bottom: calc(var(--s2) * -1); }
.cb-routine h5 { margin: 0 0 4px; }
.cb-callout { padding: var(--s3) var(--s4); border-left: 4px solid var(--focus); background: var(--surface-warm); border-radius: 8px; }
.cb-callout ul { margin: 4px 0 0; padding-left: 20px; }
.cb-remedy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.cb-remedy-list li { display: grid; gap: 4px; padding-bottom: var(--s3); border-bottom: 1px dotted var(--line-strong); }
.cb-remedy-list .verdict { font-size: var(--t-sm); padding: 2px 12px 2px 4px; }
.cb-remedy-list .v-icon { width: 20px; height: 20px; font-size: .75rem; }
.cb-shop-care { grid-template-columns: 1fr !important; }
.cb-care-foot { margin-top: var(--s4); }
.how-n-care { background: var(--green-soft); color: var(--green-ink); }

/* narrow phones: nothing scrolls sideways */
@media (max-width: 380px) {
  .verdict { white-space: normal; }
  .quick-add input { width: 100%; }
  .chip-btn, .chip-add { padding: 8px 12px; }
}

@media print {
  #homeView, #careView, .side-switch { display: none !important; }
  .cb-person { break-before: page; border-top: 0; }
  .cb-sec.cb-care { break-before: page; }
  .cb-callout { border-left: 3px solid #000; background: none; }
  .verdict, .v-icon { background: none !important; color: #000 !important; border-color: #000 !important; }
}
@media (forced-colors: active) {
  .verdict, .chip-btn, .chip-add, .checked-badge > summary, .side-switch a[aria-current="page"] { border: 1px solid CanvasText; }
}

/* =====================================================================
   Design pass (Oct 26): calmer and more premium, same behaviour.
   One primary action per area, more air on an 8px rhythm, softer
   shadows, 16/24px radii, quieter inner cards. Tokens first.
   ===================================================================== */
:root {
  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .04), 0 8px 24px -12px rgba(60, 40, 20, .10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --shadow: 0 0 0 1px #2e251e, 0 12px 28px -14px rgba(0, 0, 0, .5); }
}
:root[data-theme="dark"] { --shadow: 0 0 0 1px #2e251e, 0 12px 28px -14px rgba(0, 0, 0, .5); }

/* reading width and rhythm */
.lede, .care-head .lede { max-width: 52ch; }
.care-p, .sec-sub, .q-help { max-width: 65ch; }
@media (min-width: 760px) { .flow { gap: var(--s8); } }
.care-wrap { gap: var(--s6); }
.care-card { gap: var(--s4); }
@media (min-width: 701px) { .care-card { padding: var(--s6); } }

/* Plate hero: one clear primary. "Suggest a dish" reads as a quiet link, not a third big button. */
#heroSuggest {
  background: none; border: 0; box-shadow: none; padding: 0 2px; min-height: 44px; width: auto;
  color: var(--accent-strong); font-weight: 650; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
#heroSuggest:hover { background: none; text-decoration-thickness: 2.5px; transform: none; }
@media (max-width: 520px) { #heroSuggest { justify-self: start; } }

/* inner cards: no heavy side bars, just a soft fill and a hairline */
.ing-card { border-left: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s4) var(--s4) var(--s4); gap: var(--s2); }
.ing-name { font-size: 1.1875rem; }
.label-list li { border-radius: var(--radius-sm); padding: var(--s3) var(--s4); }
.care-letter { border-radius: var(--radius); padding: var(--s6) var(--s5); }

/* Care plan: each person breathes, so the long form reads as a few calm groups */
.person { gap: var(--s4); }
.person-fs { margin-top: var(--s1); }
.person + .person { margin-top: var(--s2); }
.care-people { gap: var(--s5); }
.routine-slot .rc-h { margin-bottom: var(--s1); }
.routine { gap: var(--s3); }

/* softer step numbers and dividers */
.care-disclaimer, .foot { border-top-color: var(--line); }
.care-callout { border-radius: var(--radius-sm); }
.doctor-notes { border-radius: var(--radius-sm); }

/* =====================================================================
   Polish pass (Oct 27): fixes and finish before the judges see it.
   Builds on the design pass above; same tokens, same behaviour.
   ===================================================================== */

/* Plate's ingredient names were picking up Care's serif card title (shared .ing-name). Body text again. */
.ing-list .ing-name { font-family: var(--sans); font-weight: 400; font-size: inherit; line-height: 1.45; }
.ing-list .ing-amt { line-height: 1.45; }

/* Display type: a touch more air between words at large optical sizes. */
.hero h1 { letter-spacing: -.02em; line-height: 1.06; }
@media (min-width: 860px) { #flowView .hero h1 { font-size: clamp(2.375rem, 4.6vw, 3.5rem); } }
.nowrap { white-space: nowrap; }
.care-head h1 { letter-spacing: -.015em; }

/* Home on phones: show the real example (the hero moment) instead of only words; steps stay short. */
@media (max-width: 859px) {
  .home-ex { display: block; max-width: 460px; }
  .home-grid { gap: var(--s5); }
}
@media (max-width: 519px) {
  .steps3 { gap: var(--s2); margin-top: var(--s4); }
  .steps3 b { font-size: var(--t-base); margin-top: 4px; }
  .s3-sub { font-size: var(--t-sm); }
  .s3-n { width: 28px; height: 28px; font-size: .9375rem; }
}

/* Cards: no thick bent top borders; the icon tile and the button carry the side colour. */
.door, .intake { border-top: 1px solid var(--line); }
.door { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
@media (hover: hover) { .door:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow), 0 16px 32px -20px rgba(60, 40, 20, .35); } }
.door h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; }

/* Plate hero: two buttons, then one quiet group of other ways in (was three stacked links). */
.hero-alt { margin-top: var(--s4); display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4); }
.hero-alt-h { color: var(--muted); font-weight: 600; }
.hero-alt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4); }
.hero-alt-list .text-link { margin-top: 0; }
.hero-alt-list .btn-link { font-size: inherit; padding: 0; }
#heroSuggest { padding: 0; }
@media (max-width: 519px) {
  .hero-alt { display: grid; gap: 0; }
  .hero-alt-list { display: grid; justify-items: start; gap: 0; }
}

/* Trust: short items separated by a dot that never starts a line. */
.trust-row { display: flex; flex-wrap: wrap; gap: 2px 0; }
.trust-row > span + span::before { content: "·"; margin: 0 var(--s2); color: var(--line-strong); }

/* Home trust badges: four short, scannable reasons. */
.trust-badges { list-style: none; margin: var(--s6) 0 0; padding: var(--s5) 0 0; border-top: 1px solid var(--line); display: grid; gap: var(--s3) var(--s5); }
@media (min-width: 600px) { .trust-badges { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .trust-badges { grid-template-columns: repeat(4, 1fr); } }
.trust-badges li { display: grid; grid-template-columns: 24px 1fr; gap: var(--s3); align-items: start; color: var(--muted); font-size: var(--t-sm); line-height: 1.45; }
.trust-badges b { color: var(--ink); font-weight: 650; }
.trust-badges svg { width: 22px; height: 22px; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }

/* "Gill family · for Mum ·": drop the dangling dot when the goal chips wrap to their own line. */
#dishesWho > span[aria-hidden="true"]:last-child { display: none; }
#dishesSub { row-gap: var(--s2); }
.goal-inline { flex: 1 1 100%; }

/* Support reply: calm, readable, help one tap away. Regular weight, not a wall of bold. */
.guard-support { padding: var(--s4) var(--s5); border: 1px solid var(--line); border-left: 4px solid var(--focus); background: var(--surface); box-shadow: var(--shadow); }
.guard-support .guard-msg { font-weight: 400; font-size: 1.125rem; line-height: 1.5; }
.guard-lines { font-weight: 500; padding-left: 0; list-style: none; gap: var(--s1); }
.guard-lines li { padding: 2px 0; }
.guard-tel { color: var(--focus); font-weight: 700; text-underline-offset: 3px; display: inline-block; min-height: 24px; }
.guard { font-weight: 500; }
.guard-msg { font-weight: 600; }
.guard-support .guard-msg { font-weight: 400; }

/* Doctor first: a warm, serious edge (not the blue focus colour, which means "keyboard focus"). */
.care-callout-doctor { border-left-color: var(--error-ink); }
.care-callout-doctor .callout-h > span { color: var(--error-ink); }

/* Label check: an at-a-glance tally before the details, and coloured section heads. */
.label-tally { list-style: none; margin: calc(var(--s2) * -1) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.label-tally li { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: var(--t-sm); font-weight: 600; background: var(--chip); color: var(--ink); }
.label-tally b { font-family: var(--serif); font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.label-tally .lt-help { background: var(--green-soft); color: var(--green-ink); }
.label-tally .lt-watch { background: var(--warn-soft); color: var(--warn-ink); }
.label-tally .lt-stop { background: var(--error-soft); color: var(--error-ink); }
.rc-h-good, .rc-h-watch { display: flex; align-items: center; gap: 8px; }
.rc-h-good::before, .rc-h-watch::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.rc-h-good { color: var(--green); }
.rc-h-good::before { background: var(--green-bar); }
.rc-h-watch { color: var(--warn-ink); }
.rc-h-watch::before { background: var(--saffron); }

/* Tactile press on every button, so taps feel answered (no motion when reduced). */
.btn:active:not(:disabled), .chip:active:not(:disabled), .chip-btn:active, .pick-opt:active span { transform: scale(.98); }
.chip, .chip-btn { transition: border-color .15s, background .15s, color .15s, transform .1s; }

/* Remedy result: the verdict is the headline moment, give it room. */
.verdict-row .verdict:first-child { font-size: 1.125rem; padding: 8px 18px 8px 10px; }
.verdict-row .verdict:first-child .v-icon { width: 26px; height: 26px; }
.care-for { font-size: var(--t-sm); }

/* =====================================================================
   Integration pass (Oct 28): one family, one product.
   Home leads with the 10-second pitch and shortcuts into both sides, then
   the family it's all for. Plate and Care share one first-screen skeleton
   (eyebrow, headline, sub-line, steps, the same input card, the same result
   anatomy); only the accent differs. Shared components below, no copies.
   ===================================================================== */

/* one icon style: 24px grid, 1.8 stroke, round ends, currentColor */
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* Plate's paprika, reachable inside Care (the Care-to-Plate card) */
.plate-scope { --accent: var(--paprika); --accent-strong: var(--paprika-strong); --accent-soft: var(--paprika-soft); }

/* ---------- header: Plate | Care as a segmented control with a sliding highlight ---------- */
.side-switch { position: relative; isolation: isolate; }
.side-switch::before {
  content: ""; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 12px) / 2);
  border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm);
  opacity: 0; transform: scale(.94); transition: transform .32s cubic-bezier(.3, .7, .2, 1), opacity .2s ease;
}
html[data-side="plate"] .side-switch::before { opacity: 1; transform: none; }
html[data-side="care"] .side-switch::before { opacity: 1; transform: translateX(calc(100% + 4px)); }
.side-switch a, .side-switch a[aria-current="page"] { background: transparent; box-shadow: none; }
/* colour follows <html data-side> (set before first paint), so the right side is lit from the first frame */
html[data-side="plate"] .side-switch a[data-side-link="plate"] { color: var(--paprika-strong); }
html[data-side="care"] .side-switch a[data-side-link="care"] { color: var(--green-ink); }

/* ---------- home: pitch, shortcuts, family, compact steps ---------- */
.home-hero { padding-top: var(--s5); }
.home-hero h1 { font-size: clamp(2.125rem, 8.6vw, 3.5rem); max-width: 16ch; }
.home-lede { margin-top: var(--s3); max-width: 50ch; color: var(--muted); }
/* phones: a short cropped banner of the art above the headline, then pitch, family, steps, example.
   tablets: a taller banner, family and example side by side.
   desktop: the art large on the right of the pitch; family and example below the shortcuts. */
.home-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "art" "copy" "fam" "steps" "ex"; gap: var(--s5); align-items: start; }
.home-copy { grid-area: copy; min-width: 0; }
#homeFamily { grid-area: fam; }
.home-grid > .steps3 { grid-area: steps; }
.home-grid > .home-ex { grid-area: ex; display: block; max-width: 460px; min-width: 0; }
@media (min-width: 760px) and (max-width: 999px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "art art" "copy copy" "fam ex" "steps steps"; }
  .home-grid > .home-ex { max-width: none; }
}
@media (min-width: 1000px) {
  .home-hero { padding-top: var(--s7); }
  .home-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "copy art" "fam ex" "steps steps";
    column-gap: var(--s7); row-gap: var(--s6); align-items: start;
  }
  .home-grid > .hero-art { align-self: center; }
  .home-grid > .home-ex { max-width: none; }
}

/* what you can do: two short columns, one per side, each a shortcut that lands ready to go */
.shortcuts { display: grid; gap: var(--s4); margin-top: var(--s5); }
@media (min-width: 380px) { .shortcuts { grid-template-columns: 1fr 1fr; gap: var(--s3); } }
@media (min-width: 760px) { .shortcuts { gap: var(--s4); } }
.sc-group { display: grid; gap: var(--s2); align-content: start; min-width: 0; }
.sc-h { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: var(--t-xs); font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-strong); }
.sc-h-sub { font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--muted); }
.sc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.sc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.sc {
  display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  font-weight: 650; font-size: var(--t-sm); line-height: 1.3; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.sc:hover { border-color: var(--accent); transform: translateY(-1px); }
.sc:active { transform: scale(.985); }
.sc-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-strong); }
.sc-ic .ic { width: 20px; height: 20px; }
.sc-t { min-width: 0; overflow-wrap: break-word; }
@media (min-width: 760px) { .sc { font-size: var(--t-base); padding: 12px 14px; gap: var(--s3); } .sc-ic { width: 38px; height: 38px; } }

/* your family: the people Plate and Care are for */
.fam-card { display: grid; gap: var(--s3); align-content: start; padding: var(--s5); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
@media (max-width: 400px) { .fam-card { padding: var(--s4); } }
.fam-title { font-size: 1.375rem; }
.fam-sub { color: var(--muted); font-size: var(--t-sm); margin-top: 2px; }
.fam-body { display: grid; gap: var(--s3); }
.fam-list { list-style: none; margin: 0; padding: 0; display: grid; }
.fam-person { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 6px var(--s3); align-items: center; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.fam-person:first-child { padding-top: 0; }
.fam-person .avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 1.125rem; }
.fam-text { display: grid; min-width: 0; line-height: 1.35; }
.fam-name { font-weight: 650; overflow-wrap: anywhere; }
.fam-age { color: var(--muted); font-weight: 500; }
.fam-status { color: var(--muted); font-size: var(--t-sm); overflow-wrap: anywhere; }
.fam-acts { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: var(--s2); }
.fam-go {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px 6px 10px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent-soft); color: var(--accent-strong); font: inherit; font-size: var(--t-sm); font-weight: 650; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.fam-go:hover { border-color: var(--accent); }
.fam-go:active { transform: scale(.98); }
.fam-go .ic { width: 18px; height: 18px; }
.fam-empty { padding: var(--s4); border-radius: var(--radius-sm); background: var(--surface-warm); border: 1.5px dashed var(--line-strong); color: var(--muted); }
.fam-empty b { color: var(--ink); }
.fam-add { justify-self: start; }
.fam-form { display: grid; gap: var(--s3); padding: var(--s4); border-radius: var(--radius-sm); background: var(--surface-warm); border: 1px solid var(--line); }
.fam-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.fam-fs legend { padding: 0; margin-bottom: var(--s2); }
.fam-form .msg { margin: 0; }
.fam-form-btns { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }

/* the 3 steps, compact: one quiet strip */
.home-grid > .steps3 { margin: 0; max-width: none; display: grid; gap: var(--s2); padding: var(--s4) 0 0; border-top: 1px solid var(--line); }
@media (min-width: 600px) { .home-grid > .steps3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); } }
.home-grid > .steps3 li { gap: 10px; }
.home-grid > .steps3 b { font-size: var(--t-base); margin-top: 2px; }
.home-grid > .steps3 .s3-sub { font-size: var(--t-sm); }
.home-grid > .steps3 .s3-n { width: 26px; height: 26px; font-size: .875rem; }
.home-sample { margin-top: var(--s6); }

/* ---------- both sides: the same first screen ---------- */
.side-hero { padding: var(--s5) 0 var(--s4); }
@media (min-width: 860px) { .side-hero { padding: var(--s7) 0 var(--s5); } }
.side-grid { display: grid; gap: var(--s6); align-items: start; }
.side-main { display: grid; gap: var(--s5); min-width: 0; max-width: 720px; }
.side-aside { display: none; min-width: 0; }
@media (min-width: 1100px) {
  .side-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s7); }
  .side-aside { display: block; position: sticky; top: var(--s5); padding-top: var(--s6); }
}
.side-head .eyebrow { color: var(--accent-strong); }
#flowView .side-head h1, #careView .side-head h1 { font-size: clamp(2.375rem, 9vw, 3.5rem); line-height: 1.04; letter-spacing: -.02em; font-weight: 600; font-variation-settings: "opsz" 144; }
.side-head h1 .accent { display: inline-block; color: var(--accent); font-style: italic; font-weight: 500; }
.side-head .lede { margin-top: var(--s3); max-width: 52ch; }
.side-head .steps-mini { flex-direction: row; gap: 6px var(--s4); margin-top: var(--s4); }

/* the input card: mic + text + "or tap one" + for whom, identical on both sides */
.input-card { position: relative; gap: var(--s4); }
.input-card textarea { min-height: 104px; }
.input-card .mic-wrap { padding: 0; }
.input-card .msg { margin-top: 0; }
.card-row { display: grid; gap: var(--s2); }
.card-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.card-fs legend { padding: 0; margin-bottom: var(--s2); }
/* Plate's card shows its own title and Cancel only while editing a dish or suggesting one */
.input-card:not(.is-alt) .composer-head {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.input-card.is-alt .card-examples { display: none; }
.input-card.is-alt { box-shadow: var(--shadow), 0 0 0 2px var(--accent-soft); }
.side-more { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s5); }
.side-more .text-link { margin-top: 0; }
button.text-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 650; cursor: pointer; }
.care-result-wrap { padding-top: 0; max-width: 1040px; }
.care-result-wrap > * { max-width: 880px; }

/* ---------- the same result anatomy: headline chip, what changes, where it comes from, save ---------- */
.rc-quick { margin-top: var(--s4); display: grid; gap: var(--s2); }
.quick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.quick-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s2); align-items: start; font-weight: 600; font-size: var(--t-sm); line-height: 1.45; }
.quick-list .tick { width: 22px; height: 22px; font-size: .75rem; margin-top: 0; }
/* one trust badge style for both sides (Plate's "food tables", Care's "Backed by sources") */
.trust-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s4); padding: 6px 14px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); font-weight: 700; font-size: var(--t-sm); }
.checked-badge > summary { padding: 6px 14px; }
/* the success moment: the headline chip settles in, the same on both sides */
@keyframes pop { from { opacity: 0; transform: scale(.88); } 60% { opacity: 1; transform: scale(1.04); } to { transform: none; } }
.dish.is-adapted .dish-top .tag, .remedy-card .verdict-row .verdict:first-child, .label-tally li:first-child { animation: pop .38s cubic-bezier(.2, .7, .2, 1) .08s both; }
/* one loading style: a warm line with a spinner, then the card's shape */
.msg.working, .care-wait-line, .dish[aria-busy="true"] .working { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--saffron-soft); }

/* ---------- the light cross-link: one small card after a result ---------- */
.xlink-slot:empty { display: none; }
.xlink-slot { margin-top: var(--s5); }
.xlink {
  display: flex; align-items: center; gap: var(--s3); max-width: 560px; padding: var(--s3) var(--s4); border-radius: var(--radius-sm);
  background: var(--surface-warm); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s;
}
.xlink:hover { border-color: var(--accent); transform: translateY(-1px); }
.xlink-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.xlink-t { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.xlink-t b { font-weight: 650; overflow-wrap: anywhere; }
.xlink-sub { color: var(--muted); font-size: var(--t-sm); }
.xlink-arrow { flex: none; color: var(--accent-strong); font-weight: 700; font-size: 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  .side-switch::before { transition: none; }
  .sc:hover, .xlink:hover { transform: none; }
}
@media (forced-colors: active) {
  .sc, .xlink, .fam-go, .fam-card { border: 1px solid CanvasText; }
  html[data-side="plate"] .side-switch a[data-side-link="plate"], html[data-side="care"] .side-switch a[data-side-link="care"] { border: 1px solid CanvasText; }
}
@media print { .xlink-slot, #plateXlink { display: none !important; } }
/* the example card beside each side's input card follows that side's accent */
.side-aside .hero-card::before { background: var(--accent-soft); }
.side-aside .ex-dot[aria-pressed="true"]::before { background: var(--accent); }

/* "About them" (sex, age, height, weight) is always visible, not hidden in a disclosure */
.target.is-open { padding: var(--s4); }
.target-h { margin: 0 0 var(--s2); }
.fam-row { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: flex-end; }
.fam-age-f input { width: 7rem; }
.fam-remove { background: none; border: 0; color: var(--muted); font: inherit; font-size: var(--t-sm); text-decoration: underline;
  text-underline-offset: 3px; min-height: 44px; padding: 0 var(--s2); cursor: pointer; align-self: start; }
.fam-remove:hover { color: var(--ink); }

/* =====================================================================
   Design lift (Oct 29): verdict-first results, a visual signature, a
   compact input card, a little delight, clearer dark mode, one chip
   system and a How-it-works diagram. Same behaviour, same IDs.
   ===================================================================== */

/* ---------- tokens: paper texture, chip borders, clearer dark mode ---------- */
:root {
  --chip-line: #d2c1a6;
  --paper-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .38 0 0 0 0 .27 0 0 0 0 .16 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --muted: #d6c7b5; --line: #43362c; --line-strong: #6f5c4b; --field-line: #93806b; --placeholder: #b9a898;
    --chip: #33291f; --chip-line: #5e4d3f; --strike: #a08a73; --bar-before: #8a735c;
    --paper-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .92 0 0 0 0 .8 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  --muted: #d6c7b5; --line: #43362c; --line-strong: #6f5c4b; --field-line: #93806b; --placeholder: #b9a898;
  --chip: #33291f; --chip-line: #5e4d3f; --strike: #a08a73; --bar-before: #8a735c;
  --paper-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .92 0 0 0 0 .8 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body { background-image: var(--grain), var(--paper-tex); background-repeat: no-repeat, no-repeat, repeat; }

/* ---------- hero illustration: a family table from above (inline SVG #ht-*, index.html) ----------
   Realistic-flat, one light from the top left. Brass, cloth and shadow are tokens so dark mode
   gets a warmer brass on a deeper table; food colours stay true. */
:root {
  --ht-b1: #f9e4a8; --ht-b2: #d4a24a; --ht-b3: #87571d;
  --ht-table: #ead9bd; --ht-cloth: #faf5ea; --ht-weave: rgba(120, 88, 48, .055); --ht-stripe: #b4532a;
  --ht-shadow: #3d2610; --ht-sh-o: .26; --ht-ds-o: .32; --ht-steam: #fffaf0; --ht-steam-o: .9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ht-b1: #f2c776; --ht-b2: #b67a2a; --ht-b3: #57340f;
    --ht-table: #1f1712; --ht-cloth: #2e241c; --ht-weave: rgba(255, 232, 196, .05); --ht-stripe: #c4673c;
    --ht-shadow: #000; --ht-sh-o: .55; --ht-ds-o: .5; --ht-steam: #fff1dc; --ht-steam-o: .4;
  }
}
:root[data-theme="dark"] {
  --ht-b1: #f2c776; --ht-b2: #b67a2a; --ht-b3: #57340f;
  --ht-table: #1f1712; --ht-cloth: #2e241c; --ht-weave: rgba(255, 232, 196, .05); --ht-stripe: #c4673c;
  --ht-shadow: #000; --ht-sh-o: .55; --ht-ds-o: .5; --ht-steam: #fff1dc; --ht-steam-o: .4;
}
.ht-b1 { stop-color: var(--ht-b1); }
.ht-b2 { stop-color: var(--ht-b2); }
.ht-b3 { stop-color: var(--ht-b3); }
.ht-fl { flood-color: var(--ht-shadow); flood-opacity: var(--ht-sh-o); }
.ht-ds { flood-color: var(--ht-shadow); flood-opacity: var(--ht-ds-o); }
.ht-cl { fill: var(--ht-cloth); }
.ht-wv { fill: none; stroke: var(--ht-weave); stroke-width: 1; }
.ht-st { fill: none; stroke: var(--ht-stripe); opacity: .55; }
.ht-steam path { stroke: var(--ht-steam); stroke-width: 9; opacity: 0; animation: ht-steam 5.4s ease-in-out infinite; }
.ht-steam .ht-s2 { animation-delay: -1.8s; }
.ht-steam .ht-s3 { animation-delay: -3.6s; }
@keyframes ht-steam {
  0% { opacity: 0; transform: translate(0, 10px); }
  35% { opacity: var(--ht-steam-o); }
  100% { opacity: 0; transform: translate(-6px, -26px); }
}
.hero-art {
  grid-area: art; margin: 0; position: relative; overflow: hidden; min-width: 0;
  border-radius: var(--radius); background: var(--ht-table);
  box-shadow: inset 0 0 0 1px rgba(60, 40, 20, .06);
}
.hero-art::after { /* a soft vignette, light from the top left */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 20% 10%, transparent 55%, rgba(40, 24, 8, .10));
}
.hero-photo { background: #141414; box-shadow: var(--shadow); }
.hero-photo::after { background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .12)); }
.hero-photo img { display: block; width: 100%; height: 200px; object-fit: cover; object-position: 20% 70%; } /* phones: turmeric and spices */
@media (min-width: 520px) { .hero-photo img { height: 240px; } }
@media (min-width: 760px) { .hero-photo img { height: 300px; object-position: 50% 55%; } }
@media (min-width: 1000px) { .hero-photo img { height: auto; aspect-ratio: 5 / 4; object-position: 30% 50%; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-photo img { filter: brightness(.92); } }
:root[data-theme="dark"] .hero-photo img { filter: brightness(.92); }
.fam-empty { display: flex; align-items: center; gap: var(--s3); }
.spot-art { flex: none; width: 72px; height: 54px; border-radius: 12px; object-fit: cover; background: #141414; }

/* ---------- one chip system for every choice and quick action ---------- */
.pick-opt span, .chip, .chip-btn, .chip-add, .ask-pill {
  min-height: 44px; border: 1px solid var(--chip-line); background: var(--surface); color: var(--ink); border-radius: 999px; font-weight: 600;
}
.pick-sm .pick-opt span { min-height: 44px; }
.pick-opt:hover input:not(:checked) + span, .chip:hover:not(:disabled), .chip-btn:hover, .chip-add:hover { border-color: var(--accent); background: var(--surface); color: var(--ink); }
.pick-opt input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.chip-add { border-style: dashed; border-color: var(--field-line); color: var(--accent-strong); }
.day-chip { border-width: 1px; border-color: var(--chip-line); }

/* ---------- compact input card: the box first, the mic inside it ---------- */
.input-card { gap: var(--s4); }
@media (min-width: 760px) { .input-card.composer { padding: var(--s6); } }
.ta-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s2) var(--s3); justify-items: stretch; text-align: left; padding: 0; }
.ta-box { display: contents; }
.ta-wrap textarea { grid-column: 1 / -1; display: block; }
.input-card .ta-wrap textarea { min-height: 96px; }
.ta-wrap .mic-hint { grid-column: 1; grid-row: 2; }
.mic.mic-inline {
  grid-column: 2; grid-row: 2; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 4px 16px 4px 4px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong);
  transition: background .15s, box-shadow .15s;
}
.mic.mic-inline:hover { box-shadow: 0 0 0 1px var(--accent); }
.mic-inline .mic-circle { width: 36px; height: 36px; box-shadow: none; }
.mic-inline .mic-circle svg { width: 20px; height: 20px; }
.mic-inline:hover .mic-circle { transform: none; }
.mic-inline .mic-label { font-size: var(--t-sm); white-space: nowrap; }
.is-listening .mic-inline { background: var(--accent); color: var(--on-accent); }
.is-listening .mic-inline .mic-circle::before, .is-listening .mic-inline .mic-circle::after { inset: -5px; border-width: 2px; border-color: var(--on-accent); }
.ta-wrap .mic-hint { font-size: var(--t-xs); max-width: none; }
.ta-wrap .mic-hint.is-novoice { font-size: var(--t-sm); }
.card-examples { display: grid; gap: 6px; }
@media (max-width: 759px) {
  .chip-scroll {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
    margin: 0 calc(var(--s5) * -1); padding: 4px var(--s5) 6px; scroll-padding: 0 var(--s5);
  }
  .chip-scroll::-webkit-scrollbar { display: none; }
  .chip-scroll > * { flex: none; scroll-snap-align: start; white-space: nowrap; }
  .care-wrap .chip-scroll { margin: 0; padding: 4px 0 6px; }
}
@media (max-width: 400px) { .input-card.composer { padding: var(--s4); } .input-card .chip-scroll { margin: 0 calc(var(--s4) * -1); padding-left: var(--s4); padding-right: var(--s4); } }
.who-row, .ex-row { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.who-row > .field-label, .ex-row > .field-label { flex: none; margin: 0; }
.who-row > .pick, .ex-row > .pick { flex: 1 1 auto; min-width: 0; }
@media (max-width: 759px) {
  .who-row > .chip-scroll, .ex-row > .chip-scroll { margin: 0 calc(var(--s5) * -1) 0 0; padding: 4px var(--s5) 6px 2px; }
}
@media (max-width: 400px) {
  .input-card .who-row > .chip-scroll, .input-card .ex-row > .chip-scroll { margin-right: calc(var(--s4) * -1); padding-right: var(--s4); }
}
@media (min-width: 760px) { .ex-row { align-items: flex-start; } .ex-row > .field-label, .who-row > .field-label { padding-top: 11px; align-self: flex-start; } }
.goal-legend { font-size: var(--t-sm); }
.goal-pick { gap: var(--s2); }
.focus-hint { font-size: var(--t-sm); margin-top: var(--s2); }
.more-opts > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s2); min-height: 44px; color: var(--ink); }
.mo-h { font-weight: 650; color: var(--accent-strong); }
.mo-sum { color: var(--muted); font-size: var(--t-sm); }
details > summary .chev { margin-left: 4px; }
details[open] > summary .chev { transform: rotate(-135deg) translate(-2px, -2px); }
.more-opts .fields { grid-template-columns: 1fr; }
@media (min-width: 760px) { .more-opts .fields { grid-template-columns: auto 1fr 1fr; align-items: end; } }
/* phones: the headline and the box, with the button in reach */
@media (max-width: 519px) {
  .side-head .lede { font-size: 1.0625rem; margin-top: var(--s2); }
  .side-head .steps-mini { display: none; } /* home carries the 3 steps; here the box comes first */
  .side-hero { padding-top: var(--s4); }
  .side-main { gap: var(--s4); }
  .input-card { gap: var(--s3); }
  #focusHint { display: none; }
  #flowView .side-head h1, #careView .side-head h1 { font-size: 2.25rem; }
}

/* ---------- verdict-first results: the same anatomy on both sides ---------- */
.rc-h, .more-h, .portion-h, .dish-meal, .wk-notes-h, .letter-label {
  font-family: var(--sans); font-size: var(--t-sm); font-weight: 700; letter-spacing: 0; text-transform: none;
}
.rc-h { color: var(--ink); }
.rc-h-lead { color: var(--accent-strong); }
.dish-meal { color: var(--muted); font-weight: 650; }
.takeaway { font-size: 1.125rem; line-height: 1.5; max-width: 60ch; color: var(--ink); }
.quick-list { gap: var(--s2); }
.quick-list li { font-size: var(--t-base); font-weight: 550; line-height: 1.45; }
.quick-list .tick { width: 24px; height: 24px; margin-top: 1px; }
.remedy-card { gap: var(--s3); }
.remedy-card .rc-quick { margin-top: var(--s1); }
.remedy-card .rc-block { gap: var(--s2); }
.remedy-card .ing-card { padding: var(--s3) var(--s4); gap: 4px; }
.remedy-card .ing-name { font-size: 1.125rem; }
.why-more { border-top: 1px solid var(--line); margin-top: var(--s1); }
.why-more > summary, .how-details > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s2); min-height: 48px;
  font-weight: 650; color: var(--accent-strong);
}
.why-more > summary::-webkit-details-marker, .how-details > summary::-webkit-details-marker { display: none; }
.why-more .when-open, .why-more[open] .when-closed { display: none; }
.why-more[open] .when-open { display: inline; }
.why-body { display: grid; gap: var(--s3); padding-bottom: var(--s2); }
.why-body .rc-h { margin: 0 0 4px; }
.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.why-list li { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--surface-warm); border: 1px solid var(--line); overflow-wrap: anywhere; }
.why-list .label-sub { margin-top: 2px; }
.dish .nums-now { font-size: 2.875rem; }
.dish .more > summary { justify-content: flex-start; }
.dish .more-body .rc-h { margin-bottom: 0; }

/* ---------- AI waiting: three steps that advance until the reply arrives ---------- */
.ai-wait { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--saffron-soft); }
.msg.ai-wait { display: block; }
.ai-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ai-steps li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; color: var(--muted); font-weight: 600; font-size: var(--t-sm); transition: color .2s; }
.ai-mark { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: .625rem; font-weight: 800; line-height: 1; }
.ai-steps li.is-now { color: var(--warn-ink); }
.ai-steps li.is-now .ai-mark { border-color: var(--spin-track); border-top-color: var(--warn-ink); animation: spin .9s linear infinite; }
.ai-steps li.is-done { color: var(--ink); }
.ai-steps li.is-done .ai-mark { background: var(--green); border-color: var(--green); color: var(--on-green); }
.ai-steps li.is-done .ai-mark::before { content: "✓"; }
.dish[aria-busy="true"] .ai-wait { margin-top: var(--s4); }
.care-wait .ai-wait { justify-self: stretch; }
@media (prefers-reduced-motion: reduce) { .ai-steps li.is-now .ai-mark { border-color: var(--warn-ink); border-width: 3px; } }

/* ---------- saved to the family book: a small moment ---------- */
.done-tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: var(--on-green); font-size: .75rem; font-weight: 800; }
.btn-done.just-saved { animation: saved-glow 1s ease-out both; }
.btn-done.just-saved .done-tick { animation: pop .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes saved-glow { from { box-shadow: 0 0 0 0 var(--green-bar); } to { box-shadow: 0 0 0 12px transparent; } }

/* ---------- How it works: one clear picture ---------- */
.how-lede { color: var(--muted); }
.how-flow { list-style: none; margin: 0; padding: 0; display: grid; }
.hf-node {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--surface-warm); border: 1px solid var(--line);
}
.hf-node + .hf-node { margin-top: 26px; }
.hf-node + .hf-node::before {
  content: ""; position: absolute; left: 35px; top: -24px; width: 2px; height: 16px; background: var(--line-strong); border-radius: 2px;
}
.hf-node + .hf-node::after {
  content: ""; position: absolute; left: 31px; top: -10px; border: 5px solid transparent; border-top: 6px solid var(--line-strong); border-bottom: 0;
}
.hf-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); font-family: var(--serif); font-weight: 600; font-size: 1.25rem; }
.hf-ic .ic { width: 22px; height: 22px; }
.hf-ai .hf-ic { background: var(--green-soft); color: var(--green-ink); }
.hf-code .hf-ic { background: var(--saffron-soft); color: var(--warn-ink); }
.hf-ai { border-color: var(--line); }
.hf-out { background: var(--green-soft); border-color: transparent; }
.hf-out .hf-ic { background: var(--surface); color: var(--green); }
.hf-t { display: grid; line-height: 1.35; min-width: 0; }
.hf-t b { font-weight: 700; }
.hf-t b i { font-style: normal; font-weight: 600; color: var(--muted); }
.hf-t > span { color: var(--muted); font-size: var(--t-sm); }
.hf-out .hf-t > span, .hf-out .hf-t b { color: var(--green-ink); }
.how-details { border-top: 1px solid var(--line); }
.how-details-body { display: grid; gap: var(--s4); padding-bottom: var(--s2); }

@media (prefers-reduced-motion: reduce) {
  .ht-steam path { animation: none; opacity: var(--ht-steam-o); transform: none; }
}
@media (forced-colors: active) {
  .hf-node, .ai-wait, .mic-inline { border: 1px solid CanvasText; }
}
@media print { .hero-art { break-inside: avoid; } }
@media (max-width: 359px) {
  .ta-wrap { grid-template-columns: minmax(0, 1fr); }
  .mic.mic-inline { grid-column: 1; grid-row: 2; justify-self: start; }
  .ta-wrap .mic-hint { grid-row: 3; }
}
.photo-credit, .photo-credit a { color: var(--muted); font-weight: 400; }
.photo-credit a { text-decoration: underline; text-underline-offset: 2px; }
.photo-credit { display: inline-block; }

/* family book / PDF: never split the note or a dish heading across pages */
.cb-note, .cb-note-text, .cb-dish h3 { break-inside: avoid; page-break-inside: avoid; }

/* ============ Nouri layout (co-founder mock): beige page, white cards, dark photo hero ============ */
:root { --bg: #f4eee5; --surface: #ffffff; --deep: #2f5a43; --on-deep: #ffffff; --clay: #c4643c; --on-clay: #ffffff;
  --card-line: #ece3d5; --tile-green: #e3eee6; --tile-sage: #e6efec; --tile-clay: #f8e6dc; --tile-sun: #fbefd3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --deep: #8dd3a6; --on-deep: #0f2418; --clay: #f0976b; --on-clay: #16110d;
  --card-line: #362b23; --tile-green: #1c3125; --tile-sage: #1b2d2a; --tile-clay: #3f2619; --tile-sun: #33281a; } }
:root[data-theme="dark"] { --deep: #8dd3a6; --on-deep: #0f2418; --clay: #f0976b; --on-clay: #16110d;
  --card-line: #362b23; --tile-green: #1c3125; --tile-sage: #1b2d2a; --tile-clay: #3f2619; --tile-sun: #33281a; }
body { background: var(--bg); }

/* header: round leaf mark, name, tagline; section pills */
.top { background: var(--bg); }
.brand { gap: 12px; }
.brand-ring { width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--clay); display: grid; place-items: center; flex: none; }
.brand-ring svg { width: 24px; height: 24px; fill: var(--deep); stroke: var(--surface); stroke-width: 1.4; stroke-linecap: round; }
.brand-words { display: grid; line-height: 1.05; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.75rem; letter-spacing: -.01em; }
.brand-tag { font-family: var(--sans); font-size: .625rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.side-switch { display: flex; gap: 8px; padding: 0; background: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.side-switch::-webkit-scrollbar { display: none; }
.side-switch a { align-items: center; gap: 8px; padding: 10px 16px; background: var(--chip); color: var(--ink); font-weight: 600; border-radius: 999px; }
.side-switch a .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-switch a[aria-current="page"], .side-switch a[data-side-link][aria-current="page"] { background: var(--deep); color: var(--on-deep); box-shadow: none; }
.scan-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--chip); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.scan-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.top-end { display: flex; gap: 8px; align-items: center; }
@media (max-width: 519px) {
  .side-switch { order: 3; width: 100%; margin: 4px 0 0; }
  .side-switch a { flex: 1 0 auto; padding: 10px 14px; }
  .brand-name { font-size: 1.5rem; }
  .brand-ring { width: 40px; height: 40px; }
}

/* home */
.home2 { display: grid; gap: var(--s5); padding-top: var(--s3); padding-bottom: var(--s7); }
.hero2 { position: relative; overflow: hidden; border-radius: 28px; background: #2b2118; color: #fff; min-height: 420px; display: flex; align-items: stretch; }
.hero2-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero2::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(38, 28, 20, .94) 0%, rgba(38, 28, 20, .82) 42%, rgba(38, 28, 20, .15) 75%, rgba(38, 28, 20, 0) 100%); }
.hero2-copy { position: relative; z-index: 1; padding: clamp(28px, 5vw, 56px); max-width: 600px; align-self: center; }
.hero2-eyebrow { font-size: .8125rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .86); margin: 0 0 var(--s4); }
.hero2 h1 { font-family: var(--serif); color: #fff; font-size: clamp(2.25rem, 5.2vw, 3.6rem); line-height: 1.04; letter-spacing: -.015em; margin: 0; font-weight: 500; }
.hero2 h1 em { font-style: italic; color: #f0a07a; }
.hero2-lede { margin: var(--s4) 0 0; font-size: 1.0625rem; line-height: 1.55; color: rgba(255, 255, 255, .88); max-width: 44ch; }
.hero2-ctas { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s5); }
.hero2-btn { background: #c4643c; color: #fff; border-radius: 999px; padding: 14px 28px; font-weight: 600; font-size: 1.0625rem; text-decoration: none; min-height: 48px; display: inline-flex; align-items: center; gap: 10px; }
.hero2-btn:hover { background: #ad5531; }
.hero2-link { background: none; border: 0; color: rgba(255, 255, 255, .9); text-decoration: underline; text-underline-offset: 3px; font: inherit; cursor: pointer; min-height: 44px; }
@media (max-width: 639px) {
  .hero2 { min-height: 0; border-radius: 22px; }
  .hero2::after { background: linear-gradient(180deg, rgba(38, 28, 20, .55) 0%, rgba(38, 28, 20, .9) 55%, rgba(38, 28, 20, .96) 100%); }
  .hero2-photo img { object-position: 85% 30%; }
  .hero2-copy { padding: 28px 22px; padding-top: 120px; }
}

.tiles4 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.tile { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 18px 10px; background: var(--surface); border: 1px solid var(--card-line); border-radius: 20px;
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: .9375rem; line-height: 1.3; height: 100%; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; }
.tile-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.t-green { background: var(--tile-green); color: var(--deep); } .t-sage { background: var(--tile-sage); color: var(--deep); }
.t-clay { background: var(--tile-clay); color: var(--clay); } .t-sun { background: var(--tile-sun); color: var(--warn-ink); }
@media (max-width: 519px) { .tiles4 { gap: 8px; } .tile { padding: 14px 4px; font-size: .8125rem; border-radius: 16px; } .tile-ic { width: 46px; height: 46px; } }

.card2 { background: var(--surface); border: 1px solid var(--card-line); border-radius: 24px; padding: clamp(18px, 3vw, 28px); }
.sec2-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.sec2-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 3vw, 1.875rem); letter-spacing: -.01em; margin: 0; }
.sec2-acts { display: flex; gap: var(--s3); }
.sec2-link { background: none; border: 0; color: var(--deep); font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; padding: 0 4px; }
.av-row { list-style: none; margin: var(--s4) 0 0; padding: 0 0 4px; display: flex; gap: var(--s4); overflow-x: auto; scrollbar-width: none; }
.av-row::-webkit-scrollbar { display: none; }
.av-item { display: grid; justify-items: center; gap: 4px; background: none; border: 0; padding: 4px; cursor: pointer; color: var(--ink); font: inherit; min-width: 88px; border-radius: 16px; }
.av-item:hover .av { transform: scale(1.04); }
.av { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 1.75rem; font-weight: 600; color: var(--on-fam); transition: transform .15s; background-size: cover; background-position: center; }
.av.fam-1 { background-color: var(--fam-1); } .av.fam-2 { background-color: var(--fam-2); } .av.fam-3 { background-color: var(--fam-3); } .av.fam-4 { background-color: var(--fam-4); }
.av-all { background: var(--deep); color: var(--on-deep); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--deep); }
.av-all .ic { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.av-add { background: var(--surface); color: var(--muted); border: 2px dashed var(--line-strong); font-family: var(--sans); font-weight: 400; }
.av-name { font-weight: 600; font-size: 1rem; margin-top: 4px; }
.av-sub { font-size: .875rem; color: var(--muted); max-width: 11ch; text-align: center; line-height: 1.25; }
.fam2 .fam-hint { margin: var(--s3) 0 0; color: var(--muted); }
.fam2 .fam-list { margin-top: var(--s4); }
.fam2 .fam-form { margin-top: var(--s4); }
.fam-form select { width: 100%; min-height: 44px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--field); color: var(--ink); font: inherit; padding: 0 10px; }

.today2 { display: grid; gap: var(--s4); }
.today-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.today-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--card-line); border-radius: 22px; overflow: hidden; text-decoration: none; color: var(--ink); height: 100%; transition: transform .15s, box-shadow .15s; }
.today-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.today-ph { aspect-ratio: 16 / 9; background-size: cover; background-position: center; }
.ph-cook { background-image: url(/static/hero/spices-640.jpg); }
.ph-scan { background: linear-gradient(135deg, #e9dfcf, #d9c7ab); }
.ph-shop { background: linear-gradient(135deg, #dfe9d9, #b9cfae); }
.ph-care { background: linear-gradient(135deg, #f3e1d3, #e2b99c); }
.today-t { display: grid; gap: 4px; padding: 16px 64px 18px 18px; }
.today-t b { font-weight: 600; font-size: 1.0625rem; }
.today-t span { color: var(--muted); font-size: .9375rem; line-height: 1.35; }
.today-arrow { position: absolute; right: 16px; bottom: 18px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--tile-clay); color: var(--clay); font-weight: 700; }
.today-grid li:nth-child(2) .today-arrow { background: var(--tile-green); color: var(--deep); }
.today-grid li:nth-child(3) .today-arrow { background: var(--tile-sun); color: var(--warn-ink); }
.today-grid li:nth-child(4) { display: none; }
@media (max-width: 759px) {
  .today-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .today-grid li { flex: 0 0 72%; scroll-snap-align: start; }
  .today-grid li:nth-child(4) { display: block; }
}
.home2 .trust-badges { margin: 0; }

/* bottom nav: phones only */
.bottom-nav { display: none; }
@media (max-width: 899px) {
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .bottom-nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--card-line); box-shadow: 0 -8px 24px -16px rgba(60, 40, 20, .3); }
  .bottom-nav a { display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .8125rem; font-weight: 500; min-height: 52px; padding-top: 6px; }
  .bottom-nav svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav a[aria-current="page"] { color: var(--deep); }
  .bottom-nav a[aria-current="page"] svg { fill: var(--deep); stroke: var(--deep); }
  .bn-plus { justify-self: center; width: 64px; height: 64px; margin-top: -30px; border-radius: 50%; border: 5px solid var(--bg); background: var(--deep); color: var(--on-deep); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 16px rgba(47, 90, 67, .35); }
  .bn-plus svg { width: 28px; height: 28px; stroke-width: 2.2; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media print { .bottom-nav { display: none !important; } }

/* scan dialog */
.scan-dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 24px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.scan-dlg::backdrop { background: rgba(20, 14, 10, .55); }
.scan-inner { padding: 22px; display: grid; gap: var(--s4); }
.scan-inner h2 { font-family: var(--serif); font-weight: 500; font-size: 1.75rem; margin: 0; }
.scan-lede { margin: 0; color: var(--muted); }
.scan-pick { display: grid; gap: 6px; justify-items: center; }
.scan-drop { width: 100%; display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--line-strong); border-radius: 18px; background: var(--surface-warm); cursor: pointer; text-align: center; }
.scan-drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.scan-drop svg { width: 40px; height: 40px; fill: none; stroke: var(--deep); stroke-width: 1.6; stroke-linecap: round; }
.scan-drop span { color: var(--muted); font-size: .9375rem; }
.scan-fs { border: 0; margin: 0; padding: 0; }
.scan-hint { margin: 0; color: var(--muted); }
.scan-status { display: flex; gap: 10px; align-items: center; min-height: 0; }
.scan-status:empty { display: none; }
.scan-status.err { color: var(--error-ink); }
.scan-card { border: 1px solid var(--card-line); border-radius: 18px; padding: 18px; display: grid; gap: 10px; }
.scan-kind { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.scan-product { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.375rem; }
.scan-summary { margin: 0; }
.scan-danger { background: var(--error-soft); color: var(--error-ink); border-radius: 12px; padding: 12px 14px; }
.scan-danger ul { margin: 6px 0 0; padding-left: 18px; }
.sv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-warm); }
.sv-name { font-weight: 650; }
.sv-pill { justify-self: start; font-size: .8125rem; font-weight: 650; padding: 2px 10px; border-radius: 999px; }
.sv-fine .sv-pill { background: var(--green-soft); color: var(--green-ink); }
.sv-sometimes .sv-pill { background: var(--warn-soft); color: var(--warn-ink); }
.sv-avoid .sv-pill { background: var(--error-soft); color: var(--error-ink); }
.sv-why { grid-column: 1 / -1; color: var(--muted); font-size: .9375rem; }
.scan-h { margin: 6px 0 0; font-size: .9375rem; }
.scan-watch { margin: 0; padding-left: 20px; }
.scan-instead { margin: 0; }
.scan-read summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.scan-read textarea, .scan-out textarea { width: 100%; border: 1px solid var(--field-line); border-radius: 12px; padding: 10px; font: inherit; background: var(--field); color: var(--ink); margin: 6px 0 10px; }
.scan-again { display: flex; justify-content: flex-end; }
.scan-foot { margin: 0; font-size: .8125rem; color: var(--muted); }
.home-view .home2 { display: grid; grid-template-columns: minmax(0, 1fr); }
.home2 > * { min-width: 0; grid-area: auto !important; }
.top-inner { flex-wrap: wrap; }
.brand { order: 0; min-width: 0; }
.top-end { order: 1; margin-left: auto; }
.side-switch { order: 2; }
@media (min-width: 900px) { .side-switch { order: 1; margin-left: auto; } .top-end { order: 2; margin-left: 0; } }
@media (max-width: 519px) { .brand-tag { letter-spacing: .12em; font-size: .5625rem; } .top-end .theme-btn, .scan-btn { width: 40px; height: 40px; } }
.join-card { margin-top: var(--s4); padding: 14px 16px; border-radius: 16px; background: var(--tile-green); color: var(--ink); display: grid; gap: 10px; }
.join-card p { margin: 0; }
.join-btns { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }
.setup-prog { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.setup-prog span { height: 6px; border-radius: 999px; background: var(--track); }
.setup-prog span.on { background: var(--deep); }
.setup-step { margin: -6px 0 0; color: var(--muted); font-size: .875rem; text-align: right; }
.setup-q { margin: 0; font-size: 1.375rem; font-weight: 650; }
.setup-sub { margin: 4px 0 14px; color: var(--muted); }
.setup-kind { margin-bottom: 12px; }
.setup-radios { display: grid; gap: 4px; }
.setup-radio { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 1.0625rem; cursor: pointer; }
.setup-radio input { width: 22px; height: 22px; accent-color: var(--deep); }
.setup-people { display: grid; gap: 10px; }
.setup-person { display: grid; grid-template-columns: 1fr 88px; gap: 10px; }
.setup-person input { width: 100%; }
.setup-goals { border: 0; padding: 0; margin: 0 0 12px; }
.setup-goals legend { font-weight: 650; margin-bottom: 6px; }
.setup-btns { display: flex; justify-content: space-between; align-items: center; }
.setup-btns .btn-primary { background: var(--ink); color: var(--bg); border-radius: 999px; padding: 12px 26px; }
.ins-dlg { width: min(720px, calc(100vw - 24px)); }
.ins-body { display: grid; gap: var(--s4); }
.ins-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.ins-chip { padding: 6px 12px; border-radius: 999px; background: var(--tile-green); color: var(--deep); font-size: .9375rem; }
.ins-week { border-radius: 18px; background: var(--surface-warm); padding: 14px 16px; }
.ins-h { margin: 0 0 8px; font-weight: 650; }
.ins-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ins-stats li { display: grid; }
.ins-stats b { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.ins-stats span { color: var(--muted); font-size: .8125rem; }
.ins-person { border: 1px solid var(--card-line); border-radius: 20px; padding: 16px; display: grid; gap: 12px; }
.ins-head { display: flex; gap: 12px; align-items: center; }
.ins-head .av { width: 52px; height: 52px; font-size: 1.375rem; flex: none; }
.ins-head > span:last-child { display: grid; }
.ins-name { font-size: 1.125rem; }
.ins-sub { color: var(--muted); font-size: .875rem; }
.ins-aims { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ins-aim { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface-warm); border-left: 4px solid var(--deep); }
.ins-kcal, .ins-sugar, .ins-satfat { border-left-color: var(--clay); } .ins-sodium, .ins-carbs_meal { border-left-color: var(--saffron); }
.ins-label { color: var(--muted); font-size: .8125rem; }
.ins-val { font-size: 1rem; line-height: 1.25; }
.ins-why { color: var(--muted); font-size: .8125rem; line-height: 1.35; margin-top: 4px; }
.ins-why i { font-style: normal; opacity: .8; white-space: nowrap; }
.ins-focus { margin: 0; padding-left: 20px; }
.ins-notes summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.ins-notes ul { margin: 0; padding-left: 20px; color: var(--muted); }
.ins-btns { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (max-width: 519px) { .ins-stats { grid-template-columns: repeat(2, 1fr); } .ins-aims { grid-template-columns: 1fr 1fr; } }
.scan-inner { grid-template-columns: minmax(0, 1fr); }
.scan-dlg { overflow-x: hidden; }
.ins-chip { max-width: 100%; }
@media (max-width: 519px) {
  .ins-why { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .ins-aim { padding: 10px; }
}
.fam-edit-acts { display: inline-flex; gap: 4px; }
.fam-form-h { margin: 0 0 6px; font-weight: 650; font-size: 1.0625rem; }
.ins-aim { min-width: 0; overflow-wrap: anywhere; }
.side-switch a[data-side-link="plate"][aria-current="page"], .side-switch a[data-side-link="care"][aria-current="page"] { background: var(--deep); color: var(--on-deep); }

/* ---- design review fixes ---- */
.side-switch::before { content: none; }
html[data-side] .side-switch a[data-side-link][aria-current="page"] { background: var(--deep); color: var(--on-deep); }
@media (max-width: 899px) {
  .dish-actions.is-sticky, .ready-bar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  body:has(#readyBar:not([hidden])) .toast, body:has(.dish-actions.is-sticky:not([hidden])) .toast { bottom: calc(160px + env(safe-area-inset-bottom)); }
}
@media (max-width: 519px) {
  .side-switch a { flex: 1 1 0; justify-content: center; padding: 10px 8px; gap: 6px; font-size: .875rem; }
  .side-switch a .ic { width: 18px; height: 18px; }
  .ins-why { -webkit-line-clamp: unset; display: block; }
}
@media (max-width: 374px) { .side-switch a .ic { display: none; } }
@media (max-width: 359px) { .brand-tag { display: none; } .top-end { margin-left: auto; } }
@media (max-width: 639px) { .hero2-copy { padding-top: 72px; } .hero2-lede { font-size: 1rem; } }
.today-ph { display: grid; place-items: center; }
:root[data-theme="dark"] .ph-scan { background: linear-gradient(135deg, #2c241c, #3a2e22); }
:root[data-theme="dark"] .ph-shop { background: linear-gradient(135deg, #1f2d22, #2a3b2c); }
:root[data-theme="dark"] .ph-care { background: linear-gradient(135deg, #33241b, #45301f); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ph-scan { background: linear-gradient(135deg, #2c241c, #3a2e22); }
  :root:not([data-theme="light"]) .ph-shop { background: linear-gradient(135deg, #1f2d22, #2a3b2c); }
  :root:not([data-theme="light"]) .ph-care { background: linear-gradient(135deg, #33241b, #45301f); }
}
.hero2 :focus-visible { outline-color: #fff; outline-offset: 3px; }
.setup-btns .btn-primary, .ins-btns .btn-primary, .scan-dlg .btn-primary { background: var(--deep); color: var(--on-deep); }
.scan-dlg .btn-link { color: var(--deep); }
.scan-dlg .pick-opt input:checked + span { background: var(--tile-green); color: var(--deep); border-color: var(--deep); }
.av-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-row { mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); scroll-snap-type: x proximity; }
.av-item { scroll-snap-align: start; }
@media (min-width: 900px) { .av-row { mask-image: none; -webkit-mask-image: none; } }
.toast { box-shadow: 0 0 0 1px rgba(255, 255, 255, .15), var(--shadow-lg); }
/* scan: ingredients and add to list */
.scan-ings { border-top: 1px solid var(--card-line); padding-top: 6px; }
.scan-ings summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ing-counts { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ing-tag { font-size: .75rem; font-weight: 650; padding: 1px 8px; border-radius: 999px; }
.ing-tag.ing-good { background: var(--green-soft); color: var(--green-ink); }
.ing-tag.ing-caution { background: var(--warn-soft); color: var(--warn-ink); }
.ing-tag.ing-avoid { background: var(--error-soft); color: var(--error-ink); }
.ing-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.ing-row { display: grid; grid-template-columns: 12px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--card-line); }
.ing-row:last-child { border-bottom: 0; }
.ing-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--line-strong); }
.ing-dot.ing-good { background: var(--green-bar); } .ing-dot.ing-caution { background: var(--saffron); } .ing-dot.ing-avoid { background: var(--error-ink); }
.ing-t { display: grid; gap: 2px; } .ing-t b { font-weight: 600; text-transform: capitalize; }
.ing-note { color: var(--muted); font-size: .875rem; }
.scan-add { border-top: 1px solid var(--card-line); padding-top: 12px; display: grid; gap: 8px; justify-items: start; }
.scan-add .scan-h { margin: 0; }
/* household shopping */
.shop-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--chip); }
.shop-tabs button { border: 0; background: none; border-radius: 999px; min-height: 44px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.shop-tabs button[aria-selected="true"] { background: var(--deep); color: var(--on-deep); }
.shop-tabs button[aria-selected="true"] .count { background: rgba(255, 255, 255, .2); color: inherit; }
.shop-body { display: grid; gap: 14px; }
.shop-gh { margin: 0 0 4px; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.shop-ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--card-line); border-radius: 16px; overflow: hidden; }
.shop-row { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--card-line); }
.shop-row:last-child { border-bottom: 0; }
.shop-check { flex: 1; display: flex; gap: 12px; align-items: center; min-height: 56px; cursor: pointer; }
.shop-check input { width: 22px; height: 22px; accent-color: var(--deep); flex: none; }
.shop-t { display: grid; } .shop-t b { font-weight: 600; text-transform: capitalize; }
.shop-sub { color: var(--muted); font-size: .875rem; }
.shop-x { width: 40px; height: 40px; border: 0; background: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; border-radius: 50%; }
.shop-x:hover { background: var(--chip); }
.shop-note { margin: 0; color: var(--muted); }
.shop-empty-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.sv-check .sv-pill { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-ink); }
.scan-partial { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn-ink); }
.av-photo { background-color: var(--chip); background-size: cover; background-position: center; }
.av-example .av-name::after { content: ""; }
.av-example { position: relative; }
.fam-photo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.fam-photo-prev { width: 56px; height: 56px; font-size: 1.5rem; color: var(--muted); background-color: var(--chip); }
.fam-photo-btn { cursor: pointer; }
.fam-photo-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.avatar.av-photo { background-size: cover; background-position: center; }
/* placeholder art until photos: a large line icon on a soft gradient */
.today-ph svg { width: 72px; height: 72px; fill: none; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.ph-scan svg { stroke: var(--deep); } .ph-shop svg { stroke: var(--deep); } .ph-care svg { stroke: var(--clay); }
.ph-scan { background: radial-gradient(circle at 70% 30%, var(--tile-sage), transparent 60%), linear-gradient(135deg, var(--surface-warm), var(--tile-green)); }
.ph-shop { background: radial-gradient(circle at 30% 70%, var(--tile-sun), transparent 60%), linear-gradient(135deg, var(--tile-green), var(--surface-warm)); }
.ph-care { background: radial-gradient(circle at 70% 30%, var(--tile-clay), transparent 60%), linear-gradient(135deg, var(--surface-warm), var(--tile-clay)); }
:root[data-theme="dark"] .ph-scan, :root[data-theme="dark"] .ph-shop, :root[data-theme="dark"] .ph-care { background: linear-gradient(135deg, var(--surface-warm), var(--tile-green)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ph-scan, :root:not([data-theme="light"]) .ph-shop, :root:not([data-theme="light"]) .ph-care { background: linear-gradient(135deg, var(--surface-warm), var(--tile-green)); } }
.ph-photo.ph-scan { background: center / cover no-repeat url(/static/hero/card-scan.jpg); }
.ph-photo.ph-shop { background: center / cover no-repeat url(/static/hero/card-shop.jpg); }
@supports (background-image: url(x.webp)) {
  .ph-photo.ph-scan { background-image: image-set(url(/static/hero/card-scan.webp) type("image/webp"), url(/static/hero/card-scan.jpg) type("image/jpeg")); }
  .ph-photo.ph-shop { background-image: image-set(url(/static/hero/card-shop.webp) type("image/webp"), url(/static/hero/card-shop.jpg) type("image/jpeg")); }
}
:root[data-theme="dark"] .ph-photo.ph-scan, :root[data-theme="dark"] .ph-photo.ph-shop { filter: brightness(.9); }
/* the card photos win over the dark-mode placeholder gradients */
:root .today-ph.ph-photo.ph-scan, :root[data-theme="dark"] .today-ph.ph-photo.ph-scan { background: center / cover no-repeat url(/static/hero/card-scan.jpg); }
:root .today-ph.ph-photo.ph-shop, :root[data-theme="dark"] .today-ph.ph-photo.ph-shop { background: center / cover no-repeat url(/static/hero/card-shop.jpg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .today-ph.ph-photo.ph-scan { background: center / cover no-repeat url(/static/hero/card-scan.jpg); }
  :root:not([data-theme="light"]) .today-ph.ph-photo.ph-shop { background: center / cover no-repeat url(/static/hero/card-shop.jpg); }
}
/* setup step 3: conditions and goals as two labelled groups per person */
.setup-goals { padding: 12px 0 14px; border-bottom: 1px solid var(--card-line); margin: 0; }
.setup-goals:last-child { border-bottom: 0; }
.setup-person-name { margin: 0 0 6px; font-weight: 700; font-size: 1.0625rem; }
.setup-sub-fs { border: 0; margin: 0 0 8px; padding: 0; }
.setup-sub-fs legend { font-size: .8125rem; color: var(--muted); margin-bottom: 4px; }
/* phone header: the bottom bar scans, so the header keeps room for the name and tagline; four pills on one line */
@media (max-width: 899px) { .top-end .scan-btn { display: none; } }
@media (max-width: 430px) {
  .side-switch a { flex: 1 1 0; padding: 9px 4px; font-size: .8125rem; gap: 0; }
  .side-switch a .ic { display: none; }
  .brand-tag { letter-spacing: .1em; }
}
.scan-news { border-top: 1px solid var(--card-line); padding-top: 10px; }
.scan-news ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.scan-news a { color: var(--deep); }
.scan-news-src { margin: 6px 0 0; font-size: .8125rem; color: var(--muted); }
.meal-skip { border: 1px solid var(--line-strong); background: none; color: var(--muted); border-radius: 999px; font: inherit; font-size: .75rem; font-weight: 600; padding: 2px 10px; min-height: 28px; cursor: pointer; margin-right: 6px; }
.meal-skip[aria-pressed="true"] { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-ink); }
.meal.is-skipped .meal-name, .meal.is-skipped .meal-meta { opacity: .45; text-decoration: line-through; }
.share-opts { display: grid; gap: 8px; }
.share-opt { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--card-line); border-radius: 16px; cursor: pointer; }
.share-opt:has(input:checked) { border-color: var(--deep); background: var(--tile-green); }
.share-opt input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--deep); }
.share-opt > span { display: grid; gap: 2px; } .share-opt > span > span { color: var(--muted); font-size: .9375rem; }
.share-opt:has(input:disabled) { opacity: .5; }
/* scan: camera or photo library */
.scan-drop { cursor: default; }
.scan-drop-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.scan-file-btn { cursor: pointer; }
.scan-file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
/* the top bar stays put while scrolling */
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); }
.scan-drop:focus-within { outline: none; }
/* recipe card, co-founder layout: title, question labels, preferences, one action */
#composer:not(.is-alt) .composer-head { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
#composer .composer-head .sec-title { font-size: 1.5rem; }
.composer-sub { margin: 4px 0 14px; color: var(--muted); }
#composer.is-alt .composer-sub, #composer.is-alt > .comp-q { display: none; }
.comp-q { margin: 12px 0 6px; font-weight: 700; font-size: 1.0625rem; color: var(--ink); padding: 0; }
.comp-sub { margin: -2px 0 8px; color: var(--muted); font-size: .875rem; }
#composer .who-row { display: block; }
#composer .who-row .chip-row { margin-top: 0; }
#composer .more-opts { margin: 14px 0 12px; border-radius: 14px; background: var(--surface-warm); padding: 4px 14px; }
.mic-hint .mic-lang { font-size: inherit; min-height: 32px; padding: 0; }
html { scroll-padding-top: 140px; }
/* "Lighter for" is chosen once, on the recipe card */
#dishesSub .goal-inline { display: none; }
/* home: the family book */
.book-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.book-list li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-warm); }
.book-ic { font-size: 1.125rem; }
/* shopping: how much is already at home */
.shop-have { display: inline-flex; align-items: center; gap: 4px; font-size: .8125rem; color: var(--muted); flex: none; }
.shop-have input { width: 64px; min-height: 36px; border: 1px solid var(--field-line); border-radius: 10px; padding: 0 6px; font: inherit; background: var(--field); color: var(--ink); }

/* Poison or chemical typed into a food field: firm, with emergency numbers one tap away. */
.guard-danger { padding: var(--s4) var(--s5); border: 1px solid var(--line); border-left: 4px solid var(--error-ink); background: var(--error-soft); color: var(--ink); }
.guard-danger .guard-msg { font-weight: 400; line-height: 1.5; }
.guard-danger .guard-msg b { color: var(--error-ink); }
