/* The Pantry Method — design system v3 (8 Oct 2026)
   "A fun Revolut. Fintech for calories." Clean and professional, so you
   trust the numbers; the kid and a few touches make it unthreatening.
   The contract is server/DESIGN.md; the signed-off look is
   DESIGN_PASS/specimen.html. v1/v2 (wobble, tilt, Shantell, dashed rules,
   a sticker on everything) are retired — this file replaced 1,429 lines of
   overrides-on-overrides. Add a rule here only if DESIGN.md has a home for it. */

/* ─────────────────────────────────────────────────────────────── fonts */
/* Self-hosted: the CSP allows no external hosts, which is correct. */
@font-face {
  font-family: "Nunito"; font-weight: 200 1000; font-style: normal; font-display: swap;
  src: url("fonts/nunito-var.woff2") format("woff2");
}
@font-face {
  font-family: "Luckiest Guy"; font-weight: 400; font-display: swap;
  src: url("fonts/luckiest-guy-400.woff2") format("woff2");
}

/* ─────────────────────────────────────────────────────────────── tokens */
/* LIGHT LEADS. The cream room, the ink pen, the fridge light. */
:root {
  --body: "Nunito", ui-rounded, system-ui, -apple-system, sans-serif;
  --hero: "Luckiest Guy", var(--body);

  --bg: #f8efd6;        /* the room */
  --bg-2: #f1e6c6;      /* tracks, segmented controls, inputs on paper */
  --card: #fffdf6;      /* paper */
  --ink: #221d1a;       /* the pen */
  --ink-2: #575046;
  --ink-3: #72695b;     /* whisper: still 4.5:1 on paper */
  --line: rgba(34, 29, 26, .09);
  --line-2: rgba(34, 29, 26, .16);

  --butter: #f4c94f;    /* the fridge light: the one accent */
  --butter-soft: #fbedc2;
  --link: #8a6a14;
  --on-butter: #221d1a;

  --ok: #2f8a5b;   --ok-soft: #e1f1e6;
  --near: #d9a400; --near-soft: #fbefc4; --near-ink: #8a6a14;
  --over: #b8766f; --over-soft: #f6e3e0; --over-ink: #9a5b54;  /* dusty rose, never red */

  /* the sticker: the balance card and the main button, nothing else */
  --sticker-border: 2px solid #221d1a;
  --sticker: 4px 4px 0 #221d1a;
  --sticker-btn: 3px 3px 0 #221d1a;
  --sticker-press: 1px 1px 0 #221d1a;
  /* the slight: every other card (Thom: "the slight shadow is super cool") */
  --slight: 2px 3px 0 rgba(34, 29, 26, .07), 0 12px 24px -16px rgba(34, 29, 26, .22);
  --dim: rgba(34, 29, 26, .42);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5l4.5 4.5 4.5-4.5' fill='none' stroke='%23221d1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --raise: #fffdf6;     /* the selected segment: paper by day, lifted grey by night */
  --radius: 22px;
  --radius-sm: 14px;
  color-scheme: light;
}

/* NIGHT: one light source in the kitchen. The ink sticker vanishes on
   black, so in the dark the sticker is the BUTTER EDGE (Thom, 8 Oct). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --bg-2: #232326; --card: #1c1c1f;
    --ink: #f5efe3; --ink-2: #c9c2b4; --ink-3: #9a9386;
    --line: rgba(245, 239, 227, .08); --line-2: rgba(245, 239, 227, .16);
    --butter-soft: rgba(244, 201, 79, .15); --link: #f4c94f; --on-butter: #121212;
    --ok: #5fcf8a; --ok-soft: rgba(95, 207, 138, .14);
    --near: #f2c94c; --near-soft: rgba(242, 201, 76, .15); --near-ink: #f2c94c;
    --over: #cf8f88; --over-soft: rgba(207, 143, 136, .16); --over-ink: #e3a59e;
    --sticker-border: 2px solid #f4c94f;
    --sticker: 4px 4px 0 #8a6a14;
    --sticker-btn: 3px 3px 0 #8a6a14;
    --sticker-press: 1px 1px 0 #8a6a14;
    --slight: 0 0 0 1px rgba(245, 239, 227, .06);
    --raise: #36363c;
    --dim: rgba(0, 0, 0, .62);
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5l4.5 4.5 4.5-4.5' fill='none' stroke='%23f5efe3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
/* the Settings toggle forces night whatever the phone says */
:root[data-theme="dark"] {
  --bg: #121212; --bg-2: #232326; --card: #1c1c1f;
  --ink: #f5efe3; --ink-2: #c9c2b4; --ink-3: #9a9386;
  --line: rgba(245, 239, 227, .08); --line-2: rgba(245, 239, 227, .16);
  --butter-soft: rgba(244, 201, 79, .15); --link: #f4c94f; --on-butter: #121212;
  --ok: #5fcf8a; --ok-soft: rgba(95, 207, 138, .14);
  --near: #f2c94c; --near-soft: rgba(242, 201, 76, .15); --near-ink: #f2c94c;
  --over: #cf8f88; --over-soft: rgba(207, 143, 136, .16); --over-ink: #e3a59e;
  --sticker-border: 2px solid #f4c94f;
  --sticker: 4px 4px 0 #8a6a14;
  --sticker-btn: 3px 3px 0 #8a6a14;
  --sticker-press: 1px 1px 0 #8a6a14;
  --slight: 0 0 0 1px rgba(245, 239, 227, .06);
  --raise: #36363c;
  --dim: rgba(0, 0, 0, .62);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5l4.5 4.5 4.5-4.5' fill='none' stroke='%23f5efe3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* the logos: ink by day, glow by night */
.only-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-light { display: none !important; }
  :root:not([data-theme="light"]) .only-dark { display: inline-block !important; }
}
:root[data-theme="dark"] .only-light { display: none !important; }
:root[data-theme="dark"] .only-dark { display: inline-block !important; }

/* ─────────────────────────────────────────────────────────────── base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
::selection { background: var(--butter); color: #221d1a; }
html { -webkit-tap-highlight-color: rgba(244, 201, 79, .3); -webkit-text-size-adjust: 100%; }
/* the window never scrolls: the shell scrolls inside main.scroll */
html, body { height: 100%; }
html { overflow: hidden; }

/* app shell: three flex rows, no fixed positioning (breaks in scaled webviews) */
body {
  margin: 0; position: relative;
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
}
a { color: var(--link); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
b, strong { font-weight: 800; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0 0 12px; }
img { max-width: 100%; }

main.scroll { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; display: flex; flex-direction: column; }
.wrap { flex: 1 0 auto; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 6px 20px 28px; display: flex; flex-direction: column; }
.wrap > * { flex: 0 0 auto; }

/* ─────────────────────────────────────────────────────────────── type */
/* Two voices. Luckiest Guy: the balance, page titles, section heads.
   Nunito: everything else. Nothing under 11px. */
.title, .settings-cap, .door h1, .hero h1 {
  font-family: var(--hero); font-weight: 400; letter-spacing: .01em;
  font-size: 30px; line-height: 1.05; color: var(--ink);
}
.settings-cap { margin: 8px 0 16px; }
/* Luckiest's lower case is small caps: mixed case reads "WelCome". Always caps. */
.title, .settings-cap, .door h1, .hero h1, .card h2, .rule, .acthead > span, .shead h3, .sw-title { text-transform: uppercase; }
.settings-cap .cog { display: none; }
.card h2, .rule, .acthead > span, .shead h3 {
  font-family: var(--hero); font-weight: 400; font-size: 19px; line-height: 1.15;
  letter-spacing: .01em; color: var(--ink);
}
.cap, .lab, .iw-label, th, .srow.head, .actday, .tl-when, .step .step-n,
.unitrow .u small, .stat div span, .iw-label {
  font-family: var(--body); font-weight: 800; font-size: 11px; line-height: 1.3;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
.sub { color: var(--ink-3); font-size: 14px; line-height: 1.5; margin: 0; }
.muted { color: var(--ink-3); font-size: 14px; line-height: 1.55; }
.num, .val, .amt, .bal, .pkcal, td { font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────────────────────── icons */
.ic { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.ic-sm { width: 16px; height: 16px; }
.ibtn, .avatar, .menu > summary {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
  display: grid; place-items: center; padding: 0;
  background: var(--card); color: var(--ink); box-shadow: var(--slight);
  border: 0; cursor: pointer; text-decoration: none;
}
.avatar:hover, .ibtn:hover { text-decoration: none; }
.avatar .cog { display: none; }

/* ─────────────────────────────────────────────────────────────── top bar */
header.bar {
  flex: 0 0 auto; position: relative; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 8px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--bg);
}
.wordmark { flex: 1 1 auto; text-align: center; min-width: 0; }
.wordmark img { height: 24px; width: auto; max-width: 100%; object-fit: contain;
  display: inline-block; vertical-align: middle; }
.wordmark a:hover { text-decoration: none; }
/* equal slots either side, or the centre is not the centre */
.ghost-slot { flex: 0 0 64px; font-size: 14px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.ghost-slot.right { text-align: right; }
.ghost-slot:hover { color: var(--ink); text-decoration: none; }

/* the menu */
.menu { position: relative; flex: 0 0 40px; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary i { display: none; }
.menu[open] > summary { background: var(--butter); color: var(--on-butter); }
.menu .sheet {
  position: absolute; right: 0; top: 50px; min-width: 220px; z-index: 30;
  background: var(--card); border-radius: 18px; padding: 8px;
  box-shadow: var(--slight), 0 18px 40px -18px rgba(0, 0, 0, .35);
}
.menu .sheet a, .menu .sheet form button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: 12px; border: 0; background: none; box-shadow: none;
  color: var(--ink); font: 700 15px/1.2 var(--body); cursor: pointer; height: auto;
}
.menu .sheet a:hover, .menu .sheet form button:hover { background: var(--bg-2); text-decoration: none; transform: none; }
.menu .sheet hr { border: 0; border-top: 1px solid var(--line); margin: 6px 6px; }
.menu .sheet .cog { display: none; }

/* ─────────────────────────────────────────────────────────────── dock */
nav.dock {
  flex: 0 0 auto; position: relative; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); box-shadow: 0 -1px 0 var(--line-2);   /* a hard edge (Thom, 23 Oct: "blends into buttons") */
  padding: 6px 24px max(10px, env(safe-area-inset-bottom));
}
nav.dock.two { grid-template-columns: 1fr 1fr; }
nav.dock a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 4px; position: relative;
  font-size: 12px; font-weight: 700; color: var(--ink-3);
}
nav.dock a .ic { width: 24px; height: 24px; }
/* THE BOY is the Dashboard (Thom, 18 Oct: "the boy the home dash icon across
   everything"): his drawing as a mask, so it takes the dock's colour */
.ic.boy { display: inline-block; width: 26px; height: 26px; background: currentColor;
  -webkit-mask: url("/static/boy-mask.png") center / contain no-repeat; mask: url("/static/boy-mask.png") center / contain no-repeat; }
/* THE PANTRY is Thom's open fridge (18 Oct, art/fridge/fridge-line.png): his
   drawing as a mask, so it takes the dock's colour */
.ic.pantry { display: inline-block; width: 26px; height: 26px; background: currentColor;
  -webkit-mask: url("/static/pantry-mask.png") center / contain no-repeat; mask: url("/static/pantry-mask.png") center / contain no-repeat; }
nav.dock a:hover { text-decoration: none; color: var(--ink-2); }
nav.dock a.on { color: var(--ink); }
nav.dock a.on::before {
  content: ""; position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 4px; border-radius: 4px; background: var(--butter);
}

/* ─────────────────────────────────────────────────────────────── cards */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--slight);
  padding: 18px; margin: 0 0 16px;
}
.card.tight { padding: 12px 16px; }
.card h2 { margin: 0 0 6px; }
.card h2 + .sub { margin: 0 0 14px; }
.card > :last-child { margin-bottom: 0; }

/* the headline card: one big number, centred. Calm, not a sticker. */
.headline { text-align: center; padding: 24px 20px 22px; }
.headline .cap { display: block; margin: 0 0 10px; }
.headline .big {
  font-family: var(--hero); font-size: 56px; line-height: 1; letter-spacing: .01em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.headline .big.mid { font-size: 44px; }
.headline .under { color: var(--ink-2); font-size: 14px; margin: 10px 0 0; }
.headline .meter { margin: 14px auto 0; max-width: 240px; }

/* ─────────────────────────────────────────────────────────────── THE BALANCE */
/* The money card: sticker #1 of 2. Label, the number, the stamp, the bar. */
.money {
  background: var(--card); border: var(--sticker-border); box-shadow: var(--sticker);
  border-radius: 26px; padding: 22px 20px 20px; margin: 0 0 22px; text-align: center;
}
.money .mlabel { margin: 0; }
.money .mnum { margin: 12px 0 0; }
.money .mbig {
  font-family: var(--hero); font-size: 66px; line-height: .95; letter-spacing: .01em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
/* THE STAMP: the label follows the SIGN of the balance. Straight, never tilted. */
.money .mcap, .stamp {
  display: inline-block; margin: 10px 0 0; padding: 6px 12px 5px; border-radius: 9px;
  border: 2px solid currentColor; font: 800 12px/1 var(--body); letter-spacing: .14em;
  text-transform: uppercase; color: var(--ok); background: var(--ok-soft);
}
.money .mcap.overdrawn, .stamp.over { color: var(--over-ink); background: var(--over-soft); }
.money .mline { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.money .mused { display: flex; justify-content: space-between; margin: 18px 0 8px;
  font-size: 14px; color: var(--ink-2); }
.money .mused b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }

/* bars: one shape everywhere */
.track { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: 99px; background: var(--butter);
  animation: grow .7s cubic-bezier(.2, .8, .2, 1) both; }
.track > i.ok { background: var(--ok); }
.track > i.near { background: var(--near); }
.track > i.over, .track > i.short { background: var(--over); }
@keyframes grow { from { width: 0; } }
.meter { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; position: relative; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--butter); }

/* the week picker: plain words, two quiet arrows */
.picker { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; }
.picker .pk-arrow {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-2); font-size: 0; text-decoration: none;
}
.picker .pk-arrow:hover { background: var(--bg-2); color: var(--ink); }
.picker .pk-arrow .ic { width: 20px; height: 20px; }
.picker .pk-mid { text-align: center; }
.picker .pk-mid b { display: block; font-size: 16px; font-weight: 800; }
.pk-jump { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 99px;
  background: var(--butter-soft); color: var(--ink); font-size: 12px; font-weight: 800; }
.pk-jump:hover { text-decoration: none; }

/* ─────────────────────────────────────────────────────────────── buttons */
/* The main button: sticker #2 of 2. One per screen where possible. */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 22px; border-radius: 999px; cursor: pointer;
  background: var(--butter); color: var(--on-butter);
  border: var(--sticker-border); box-shadow: var(--sticker-btn);
  font: 800 16px/1.15 var(--body); text-align: center; text-decoration: none;
  transition: transform .08s, box-shadow .08s;
}
:root[data-theme="dark"] button:not(.ghost):not(.link):not(.danger):not(.blocked),
:root[data-theme="dark"] .btn:not(.ghost) { border-color: #f4c94f; }
button:hover, .btn:hover { text-decoration: none; }
button:active, .btn:active { transform: translate(2px, 2px); box-shadow: var(--sticker-press); }
button .ic, .btn .ic { width: 20px; height: 20px; }
/* the second action: paper with the slight shadow */
button.ghost, .btn.ghost { background: var(--card); color: var(--ink); border: 0; box-shadow: var(--slight); }
button.ghost:active, .btn.ghost:active { transform: translate(1px, 1px); }
button.full, .btn.full { width: 100%; }
.btn.small, button.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
/* destructive: only inside details.confirm. Dusty rose, never red. */
button.danger { background: var(--over-ink); color: #fff; border: 0; box-shadow: none; }
/* undo-grade text buttons */
button.link {
  min-height: 0; padding: 2px 4px; border: 0; background: none; box-shadow: none;
  color: var(--ink-3); font: 700 13px/1.3 var(--body); text-decoration: underline; text-underline-offset: 3px;
}
button.link:active { transform: none; }
/* waiting on something: the button rests until the gap is filled */
.btn.blocked, button.blocked { background: var(--bg-2); color: var(--ink-3); border-color: transparent; box-shadow: none; }
.blocked-note { font-size: 13px; font-weight: 700; color: var(--over-ink); margin: 10px 0 0; text-align: center; min-height: 18px; }

.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.quick button, .quick .btn { min-height: 44px; font-size: 15px; }

/* ─────────────────────────────────────────────────────────────── forms */
label { display: block; margin: 16px 0 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
label > input, label > select, label > textarea { margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=tel], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink);
  font: 600 16px/1.35 var(--body); letter-spacing: normal; text-transform: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 120px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: .8; font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--butter-soft); }
select { background-image: var(--chev); background-repeat: no-repeat; background-position: right 16px center;
  padding-right: 40px; cursor: pointer; }
input.missing, input.bad, input.missing:focus, input.bad:focus { border-color: var(--over); }
input.good, input.good:focus { border-color: var(--ok); }
.hint { font-size: 13px; font-weight: 700; margin: 8px 0 0; color: var(--ink-3); min-height: 0; }
.hint:empty { margin: 0; }
.hint.bad { color: var(--over-ink); }
.hint.ok { color: var(--ok); }
.inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline > * { flex: 1 1 120px; }

/* a number with its unit beside it */
.unitrow { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.unitrow .u { display: flex; gap: 6px; align-items: center; flex: 1 1 auto; min-width: 0; }
.unitrow .u input { min-width: 0; }
.unitrow .u small { letter-spacing: .08em; }
.unitrow select.unit { flex: 0 0 auto; width: auto; font-size: 15px; }
.unitrow.dob .u { flex: 1 1 0; }
.unitrow.dob .u.wide { flex: 1.6 1 0; }
.unitrow.dob input { text-align: center; }

/* the six digits */
input.code { font: 800 32px/1 var(--body); letter-spacing: .3em; text-align: center; padding: 14px 10px; }

/* radio cards: the goal picker, the week picker */
.goals { display: grid; gap: 10px; margin-top: 4px; }
.goals .goal {
  position: relative; display: block; margin: 0; padding: 14px 16px; cursor: pointer;
  background: var(--card); border: 2px solid transparent; border-radius: 18px; box-shadow: var(--slight);
  color: var(--ink);
}
.card .goals .goal { background: var(--bg); box-shadow: none; }
/* the radio is invisible but sits INSIDE its card: an unplaced absolute
   input scrolled the page black on focus (Thom, 7 Oct) */
.goals .goal input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; margin: 0; }
.goals .goal b { display: block; font-size: 16px; font-weight: 800; }
.goals .goal span { display: block; font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.goals .goal.on, .goals .goal:has(input:checked) { border-color: var(--ink); background: var(--butter-soft); }
:root[data-theme="dark"] .goals .goal.on, :root[data-theme="dark"] .goals .goal:has(input:checked) { border-color: var(--butter); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .goals .goal.on, :root:not([data-theme="light"]) .goals .goal:has(input:checked) { border-color: var(--butter); }
}

/* chips you pick from: radio + span */
.iw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.iw-chips label { margin: 0; cursor: pointer; }
.iw-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.iw-chips span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink-2); font-size: 14px; font-weight: 700; }
.iw-chips input:checked + span { background: var(--butter); color: var(--on-butter); }
.iw-chips input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.iw-label { margin: 18px 0 8px; }
.iw-kcal { margin: -6px 0 6px; font-size: 14px; color: var(--ink-3); }
.iw-now { margin: 18px 0 14px; font-size: 14px; color: var(--ink-2); }

/* M T W T F S S */
.dayticks { display: flex; gap: 6px; margin: 8px 0 4px; }
.dayticks label { margin: 0; cursor: pointer; }
.dayticks form { margin: 0; }
.dayticks input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.dayticks span, .dayticks .dt {
  display: inline-grid; place-items: center; width: 38px; height: 38px; min-height: 0; padding: 0;
  border-radius: 50%; border: 0; box-shadow: none; background: var(--bg-2); color: var(--ink-3);
  font: 800 13px/1 var(--body);
}
.dayticks input:checked + span, .dayticks .dt.on { background: var(--butter); color: var(--on-butter); }
.dayticks input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.dayticks .dt:active { transform: scale(.94); box-shadow: none; }
.dayticks.small { gap: 4px; margin: 0; }
.dayticks.small .dt { width: 28px; height: 28px; font-size: 11px; }
.dayticks .dt.today { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--ink-3); }

/* ─────────────────────────────────────────────────────────────── lists */
/* The only place a line is allowed: 1px, between rows, inside one card. */
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; }
.row + .row, form.row + form.row { border-top: 1px solid var(--line); }
.row .name { color: var(--ink); font-weight: 700; min-width: 0; }
.row .meta { color: var(--ink-3); font-size: 13px; font-weight: 500; }
.row .val { color: var(--ink-2); white-space: nowrap; font-weight: 700; }

.list, .actlist { background: var(--card); border-radius: var(--radius); box-shadow: var(--slight); padding: 2px 16px; margin: 0 0 8px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.li + .li { border-top: 1px solid var(--line); }
.li .av { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px; display: grid; place-items: center;
  background: var(--butter-soft); color: var(--ink); }
.li .nm { flex: 1 1 auto; min-width: 0; }
.li .nm b { display: block; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .nm small { display: block; font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.li .amt { font-size: 16px; font-weight: 800; white-space: nowrap; }
.li .amt.plus { color: var(--ok); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; padding: 4px 6px 10px; }
td { padding: 10px 6px; border-top: 1px solid var(--line); }
td input { min-height: 40px; padding: 8px 10px; text-align: right; }
td.num, th.num { text-align: right; }

.pill {
  display: inline-block; margin-left: 6px; padding: 3px 8px; border-radius: 99px; vertical-align: 2px;
  background: var(--butter-soft); color: var(--ink); font: 800 11px/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase;
}
.pill.est, .est { background: var(--near-soft); color: var(--near-ink); }
span.est { display: inline-block; margin-left: 6px; padding: 3px 7px; border-radius: 6px; vertical-align: 2px;
  font: 800 11px/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; }

.stat { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 8px; }
.stat div b { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }

/* section heads */
.rule { display: block; margin: 26px 2px 10px; text-align: left; }
.acthead { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 10px; }
.acthead a { font-size: 14px; font-weight: 800; color: var(--link); display: inline-flex; align-items: center; gap: 2px; }
.acthead a .ic { width: 16px; height: 16px; }
.actday { margin: 14px 4px 8px; }

/* the voice: a note, never next to a number it judges */
.nudge { background: var(--bg-2); border-radius: 16px; padding: 12px 15px; margin: 10px 0; color: var(--ink); font-size: 15px; line-height: 1.5; }
.nudge.win { background: var(--ok-soft); }
.nudge a { color: inherit; }

/* ─────────────────────────────────────────────────────────────── home */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 4px; }
.actions .btn { width: 100%; padding: 0 12px; }

/* tiles: label, number, bar — one card, no outlines */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; text-decoration: none; color: var(--ink); }
.tiles.three { grid-template-columns: repeat(3, 1fr); }
a.tiles:hover { text-decoration: none; }
.tile .tl-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tile .st { font-size: 12px; font-weight: 800; white-space: nowrap; }
.tile .st.ok { color: var(--ok); } .tile .st.near { color: var(--near-ink); }
.tile .st.over, .tile .st.short { color: var(--over-ink); }
.tile .v { margin: 6px 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .v small { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.tile .track { height: 6px; }
.tiles.three .tile .v { font-size: 19px; }

/* the balance rows: swipe sideways, the next tile peeks (Thom, 8 Oct) */
.swipe { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 20px;
  margin: 0 -20px; padding: 2px 20px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.swipe::-webkit-scrollbar { display: none; }
.mini { flex: 0 0 auto; min-width: 136px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px 12px; border-radius: 18px; background: var(--card); box-shadow: var(--slight); color: var(--ink); }
.mini:hover { text-decoration: none; }
.mini .v { font-size: 20px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini .v small { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.mini .track { height: 6px; }
.mini .st { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .st.ok { color: var(--ok); } .mini .st.near { color: var(--near-ink); }
.mini .st.over, .mini .st.short { color: var(--over-ink); }

/* close out last week: a prompt, not an alarm */
.closebar { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 14px 16px;
  border-radius: 18px; background: var(--butter-soft); color: var(--ink); }
.closebar:hover { text-decoration: none; }
.closebar b { display: block; font-size: 16px; font-weight: 800; }
.closebar small { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.closebar .go { margin-left: auto; display: grid; place-items: center; }

/* routines on the dashboard: a day ticker per routine */
.rtstrip { background: var(--card); border-radius: var(--radius); box-shadow: var(--slight); padding: 2px 16px; margin: 0; }
.rtrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; flex-wrap: wrap; }
.rtrow + .rtrow { border-top: 1px solid var(--line); }
.rtname { font-weight: 700; font-size: 15px; min-width: 0; }
.rtname small { display: block; font-weight: 600; font-size: 13px; color: var(--ink-3); }

/* ─────────────────────────────────────────────────────────────── statement + balances */
.stmt { display: flex; flex-direction: column; }
.srow { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; }
.srow + .srow { border-top: 1px solid var(--line); }
.srow.head { padding: 0 0 8px; }
.srow.head span { font: inherit; color: inherit; min-width: 0; }
.srow .what { min-width: 0; font-weight: 700; }
.srow .what small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.srow .amt { white-space: nowrap; color: var(--ink-2); font-weight: 600; }
.srow .amt.credit, .srow.credit .amt { color: var(--ok); font-weight: 800; }
.srow .bal { white-space: nowrap; font-weight: 800; min-width: 64px; text-align: right; }
.srow.routine .what { color: var(--ink-2); }

.lines { display: flex; flex-direction: column; }
.line { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n d" "k d" "b b";
  gap: 2px 12px; padding: 14px 0; color: var(--ink); text-decoration: none; }
.line + .line { border-top: 1px solid var(--line); }
.line:hover { text-decoration: none; }
.line .lname { grid-area: n; font-size: 16px; font-weight: 800; }
.line .lnums { grid-area: k; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.line .lnums b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.line .ldiff { grid-area: d; align-self: center; padding: 6px 11px; border-radius: 99px; white-space: nowrap;
  font-size: 13px; font-weight: 800; background: var(--bg-2); color: var(--ink); border: 0; }
.line.ok .ldiff { background: var(--ok-soft); color: var(--ok); }
.line.near .ldiff { background: var(--near-soft); color: var(--near-ink); }
.line.over .ldiff, .line.short .ldiff { background: var(--over-soft); color: var(--over-ink); }
.line .lbar { grid-area: b; display: block; height: 6px; margin-top: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.line .lbar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); animation: grow .7s cubic-bezier(.2, .8, .2, 1) both; }
.line.near .lbar i { background: var(--near); }
.line.over .lbar i, .line.short .lbar i { background: var(--over); }
.bal .big { color: var(--ink); }
.bal .verdict { margin: 10px 0 0; font-weight: 800; font-size: 16px; }
.bal.ok .verdict { color: var(--ok); }
.bal.near .verdict { color: var(--near-ink); }
.bal.over .verdict, .bal.short .verdict { color: var(--over-ink); }

/* ─────────────────────────────────────────────────────────────── the pantry */
.phead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.phead h2, .phead .title { margin: 0; }
.chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; margin: 14px -20px 14px; padding: 2px 20px 6px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border-radius: 99px; background: var(--card); box-shadow: var(--slight); color: var(--ink);
  font-size: 14px; font-weight: 700; white-space: nowrap; }
.chips a:hover { text-decoration: none; }
.chips a.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.card .chips a { background: var(--bg-2); box-shadow: none; }
.card .chips a.on { background: var(--ink); }

.plist { width: 100%; }
.plist .pitem { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 13px 0; }
.plist .pitem { position: relative; }
.plist .pitem + .pitem::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.plist .pitem .pname { color: var(--ink); font-size: 16px; font-weight: 700; min-width: 0; }
.plist .pitem .pname em { display: inline-block; font-style: normal; margin-left: 6px; padding: 2px 7px; border-radius: 6px;
  background: var(--bg-2); color: var(--ink-2); font-size: 11px; font-weight: 800; letter-spacing: .04em; vertical-align: 2px; }
.plist .pitem .pname em.offender { background: var(--butter-soft); color: var(--ink); }
.plist .pitem .pkcal { color: var(--ink); font-weight: 800; font-size: 16px; white-space: nowrap; }
.plist .pitem .pkcal small { font-weight: 600; color: var(--ink-3); font-size: 12px; margin-left: 2px; }
.plist .pitem.binned .pname, .plist .pitem.binned .pkcal { color: var(--ink-3); text-decoration: line-through; }
.pitem.tap { cursor: pointer; border-radius: 12px; }
.pitem.tap:hover, .pitem.tap:focus-visible { background: linear-gradient(90deg, transparent, var(--bg-2) 8%, var(--bg-2) 92%, transparent); outline: none; }

/* the sort screen */
.items .item { padding: 14px 0; }
.items .item + .item { border-top: 1px solid var(--line); }
.items .itop { display: flex; gap: 8px; align-items: center; }
.items .itop input { flex: 1 1 auto; min-width: 0; }
.items .nums { display: flex; gap: 8px; margin-top: 8px; }
.items .nums label { flex: 1 1 0; min-width: 0; margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.items .nums input, .items .nums select { margin-top: 4px; min-height: 44px; padding: 9px 10px; font-size: 15px; }
.items .nums input { text-align: right; }
.items .nums select { padding-right: 30px; background-position: right 10px center; }
.items .item.off { opacity: .45; }
.items .item.off .itop input { text-decoration: line-through; }
.sweep-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.sweep-row + .sweep-row { border-top: 1px solid var(--line); }
.sweep-row .name { flex: 1 1 auto; min-width: 0; font-weight: 700; }
.sweep-row select { flex: 0 0 150px; min-height: 44px; padding: 9px 30px 9px 12px; font-size: 14px; background-position: right 10px center; }

/* "Check it": a clean list, tap a line to fix it (design v3) */
.list.items { margin-bottom: 16px; }
.irow { padding: 0 !important; }
.irow-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 0; padding: 13px 0; border: 0; border-radius: 0;
  background: none; box-shadow: none; color: var(--ink); text-align: left; font: inherit; }
.irow-head:active { transform: none; box-shadow: none; }
.irow-head .nm { flex: 1 1 auto; min-width: 0; }
.irow-head .nm b { font-size: 16px; font-weight: 700; }
.irow-head .nm small { display: block; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.irow-head .nm small:empty { display: none; }
.irow-head .amt { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.irow-head .ipen { color: var(--ink-3); display: grid; }
.irow-head .ipen .ic { width: 18px; height: 18px; }
.irow.open .irow-head .ipen { color: var(--ink); }
.irow-body { padding: 0 0 14px; }
/* NOT THIS ONE? (Thom, 24 Oct): real products the line could be, one tap each */
.alts { margin: 10px 0 4px; }
.alts .cap { margin: 0 0 6px; }
.alts .alt { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; margin: 0 0 6px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2);
  font: inherit; color: var(--ink); cursor: pointer; }
.alts .alt b { font-weight: 800; font-size: 15px; }
.alts .alt small { flex: 0 0 auto; font-size: 12px; color: var(--ink-3); }
.alts .alt.on { box-shadow: inset 0 0 0 2px var(--ink); }
.althint { color: var(--ink-2); font-weight: 700; }
.irow.off .irow-head { opacity: .45; }
.irow.off .irow-head b { text-decoration: line-through; }

/* the commit bar: sits at the bottom of the scroll, never scrolls away */
.pinbar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 14px;
  margin: 8px -20px 0; padding: 14px 20px 16px; background: var(--bg);
  box-shadow: 0 -12px 16px -12px rgba(0, 0, 0, .12); }
.pinbar .pin-total { flex: 0 0 auto; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.pinbar .pin-total b { display: block; font-family: var(--hero); font-weight: 400; font-size: 24px; line-height: 1; color: var(--ink); }
.pinbar button { flex: 1 1 auto; }

/* close out */
.crow { padding: 14px 0; }
.crow + .crow { border-top: 1px solid var(--line); }
.crow-top { display: flex; justify-content: space-between; margin: 0 0 10px; }
.crow-top b { font-weight: 800; font-size: 16px; }
.crow-top span { color: var(--ink-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.crow .iw-chips span { min-height: 34px; padding: 0 12px; font-size: 13px; }
.crow-spread { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }
.crow-spread select { margin: 0; width: auto; flex: 0 0 auto; min-height: 40px; padding: 6px 36px 6px 12px; font-size: 14px; }
.crow.gone .crow-top b { color: var(--ink-3); }
.crow-tap { width: 100%; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; color: var(--ink);
  min-height: 0; text-align: left; align-items: center; gap: 12px; cursor: pointer; }
.crow-tap b { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow-tap span { flex: 0 0 auto; font-size: 14px; }
.crow-tap em { font-style: normal; }
.crow.kept .crow-tap em { color: var(--on-butter); background: var(--butter); border-radius: 999px; padding: 3px 9px; }
.crow .crow-top { margin: 0; }
.crow-pick { margin-top: 12px; }

/* ─────────────────────────────────────────────────────────────── settings */
.tabs { display: flex; gap: 22px; margin: 0 -20px 18px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; flex: 0 0 auto; white-space: nowrap; padding: 6px 0 12px;
  font-size: 15px; font-weight: 800; color: var(--ink-3); text-decoration: none; }
.tabs a.on { color: var(--ink); }
.tabs a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 4px; border-radius: 4px; background: var(--butter); }
.tabs a:hover { color: var(--ink); text-decoration: none; }

.planner { margin: 12px 0 4px; padding: 14px; border-radius: 18px; background: var(--bg-2); }
.planner > label { margin-top: 0; }
.planner input, .planner select { background-color: var(--card); }
.step { display: grid; grid-template-columns: 52px 1fr 1fr 32px; grid-template-areas: "n kind kind x" ". kg wk .";
  row-gap: 8px; column-gap: 8px; align-items: center; margin: 12px 0 0; padding-bottom: 12px; }
.step + .step { border-top: 1px solid var(--line); padding-top: 12px; }
.step .step-n { grid-area: n; }
.step select { grid-area: kind; margin: 0; }
.step .step-x { grid-area: x; width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3); border: 0; box-shadow: none; font-size: 18px; }
.step .step-kg { grid-area: kg; position: relative; }
.step .step-wk { grid-area: wk; position: relative; }
.step input { margin: 0; padding-right: 50px; width: 100%; }
.step small { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--ink-3); pointer-events: none; }
.step .step-in { display: none; }
.step.hold .step-kg { display: none; }
.step.hold .step-wk { grid-column: kg / wk; }
.step-add { margin-top: 12px; }
#plannote { margin: 10px 0 0; }
.timeline { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.tl { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border-radius: 16px; background: var(--bg-2); }
.tl.live { background: var(--butter-soft); box-shadow: inset 0 0 0 2px var(--butter); }
.tl-when { grid-column: 1 / -1; }
.tl-what b { font-weight: 800; }
.tl-what small { display: inline-block; margin-left: 8px; font-size: 13px; color: var(--ink-3); }
.tl-num { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.tl-num small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); }

/* destructive actions: closed by default, the consequence first */
details.confirm { margin-top: 16px; }
details.confirm > summary { list-style: none; cursor: pointer; text-align: center; padding: 8px;
  font-size: 14px; font-weight: 700; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm > .confirm-body { margin-top: 10px; padding: 16px; border-radius: 18px; background: var(--over-soft); color: var(--ink); }
details.confirm > .confirm-body .sub { color: var(--ink-2); }
/* lifted into a sheet: the body loses its own panel, the sheet is the panel */
.confirm-sheet .confirm-body { padding: 0; background: none; }
.confirm-sheet .confirm-body .sub { color: var(--ink-2); font-size: 15px; }
.confirm-sheet .sheet-no { display: block; margin: 14px auto 0; font-size: 15px; color: var(--ink-2); text-decoration: none; }
details.drop > summary { list-style: none; cursor: pointer; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--slight); }
details.drop > summary::-webkit-details-marker { display: none; }
details.drop > .drop-body { margin-top: 8px; padding: 8px; border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--slight); }

/* membership */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 12px; }
.plan { display: flex; flex-direction: column; gap: 6px; padding: 18px 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--slight); }
.plan.top { background: var(--butter-soft); }
/* dark: the butter tint went muddy olive on the near-black (Thom, 19 Oct: "awful colour") — card + butter edge */
:root[data-theme="dark"] .plan.top { background: var(--card); box-shadow: inset 0 0 0 2px var(--butter); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plan.top { background: var(--card); box-shadow: inset 0 0 0 2px var(--butter); } }
/* the free run's banner on the dashboard (19 Oct) */
.trial-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px;
  padding: 11px 16px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 2px var(--butter);
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; }
.trial-bar b { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; background: var(--butter); color: var(--on-butter, #121212); font-size: 13px; }
.plan b { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.plan .price { font-family: var(--hero); font-size: 38px; line-height: 1; margin: 6px 0 2px; color: var(--ink); }
.plan .price small { font-family: var(--body); font-size: 13px; font-weight: 700; margin-left: 4px; color: var(--ink-3); }
.plan span { font-size: 14px; color: var(--ink-2); line-height: 1.45; flex: 1 1 auto; }
.plan button { margin-top: 10px; width: 100%; }
.plan.solo { margin: 0 0 16px; text-align: center; align-items: center; }
.plan.solo .price { font-size: 52px; }
@media (max-width: 380px) { .plans { grid-template-columns: 1fr; } }

/* ─────────────────────────────────────────────────────────────── the doors (signed out) */
.door { text-align: center; padding: 22px 0 6px; }
.door .mark, .door .hero-kid { display: block; width: 40%; max-width: 190px; height: auto; margin: 0 auto 14px; }
.door .crest {
  display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 99px;
  background: var(--butter); color: #221d1a; font: 800 11px/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase;
}
.door h1 { font-size: clamp(34px, 10vw, 46px); line-height: 1.05; margin: 0 0 12px; }
.door .motto, .door .lede { color: var(--ink-2); font-size: 16px; line-height: 1.55; margin: 0 auto 26px; max-width: 26em; }
.door .btn { display: flex; margin: 0 0 12px; }
.door .aside { margin-top: 18px; font-size: 14px; color: var(--ink-3); }

.doors { display: flex; flex-direction: column; gap: 12px; margin: 0 0 18px; }
.door-google, .door-apple { display: flex; align-items: center; justify-content: center; gap: 10px; }
.door-google { background: #fff; color: #1f1f1f; border: 0; box-shadow: var(--slight); }
.door-apple { background: #000; color: #fff; border: 0; box-shadow: var(--slight); }
:root[data-theme="dark"] .door-apple { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .door-apple { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); } }
.door-google svg, .door-apple svg { flex: 0 0 auto; }

/* the landing's note, the about page's plate */
.plate { background: var(--butter-soft); border-radius: var(--radius); padding: 20px; margin: 22px 0; text-align: center; color: var(--ink); }
.plate p { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.plate p:last-child { margin-bottom: 0; }
.plate .btn { margin-top: 12px; }
.hero { padding: 30px 0 16px; text-align: center; }
.hero h1 { font-size: clamp(32px, 9vw, 46px); line-height: 1.08; margin: 0 0 12px; }
.hero p.lede { font-size: 17px; color: var(--ink-2); margin: 0 0 24px; }

.steps { counter-reset: s; padding: 0; margin: 0; }
.steps li { list-style: none; padding: 14px 0 14px 50px; position: relative; }
.steps li + li { border-top: 1px solid var(--line); }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: 13px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--butter); color: #221d1a; font-weight: 800; font-size: 15px;
}
.steps li b { display: block; font-size: 16px; font-weight: 800; }
.steps li span { color: var(--ink-3); font-size: 14px; }

/* the members deck */
.deck { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 4px -20px 8px; padding: 6px 20px 10px; scrollbar-width: none; }
.deck::-webkit-scrollbar { display: none; }
.deck > .card { flex: 0 0 86%; scroll-snap-align: center; margin: 0; }
.deck.free > .card { height: auto; }
.hgroup { margin-bottom: 18px; }
.lens-stage { background: var(--bg-2); border-radius: var(--radius-sm); overflow: hidden; min-height: 120px; display: grid; place-items: center; }
.lens-stage video { width: 100%; display: none; background: #000; }

/* ─────────────────────────────────────────────────────────────── the toast */
/* Top, slides down, gone in 3s; Undo where it makes sense (Thom, 8 Oct). */
.toasts { position: absolute; z-index: 60; left: 12px; right: 12px; top: max(10px, env(safe-area-inset-top));
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.flash {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 520px; width: 100%;
  padding: 12px 14px 12px 16px; border-radius: 18px; background: var(--ink); color: var(--bg);
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .5); font-size: 14px; font-weight: 700;
  animation: toastin .32s cubic-bezier(.2, .9, .3, 1.15) both, toastout .3s ease-in 3.4s forwards;
}
.flash::before { content: ""; flex: 0 0 8px; height: 8px; border-radius: 50%; background: var(--butter); }
.flash > span { flex: 1 1 auto; }
.flash form { margin: 0; }
.flash .undo { min-height: 32px; padding: 0 12px; border: 0; box-shadow: none; border-radius: 99px;
  background: var(--butter); color: #221d1a; font-size: 13px; font-weight: 800; }
.flash:has(.undo) { animation: toastin .32s cubic-bezier(.2, .9, .3, 1.15) both, toastout .3s ease-in 5.4s forwards; }
@keyframes toastin { from { transform: translateY(-120%); opacity: 0; } }
@keyframes toastout { to { transform: translateY(-120%); opacity: 0; visibility: hidden; } }

/* ─────────────────────────────────────────────────────────────── THE WINDOW (bottom sheet) */
/* Windows slide up from the bottom over the dimmed room. Add a shop and
   Eat out are one sheet with a switch (Thom, 8 Oct). */
dialog.sheet-win {
  margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  border: 0; border-radius: 28px 28px 0 0; padding: 10px 20px max(24px, env(safe-area-inset-bottom));
  background: var(--card); color: var(--ink); box-shadow: 0 -10px 40px rgba(0, 0, 0, .16);
}
dialog.sheet-win::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 9px; margin: 0 auto 14px; background: var(--line-2); }
/* ::backdrop does not inherit custom properties everywhere: literal colour */
dialog.sheet-win::backdrop { background: rgba(20, 16, 12, .5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
dialog.sheet-win[open] { animation: sheetup .26s cubic-bezier(.2, .9, .3, 1); }
@keyframes sheetup { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) {
  dialog.sheet-win { margin: auto; border-radius: 28px; max-width: 480px; }
}
.sw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.sw-head h2, .sw-head .cap { margin: 0; }
.sw-title { font-family: var(--hero); font-size: 26px; line-height: 1; letter-spacing: .01em; }
.sw-x { width: 36px; height: 36px; min-height: 0; flex: 0 0 36px; padding: 0; border-radius: 50%;
  background: var(--bg-2); color: var(--ink); border: 0; box-shadow: none; margin-left: auto; }
.sw-x:active { transform: none; box-shadow: none; }
/* the switch: segmented */
.sw-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 16px; border-radius: 999px; background: var(--bg-2); }
.sw-switch button { min-height: 40px; border-radius: 999px; background: transparent; color: var(--ink-2);
  border: 0; box-shadow: none; font-size: 15px; font-weight: 800; }
.sw-switch button.on { background: var(--raise); color: var(--ink); box-shadow: var(--slight); }
.sw-switch button:active { transform: none; }
.sw-switch.solo { display: none; }
.sw-form .sw-title[hidden], .sw-form .cap[hidden] { display: none; }
.sw-lede { margin: -6px 0 12px; font-size: 14px; color: var(--ink-2); }

/* the one box: camera, file, drop, paste, typing, voice */
.sw-box { border: 1.5px solid var(--line-2); border-radius: 20px; padding: 12px 14px; background: var(--bg); transition: border-color .15s, background .15s; }
.sw-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px var(--butter-soft); }
.sw-box.over { background: var(--butter-soft); border-color: var(--butter); }
.sw-box.empty { animation: nudge .3s ease 2; }
@keyframes nudge { 50% { transform: translateX(-4px); } }
.sw-box textarea { min-height: 92px; margin: 0; padding: 2px 0; border: 0; border-radius: 0; background: transparent;
  box-shadow: none; font-size: 16px; font-weight: 500; resize: none; }
.sw-box textarea:focus { box-shadow: none; }
/* thumbnails: up to five, each with its x */
.sw-files { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0 10px; }
.sw-files .thumb { position: relative; width: 58px; height: 72px; border-radius: 12px; background: var(--card) center / cover no-repeat;
  box-shadow: var(--slight); display: grid; place-items: center; color: var(--ink-2); }
.sw-files .thumb .ic { width: 22px; height: 22px; }
.sw-files .thumb small { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 800; color: var(--ink-3); }
.sw-files .thumb button { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; min-height: 0; padding: 0;
  border-radius: 50%; border: 0; box-shadow: none; background: var(--ink); color: var(--bg); }
.sw-files .thumb button .ic { width: 12px; height: 12px; }
.sw-files .chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--butter-soft); font-size: 13px; font-weight: 700; }
.sw-files .chip b { cursor: pointer; font-size: 16px; line-height: 1; }
.sw-tools { display: flex; align-items: center; gap: 8px; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); }
.sw-tool { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; border: 0;
  background: var(--card); color: var(--ink); box-shadow: var(--slight); }
.sw-tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sw-tool:active { transform: scale(.94); box-shadow: var(--slight); }
.sw-tool.on { background: var(--butter); color: #221d1a; box-shadow: 0 0 0 6px var(--butter-soft); animation: listen 1.4s ease-in-out infinite; }
@keyframes listen { 50% { box-shadow: 0 0 0 10px var(--butter-soft); } }
.sw-hint { margin-left: auto; font-size: 12px; color: var(--ink-3); text-align: right; max-width: 46%; line-height: 1.3; }
.sw-listen { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; color: var(--link); font-size: 14px; font-weight: 800; }
.sw-go { margin-top: 16px; }
.sw-again { text-align: center; font-size: 14px; color: var(--ink-2); margin: 14px 0 0; }
.sw-lede[hidden], .sw-again[hidden] { display: none; }
/* the usual, one tap: above the box on Eat out */
.sw-usual { margin: 0 0 14px; }
.sw-usual .cap { margin: 0 2px 8px; }
.sw-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 4px; scrollbar-width: none; }
.sw-chips::-webkit-scrollbar { display: none; }
.sw-chips button { flex: 0 0 auto; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 0; box-shadow: none;
  background: var(--bg-2); color: var(--ink); font-size: 14px; font-weight: 700; }
.sw-chips button:active { transform: scale(.96); box-shadow: none; }

/* ─────────────────────────────────────────────────────────────── THE LOADER */
/* The room dims, the kid works. Calculations and AI reads only; at least two
   loops, then only as long as the work takes (Thom, 8 Oct). */
.loading { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center;
  background: var(--dim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.loading .loadcard { width: 236px; padding: 22px 24px; border-radius: 30px; text-align: center;
  background: var(--card); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.loading img { width: 140px; height: 140px; display: block; margin: 0 auto 6px; }
.loading .only-dark { margin: 0 auto 6px; }
.loading p { margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); }
/* the holding screen on confirm: the loader, but it stays and takes a code */
.loading.stay { position: fixed; }
.loading.stay .codebox { width: min(260px, 80vw); margin-top: 14px; }
.loading.stay .hint { margin: 8px 0 0; }

/* ─────────────────────────────────────────────────────────────── the tour */
/* Plain speech bubbles, forever (Thom, 8 Oct). Max 3 a screen. */
.tour { position: absolute; inset: 0; z-index: 45; }
.tour-spot { position: absolute; border-radius: 22px; box-shadow: 0 0 0 9999px var(--dim); transition: all .28s cubic-bezier(.2, .9, .3, 1); pointer-events: none; }
.bubble { position: absolute; left: 16px; right: 16px; max-width: 420px; margin: 0 auto; padding: 18px 18px 14px;
  border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .4); transition: top .28s cubic-bezier(.2, .9, .3, 1); }
.bubble::before { content: ""; position: absolute; left: var(--px, 60px); width: 18px; height: 18px; background: var(--card); transform: rotate(45deg); border-radius: 4px 0 0 0; }
.bubble.below::before { top: -8px; }
.bubble.above::before { bottom: -8px; border-radius: 0 0 4px 0; }
.bubble h4 { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.bubble p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.bubble .bf { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.bubble .bf .cap { margin-right: auto; }
.bubble .skip { min-height: 0; padding: 4px; border: 0; background: none; box-shadow: none; font-size: 14px; font-weight: 700; color: var(--ink-3); }
.bubble .next { min-height: 40px; padding: 0 18px; font-size: 14px; border: 0; box-shadow: none; }

/* ─────────────────────────────────────────────────────────────── THE WIZARD */
/* Full screen, one thing a step (Thom, 8 Oct): progress bar on top, back
   arrow, close; one big button at the bottom. The chrome steps aside. */
body.wz-on header.bar, body.wz-on nav.dock, body.wz-on .foot { display: none; }
body.wz-on .wrap { padding-top: 0; }
form.wz { display: flex; flex-direction: column; flex: 1 0 auto; }
.wz-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  margin: 0 -20px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: var(--bg); }
.wz-back, .wz-x { width: 40px; height: 40px; min-height: 0; flex: 0 0 40px; padding: 0; border-radius: 50%; border: 0;
  background: transparent; color: var(--ink-2); box-shadow: none; display: grid; place-items: center; }
.wz-back:active { transform: none; box-shadow: none; }
.wz-x:hover { text-decoration: none; background: var(--bg-2); }
.wz-bar { flex: 1 1 auto; height: 10px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.wz-bar i { display: block; height: 100%; border-radius: 99px; background: var(--butter);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08); transition: width .35s cubic-bezier(.2, .9, .3, 1); }
form.wz [data-step] { flex: 1 0 auto; padding: 18px 0 8px; }
form.wz [data-step].in-r { animation: stepr .28s cubic-bezier(.2, .9, .3, 1) both; }
form.wz [data-step].in-l { animation: stepl .28s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes stepr { from { opacity: 0; transform: translateX(28px); } }
@keyframes stepl { from { opacity: 0; transform: translateX(-28px); } }
.wz-q { font-family: var(--hero); font-weight: 400; font-size: 30px; line-height: 1.05; letter-spacing: .01em;
  text-transform: uppercase; margin: 0 0 8px; }
.wz-lede { color: var(--ink-2); font-size: 16px; margin: 0 0 18px; }
.wz-foot { position: sticky; bottom: 0; z-index: 10; margin: auto -20px 0; padding: 14px 20px max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
.wz-foot button { width: 100%; }
/* a page that hosts a wizard: only the wizard shows */
.wz-only { display: none; }
form.wz .wz-only { display: block; }
form.wz .wz-off { display: none; }
body.wz-on .wrap > *:not(form.wz):not(:has(form.wz)):not(script) { display: none !important; }
body.wz-on [data-pane] > *:not(form.wz):not(:has(form.wz)) { display: none !important; }
body.wz-on .card:has(> form.wz) { background: none; box-shadow: none; padding: 0; margin: 0; border-radius: 0; display: flex; flex-direction: column; flex: 1 0 auto; }
body.wz-on .card:has(> form.wz) > :not(form) { display: none; }
body.wz-on [data-pane]:has(form.wz) { display: flex; flex-direction: column; flex: 1 0 auto; }
form.wz label:first-of-type { margin-top: 4px; }
form.wz .goals .goal { background: var(--card); box-shadow: var(--slight); }
form.wz .goals .goal.on, form.wz .goals .goal:has(input:checked) { background: var(--butter-soft); }
/* big choice buttons: Ate it / Binned it / Still going */
.wz-choices { display: grid; gap: 10px; margin: 18px 0 0; }
.wz-choice { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 0 18px; border-radius: 20px;
  border: 2px solid transparent; background: var(--card); color: var(--ink); box-shadow: var(--slight);
  font: 800 17px/1.2 var(--body); text-align: left; cursor: pointer; }
.wz-choice .ic { width: 24px; height: 24px; }
.wz-choice .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); }
.wz-choice:active { transform: scale(.98); box-shadow: var(--slight); }
.wz-choice.on { border-color: var(--ink); background: var(--butter-soft); }
:root[data-theme="dark"] .wz-choice.on { border-color: var(--butter); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wz-choice.on { border-color: var(--butter); } }
/* the item card you swipe */
.wz-card { background: var(--card); border-radius: 26px; box-shadow: var(--slight); padding: 22px 20px; text-align: center;
  touch-action: pan-y; user-select: none; transition: transform .2s; }
.wz-card .wz-q { font-size: 28px; margin: 6px 0 4px; }
.wz-card.go-r { transform: translateX(120%) rotate(8deg); transition: transform .3s ease-in; }
.wz-card.go-l { transform: translateX(-120%) rotate(-8deg); transition: transform .3s ease-in; }
.wz-swipehint { display: flex; justify-content: space-between; margin: 12px 4px 0; font-size: 12px; font-weight: 800; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.wz-left { margin-top: 16px; }

/* ─────────────────────────────────────────────────────────────── THE CELEBRATION */
/* Duolingo-style, full screen (Thom, 8 Oct): the room goes butter, the kid
   jumps, the word lands, the stars pop in one at a time. Same in day and
   night: the fridge light floods the room. */
.celebrate { position: absolute; inset: 0; z-index: 70; display: flex; flex-direction: column;
  background: #f4c94f; color: #221d1a; --kid-fill: #fffdf6; overflow: hidden;
  padding: max(18px, env(safe-area-inset-top)) 24px max(22px, env(safe-area-inset-bottom));
  animation: celin .34s cubic-bezier(.2, .9, .3, 1) both; }
.celebrate.bye { animation: celout .26s ease-in forwards; }
@keyframes celin { from { opacity: 0; transform: scale(1.04); } }
@keyframes celout { to { opacity: 0; transform: scale(.98); } }
.cel-body { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 0; }
.cel-badges { display: flex; gap: 8px; min-height: 30px; }
.cel-badge { display: inline-block; padding: 6px 12px; border-radius: 99px; background: #221d1a; color: #f4c94f;
  font: 800 12px/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; animation: pop .4s .5s both cubic-bezier(.2, .9, .3, 1.4); }
.cel-kid { width: min(56vw, 250px); margin: 0 0 2px; }
.cel-kid img { width: 100%; height: auto; display: block; margin: 0 auto; }
.cel-kid img.still { width: 64%; margin: 18px auto 10px; }
.cel-label { margin: 0 0 6px; font: 800 12px/1.2 var(--body); letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.cel-word { font-family: var(--hero); font-weight: 400; font-size: clamp(40px, 12vw, 58px); line-height: 1; letter-spacing: .01em;
  text-transform: uppercase; margin: 0 0 14px; animation: wordin .5s .15s both cubic-bezier(.2, .9, .3, 1.5); }
@keyframes wordin { from { transform: scale(.6) translateY(10px); opacity: 0; } }
.cel-stars { display: flex; gap: 8px; margin: 0 0 14px; }
.cel-stars .star { width: 40px; height: 40px; fill: none; stroke: #221d1a; stroke-width: 1.6; stroke-linejoin: round; opacity: .35; }
.cel-stars .star.on { fill: #221d1a; opacity: 1; animation: starpop .42s cubic-bezier(.2, .9, .3, 1.6) both; animation-delay: calc(.55s + var(--i) * .16s); }
@keyframes starpop { 0% { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.25) rotate(8deg); } 100% { transform: none; } }
.cel-win { margin: 0 0 12px; font-size: 17px; font-weight: 800; max-width: 22em; }
.cel-checks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 12px; max-width: 340px; }
.cel-checks span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 800; border: 1.5px solid rgba(34, 29, 26, .25); color: rgba(34, 29, 26, .6); }
.cel-checks span.ok { background: #221d1a; border-color: #221d1a; color: #fffdf6; }
.cel-nudge { margin: 4px 0 0; font-size: 15px; font-weight: 600; opacity: .85; max-width: 22em; }
.cel-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cel-go { width: 100%; max-width: 420px; min-height: 58px; border: 0; border-radius: 999px; background: #221d1a; color: #fffdf6;
  font-size: 17px; box-shadow: 0 6px 0 rgba(34, 29, 26, .25); }
.cel-go:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(34, 29, 26, .25); }
.cel-share { min-height: 40px; border: 0; box-shadow: none; background: none; color: #221d1a; font-size: 15px; }
.cel-share:active { transform: none; box-shadow: none; }
.cel-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cel-confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall 2.4s cubic-bezier(.3, .6, .5, 1) both; }
@keyframes fall { to { transform: translate(var(--x), 105vh) rotate(var(--r)); } }
/* NIGHT (Thom's white boy, 9 Oct): the room goes dark instead of butter,
   the pen goes cream, the stars and the button take the fridge light. */
:root[data-theme="dark"] .celebrate { background: #121212; color: #f5efe3; }
:root[data-theme="dark"] .cel-badge { background: #f4c94f; color: #121212; }
:root[data-theme="dark"] .cel-stars .star { stroke: #f4c94f; }
:root[data-theme="dark"] .cel-stars .star.on { fill: #f4c94f; }
:root[data-theme="dark"] .cel-checks span { border-color: rgba(245, 239, 227, .25); color: rgba(245, 239, 227, .6); }
:root[data-theme="dark"] .cel-checks span.ok { background: #f4c94f; border-color: #f4c94f; color: #121212; }
:root[data-theme="dark"] .cel-go { background: #f4c94f; color: #121212; box-shadow: 0 6px 0 #8a6a14; }
:root[data-theme="dark"] .cel-share { color: #f5efe3; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .celebrate { background: #121212; color: #f5efe3; }
  :root:not([data-theme="light"]) .cel-badge { background: #f4c94f; color: #121212; }
  :root:not([data-theme="light"]) .cel-stars .star { stroke: #f4c94f; }
  :root:not([data-theme="light"]) .cel-stars .star.on { fill: #f4c94f; }
  :root:not([data-theme="light"]) .cel-checks span { border-color: rgba(245, 239, 227, .25); color: rgba(245, 239, 227, .6); }
  :root:not([data-theme="light"]) .cel-checks span.ok { background: #f4c94f; border-color: #f4c94f; color: #121212; }
  :root:not([data-theme="light"]) .cel-go { background: #f4c94f; color: #121212; box-shadow: 0 6px 0 #8a6a14; }
  :root:not([data-theme="light"]) .cel-share { color: #f5efe3; }
}

/* EMPTY SCREENS (Thom, 8 Oct): the kid, one line, one button */
.empty { text-align: center; padding: 26px 8px 8px; }
.empty img { width: 40%; max-width: 170px; height: auto; margin: 0 auto 16px; display: block; }
.empty .only-dark { margin: 0 auto 16px; }
.empty h2 { font-family: var(--hero); font-size: 26px; line-height: 1.05; text-transform: uppercase; margin: 0 0 8px; }
.empty p { color: var(--ink-2); font-size: 16px; margin: 0 auto 20px; max-width: 22em; }
.empty .btn { min-width: 220px; }

/* ─────────────────────────────────────────────────────────────── the kid signs off */
.foot { text-align: center; padding: 30px 0 6px; margin-top: auto; }
.foot img { width: 56px; height: auto; }

/* ─────────────────────────────────────────────────────────────── motion, politely */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── THE APPS (9 Oct 2026). Inside the iOS/Android shells the page runs edge
   to edge under the status bar; this strip keeps scrolled content out from
   behind the clock and the camera. The room's colour, both modes. ── */
.in-app body::before {
  content: ""; position: fixed; z-index: 90; top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top); background: var(--bg); pointer-events: none;
}
.in-app { -webkit-tap-highlight-color: transparent; }
.in-app body { overscroll-behavior-y: none; }
.in-app body:has(.celebrate)::before { background: #f4c94f; }   /* the strip takes the party's colour */
.in-app .celebrate button:focus { outline: none; }

/* THE DATE PICKER (static/datepick.js): a field that reads like a field,
   a bottom sheet with ‹ Month › ‹ Year › and a Monday-first grid */
.dp-wrap { position: relative; display: block; }
.dp-native { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.dp-field { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 50px;
  margin: 6px 0 0; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); font: 600 16px/1.35 var(--body); text-align: left; text-transform: none;
  letter-spacing: normal; box-shadow: none; cursor: pointer; }
.dp-field:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--butter-soft); }
.dp-field.empty span { color: var(--ink-3); font-weight: 500; }
.dp-field svg { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.dp-head { display: grid; grid-template-columns: 40px 1fr 40px 40px auto 40px; align-items: center; gap: 2px; margin: 6px 0 12px; }
.dp-month { text-align: center; font-size: 18px; font-weight: 800; }
.dp-arrow, .dp-year { border: 0; background: none; box-shadow: none; color: var(--ink); font: inherit; padding: 6px; margin: 0; min-height: 40px; }
.dp-arrow { font-size: 26px; line-height: 1; color: var(--ink-2); }
.dp-year { font-size: 18px; font-weight: 800; border-radius: 12px; padding: 6px 10px; }
.dp-year:hover, .dp-arrow:hover { background: var(--bg-2); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; margin-bottom: 14px; }
.dp-dow { font-size: 13px; font-weight: 800; color: var(--ink-3); padding: 6px 0; }
.dp-day { border: 0; box-shadow: none; background: none; color: var(--ink); font: inherit; font-size: 16px;
  aspect-ratio: 1; min-height: 40px; padding: 0; margin: 0; border-radius: 12px; cursor: pointer; }
.dp-day:hover { background: var(--bg-2); }
.dp-day.today { box-shadow: inset 0 0 0 2px var(--line, rgba(0,0,0,.15)); }
.dp-day.on { background: var(--butter, #f4c94f); color: #121212; font-weight: 800; }
.dp-day[disabled] { opacity: .3; cursor: default; }
.dp-years { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 300px; overflow-y: auto; margin-bottom: 14px; }
.dp-years button { border: 0; box-shadow: none; background: var(--bg); color: var(--ink); font: inherit; font-weight: 700; padding: 12px 0; margin: 0; border-radius: 12px; }
.dp-years button.on { background: var(--butter, #f4c94f); color: #121212; }

/* the routine result sheet: what it came to, before you trust it */
.rr-big { font-family: var(--hero); font-size: 44px; line-height: 1; margin: 6px 0 2px; text-align: center; }
.rr-under { text-align: center; margin: 0 0 14px; }
.rr-macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 10px; }
.rr-macros span { background: var(--bg-2); border-radius: 16px; padding: 14px 6px; text-align: center; font-size: 14px; font-weight: 700; }
.rr-macros b { display: block; font-family: var(--hero); font-weight: 400; font-size: 28px; line-height: 1.1; }
.rr-macros b small { font-family: var(--body); font-weight: 800; font-size: 16px; text-transform: none; margin-left: 1px; }
.rr-small { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 0 0 6px; font-size: 13px; color: var(--ink-2); }
.rr-small b { color: var(--ink); }
/* two pages side by side; swipe, or the arrows */
.rr-pages { display: flex; align-items: flex-start; transition: height .2s; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -2px; }
.rr-pages::-webkit-scrollbar { display: none; }
.rr-page { flex: 0 0 100%; scroll-snap-align: start; padding: 0 2px; box-sizing: border-box; }
.rr-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 4px 0 10px; }
.rr-arrow { border: 0; box-shadow: none; background: var(--bg-2); color: var(--ink); width: 40px; height: 40px; min-height: 0;
  padding: 0; margin: 0; border-radius: 50%; font-size: 24px; line-height: 1; }
.rr-dots { display: flex; gap: 6px; }
.rr-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.rr-dots i.on { background: var(--butter); }
.rr-table { font-size: 14px; }
.rr-th, .rr-tr { display: grid; grid-template-columns: 1.3fr 1fr 1fr .8fr; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.rr-th { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.rr-th span:not(:first-child), .rr-tr > :not(:first-child) { text-align: right; }
.rr-tr span:first-child { font-weight: 700; }
.rr-tr span:last-child { color: var(--ink-3); }

/* the add window opens on the week and the name (Thom, 10 Oct) */
.sw-cap { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.sw-week { display: grid; gap: 8px; margin: 0 0 12px; }
.sw-wk { position: relative; display: block; padding: 12px 14px; border-radius: 16px; border: 2px solid transparent;
  background: var(--bg); cursor: pointer; }
.sw-wk input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; margin: 0; }
.sw-wk b { display: block; font-size: 15px; font-weight: 800; }
.sw-wk span { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.sw-wk.on, .sw-wk:has(input:checked) { border-color: var(--ink); background: var(--butter-soft); }
.sw-name { display: block; margin: 0 0 12px; }
.sw-week[hidden], .sw-name[hidden] { display: none; }

/* the profile: one sentence under the box that needs it (person_form.py) */
.field-err { margin: 6px 2px 0; font-size: 14px; font-weight: 700; color: var(--over); }
.field-err.top { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); color: var(--ink); }

/* YOUR NUMBERS as a sum: burn -> goal -> what you eat (Thom, 12 Oct) */
.sum .cap { margin-bottom: 4px; }
.sum-big { font-family: var(--hero); font-size: 34px; line-height: 1.1; margin: 2px 0 4px; }
.sum-big small { font-family: var(--body); font-size: 15px; font-weight: 700; color: var(--ink-2); }
.sum-week { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; }
.sum-rows { border-top: 1px solid var(--line); }
.sum-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sum-rows span { font-weight: 700; }
.sum-rows small { display: block; font-weight: 500; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.sum-rows b { font-variant-numeric: tabular-nums; font-size: 17px; white-space: nowrap; }
.sum-rows .tot { border-bottom: 0; }
.sum-rows .tot span, .sum-rows .tot b { font-weight: 900; }
.sum-how { margin: 10px 0 0; font-size: 13px; }
.sum-eq { margin: 10px 0 0; font-weight: 800; font-variant-numeric: tabular-nums; }
/* the working on each check-screen line: an assumed pack size, said quietly */
.irow-head small em.assumed { font-style: normal; font-weight: 800; color: var(--ink-2); }

/* NO WEIGHT ON THE RECEIPT: the lines that are our assumption, said plainly */
.weigh-note { font-size: 14px; line-height: 1.45; }
.weigh-note b { display: block; font-size: 15px; margin-bottom: 2px; }
.flag-weigh { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 99px; font-size: 11px;
  font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px;
  background: var(--butter); color: #121212; border: 0; }
.flag-weigh.done { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.irow.unweighed { box-shadow: inset 3px 0 0 var(--butter); }
/* the last rung is the customer: check the packet */
.ask-pack { margin: 4px 0 8px; font-size: 14px; color: var(--ink-2); }
.per100 { display: block; margin-bottom: 8px; }

/* ─────────────────────────────────────────────────────────────── STEP TWO OF THE WINDOW */
/* The read lands in the sheet as the check list (Thom, 13 Oct: "the full page
   is trash"). The kid reads at the fridge in the sheet, not over the room. */
.sw-reading { display: grid; place-items: center; text-align: center; padding: 18px 0 26px; }
.sw-reading[hidden], .sw-step2[hidden], .sw-err[hidden] { display: none; }
.sw-reading img { width: 140px; height: 140px; display: block; margin: 0 auto 6px; }
.sw-reading p { margin: 0; font-size: 16px; font-weight: 800; }
.sw-err { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--bg-2); font-weight: 700; }
.sw-back { min-height: 0; padding: 0; margin: -6px 0 10px; background: none; border: 0; box-shadow: none;
  color: var(--ink-2); font-size: 14px; font-weight: 800; }
.sw-back:active { transform: none; }
.sw-check .card { box-shadow: none; border: 1px solid var(--line); }
/* sticky pins to the sheet's padding edge; pull it down over the padding so
   nothing scrolls under the button */
.sw-check .pinbar { background: var(--card); bottom: calc(-1 * max(24px, env(safe-area-inset-bottom)));
  margin-bottom: calc(-1 * max(24px, env(safe-area-inset-bottom)));
  padding-bottom: max(16px, env(safe-area-inset-bottom)); }

/* ─────────────────────────────────────────────────────────────── THE FOCUS POP-UP */
/* One nutrient at a time from the dashboard (Thom, 14 Oct). */
#focus section[hidden] { display: none; }
.fx-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n k" "w w" "b b"; gap: 2px 10px;
  width: 100%; min-height: 0; padding: 12px 0; margin: 0; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; color: var(--ink); font-weight: 400; }
.fx-row:active { transform: none; }
.fx-row .fx-name { grid-area: n; font-weight: 800; }
.fx-row .fx-nums { grid-area: k; }
.fx-row .fx-nums small { color: var(--ink-2); }
.fx-row .fx-word { grid-area: w; font-size: 13px; color: var(--ink-2); }
.fx-row .track { grid-area: b; margin-top: 6px; }
.fx-group { margin-top: 18px; }
.fx-foot { text-align: center; margin-top: 16px; }
.fx-nav { display: flex; align-items: center; justify-content: space-between; margin: -6px 0 10px; }
.fx-nav .sw-back { margin: 0; }
.fx-arrow { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; background: var(--bg-2);
  color: var(--ink); border: 0; box-shadow: none; }
.fx-arrow:active { transform: none; }
.fx-hero { padding: 6px 0 14px; }
.fx-big { font-family: var(--hero); font-size: 44px; line-height: 1; }
.fx-big small { font-family: inherit; font-size: 18px; color: var(--ink-2); margin-left: 4px; }
.fx-state { margin: 6px 0 8px; font-weight: 800; }
.fx-why { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; }
.fx-list { margin: 0 0 6px; }
.fx-src, .fx-tip { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fx-sn { font-weight: 700; }
.fx-sn small, .fx-sa small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-2); }
.fx-sa { text-align: right; font-weight: 800; }
.fx-sa.plus { color: var(--ok); }
.fx-sbar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.fx-sbar i { display: block; height: 100%; background: var(--ink-2); border-radius: 4px; }
.fx-gap { float: right; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--ink-2); }
.fx-note { font-size: 13px; margin: 8px 0 0; }

/* ─────────────────────────────────────────────────────────────── THE ITEM CARDS */
/* The pantry as cards (Thom, 15 Oct): name with brand, when, macros, vitamins;
   Edit and Bin bottom right. */
.icards { display: grid; gap: 12px; margin: 12px 0 18px; }
.icard { background: var(--card); border-radius: 22px; padding: 16px 16px 10px; box-shadow: var(--slight);
  cursor: pointer; -webkit-tap-highlight-color: transparent; }
.icard.top { box-shadow: inset 0 0 0 2px var(--butter), var(--slight); }
.icard.off { opacity: .55; }
.ic-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ic-name { margin: 0; font-size: 17px; line-height: 1.25; font-weight: 800; font-family: inherit; letter-spacing: 0; text-transform: none; }
.ic-kcal { flex: 0 0 auto; font-family: var(--hero); font-size: 24px; line-height: 1; text-align: right; }
.ic-kcal small { display: block; font-family: inherit; font-size: 12px; color: var(--ink-2); }
.ic-when { margin: 4px 0 10px; font-size: 13px; color: var(--ink-2); }
.ic-focus { margin: -4px 0 10px; font-size: 14px; }
.ic-macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ic-macros span { background: var(--bg-2); border-radius: 12px; padding: 7px 8px; font-size: 11px; color: var(--ink-2); }
.ic-macros span.on { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.ic-macros b { display: block; font-size: 15px; color: var(--ink); }
.ic-vits { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 10px 0 0; font-size: 12px; color: var(--ink-2); }
.ic-vits span.on { color: var(--ink); font-weight: 800; }
.ic-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.ic-tags { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 6px; }
.ic-tags em { font-style: normal; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--bg-2); }
.ic-tags em.offender { background: var(--butter); color: var(--on-butter); }
.ic-btn { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; background: var(--bg-2);
  color: var(--ink); border: 0; box-shadow: none; display: grid; place-items: center; }
.ic-btn:active { transform: scale(.94); }
.ic-btn .ic { width: 19px; height: 19px; }
#itemwin [data-side][hidden], #itemwin [data-amount][hidden] { display: none; }
.iw-amount { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; font-weight: 800; }
.iw-amount span { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.iw-amount input { width: 110px; text-align: right; }

/* ─────────────────────────────────────────────────────────────── THE PICKER */
/* The drop-down from the food database (Thom, 15 Oct). */
.fp-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 4px; max-height: 300px; overflow: auto;
  background: var(--card); border-radius: 16px; box-shadow: 0 16px 36px -14px rgba(0, 0, 0, .35), 0 0 0 1px var(--line); }
.fp-item { display: block; width: 100%; min-height: 0; padding: 10px 14px; text-align: left; background: none; border: 0;
  border-radius: 0; box-shadow: none; color: var(--ink); font-weight: 400; border-bottom: 1px solid var(--line); }
.fp-item:last-child { border-bottom: 0; }
.fp-item:active, .fp-item.on { background: var(--bg-2); transform: none; }
.fp-item b { display: block; font-size: 15px; font-weight: 800; }
.fp-item small { display: block; font-size: 12px; color: var(--ink-2); }

/* ─────────────────────────────────────────────────────────────── THE BREAKDOWN (combos) */
.combo .cq { margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; background: var(--butter-soft); }
.cq-ask { margin: 0 0 8px; font-weight: 800; }
.cq-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.cq-opts button { min-height: 0; padding: 8px 12px; border-radius: 999px; background: var(--card); color: var(--ink);
  border: 0; box-shadow: none; font-size: 14px; font-weight: 800; }
.cq-opts button.on { background: var(--ink); color: var(--bg); }
.cparts { display: grid; gap: 8px; }
.cpart { padding: 10px 12px; border-radius: 16px; background: var(--bg-2); }
.cp-top { display: flex; gap: 8px; align-items: center; position: relative; }
.cp-name { flex: 1 1 auto; font-weight: 800; background: transparent; border: 0; padding: 4px 0; }
.cp-x { width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%; background: var(--card); color: var(--ink-2);
  border: 0; box-shadow: none; flex: 0 0 32px; }
.cp-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.cp-amt { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; }
.cp-amt input { width: 96px; text-align: right; }
.cp-kcal { font-family: var(--hero); font-size: 20px; }
.cp-kcal::after { content: " kcal"; font-family: var(--body); font-size: 12px; color: var(--ink-2); }
.cp-note { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.cp-add { position: relative; margin: 10px 0 14px; }
.ctotal { padding: 14px 0 6px; border-top: 1px solid var(--line); }
.ct-big { margin: 0 0 10px; }
.ct-big b { font-family: var(--hero); font-size: 36px; font-weight: 400; }
.ct-macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ct-macros span { background: var(--bg-2); border-radius: 12px; padding: 7px 8px; font-size: 11px; color: var(--ink-2); }
.ct-macros b { display: block; font-size: 15px; color: var(--ink); }
.ct-vits { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 10px 0 12px; font-size: 12px; color: var(--ink-2); }

/* ─────────────────────────────────────────────────────────────── THE REVIEW LIST (admin) */
.rv-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rv-row:last-child { border-bottom: 0; }
.rv-head { display: flex; justify-content: space-between; gap: 10px; }
.rv-name { font-weight: 800; color: var(--ink); text-decoration: none; }
.rv-k { white-space: nowrap; font-weight: 700; }
.rv-meta { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); word-break: break-word; }
.rv-why { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--over-ink); }
.rv-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.rv-acts form { margin: 0; }
.rv-fix { display: flex; gap: 6px; align-items: center; }
.rv-fix select, .rv-fix input { width: auto; min-width: 0; max-width: 130px; padding: 6px 8px; font-size: 14px; }
.card h2 small { font-family: var(--body); font-size: 13px; color: var(--ink-2); text-transform: none; letter-spacing: 0; }

/* the shop's week picker in the pop-up (16 Oct) */
.sw-pick { margin: 0 0 12px; padding: 8px 6px; border-radius: 16px; background: var(--butter-soft); }
.sw-wsub { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.sw-pick button.pk-arrow { min-height: 0; padding: 0; border: 0; box-shadow: none; background: transparent; color: var(--ink); }
.sw-pick button.pk-arrow:active { transform: none; background: var(--bg-2); }

/* a statement line you can change (16 Oct) */
[data-txn] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[data-txn]:active { opacity: .7; }
#txnwin [hidden] { display: none !important; }

/* PLANS (17 Oct): Now / Plan it on Eat out, and the did-it-happen card */
.sw-when { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: 999px; background: var(--bg-2); }
.sw-when label { position: relative; display: block; margin: 0; padding: 8px 0; text-align: center; border-radius: 999px;
  font-size: 14px; font-weight: 800; color: var(--ink-2); cursor: pointer; }
.sw-when label.on { background: var(--raise); color: var(--ink); box-shadow: var(--slight); }
.sw-when input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.sw-plandate { margin: -4px 0 12px; }
.sw-plandate[hidden] { display: none; }
.plan-ask { border: 2px solid var(--butter); }
.plan-q { margin: 4px 0 4px; font-size: 20px; }
.plan-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.plan-acts form { margin: 0; }

/* households: the joint account under your own number; the statement's switch */
.mhouse { display: block; margin-top: 10px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.mhouse b { color: var(--ink); }
.sw-switch a { display: grid; place-items: center; min-height: 40px; border-radius: 999px; color: var(--ink-2);
  font-size: 15px; font-weight: 800; text-decoration: none; }
.sw-switch a.on { background: var(--raise); color: var(--ink); box-shadow: var(--slight); }

/* member cards (Household profile, 17 Oct) */
.mhead { display: flex; align-items: center; gap: 12px; }
.mav { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--butter-soft); font-weight: 800; color: var(--ink); }
.mname { flex: 1 1 auto; min-width: 0; }
.mname b { display: block; font-size: 17px; }
.mname small { display: block; font-size: 13px; color: var(--ink-2); }
.mform [data-how][hidden] { display: none; }
.mhow { margin: 4px 0 8px; }
.mfacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mfacts:empty { display: none; }
.mfacts span { background: var(--bg-2); border-radius: 12px; padding: 7px 10px; font-size: 11px; color: var(--ink-2); }
.mfacts b { display: block; font-size: 15px; color: var(--ink); }
.mmeta { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.dash-switch { margin: 0 0 14px; }

/* whose line (Thom, 17 Oct): H for the house, initials for a person */
.li .av { position: relative; }
.who { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  font-weight: 800; font-size: 10px; line-height: 1; font-style: normal; letter-spacing: .02em;
  background: var(--card); color: var(--ink-2); box-shadow: 0 0 0 1.5px var(--line-2); }
.who.h { width: 20px; height: 20px; padding: 0; background: var(--ok); color: var(--card); box-shadow: 0 0 0 2px var(--card); }
.who.h .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.who.me { background: var(--ink); color: var(--card); box-shadow: 0 0 0 2px var(--card); }
.li .av .who { position: absolute; right: -4px; bottom: -4px; }
.srow .what .who { margin-right: 6px; vertical-align: 1px; }
/* the members filter within Household */
.whofilter { display: flex; gap: 6px; margin: -6px 0 14px; overflow-x: auto; scrollbar-width: none; }
.whofilter a { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px;
  color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line-2); text-decoration: none; }
.whofilter a.on { background: var(--ink); color: var(--card); box-shadow: none; }
.rtaway { display: flex; justify-content: space-between; align-items: center; font-weight: 700; text-decoration: none; color: var(--ink-2); }
/* who it's for, in the pop-ups: the same chips, as radios */
.forpick { margin: 0 0 12px; }
.forpick label { position: relative; flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px;
  color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line-2); cursor: pointer; }
.forpick input { position: absolute; opacity: 0; pointer-events: none; }
.forpick label:has(input:checked) { background: var(--ink); color: var(--card); box-shadow: none; }
.forpick label:has(input:focus-visible) { outline: 2px solid var(--ok); outline-offset: 2px; }
.whofilter.wraps { flex-wrap: wrap; overflow: visible; }  /* not .wrap: the wizard hides every .wrap child that is not the form */
.forpick label small { font-weight: 600; opacity: .7; margin-left: 2px; }
/* the health-data consent: its own box (COMPLIANCE.md section 4) */
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); font-weight: 500; }
.consent input { flex: 0 0 22px; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ok); }
.consent b { color: var(--ink); display: block; margin-bottom: 2px; }
/* the weight chart: the dots, and the trend the burn follows */
.wchart { width: 100%; height: auto; display: block; margin-top: 10px; }
.wchart polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wc-raw { stroke: var(--line-2); stroke-width: 1.5; }
.wc-trend { stroke: var(--ok); stroke-width: 3; }
.wc-dot { fill: var(--ink-2); }
/* the barcode scanner */
.scan-video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; background: #000; display: block; }
.scan-typed { display: flex; gap: 8px; }
.scan-typed input { flex: 1; min-width: 0; }
.scan-chips { margin-bottom: 10px; }
.scan-chips button { min-height: 38px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line-2); width: auto; }
.scan-g { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.scan-g span { display: inline-flex; align-items: center; gap: 6px; }
.scan-g input { width: 110px; }
.scan-g b { font-size: 18px; }
/* a row with a switch (Reminders) */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; margin: 0;
  font-weight: 600; color: var(--ink); }
.toggle-row + .toggle-row { border-top: 1px solid var(--line); }
.toggle-row input { appearance: none; -webkit-appearance: none; flex: 0 0 44px; width: 44px; height: 26px; margin: 0;
  border-radius: 13px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; }
.toggle-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--card); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle-row input:checked { background: var(--ok); }
.toggle-row input:checked::after { transform: translateX(18px); }
.toggle-row input:focus-visible { outline: 2px solid var(--ok); outline-offset: 2px; }

/* YOUR TARGETS (Thom, 19 Oct): daily and weekly, side by side */
.tgt { margin: 10px 0 4px; }
.tgt > div { display: grid; grid-template-columns: 1fr 84px 96px; align-items: baseline; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.tgt > div.tgt-h { border-top: 0; padding: 0 0 6px; }
.tgt-h b { font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.tgt span { font-weight: 700; color: var(--ink-2); }
.tgt b { text-align: right; font-weight: 900; color: var(--ink); }
.tgt-kcal b { font-family: var(--hero); font-weight: 400; font-size: 22px; }
/* the Change buttons on the numbers sums */
.card.sum { position: relative; }
.sum-change { position: absolute; top: 16px; right: 16px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line-2);
  font-size: 14px; font-weight: 800; color: var(--ink); text-decoration: none; background: var(--card); }

/* WHICH DAY in Eat out (Thom, 19 Oct): today, tomorrow, the days gone */
.sw-days { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding: 2px 0; scrollbar-width: none; }
.sw-days::-webkit-scrollbar { display: none; }
.sw-days label { position: relative; flex: 0 0 auto; margin: 0; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-2);
  font-size: 14px; font-weight: 800; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.sw-days label.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.sw-days input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

/* the week that closed itself (19 Oct) */
.missed { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(20, 16, 12, .5); }
.missed-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 22px; padding: 22px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.missed-card h2 { font-family: var(--hero); font-weight: 400; font-size: 28px; line-height: 1.05; margin: 0 0 10px; }
.missed-card p { color: var(--ink-2); margin: 0 0 10px; }
.missed-card form { margin-top: 16px; }

/* how many, on the check line (19 Oct) */
.qstep { display: inline-flex; align-items: center; gap: 4px; margin: -2px 0 10px 2px; }
.qstep button { min-height: 32px; width: 36px; padding: 0; margin: 0; border-radius: 999px; background: var(--card);
  color: var(--ink); border: 1.5px solid var(--line2, var(--line)); box-shadow: none; font-size: 18px; font-weight: 800; line-height: 1; }
.qstep [data-qty] { min-width: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* loaders carry data-src until shown (19 Oct) */
.loading img:not([src]), .reading img:not([src]) { visibility: hidden; }

/* the pantry: totals at the top, the pack on every card, how many in the sheet (19 Oct) */
.ptotals { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.ptotals b { color: var(--ink); font-weight: 800; }
.ic-pack { margin: 0 0 2px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.iw-qty { margin: 6px 0 10px; }
.iw-packsize { margin-left: 8px; color: var(--ink-2); font-size: 14px; }
.qr svg { border-radius: 10px; max-width: 180px; height: auto; }
