:root {
  --bg: #f7f3ec;
  --surface: #fffdf9;
  --surface-2: #f1ebe1;
  --ink: #1e1c19;
  --muted: #6f685e;
  --line: #e6dfd3;
  --accent: #0b7f57;      /* emerald */
  --accent-ink: #fff;
  --accent-soft: #eaf7f0;
  --accent-glow: rgb(11 127 87 / .3);
  --herb: #3b7022;        /* leaf green: done / checked */
  --bar: #0b7f57; --bar-ink: #fff; /* the top bar: the app's emerald */
  --herb-soft: #e4f0d8;
  --tomato: #b23a19;      /* secondary: must-rules, cook tag, protein */
  --tomato-soft: #fbe3da;
  --saffron: #c98a12;
  --saffron-soft: #f8ecd0;
  --sky: #2f6fa3;
  --sky-soft: #dceaf6;
  --plum: #8a3f74;
  --plum-soft: #f2dfeb;
  --danger: #b3261e;
  --shadow: 0 1px 2px rgb(60 40 20 / .06), 0 6px 24px rgb(60 40 20 / .06);
  --radius: 18px;
  --lane-label: 88px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151412; --surface: #1f1d1a; --surface-2: #2a2723; --ink: #f2ede4; --muted: #a59d90; --line: #36322c;
    --accent: #34c88f; --accent-ink: #052b1d; --accent-soft: #11352a; --accent-glow: rgb(52 200 143 / .25);
    --herb: #8ccf5e; --herb-soft: #22301a; --bar: #0b5c40; --bar-ink: #f2ede4; --tomato: #f06a43; --tomato-soft: #3d2219; --saffron: #e6b04a; --saffron-soft: #3a2f17;
    --sky: #6aaee6; --sky-soft: #172a3b; --plum: #d58bbf; --plum-soft: #35202f; --danger: #ff8a80;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151412; --surface: #1f1d1a; --surface-2: #2a2723; --ink: #f2ede4; --muted: #a59d90; --line: #36322c;
  --accent: #34c88f; --accent-ink: #052b1d; --accent-soft: #11352a; --accent-glow: rgb(52 200 143 / .25);
  --herb: #8ccf5e; --herb-soft: #22301a; --bar: #0b5c40; --bar-ink: #f2ede4; --tomato: #f06a43; --tomato-soft: #3d2219; --saffron: #e6b04a; --saffron-soft: #3a2f17;
  --sky: #6aaee6; --sky-soft: #172a3b; --plum: #d58bbf; --plum-soft: #35202f; --danger: #ff8a80; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, sans-serif; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; letter-spacing: -.01em; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(26px, 5vw, 36px); }
h2 { font-size: 20px; margin-bottom: 10px; }
h3 { font-size: 17px; }
h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 6px 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.grow { flex: 1; min-width: 0; }
.error { color: var(--danger); }

/* ---------- shell ---------- */
.app { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, calc((100vw - 980px) / 2)); background: var(--bar); color: var(--bar-ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bar-ink); font: 700 22px Fraunces, serif; }
/* The cooking show's first scene, small, in place of the logo: the three veggies bouncing. */
.brand-veg { flex: none; display: block; height: 36px; }
.brand-veg .sc { position: static; height: 100%; gap: 3px; padding: 0 0 2px; }
.brand-veg .sc-veg > span { --lift: -4px; }
.brand-veg .sc-veg > span:nth-child(2) { --lift: -3px; }
.brand-veg .sc-veg > span:nth-child(3) { --lift: -4px; }
.brand-veg .sc-veg img { width: 22px; height: 22px; }
/* Chips on the green bar: light outlines, so they read on it. */
.topbar .demo-chip { color: var(--bar-ink); border-color: color-mix(in srgb, var(--bar-ink) 70%, transparent); }
.topbar .demo-chip:hover { background: color-mix(in srgb, var(--bar-ink) 15%, transparent); }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.tabs button { border: 0; background: none; color: var(--muted); font: 600 14px Inter, sans-serif; padding: 8px 14px; border-radius: 999px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.ti { font-size: 15px; }
main { padding: 20px 16px 48px; max-width: 980px; margin: 0 auto; }
/* The console's tables use a wide screen (the app's pages stay a reading width). */
main:has(.page.admin) { max-width: 1280px; }

@media (max-width: 900px) {
  /* Phones, tablets and narrow windows: tabs move to a bar at the bottom (they don't fit the top bar).
     backdrop-filter would trap the fixed tab bar inside the header. */
  .topbar { padding: 10px 16px; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; border-radius: 0; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line); }
  .tabs button { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 12px; }
  .tabs button.on { box-shadow: none; background: var(--accent-soft); color: var(--accent); }
  .ti { font-size: 20px; }
  /* Just enough room for the tab bar fixed at the bottom. */
  main { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
}

.page { display: flex; flex-direction: column; gap: 16px; }
.page-head { margin: 8px 0 4px; }
.plan-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.plan-head > div:first-child { flex: 1 1 420px; }
.center { align-items: center; justify-content: center; min-height: 60vh; }

/* ---------- primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: 600 14px Inter, sans-serif; padding: 9px 16px; border-radius: 12px; cursor: pointer; white-space: nowrap;
  transition: transform .08s, background .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row > input, .row > select { flex: 1; min-width: 0; }

input, select, textarea {
  width: 100%; font: 15px Inter, sans-serif; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
/* Sliders: a green -> amber -> red track with a round thumb. */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; padding: 0; margin: 12px 0; border: 0; box-shadow: none;
  border-radius: 999px; background: linear-gradient(90deg, var(--herb), #e0a020 55%, var(--danger)); cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
input[type=range]::-moz-range-track { background: transparent; }
input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field > span:first-child { font-weight: 600; font-size: 14px; }
.field em { font-style: normal; font-weight: 400; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.span2 { grid-column: span 2; }
@media (max-width: 480px) { .span2 { grid-column: auto; } }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 999px; font: 600 14px Inter, sans-serif; cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { border: 1px dashed var(--line); background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 999px; font: 500 13px Inter, sans-serif; cursor: pointer; }
.chip.on { border-style: solid; border-color: var(--herb); background: var(--herb-soft); color: var(--herb); }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.pill.ghost { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.pill.live { background: var(--accent); color: var(--accent-ink); }
.s-must { background: var(--tomato-soft); color: var(--tomato); }
.s-prefer { background: var(--sky-soft); color: var(--sky); }
.s-avoid { background: var(--plum-soft); color: var(--plum); }
.t-assemble { background: var(--herb-soft); color: var(--herb); }
.t-reheat { background: var(--saffron-soft); color: var(--saffron); }
.t-hands { background: var(--sky-soft); color: var(--sky); }
.t-quick { background: var(--plum-soft); color: var(--plum); }
.t-cook { background: var(--tomato-soft); color: var(--tomato); }

.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.bar > div { height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s ease; }
.bar.thin { height: 6px; margin: 6px 0 0; }
.bar.protein > div { background: var(--tomato); }
.bar.carbs > div { background: var(--saffron); }
.bar.fat > div { background: var(--sky); }

.sticky-cta { position: sticky; bottom: 16px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; z-index: 5; padding-top: 4px; }
.sticky-cta .btn.lg { box-shadow: 0 8px 24px var(--accent-glow); }
.sticky-cta .small { background: var(--surface); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; }
@media (max-width: 900px) { .sticky-cta { bottom: 84px; } }

.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--saffron-soft); color: var(--ink); }
.prep-banner { background: var(--accent-soft); }

/* In-app notifications: at the top, under the top bar (away from the thumb), over dialogs too;
   the border says what kind it is. */
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 70px); transform: translate(-50%, -24px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 16px; border: 3px solid var(--accent); font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .35s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); animation: toast-in .35s cubic-bezier(.2, .8, .2, 1), toast-glow 1.1s ease-in-out .3s 2; }
.toast { --glow: var(--accent); }
.toast.warn { border-color: #e0a020; --glow: #e0a020; }
.toast.error { border-color: var(--danger); --glow: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -24px); } }
/* The border glows twice in its own colour, to catch the eye. */
@keyframes toast-glow {
  0%, 100% { box-shadow: 0 6px 20px rgba(0,0,0,.3), 0 0 0 0 transparent; }
  50% { box-shadow: 0 6px 20px rgba(0,0,0,.3), 0 0 14px 4px color-mix(in srgb, var(--glow) 70%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .toast.show { animation: none; } }
@media (max-width: 900px) { .toast { top: calc(env(safe-area-inset-top) + 64px); } }

/* ---------- welcome ---------- */
.hero { align-items: center; text-align: center; padding: 40px 0; max-width: 620px; margin: 0 auto; }
/* Each veggie bobs on its own clock (different speed, phase and tilt) so they never move in lockstep. */
.hero-art { font-size: 56px; display: flex; justify-content: center; gap: 14px; }
.hero-art img { display: block; width: 64px; height: 64px; }
.hero-art > span { display: inline-block; animation: bob 3s ease-in-out infinite; --tilt: -2deg; --lift: -6px; }
.hero-art > span:nth-child(1) { animation-duration: 2.6s; --tilt: -4deg; --lift: -7px; }
.hero-art > span:nth-child(2) { animation-duration: 3.4s; animation-delay: -1.1s; --tilt: 3deg; --lift: -5px; }
.hero-art > span:nth-child(3) { animation-duration: 2.9s; animation-delay: -2s; --tilt: -2deg; --lift: -8px; }
@keyframes bob { 50% { transform: translateY(var(--lift)) rotate(var(--tilt)); } }
.lead { font-size: 17px; color: var(--muted); }
.how { text-align: left; display: grid; gap: 10px; padding: 0; counter-reset: s; list-style: none; margin: 8px 0 16px; }
.how li { counter-increment: s; display: flex; gap: 12px; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.how li::before { content: counter(s); font: 700 18px Fraunces, serif; color: var(--accent); }

/* ---------- profile ---------- */
.targets { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 10px; margin: 14px 0; align-items: stretch; }
.target { background: var(--surface-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.target b { font: 700 22px Fraunces, serif; }
.target.big { background: var(--accent-soft); }
.target.big b { color: var(--accent); font-size: 28px; }
.target span { font-size: 12px; color: var(--muted); }
.span-all { grid-column: 1 / -1; margin: 0; }
@media (max-width: 520px) { .targets { grid-template-columns: 1fr 1fr; } }

.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.mode { text-align: left; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit; }
.mode b { font: 700 17px Fraunces, serif; }
.mode span { font-size: 13px; color: var(--muted); }
.mode.on { border-color: var(--accent); background: var(--accent-soft); }
/* Titles only (the guide explains them): side by side on phones too. */
.mode { align-items: center; text-align: center; justify-content: center; }

.prefs { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.prefs li { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--surface-2); border-radius: 12px; }
.pref-add { border-top: 1px solid var(--line); padding-top: 6px; }
.step-label { font-weight: 600; font-size: 14px; margin: 14px 0 8px; }
.pref-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 700px) { .pref-cats { grid-template-columns: 1fr 1fr; } }

/* containers: how many of each size (a cell each) */
.cell { position: relative; }
.cell-add { width: 60px; height: 44px; border-radius: 12px; border: 1.5px dashed var(--line); background: transparent; color: var(--muted); font: 700 16px Inter, sans-serif; cursor: pointer; }
.cell-add:hover { border-color: var(--accent); color: var(--accent); }
.cell.on .cell-add { border-style: solid; border-color: var(--herb); background: var(--herb-soft); color: var(--herb); }
.cell-minus { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1; cursor: pointer; padding: 0; }
@media (max-width: 420px) { .cell-add { width: 44px; height: 40px; } }

/* ---------- settings ---------- */
.provider { position: relative; text-align: left; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 14px; cursor: pointer; font: 600 14px Inter, sans-serif; }
.provider.active { border-color: var(--accent); background: var(--accent-soft); }
.dot { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border-radius: 50%; }
.dot.ok { background: var(--herb); box-shadow: 0 0 0 3px var(--herb-soft); }
.oauth { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 4px; }
.privacy { margin-top: 10px; font-size: 14px; }
.privacy summary { cursor: pointer; color: var(--muted); }

/* ---------- stepper ---------- */
.stepper { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px; box-shadow: var(--shadow); }
.step { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: none; color: var(--muted); font: 600 15px Inter, sans-serif; padding: 10px; border-radius: 999px; cursor: pointer; }
.step.done { color: var(--herb); }
.step.current { background: var(--ink); color: var(--bg); }
.step-ico { font-size: 16px; }

/* ---------- generating ---------- */
.gen { width: min(460px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 24px; }
.gen .bar { width: 100%; }
.pot span { display: inline-block; font-size: 64px; animation: simmer 1.4s ease-in-out infinite; }
@keyframes simmer { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-3px); } }
.raw { text-align: left; max-height: 240px; overflow: auto; font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 10px; white-space: pre-wrap; word-break: break-all; }

/* ---------- shop ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.section-head h2 { margin-bottom: 0; }
.aisle { font: 600 12px Inter, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; user-select: none; }
.checklist li:hover { background: var(--surface-2); }
.checklist li:has(> .item-row) { display: block; padding: 0; }
.checklist li:has(> .item-row):hover { background: none; }
.item-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 8px; }
.item-row:hover { background: var(--surface-2); }
.swap-line { display: block; color: var(--sky); margin-top: 2px; }
.swap-line s { color: var(--muted); }
.link { border: 0; background: none; color: var(--accent); font: 600 13px Inter, sans-serif; cursor: pointer; padding: 0 4px; text-decoration: underline; }
.miss-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 50%; cursor: pointer; }
.miss-btn:hover, li.open .miss-btn { border-color: var(--accent); color: var(--accent); }
.checklist li:last-child { border-bottom: 0; }
.checklist li.checked b { text-decoration: line-through; color: var(--muted); }
.box { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); color: #fff; font-size: 14px; font-weight: 700; background: var(--surface); cursor: pointer; padding: 0; }
.checked .box, .done > .box { background: var(--herb); border-color: var(--herb); }
.qty { flex: none; max-width: 38%; text-align: right; font-weight: 600; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- prep ---------- */
.timer { display: flex; align-items: center; gap: 6px; }
.timer b { font: 700 26px Fraunces, serif; color: var(--accent); font-variant-numeric: tabular-nums; }
.gantt { position: relative; margin: 14px 0 6px; display: grid; gap: 6px; }
.lane { display: grid; grid-template-columns: var(--lane-label) 1fr; align-items: center; }
.lane-name { font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.lane-track { position: relative; height: 18px; background: var(--surface-2); border-radius: 6px; }
.lane-track i { position: absolute; top: 2px; bottom: 2px; background: var(--load, var(--accent)); opacity: .9; border-radius: 4px; border: 1px solid var(--surface); }
.lane-track i.done { background: var(--muted); opacity: .45; }
.now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.timeline { list-style: none; padding: 0; margin: 14px 0 0; }
.timeline li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 8px; border-left: 2px solid var(--line); margin-left: 11px; padding-left: 0; position: relative; }
.timeline li > .box { margin-left: -13px; }
.timeline li.done b { text-decoration: line-through; color: var(--muted); }
.timeline li.live { background: var(--accent-soft); border-radius: 0 12px 12px 0; border-left-color: var(--accent); }
.t-time { flex: none; width: 52px; font: 700 15px Fraunces, serif; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
.t-time span { font: 500 11px Inter, sans-serif; color: var(--muted); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.cols > div { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 700px) { .cols { grid-template-columns: 1fr; } }
.containers { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.containers li { display: flex; gap: 12px; align-items: flex-start; }
.tag-box { flex: none; min-width: 52px; text-align: center; padding: 6px 8px; border-radius: 10px; background: var(--saffron-soft); color: var(--saffron); font-weight: 700; font-size: 13px; }
.plain { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* ---------- eat ---------- */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days button { position: relative; flex: 1 0 60px; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 14px; padding: 8px 6px; cursor: pointer; font: 500 12px Inter, sans-serif; }
.days button b { font: 700 20px Fraunces, serif; color: var(--ink); }
.days button.today { border-color: var(--accent); }
.days button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.days button.on b { color: var(--accent-ink); }
.days button i { position: absolute; top: 4px; right: 6px; font-style: normal; color: var(--herb); font-size: 11px; font-weight: 700; }
.days button.on i { color: var(--accent-ink); }
.macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 14px 18px; }
@media (max-width: 560px) { .macros { grid-template-columns: 1fr 1fr; } }
.macro-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); font-weight: 600; }
.macro-top b { color: var(--ink); font-size: 15px; }
.macro-top em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 12px; }
.defrost { background: var(--sky-soft); border-color: transparent; }
.defrost .checklist li { border-color: color-mix(in srgb, var(--sky) 20%, transparent); }
.meals { display: grid; gap: 12px; }
.meal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: opacity .2s; }
.meal.eaten { opacity: .65; }
.meal header { display: flex; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; }
.meal-slot { flex: none; display: flex; flex-direction: column; align-items: center; width: 48px; }
.meal-slot span { font-size: 26px; }
.meal-slot small { font-size: 11px; color: var(--muted); font-weight: 600; }
.meal h3 { margin: 0 0 6px; }
.meal-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.meal-body { padding: 0 16px 8px 78px; }
@media (max-width: 560px) { .meal-body { padding-left: 16px; } }
.steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.eat-btn { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; color: var(--muted); padding: 10px; font: 600 13px Inter, sans-serif; cursor: pointer; }
.eat-btn:hover { background: var(--surface-2); }
.eat-btn.on { color: var(--herb); background: var(--herb-soft); }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgb(20 15 10 / .45); display: grid; place-items: center; z-index: 40; padding: 16px; animation: fade .15s; }
.modal { width: min(560px, 100%); display: flex; flex-direction: column; gap: 10px; animation: pop .2s; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- history ---------- */
.hist-list { display: grid; gap: 12px; }
.hist-card { padding: 0; overflow: hidden; }
.hist-main { display: block; width: 100%; text-align: left; border: 0; background: none; color: inherit; font: inherit; padding: 18px 18px 10px; cursor: pointer; }
.hist-main:hover h2 { color: var(--accent); }
.hist-main h2 { margin: 0 0 4px; }
.hist-main .meal-meta { margin: 8px 0 4px; }
.hist-actions { padding: 0 18px 16px; }

.dish-line { color: var(--muted); margin: 6px 0 0; }
.pill.avoid { background: var(--accent-soft); color: var(--accent); }
.empty { text-align: center; padding: 32px 18px; }
.hist-day .meals { margin-bottom: 8px; }
.checklist.readonly li { cursor: default; }
.checklist.readonly li:hover { background: none; }
div.eat-btn { text-align: center; cursor: default; }
.timeline li > .t-time:first-child { margin-left: 16px; }
.base-banner { background: var(--accent-soft); justify-content: space-between; }

/* ---------- calendar & to-do integrations ---------- */
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 6px; }
.int-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: var(--bg); }
.int-card .row { width: 100%; }
.int-card p { margin: 0; }
.int-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.int-ico { font-size: 20px; }
.int-card .chips { margin: 0; }
code { font: 12px ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.int-group { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.int-group h3 { margin: 0 0 2px; font-size: 18px; }
.int-group > p { margin: 0 0 8px; }
.int-include { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 10px; }
.int-include .chip { padding: 5px 10px; }
.sync-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.sync-card p { margin: 2px 0 0; }
.sync-done { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--herb); font-weight: 600; padding: 0 4px; }
.sync-done .btn { margin-left: auto; }

/* ---------- prep cook mode ---------- */
.cook-status { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.cook-status.ok { background: var(--herb-soft); color: var(--herb); }
.cook-status.late { background: var(--saffron-soft); color: var(--saffron); }

.cook-list { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 8px; }
.cook-step { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.cook-step.running { border-color: var(--accent); background: var(--accent-soft); }
.cook-step.over { border-color: var(--tomato); background: var(--tomato-soft); }
.cook-step.blocked { opacity: .75; }
.cook-step.done b { text-decoration: line-through; color: var(--muted); }
.cook-step p { margin: 2px 0 0; }
.cook-step .bar { margin-top: 8px; }
.cook-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; text-align: right; }
.countdown { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.countdown b { font: 700 26px Fraunces, serif; font-variant-numeric: tabular-nums; color: var(--accent); }
.cook-step.over .countdown b { color: var(--tomato); }
.countdown span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.wait { color: var(--saffron); }
.cook-done summary { cursor: pointer; }
.lane-track i.running { background: var(--load, var(--accent)); opacity: 1; }
.lane-track i.ready { background: var(--load, var(--accent)); opacity: .45; }
.lane-track i.blocked { background: var(--muted); opacity: .35; }
@media (max-width: 560px) { .cook-step { flex-direction: column; align-items: stretch; } .cook-side { flex-direction: row; justify-content: space-between; align-items: center; } }
.confirm { width: min(420px, 100%); }
.confirm p { margin: 0 0 6px; font-size: 16px; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: var(--bg); }

/* ---------- AI connect ---------- */
.or-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px; border-radius: 16px; background: var(--accent-soft); }
.or-hero > div { flex: 1 1 280px; }
.or-hero .eyebrow { margin-bottom: 2px; }
.or-title { font: 700 20px Fraunces, serif; display: block; margin-bottom: 4px; }
.or-hero p { margin: 0; }
.key-details { margin-top: 12px; }
.key-details summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); padding: 6px 0; }
.key-details[open] summary { color: var(--ink); }
.key-details .seg { margin: 8px 0; }
.key-row { margin: 8px 0 4px; }
.demo-link { margin-top: 10px; padding: 0; font-weight: 500; }
.demo-note { margin: 0 0 12px; }
.ai-connected .int-head { margin-bottom: 4px; }
.ai-connect.compact .or-hero { background: transparent; padding: 0; }
.or-help { margin-top: 8px; }
.or-help summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.or-help ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; color: var(--muted); }

/* ---------- account & credits ---------- */
.gsi { min-height: 44px; display: flex; justify-content: center; }
/* Google renders its button in an iframe. On a dark page the iframe inherits
   color-scheme: dark and the browser fills it with an opaque white backdrop;
   forcing light keeps the iframe transparent around the pill. */
.gsi, .gsi iframe { color-scheme: light; background: transparent; }
.center-card { display: flex; justify-content: center; padding: 28px; }
.balance-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--accent-soft); border-color: transparent; }
.balance-card > div:first-child { display: flex; flex-direction: column; }
.balance { font: 700 44px Fraunces, serif; color: var(--accent); line-height: 1.1; }
.balance-sm { font: 700 22px Fraunces, serif; color: var(--accent); }
.price-list { display: grid; gap: 4px; min-width: 200px; }
.price-list div { display: flex; justify-content: space-between; gap: 16px; }

.ledger { list-style: none; padding: 0; margin: 0; display: grid; }
.ledger li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ledger li:last-child { border-bottom: 0; }
.plus { color: var(--herb); }
.minus { color: var(--tomato); }
.mise-on { padding: 14px; border-radius: 14px; background: var(--accent-soft); }
.mise-on p { margin: 4px 0 10px; }
.advanced { margin-top: 14px; }

/* ---------- admin console ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font: 700 26px Fraunces, serif; }
.table-wrap { overflow-x: auto; margin-top: 10px; }
/* A table wider than the card scrolls inside it: a shadow on the side with more columns says so
   (scroll shadows: the covers move with the content, the shadows stay with the box). */
.table-wrap {
  background:
    linear-gradient(to right, var(--surface), var(--surface)) left / 24px 100% no-repeat local,
    linear-gradient(to left, var(--surface), var(--surface)) right / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / .28), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / .28), transparent) right / 12px 100% no-repeat scroll;
}
@media (max-width: 640px) {
  /* Said above the table: under a long list nobody reaches it. */
  .card:has(> .table-wrap > .admin-table:not(.cost-table)) .table-wrap::before { content: 'Swipe sideways for more columns →'; display: block; font-size: 11px; color: var(--muted); padding: 0 2px 4px; position: sticky; left: 0; }
  /* Costs: each call as a small card (when, who, result, cost and margin all in view). */
  .cost-table thead { display: none; }
  .cost-table, .cost-table tbody { display: block; }
  .cost-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .cost-table td { border: 0; padding: 2px 0; white-space: normal; }
  .cost-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
  .admin-table td, .admin-table th { white-space: nowrap; }
  .admin-table td.wrap, .admin-table td .wrap { white-space: normal; }
}
.danger-zone { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table td input { max-width: 110px; padding: 6px 8px; }
.admin-table tr.click { cursor: pointer; }
.admin-table tr.click:hover td { background: var(--surface-2); }
.sample-banner { justify-content: space-between; }
.privacy-list { list-style: none; padding: 0; margin: 6px 0 12px; display: grid; gap: 12px; }
.privacy-list li { display: flex; gap: 12px; align-items: flex-start; }
.privacy-list li > span { font-size: 20px; line-height: 1.3; }
.privacy-list p { margin: 2px 0 0; }
.privacy-line { margin: 8px 0 0; color: var(--herb); }
.privacy-line .link { color: var(--herb); }
.int-alt { margin-top: 8px; }
.int-alt summary { cursor: pointer; }
.int-alt[open] summary { margin-bottom: 8px; }
/* Fluent emoji images (see js/lib.js): sized like the text around them. */
.emo { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.22em; object-fit: contain; }
.welcome-signin { text-align: left; display: grid; gap: 8px; justify-items: start; background: var(--surface); border: 1px solid var(--accent); border-radius: 16px; padding: 16px 18px; margin: 4px 0 18px; }
.welcome-signin p { margin: 0; }
.welcome-in { margin: 0 0 16px; }
.demo-chip { margin-right: auto; margin-left: 4px; border: 1px dashed var(--accent); background: transparent; color: var(--accent); border-radius: 999px; padding: 4px 10px; font: 600 13px Inter, sans-serif; cursor: pointer; white-space: nowrap; }
.demo-chip:hover { background: var(--surface); }
/* Our own "Continue with Google" for redirect sign-in, styled after Google's button. */
.g-btn { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px 0 14px; border-radius: 999px; border: 1px solid #dadce0; background: #fff; color: #1f1f1f; font: 500 15px Inter, Roboto, sans-serif; cursor: pointer; }
.g-btn:hover { background: #f8faff; }
/* The Profile tab's bust is dark grey: on the dark bar it nearly vanished. Lighter there. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) img.emo[alt="👤"] { filter: brightness(2.1) saturate(.7); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .g-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; } }
:root[data-theme="dark"] .g-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; }

/* ---- Phone layout fixes ---- */
/* Never let one wide element make the whole page scroll sideways (clip keeps position: sticky working). */
html, body { overflow-x: clip; }
/* Toasts size to their text instead of to half the screen. */
.toast { width: max-content; max-width: calc(100vw - 32px); text-align: center; }
/* Preference rules: long text wraps instead of pushing the page wider. */
.prefs li { flex-wrap: wrap; }
.prefs li .grow { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  /* Bottom bar: every tab gets an equal share, labels may wrap to two short lines. */
  .tabs { gap: 2px; padding-left: 4px; padding-right: 4px; }
  .tabs button { flex: 1 1 0; min-width: 0; padding: 6px 2px; text-align: center; line-height: 1.15; }
}
@media (max-width: 560px) {
  .pref-cats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  /* Container cells fit the card: they shrink with the screen. */
  .cell-add { width: 100%; min-width: 0; height: 38px; font-size: 14px; }
  .cell-minus { top: -5px; right: -4px; width: 18px; height: 18px; font-size: 12px; }
}

/* Numbers with their unit inside the box ("75 kg"). */
.unit-input { position: relative; display: block; flex: 1; min-width: 0; }
.unit-input input { width: 100%; padding-right: 3.2em; }
.unit-input .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
/* The small inline kind: a recipe line's grams, a step's minutes */
.unit-input.num { flex: none; display: inline-block; width: 92px; }
.unit-input.num input { padding-top: 6px; padding-bottom: 6px; padding-left: 8px; }
.unit-input.num .unit { right: 8px; }

/* While the phone keyboard is open, hide the bars pinned to the bottom so they don't cover the field. */
/* While typing, the bottom bar and the floating button slide away, and slide back afterwards. */
@media (max-width: 900px) {
  .tabs { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
  /* Away at once (the keyboard is coming up and moves the screen), back with a slide. */
  .kb-open .tabs { transform: translateY(110%); transition: none; }
}
.sticky-cta { transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s; animation: slide-up .35s cubic-bezier(.2, .8, .2, 1); }
@media (max-width: 900px) { .kb-open .sticky-cta { transform: translateY(160px); opacity: 0; pointer-events: none; transition: none; } }
@keyframes slide-up { from { transform: translateY(160px); opacity: 0; } }

/* ---- Cooking show while a plan is generated (js/views/week.js → CookingShow) ---- */
.cook-show { position: relative; width: 220px; height: 120px; overflow: hidden; margin-bottom: 4px; }
.sc-wrap { position: absolute; inset: 0; animation: scene-in .9s ease-in-out backwards, scene-out .8s ease-in-out 5.7s forwards; }
/* Two short animations, nothing in between: while a scene plays, its container is still, so the
   phone doesn't redraw the whole scene (through its fading) on every frame. */
@keyframes scene-in { from { transform: translateX(60%); opacity: 0; } }
@keyframes scene-out { to { transform: translateX(-60%); opacity: 0; } }
.sc { position: absolute; inset: 0; }
.sc img { position: absolute; }

/* 1. veggies bouncing at different speeds */
.sc-veg { display: flex; justify-content: center; align-items: flex-end; gap: 10px; padding-bottom: 14px; }
.sc-veg > span { display: block; animation: bob 3s ease-in-out infinite; --tilt: -4deg; --lift: -10px; }
.sc-veg img { position: static; display: block; width: 52px; height: 52px; }
.sc-veg > span:nth-child(2) { animation-duration: 3.6s; animation-delay: -1.2s; --tilt: 3deg; --lift: -8px; }
.sc-veg > span:nth-child(3) { animation-duration: 3.3s; animation-delay: -2.1s; --tilt: -3deg; --lift: -11px; }
@keyframes hop { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-12px) rotate(4deg); } }

/* 2. knife chopping, bits flying */
.sc-chop .board { width: 64px; height: 64px; left: 46px; bottom: 16px; transform: rotate(-20deg); }
.sc-chop .knife { width: 64px; height: 64px; left: 104px; bottom: 34px; transform-origin: 85% 85%; animation: chop 1.3s ease-in-out infinite; }
@keyframes chop { 0%, 100% { transform: rotate(-38deg) translateY(-8px); } 55% { transform: rotate(4deg) translateY(6px); } }
.sc-chop .bit { position: absolute; width: 9px; height: 7px; border-radius: 3px; background: #f08a24; left: 104px; bottom: 26px; animation: fly 2.6s ease-out infinite; opacity: 0; }
.sc-chop .b2 { animation-delay: .87s; background: #f6a24a; }
.sc-chop .b3 { animation-delay: 1.73s; background: #5fb27a; width: 7px; }
@keyframes fly { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(46px, -34px) rotate(200deg); } }

/* 3. into the pot, with steam */
.sc-pot .pot { width: 78px; height: 78px; left: 71px; bottom: 6px; animation: simmer 2.6s ease-in-out infinite; }
.sc-pot .steam { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); opacity: 0; bottom: 70px; left: 92px; animation: steam 3.6s ease-out infinite; }
.sc-pot .s2 { left: 108px; animation-delay: 1.2s; }
.sc-pot .s3 { left: 122px; animation-delay: 2.4s; }
@keyframes steam { 0% { opacity: .45; transform: translateY(0) scale(.6); } 100% { opacity: 0; transform: translateY(-46px) translateX(6px) scale(1.6); } }

/* 4. tossing the pan over a flame */
@keyframes flicker { from { transform: scale(.88, .92); } to { transform: scale(1.06, 1.12); } }

/* 6. plating up */
.sc-plate .plate { width: 84px; height: 84px; left: 68px; bottom: 8px; }
.sc-plate .salad { width: 54px; height: 54px; left: 83px; bottom: 30px; animation: land 6.5s ease-out both; }
@keyframes land { 0%, 15% { transform: translateY(-90px); opacity: 0; } 35% { transform: translateY(0); opacity: 1; } 42% { transform: translateY(-8px); } 50%, 100% { transform: translateY(0); } }
.sc-plate .spark { width: 22px; height: 22px; animation: twinkle 2.4s ease-in-out infinite; opacity: 0; }
.sc-plate .k1 { left: 56px; top: 14px; animation-delay: 1.8s; }
.sc-plate .k2 { left: 146px; top: 30px; animation-delay: 3s; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(30deg); } }

/* The elapsed time, big and steady. */
.gen-clock { font: 700 34px Inter, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .02em; margin: 2px 0 0; color: var(--ink); }
@media (max-width: 400px) { .tabs button { font-size: 10px; letter-spacing: -.01em; } }
.gen-credits { margin: 4px 0 0; font-weight: 600; color: var(--accent); }
/* Admin: section buttons wrap on phones; cost filters share a row. */
.admin .seg { flex-wrap: wrap; }
.cost-filters { margin-bottom: 12px; }
.cost-filters select, .cost-filters input { flex: 1 1 160px; width: auto; }
.nowrap { white-space: nowrap; }

/* 3. into the pot: veggies fall in front of it, sink in at the rim, and splash */
.sc-pot .pot { z-index: 1; }
.sc-pot .drop { position: absolute; width: 32px; height: 32px; left: 94px; top: -40px; z-index: 2; opacity: 0; animation: drop 3.2s ease-in infinite; }
.sc-pot .drop img { position: static; display: block; width: 32px; height: 32px; }
.sc-pot .d2 { left: 103px; animation-delay: 1.6s; }
@keyframes drop {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  58% { transform: translateY(78px) rotate(150deg) scale(1); opacity: 1; }
  74% { transform: translateY(92px) rotate(180deg) scale(.45); opacity: 0; }
  100% { transform: translateY(92px) scale(.45); opacity: 0; }
}
.sc-pot .splash { width: 34px; height: 34px; left: 93px; top: 30px; z-index: 3; opacity: 0; animation: splash 3.2s ease-out infinite; }
.sc-pot .p2 { left: 102px; animation-delay: 1.6s; }
@keyframes splash {
  0%, 56% { opacity: 0; transform: translateY(6px) scale(.3); }
  66% { opacity: 1; transform: translateY(-6px) scale(1.05); }
  84%, 100% { opacity: 0; transform: translateY(-12px) scale(1.2); }
}

/* Progress bar with no progress to show yet (the AI is thinking): a highlight sliding back and forth. */
.bar.indeterminate { position: relative; }
.bar.indeterminate > div { position: absolute; top: 0; bottom: 0; width: 35%; animation: indeterminate 1.8s ease-in-out infinite; }
@keyframes indeterminate { 0% { left: -35%; } 100% { left: 100%; } }
/* 4. tossing the pan over the flame (the pan's body is centred at 37% across, its rim at 84% down) */
.sc-pan .pan-toss { position: absolute; width: 76px; height: 76px; left: 72px; top: 4px; z-index: 1; transform-origin: 96% 50%; animation: toss 2.2s ease-in-out infinite; }
.sc-pan .pan { position: static; width: 100%; height: 100%; transform: rotate(-45deg); }
@keyframes toss { 0%, 100% { transform: rotate(0) translateY(0); } 35% { transform: rotate(9deg) translateY(-10px); } 60% { transform: rotate(-3deg) translateY(1px); } }
.sc-pan .fire { width: 46px; height: 46px; left: 77px; top: 56px; z-index: 0; transform-origin: 50% 90%; animation: flicker .9s ease-in-out infinite alternate; }
.confirm-title { margin: 0 0 4px; font: 700 18px Inter, sans-serif; line-height: 1.3; }
.confirm p { margin: 8px 0; }
/* History: reuse a past week */

/* Meal card chevron: an SVG centred in its box, so it turns on the spot. */
.chev { display: block; flex: none; color: var(--muted); transform-origin: 50% 50%; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.chev.up { transform: rotate(180deg); }

/* Page changes: the new page fades in and settles, instead of blinking in. */
.view { animation: view-in .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }

/* Dialog with a value to fill in (e.g. the start date when reusing a plan). */
.confirm-input { margin: 4px 0 2px; }

/* On/off switch (a styled checkbox with role="switch"). */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; margin: 0; padding: 0; border-radius: 999px; border: 0;
  background: var(--line); position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Bordered danger button (Delete), matching the other outlined buttons. */
.btn.danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }

/* ---- Wheel picker (js/picker.js) ---- */
.picker-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.picker-field svg { color: var(--muted); flex: none; }
.picker-field:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sheet-bg > .sheet { margin: auto; } /* centred, like the dialogs (the backdrop is a flex box) */
.sheet { width: min(420px, 100%); display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 16px; animation: pop .2s; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-head b { font-size: 16px; text-align: center; flex: 1; }
.sheet-clear { align-self: center; }
@media (max-width: 640px) {
  /* Phones: the sheet comes up from the bottom edge. */
  .sheet-bg { place-items: end center; padding: 0; }
  .sheet-bg > .sheet { margin: auto 0 0; }
  .sheet { width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); animation: sheet-up .25s cubic-bezier(.2, .8, .2, 1); }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
.wheels { display: flex; gap: 8px; }
.wheel { position: relative; flex: 1; }
.wheel-band { position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); border-radius: 12px; background: var(--accent-soft); pointer-events: none; }
.wheel-list { position: relative; height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.wheel-list::-webkit-scrollbar { display: none; }
.wheel-list:focus-visible { outline: none; }
.wheel:focus-within .wheel-band { box-shadow: inset 0 0 0 2px var(--accent); }
.wheel-item { height: 44px; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; font: 600 20px Inter, sans-serif;
  font-variant-numeric: tabular-nums; color: var(--muted); cursor: pointer; user-select: none; transition: color .15s, transform .15s; }
.wheel-item.on { color: var(--ink); transform: scale(1.08); }
.wheel-unit { font-size: 14px; font-weight: 500; margin-left: 4px; }
/* Wheels of words (activity, freezer size…): smaller type that may wrap to two lines. */
.wheel.text .wheel-item { font-size: 16px; font-weight: 600; line-height: 1.2; white-space: normal; text-align: center; padding: 0 12px; }
.wheel.text .wheel-item.on { transform: none; }
.picker-field span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-pick { flex: 1 1 160px; min-width: 0; }
.where-row input { flex: 1 1 auto; min-width: 0; }
.where-row .btn { flex: none; white-space: nowrap; }
@media (max-width: 420px) { .where-row { flex-wrap: wrap; } .where-row .btn { flex: 1 1 100%; } }
/* Admin -> Limits */
.limit-row { padding: 10px 0; border-top: 1px solid var(--line); }
.limit-row:first-of-type { border-top: 0; }
.limit-row p { margin: 4px 0 0; }
.limit-bar { margin: 8px 0 0; }
.limit-bar.ok > div { background: var(--herb); }
.limit-bar.warn > div { background: var(--saffron, #e0a020); }
.limit-bar.bad > div { background: var(--danger); }
.limit-pct { margin-left: 8px; }
/* Admin, Extension: each store's card and the status of each version */
.ext-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ext-head h2 { margin: 0; }
.ext-state.good { background: var(--accent-soft); color: var(--accent); }
.ext-state.warn { background: var(--saffron-soft); }
.ext-state.bad { color: var(--danger); }
.limit-pct.warn { background: var(--saffron-soft); }
.limit-pct.bad { color: var(--danger); }

/* Top bar between the bottom-bar layout and a wide window: the chip shrinks to its icon
   (full text on hover), and the tabs scroll inside their pill rather than run off screen. */
@media (min-width: 901px) {
  .topbar .tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .topbar .tabs::-webkit-scrollbar { display: none; }
  .topbar .tabs button { flex: none; white-space: nowrap; }
}
@media (max-width: 1100px) { .demo-chip .chip-text { display: none; } .demo-chip { padding: 4px 8px; } }
.brand, .demo-chip { flex: none; }

/* Wheel rows with a title and a smaller description (js/picker.js). */
.wheel.described .wheel-item { flex-direction: column; justify-content: center; gap: 2px; line-height: 1.15; }
.wheel-title { font-size: 16px; font-weight: 600; }
.wheel-desc { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.wheel-item.on .wheel-desc { color: var(--ink); opacity: .75; }

/* 3-stop slider with clickable labels under the stops (rule strictness). */
.stops { padding: 0 6px; }
.stops-labels { display: flex; justify-content: space-between; margin-top: -4px; }
.stops-labels button { border: 0; background: none; color: var(--muted); font: 600 13px Inter, sans-serif; padding: 4px 0; cursor: pointer; }
.stops-labels button.on { color: var(--ink); }

/* ---- Date picker (js/picker.js -> DateField) ---- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 6px; }
.cal-head b { font-size: 16px; text-transform: capitalize; }
.cal-nav { border: 0; background: var(--surface-2); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; text-transform: capitalize; }
.cal-day { border: 0; background: none; color: var(--ink); height: 42px; border-radius: 12px; font: 600 15px Inter, sans-serif; cursor: pointer; font-variant-numeric: tabular-nums; }
.cal-day:hover:not(:disabled) { background: var(--surface-2); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--line); }
.cal-day.on { background: var(--accent); color: var(--bg); }
.cal-day:disabled { color: var(--muted); opacity: .35; cursor: default; }
.cal-day.blank { visibility: hidden; }

/* Grocery rows: long names and quantities wrap inside their own column. */
.item-row > .grow { min-width: 0; overflow-wrap: anywhere; }

/* Prep while cooking: title, clock, progress and status stay at the top while scrolling the steps. */
.stage { display: flex; flex-direction: column; gap: 16px; }
.cook-head.pinned { position: sticky; top: 61px; z-index: 6; margin: -18px -18px 12px; padding: 14px 18px 10px; background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); box-shadow: 0 6px 12px -10px rgba(0,0,0,.4); }
.cook-head .cook-status { margin: 6px 0 0; }
@media (max-width: 900px) { .cook-head.pinned { top: 55px; } }
/* While a picker or calendar sheet is open, the floating button stays hidden (the sheet covers that area,
   and it would otherwise jump around while the phone keyboard closes). */
body:has(.sheet-bg) .sticky-cta { transform: translateY(160px); opacity: 0; pointer-events: none; }

/* While a plan is being written: a chip in the top bar on every other tab, leading back to it. */
.job-chip { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent-soft);
  color: var(--accent); border-radius: 999px; padding: 4px 10px 4px 6px; font: 600 13px Inter, sans-serif; cursor: pointer; white-space: nowrap; animation: chip-in .3s ease-out; }
.topbar .demo-chip:has(+ .job-chip) { margin-right: 0; }
/* Several chips (test mode, extended logs): side by side; only the last pushes the tabs right. */
.topbar .demo-chip:has(+ .demo-chip) { margin-right: 0; }
.topbar .demo-chip + .demo-chip { margin-left: -10px; } /* 6 px apart, not the bar's 16 px gap */
.job-chip .jp-time, .job-chip .jp-pct { font-variant-numeric: tabular-nums; }
.job-chip .jp-pct { color: var(--muted); }
.job-chip.ok { padding-left: 10px; }
.job-chip.bad { border-color: var(--danger); color: var(--danger); background: transparent; padding-left: 10px; }
.job-chip + .tabs { margin-left: 8px; }
.jp-ring { flex: none; width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); }
.jp-ring.spin { background: conic-gradient(var(--accent) 25%, var(--line) 0); animation: jp-spin 1s linear infinite; }
@keyframes jp-spin { to { transform: rotate(1turn); } }
@keyframes chip-in { from { opacity: 0; transform: scale(.85); } }

/* Chips fill each row evenly; the last row keeps close to its natural widths
   (the invisible ::after takes most of its spare room). */
.chips::after { content: ''; flex: 6 1 0; }
.chips > .chip { flex: 1 1 auto; text-align: center; }
/* Rule strictness: Must is the rigid end (red), Avoid the soft one (green). */
input[type=range].strict { background: linear-gradient(90deg, var(--danger), #e0a020 45%, var(--herb)); }
/* Date picker: the month title opens a month grid, its year a year grid. */
.cal-title { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--ink); font: 700 16px Inter, sans-serif;
  text-transform: capitalize; padding: 6px 10px; border-radius: 10px; cursor: pointer; }
.cal-title:hover { background: var(--surface-2); }
.cal-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0 8px; }
.cal-pick .cal-day { height: 52px; text-transform: capitalize; }
.cal-pick.years { grid-template-columns: repeat(4, 1fr); max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }

/* Prep: container names and contents wrap inside the card instead of widening the page. */
.containers li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tag-box { max-width: 45%; overflow-wrap: anywhere; }
/* Prep while cooking: the equipment bars ride in the pinned header, a little slimmer. */
.cook-head .gantt { margin: 8px 0 2px; gap: 4px; }
.cook-head .lane-track { height: 12px; }
.cook-head .section-head h2 { margin: 0; }
/* Moving pictures: each one gets its own layer, set up before it moves (Firefox for Android
   otherwise redraws some of them, like the garlic, on every frame and they freeze). */
.hero-art > span, .sc-veg > span, .sc-pot .drop, .sc-pan .pan-toss { will-change: transform; }
.cook-head.pinned .section-head { flex-wrap: nowrap; align-items: center; gap: 10px; }
.cook-head.pinned .section-head > div:first-child { min-width: 0; }
.cook-head.pinned .section-head p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 0; }
.cook-head.pinned .timer { flex: none; }
.round-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.round-btn:hover { color: var(--ink); background: var(--surface-2); }
/* Phones: each container in one column, its label above what goes in it, so every row lines up. */
@media (max-width: 700px) {
  .containers { gap: 14px; }
  .containers li { flex-direction: column; gap: 4px; }
  .containers li > div { width: 100%; }
  .tag-box { max-width: none; min-width: 0; }
}

/* Pay per use: a receipt (top-up breakdown, the cost of an AI action). */
.receipt { display: grid; gap: 6px; margin: 4px 0; }
.receipt > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.receipt dt { color: var(--muted); font-size: 14px; }
.receipt dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.receipt .total { border-top: 1px solid var(--line); padding-top: 6px; }
.receipt .total dd { color: var(--accent); font-size: 17px; }
.topup { display: flex; flex-direction: column; gap: 10px; }
.topup .chips { margin: 0; }
.topup .btn.lg { align-self: flex-start; }
.balance-card .span-all { flex-basis: 100%; margin: 0; }
.price-list > span { font-size: 12px; }

/* Dialogs scroll when they don't fit (e.g. with the keyboard up), centred when they do. */
.modal-bg { display: flex; overflow-y: auto; overscroll-behavior: contain; }
.modal-bg > .modal { margin: auto; flex: none; }
/* Receipts: the estimate before an AI action and the exact cost after it, on a paper slip. */
.ticket { --z: 7px; position: relative; background: #fffdf6; color: #2b2620; padding: calc(16px + var(--z)) 18px calc(16px + var(--z));
  font: 500 14px/1.45 ui-monospace, 'SFMono-Regular', 'Cascadia Mono', 'Roboto Mono', Menlo, monospace; font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) 51% repeat-x,
                conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--z)) 51% repeat-x;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) 51% repeat-x,
                conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--z)) 51% repeat-x; }
.ticket-head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px dashed #b9b1a3; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.ticket-head b { font-size: 16px; letter-spacing: .3em; }
.ticket-row { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; }
.ticket-row span { color: #6f685e; }
.ticket-row i { flex: 1; border-bottom: 1px dotted #b9b1a3; transform: translateY(-4px); min-width: 12px; }
.ticket-row b { font-weight: 600; text-align: right; }
.ticket-total { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #b9b1a3; font-size: 17px; font-weight: 700; text-transform: uppercase; }
.ticket-foot { margin: 10px 0 0; font-size: 12px; color: #6f685e; text-align: center; font-family: Inter, sans-serif; }
.ticket img.emo, .receipt img.emo { vertical-align: -0.15em; }

/* A picker field being typed into with the keyboard. */
.picker-field.typing { display: flex; align-items: center; gap: 8px; }
.picker-field.typing input { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; box-shadow: none; font: inherit; color: inherit; outline: none; }

.balance-sm.ok { color: var(--herb); }
.balance-sm.warn { color: var(--saffron); }
.balance-sm.bad { color: var(--danger); }

/* Containers by capacity: one tile per size. */
.sizes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
@media (max-width: 480px) { .sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.size { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.size-vol { font-size: 12px; font-weight: 600; color: var(--muted); }
.size .cell, .size .cell-add { width: 100%; }

.gen-push-msg { margin: 4px 0 0; color: var(--saffron); max-width: 380px; }

/* Settings: a newer version is waiting. */
.update-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-color: var(--accent); }
.update-card h2 { margin: 0 0 4px; }
.update-card p { margin: 0; }
.build-id { text-align: center; margin: 8px 0 0; }

/* Updating to a new version: covers the app until it reloads. */
.updating { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgb(20 15 10 / .55); animation: fade .2s; }
.updating-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 320px; padding: 24px 28px;
  background: var(--surface); color: var(--ink); border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.updating-box span:last-child { color: var(--muted); font-size: 14px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: jp-spin .8s linear infinite; }

/* Subpages: back (top left) and an optional action (top right). */

.build-id { cursor: pointer; }
.build-id.diag { font-family: ui-monospace, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }

/* Progress screen: the facts as small chips instead of sentences. */
.gen-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 2px 0 4px; }
.gen-facts span { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.gen-facts .gen-credits { color: var(--accent); }

/* An app, not a page: no double-tap zoom, and no text selection except where you type. */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* The bottom bar on its own layer: big scroll jumps used to repaint it half-drawn on Firefox for Android. */
@media (max-width: 900px) { .tabs { will-change: transform; backface-visibility: hidden; } }
/* Eat: the day's nutrition in two columns on narrow screens. */
@media (max-width: 420px) {
  .macros { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 12px 14px; }
  .macro-top { flex-wrap: wrap; gap: 0 6px; }
}
/* Each nutrition cell fills its grid row and keeps its bar at the bottom, so the bars of a row
   line up even when one label wraps onto two lines. */
.macro { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.macro .bar { margin-top: auto; }

/* Cooking show, more scenes. Moving pictures sit in a wrapper that moves; the picture stays still. */
.sc span { position: absolute; display: block; will-change: transform; }
.sc span img { position: static; display: block; width: 100%; height: 100%; }

/* The bouncing veggies are laid out in a row, not placed by hand like the other scenes' pictures. */
.sc-veg > span { position: relative; }

/* Stirring: the bowl rocks around its base, splashes fly off the rim */
.sc-stir .bowl { width: 88px; height: 88px; left: 66px; bottom: 4px; transform-origin: 50% 90%; animation: rock 1.4s ease-in-out infinite; }
@keyframes rock { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.sc-stir .splash-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #e9d8b0; left: 106px; top: 40px; opacity: 0; animation: splash-fly 1.4s ease-out infinite; }
.sc-stir .d2 { animation-delay: .47s; background: #f2b04e; }
.sc-stir .d3 { animation-delay: .93s; }
@keyframes splash-fly { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(var(--dx, 26px), -26px) scale(.6); } }
.sc-stir .d2 { --dx: -28px; }
.sc-stir .d3 { --dx: 8px; }

/* Shopping: the veggies land in the basket, behind the cart's front, and stay */
.sc-cart .cart { width: 92px; height: 92px; left: 64px; bottom: 2px; z-index: 2; animation: cart-bump 3.6s ease-out both; }
@keyframes cart-bump { 0%, 39%, 47%, 67%, 75%, 95%, 100% { transform: none; } 42%, 70%, 97% { transform: translateY(3px) rotate(-2deg); } }
.sc-cart .in { width: 30px; height: 30px; left: 96px; top: -36px; z-index: 1; animation: into-cart .9s cubic-bezier(.5, 0, .9, .6) .6s both; }
.sc-cart .i1 { left: 80px; animation-delay: 1.6s; }
.sc-cart .i2 { left: 112px; animation-delay: 2.6s; }
@keyframes into-cart { from { transform: translateY(0) rotate(0); opacity: 1; } to { transform: translateY(78px) rotate(160deg); opacity: 1; } }

.privacy-btn { margin: 4px 0 10px; }
.confirm .privacy-list { margin: 0; }

/* ---- Cooking show at a calmer pace: scenes last 8 s, everything moves ~1.4x slower ---- */
.sc-wrap { animation: scene-in 1.1s ease-in-out backwards, scene-out 1s ease-in-out 7s forwards; }
.sc-veg > span { animation-duration: 3.6s; }
.sc-veg > span:nth-child(2) { animation-duration: 4.2s; }
.sc-veg > span:nth-child(3) { animation-duration: 3.9s; }
.sc-chop .knife { animation-duration: 1.9s; }
.sc-chop .bit { animation-duration: 3.8s; }
.sc-chop .b2 { animation-delay: 1.27s; }
.sc-chop .b3 { animation-delay: 2.53s; }
.sc-pot .pot { animation-duration: 3.4s; }
.sc-pot .steam { animation-duration: 4.8s; }
.sc-pot .s2 { animation-delay: 1.6s; }
.sc-pot .s3 { animation-delay: 3.2s; }
.sc-pot .drop, .sc-pot .splash { animation-duration: 4.4s; }
.sc-pot .d2, .sc-pot .p2 { animation-delay: 2.2s; }
.sc-pan .pan-toss { animation-duration: 3s; }
.sc-pan .fire { animation-duration: 1.2s; }
.sc-plate .salad { animation-duration: 8s; }
.sc-plate .spark { animation-duration: 3.2s; }
.sc-stir .bowl, .sc-stir .splash-dot { animation-duration: 2.2s; }
.sc-stir .d2 { animation-delay: .73s; }
.sc-stir .d3 { animation-delay: 1.47s; }

/* Shopping, slower: each veggie takes 1.4 s to fall, 1.6 s apart; the cart bumps as each lands */
.sc-cart .cart { animation: cart-bumps 5.6s ease-out both; }
@keyframes cart-bumps { 0%, 40%, 47%, 68%, 75%, 96%, 100% { transform: none; } 43%, 71%, 98% { transform: translateY(3px) rotate(-2deg); } }
.sc-cart .in { animation: into-cart 1.4s cubic-bezier(.45, 0, .8, .5) 1s both; }
.sc-cart .i1 { animation-delay: 2.6s; }
.sc-cart .i2 { animation-delay: 4.2s; }

/* Portioning: closed jars pop into a row, each with a sparkle */
.sc-jars .jar { width: 44px; height: 44px; bottom: 8px; animation: jar-pop 1s cubic-bezier(.3, 1.6, .5, 1) both; }
.sc-jars .j0 { left: 44px; animation-delay: 1s; }
.sc-jars .j1 { left: 88px; animation-delay: 2.5s; }
.sc-jars .j2 { left: 132px; animation-delay: 4s; }
@keyframes jar-pop { from { opacity: 0; transform: translateY(18px) scale(.3); } }
.sc-jars .jar-spark { width: 18px; height: 18px; bottom: 50px; opacity: 0; animation: jar-spark 1.4s ease-out both; }
.sc-jars .s0 { left: 70px; animation-delay: 1.6s; }
.sc-jars .s1 { left: 114px; animation-delay: 3.1s; }
.sc-jars .s2 { left: 158px; animation-delay: 4.6s; }
@keyframes jar-spark { 0% { opacity: 0; transform: scale(.3) rotate(0); } 40% { opacity: 1; transform: scale(1.1) rotate(25deg); } 100% { opacity: 0; transform: scale(.8) rotate(45deg); } }

/* Storing: the open fridge picture, frost drifting out of it */
.sc-fridge .fridge { width: 80px; height: 80px; left: 70px; bottom: 4px; }
.sc-fridge .frost { width: 16px; height: 16px; left: 104px; bottom: 44px; opacity: 0; animation: frost-out 3.4s ease-out infinite; }
.sc-fridge .f0 { animation-delay: .6s; --fx: 46px; --fy: -30px; }
.sc-fridge .f1 { animation-delay: 1.3s; --fx: 58px; --fy: 4px; width: 12px; height: 12px; }
.sc-fridge .f2 { animation-delay: 2s; --fx: 36px; --fy: -46px; width: 14px; height: 14px; }
.sc-fridge .f3 { animation-delay: 2.7s; --fx: 62px; --fy: -14px; }
.sc-fridge .f4 { animation-delay: 3.4s; --fx: 48px; --fy: 18px; width: 12px; height: 12px; }
@keyframes frost-out { 0% { opacity: 0; transform: translate(0, 0) rotate(0) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--fx), var(--fy)) rotate(160deg) scale(1); } }

/* Washing up: the sponge scrubs back and forth over the pan, bubbles float up */
.sc-wash .pan-wash { width: 80px; height: 80px; left: 70px; bottom: 4px; }
.sc-wash .sponge { width: 40px; height: 40px; left: 86px; bottom: 34px; animation: scrub 1.6s ease-in-out infinite; }
@keyframes scrub { 0%, 100% { transform: translate(-12px, 2px) rotate(-10deg); } 50% { transform: translate(12px, -2px) rotate(8deg); } }
.sc-wash .bubble { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(190, 225, 255, .9);
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .8), rgba(170, 215, 255, .25)); left: 100px; bottom: 50px; opacity: 0; animation: bubble-up 3.2s ease-out infinite; }
.sc-wash .u1 { left: 84px; animation-delay: .8s; width: 8px; height: 8px; }
.sc-wash .u2 { left: 118px; animation-delay: 1.6s; width: 12px; height: 12px; }
.sc-wash .u3 { left: 108px; animation-delay: 2.4s; width: 7px; height: 7px; }
@keyframes bubble-up { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -60px) scale(1.1); } }
.sc-fridge .frost img { filter: drop-shadow(0 0 3px rgba(255, 255, 255, .8)); }

/* Jars and fridge bob gently like the other scenes: the pop/placement is on the outer wrapper,
   the bob on the inner one, so the two movements don't fight over the same transform. */
.sc .bobber { position: relative; width: 100%; height: 100%; animation: bob 3.4s ease-in-out infinite; --tilt: -3deg; --lift: -5px; }
.sc-jars .j1 .bobber { animation-duration: 3.9s; animation-delay: -1.2s; --tilt: 3deg; }
.sc-jars .j2 .bobber { animation-duration: 3.6s; animation-delay: -2.1s; --lift: -6px; }
.sc-fridge .fridge .bobber { --tilt: -2deg; --lift: -4px; animation-duration: 3.8s; }
/* Jars pop in over the whole scene (not all in the first half), sparkles keep twinkling. */
.sc-jars .j0 { animation-delay: 1.2s; }
.sc-jars .j1 { animation-delay: 3.2s; }
.sc-jars .j2 { animation-delay: 5.2s; }
.sc-jars .jar-spark { animation: jar-spark 2.6s ease-out infinite backwards; }
.sc-jars .s0 { animation-delay: 1.8s; }
.sc-jars .s1 { animation-delay: 3.8s; }
.sc-jars .s2 { animation-delay: 5.8s; }

/* Plate and washing-up bob too: the plate and what's on it share one wrapper (a div, so the
   pictures inside keep their own placement), which bobs gently. */
.sc .group { position: absolute; inset: 0; }
.sc-plate .bobber, .sc-wash .bobber { --tilt: -2deg; --lift: -4px; animation-duration: 3.8s; }

.gen-actions { justify-content: center; gap: 8px; margin-top: 4px; }

/* Swipe through the cooking show: horizontal swipes are ours, vertical ones still scroll the page.
   Swiping right brings the previous scene in from the left. */
.cook-show { touch-action: pan-y; cursor: grab; }
.sc-wrap.back { animation: scene-in-back 1.1s ease-in-out backwards, scene-out 1s ease-in-out 7s forwards; }
@keyframes scene-in-back { from { transform: translateX(-60%); opacity: 0; } }

/* A swiped-away scene slides out slowly the way it was pushed, still playing. */
.sc-wrap.leaving { animation: scene-out-left 1s ease-in-out forwards; }
.sc-wrap.leaving.right { animation-name: scene-out-right; }
@keyframes scene-out-left { to { transform: translateX(-60%); opacity: 0; } }
@keyframes scene-out-right { to { transform: translateX(60%); opacity: 0; } }

/* Cart and chopping bob too (each scene's pictures move together). */
.sc-cart .bobber, .sc-chop .bobber { --tilt: -2deg; --lift: -4px; animation-duration: 3.6s; }

/* Meals: what to take from each prepped container */
.take li { margin-bottom: 8px; }
.take li .small { display: block; }

/* Profile: adding custom equipment, with how it behaves during prep */
.eq-add { display: grid; gap: 12px; }
.chip.add { border-style: dashed; }
.mode-cards.two { grid-template-columns: 1fr 1fr; }
.eq-jobs { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.eq-jobs span { flex: 1; font-weight: 600; font-size: 14px; color: var(--ink); }
.eq-jobs b { min-width: 1.5em; text-align: center; }

/* Prep: what doesn't add up in the plan (too few boxes, a freezer box spread too far…) */
.warn-card { border-color: color-mix(in srgb, #e0a020 60%, transparent); display: grid; gap: 6px; }
.warn-card p { margin: 0; }

/* Eat: the day bar stays under the top bar while scrolling the meals */
.stage > .days { position: sticky; top: 61px; z-index: 6; margin: 0 -4px; padding: 6px 4px 8px; background: var(--bg);
  box-shadow: 0 6px 12px -10px rgba(0,0,0,.4); } /* like the prep head pinned while cooking */
@media (max-width: 900px) { .stage > .days { top: 55px; } }
/* The meal that's due now */
.meal.due { border-color: var(--accent); }

/* Profile: the day's meals */
.meal-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.meal-list li { display: flex; align-items: center; gap: 6px; }
.meal-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.meal-ico { font-size: 20px; }
.meal-share { display: flex; flex-direction: column; align-items: flex-end; }
.pin { border: 0; background: none; font-size: 16px; cursor: pointer; padding: 6px; }
.meal-dialog { display: grid; gap: 12px; }

/* Profile: a ready-made day at a glance (one column per meal) */
.glance-wrap { container-type: inline-size; }
/* One row while each square has room (~66 px); otherwise two even rows. */
.day-glance { display: grid; gap: 4px; margin-top: 4px; grid-template-columns: repeat(var(--cols), 1fr); --cols: 4; }
.day-glance.n1 { --cols: 1; } .day-glance.n2 { --cols: 2; } .day-glance.n3 { --cols: 3; } .day-glance.n5 { --cols: 5; } .day-glance.n6 { --cols: 6; }
@container (max-width: 345px) { .day-glance.n5, .day-glance.n6 { --cols: 3; } }
@container (max-width: 415px) { .day-glance.n6 { --cols: 3; } }
@container (max-width: 275px) { .day-glance.n4 { --cols: 2; } }
.day-glance > * { position: relative; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 1px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); min-width: 0; }
.day-glance span { font-size: 20px; }
.day-glance em { font-style: normal; font-size: 10.5px; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: break-word; max-width: 100%; }
.day-glance b { font-size: 13px; }
.day-glance small { color: var(--muted); font-size: 12px; }

/* Meal dialog: precision split, the app's slider (thin track, round handles) in three colours */
.macro-split { position: relative; height: 12px; margin: 2px 0 6px; touch-action: none; user-select: none; }
.macro-split.editable { height: 28px; margin: 2px 0 6px; }
.macro-split .track { position: absolute; left: 0; right: 0; top: 2px; height: 8px; display: flex; border-radius: 999px; overflow: hidden; }
.macro-split.editable .track { top: 10px; }
.macro-split .track i { display: block; height: 100%; }
.macro-split .p, .macro-legend .dot.p { background: var(--tomato); }
.macro-split .c, .macro-legend .dot.c { background: var(--saffron); }
.macro-split .f, .macro-legend .dot.f { background: var(--sky); }
.macro-split .thumb { position: absolute; top: 2px; width: 24px; height: 24px; margin-left: -12px; padding: 0; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: ew-resize; touch-action: none; }
.macro-split .thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.macro-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 4px; }
.macro-legend .part { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.macro-legend .part.c { align-items: center; text-align: center; }
.macro-legend .part.f { align-items: flex-end; text-align: right; }
.macro-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.precision-row { margin: 4px 0 12px; }
.macro-tag { display: block; }
.day-totals { margin: 8px 0 0; display: grid; gap: 4px; }
.day-totals p { margin: 0; color: var(--muted); }
.day-totals .off { color: var(--danger); font-weight: 600; }
.day-totals p.warn-line { color: var(--danger); }
.warn-line { margin: 0; color: var(--danger); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Profile: a type of day for each weekday */
.week-days { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 14px; }
.week-days > li { display: grid; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.week-days > li:last-child { border-bottom: 0; padding-bottom: 0; }
.week-day-head { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; }
.week-day-head > span { font-weight: 600; font-size: 14px; }
.day-editor { display: grid; gap: 2px; }
.day-editor > .chip.add { justify-self: start; }

/* Controls that can't move right now: greyed out (touching them explains why). */
input[type=range].locked { filter: grayscale(1); opacity: .45; cursor: not-allowed; }
.macro-split .thumb.stuck { border-color: var(--muted); background: var(--surface-2); box-shadow: none; opacity: .7; cursor: not-allowed; }

/* Profile: diet and allergies, a type then an item (or typed) */
/* Three columns: type, detail, button. Fits a phone: the two pickers share the width. */
.restr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px 8px; align-items: center; }
.restr-grid > * { min-width: 0; }
.restr-grid .restr-type, .restr-grid .restr-item { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; overflow-wrap: anywhere; }
.restr-grid .restr-type { font-weight: 600; }
.restr-grid .restr-type.strict { box-shadow: inset 3px 0 0 var(--danger); }
.restr-grid > input { width: 100%; }
.restr-grid .round-btn { justify-self: center; }
.restr-grid .round-btn.add { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 20px; }
.restr-grid .round-btn.remove { color: var(--danger); font-size: 20px; }
.restr-grid .round-btn:disabled { opacity: .4; }
/* Compact pickers in the grid: text wraps instead of being cut off on a phone. */
.restr-grid .picker-field { padding: 8px 8px 8px 10px; gap: 4px; min-height: 45px; }
.restr-grid .picker-field span { white-space: normal; line-height: 1.2; font-size: 14px; text-align: left; }
.restr-grid .picker-field svg { width: 14px; height: 14px; }
.picker-field:disabled { opacity: .55; cursor: not-allowed; }

/* Plan: what may break an allergy, intolerance or diet */
.restr-card { border: 2px solid var(--danger); display: grid; gap: 6px; }
.restr-card h3 { margin: 0; }
.restr-card p { margin: 0; }
.label-check { color: #b07a10; white-space: nowrap; }

/* A diet not allowed at the user's age: struck through, explained below the grid */
.restr-grid .blocked { text-decoration: line-through; opacity: .6; }

/* Side-by-side fields share their rows (title, control, note), so the controls line up even
   when one title or note wraps. Spacing is margins, so a field without a note adds nothing. */
.grid > .field { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.grid > .field > :first-child { align-self: end; margin-bottom: 6px; }
.grid > .field > :nth-child(3 of :not(.modal-bg)) { margin-top: 6px; align-self: start; }
/* A picker's sheet opens inside its field: keep it full screen, outside those rows. */
.grid > .field > .modal-bg { align-self: stretch; justify-self: stretch; margin: 0; }
.grid > .field > input[type=range] { align-self: center; }

/* Text inputs and picker fields are the same height (the pickers' line height). */
input:not([type=range]):not([type=checkbox]):not([type=radio]), select { line-height: 1.5; }
/* A button beside an input (use my location, add…) is as tall as the input. */
.row:has(> input) > .btn { min-height: 45px; }

/* Admin: extended logs count and download */
.ext-row { gap: 10px; align-items: center; justify-content: space-between; }

/* Where a meal is eaten: the overview's squares open it; a badge marks packed / provided ones */
.day-glance > .glance-meal:hover { border-color: var(--accent); }
.day-glance > .glance-meal.packed, .day-glance > .glance-meal.out { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.place-badge { position: absolute; top: 3px; right: 4px; font-style: normal; font-size: 13px; line-height: 1; }

.place-cards .mode { padding: 10px 6px; min-width: 0; }
.place-cards .mode b { font-size: 15px; overflow-wrap: anywhere; } /* three side by side: the longer names wrap, the dialog stays on screen */
.mode-cards > .mode { min-width: 0; }
.pill.place { background: var(--accent-soft); color: var(--accent); }
.place-guide { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }

/* Profile: the disabled button listing what's missing wraps instead of running off the screen */
.sticky-cta .missing-cta { white-space: normal; max-width: min(560px, 100%); text-align: center; font-size: 14px; padding: 9px 16px; opacity: .92; }
.sticky-cta .missing-cta::after { content: ' ↓'; }
.field.flash, .missing.flash { animation: flash-field 1.2s ease; border-radius: 12px; }
@keyframes flash-field { 0%, 60% { box-shadow: 0 0 0 3px var(--accent-glow); } 100% { box-shadow: none; } }

/* Profile: a required field still empty is red until it's filled in (its title too) */
.field.missing > span:first-child { color: var(--danger); }
.field.missing .picker-field, .field.missing select, .field.missing input:not([type=checkbox]):not([type=range]), .field.missing textarea, textarea.missing
  { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.chips.missing .chip:not(.add), .sizes.missing .cell-add { border-color: var(--danger); }
/* A required group still empty (equipment, containers): said in words, and the group outlined. */
.need-line { color: var(--danger); font-weight: 600; margin: -4px 0 8px; }
.need-line::before { content: '⚠️ '; }
.chips.missing, .sizes.missing { outline: 2px solid color-mix(in srgb, var(--danger) 55%, transparent); outline-offset: 6px; border-radius: 12px; }
/* While you're typing in a required field it's no longer "wrong": the usual focus colour, not red. */
.field.missing:focus-within > span:first-child { color: var(--accent); }
.field.missing input:not([type=checkbox]):not([type=range]):focus, .field.missing select:focus, .field.missing textarea:focus, textarea.missing:focus
  { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Family plans: who's eating (Profile), each person's kcal on a meal, their portion, their day */
.people { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.person-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: inherit; font: inherit; text-align: left; }
button.person-row { cursor: pointer; }
button.person-row:hover { border-color: var(--accent); }
.who-emoji { font-size: 22px; line-height: 1; }
.person-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.who-kcal { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; }
.who-kcal i { font-style: normal; margin-right: 3px; }
.who-name { margin-right: 2px; }
@media (max-width: 560px) { .who-name { display: none; } }
.portion { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.portion.common { border-top: 0; padding-top: 0; margin-top: 0; }
.portion-head { margin: 0 0 6px; display: flex; flex-direction: column; gap: 2px; }
.portion-head b { font-size: 15px; }
.portion-head i { font-style: normal; }
.portion > p { margin: 0 0 4px; }
.macros.family { grid-template-columns: auto repeat(4, minmax(0, 1fr)); gap: 6px 12px; align-items: center; }
.macros.family .macro-head { font-size: 12px; color: var(--muted); }
.macros.family .macro b { font-size: 13px; }
.macros.family .macro em { font-style: normal; color: var(--muted); font-weight: 400; }
@media (max-width: 560px) { .macros.family { grid-template-columns: auto repeat(4, minmax(0, 1fr)); padding: 12px 12px; gap: 6px 8px; } .macros.family .macro em { display: block; } }

/* A person's icon: a grid of faces in the picker sheet */
.emoji-field > span { font-size: 20px; line-height: 1; }
.sheet-spacer { width: 64px; flex: none; } /* balances Cancel so the title stays centred */
.emoji-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 6px 0 4px; }
.emoji-grid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; font-size: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--ink); cursor: pointer; padding: 6px 2px; }
.emoji-grid button small { font-size: 11px; line-height: 1.2; color: var(--muted); text-align: center; }
.emoji-grid button:hover { border-color: var(--accent); }
.emoji-grid button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.emoji-grid .emo { width: 30px; height: 30px; }

/* Standing preferences: the rule and its Add button stay on one line, the button no wider than its text */
.rule-row { flex-wrap: nowrap; }
.rule-row input { flex: 1 1 auto; min-width: 0; width: auto; }
.rule-row .btn { flex: none; white-space: nowrap; }
/* Foods: the search takes the whole line when the buttons would squeeze it; they go below. */
.food-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.food-tools input { flex: 1 1 260px; min-width: 0; }
.food-tools .btn { flex: none; white-space: nowrap; }

/* Shopping list: the progress stays under the top bar while scrolling (like the day picker);
   ticked items go to the bottom of the list. */
.shop-progress { position: sticky; top: 61px; z-index: 4; margin: 6px -18px 0; padding: 6px 18px 10px; background: var(--surface); }
.shop-progress p { margin: 0 0 6px; }
@media (max-width: 900px) { .shop-progress { top: 55px; } }

/* Family: someone's own schedule inside their dialog; who eats a meal together (emojis) */
.own-schedule { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.with-who { font-style: normal; font-size: 12px; line-height: 1; letter-spacing: 1px; }
.day-glance .with-who { position: absolute; top: 3px; left: 4px; }
.meal-row .with-who { margin-right: 6px; }
/* Right under the time picker, so no title: the others' times for that meal */
.together-hint { display: grid; gap: 6px; margin: -2px 0 6px; }
.together-hint .row { gap: 6px; }

/* Admin → Foods */
.food-numbers { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.pill.warn { background: color-mix(in srgb, #e0a020 25%, transparent); color: #b07a10; }
.food-quote { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; }
.food-labels { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.lookup-wait { text-align: center; padding: 8px 0 4px; }
.lookup-wait .pot span { font-size: 44px; }
.lookup-wait p { margin: 4px 0; }
.lookup-recap p { margin: 0 0 8px; overflow-wrap: anywhere; }
.lookup-recap .ok-line { color: var(--herb); }
.lookup-steps { max-height: 220px; overflow: auto; text-align: left; }
.lookup-retry { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.lookup-retry p { margin: 0 0 8px; }
/* Admin -> Foods -> Lookups: running and recent lookups. */
.lookup-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; }
.lookup-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lookup-list li:last-child { border-bottom: 0; }
.lookup-list .lookup-what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lookup-list .btn { flex: none; padding: 6px 12px; font-size: 13px; }

/* Admin -> Recipes: an ingredient line, a step, the ingredient search. */
.recipe-line, .recipe-step { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.recipe-line .line-head, .recipe-step .line-head { display: flex; align-items: flex-start; gap: 8px; }
.recipe-step .step-no { padding-top: 6px; }
.recipe-step .chips { gap: 6px; }
.line-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.recipe-line .note { width: 100%; padding: 6px 8px; font-size: 13px; }
.recipe-step textarea { width: 100%; min-width: 0; }
input.num { flex: none; width: 72px; padding: 6px 8px; }
.row > input.num { flex: none; }
.ingredient-picker { position: relative; margin-top: 8px; }
.ingredient-picker input { width: 100%; }
.picker-hits { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.picker-hits button { width: 100%; text-align: left; background: none; border: 0; padding: 8px; border-radius: 8px; color: var(--ink); cursor: pointer; font: inherit; }
.picker-hits button:hover { background: var(--surface-2); }

/* MultiSelectField (picker.js): a list to tick in the sheet. */
.multi-list { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain; }
.multi-list button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 6px; color: var(--ink); font: inherit; cursor: pointer; }
.multi-list button.on .multi-title { font-weight: 600; }
.multi-check { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.multi-list button.on .multi-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.multi-title { display: block; }
.multi-desc { display: block; font-size: 12px; color: var(--muted); }
.chip:disabled { opacity: .4; cursor: default; }

/* Admin home, like a phone's settings: the month at a glance, then the sections as grouped rows. */
.admin-glance { padding: 12px 14px; gap: 8px; }
.admin-glance .glance-head { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.glance-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.glance-stats div { display: flex; flex-direction: column; min-width: 0; }
.glance-stats b { font: 700 18px Fraunces, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glance-stats span { font-size: 11px; color: var(--muted); }
.menu-title { margin: 18px 4px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.menu-group { padding: 4px 0; gap: 0; overflow: hidden; }
.menu-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; background: none; border: 0; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.menu-row + .menu-row { border-top: 1px solid var(--line); }
a.menu-row { text-decoration: none; }
.menu-row:hover { background: var(--surface-2); }
.menu-icon { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: var(--surface-2); }
.menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-text b { font-weight: 600; }
.menu-text span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-badge { flex: none; min-width: 22px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; text-align: center; }
.menu-chevron { flex: none; color: var(--muted); }
/* A generic food's brand labels: one row each, the median underneath. */
.label-table { font-size: 13px; }
.label-table td.num, .label-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.label-table td:first-child { min-width: 170px; }
.label-table th:first-child, .label-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.label-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
/* A label left out is red, its link too, so it stands out among the ones used. */
.label-table tr.left-out td, .label-table tr.left-out a { color: var(--danger); }
.label-table tr.left-out td.num { text-decoration: line-through; }
.label-table tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }
.label-table .btn.sm { padding: 4px 10px; font-size: 12px; }
.recipe-line .role-pick { flex: none; width: 120px; }
.recipe-line .role-pick .picker-field { padding: 6px 10px; }
.step-after { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.line-controls label { display: inline-flex; align-items: center; gap: 4px; }
.line-controls label input[type=checkbox] { width: auto; margin: 0; }

/* What's already in the kitchen (the new plan's form): a grid typed straight through. */
.onhand { display: flex; flex-direction: column; gap: 6px; }
/* Each row is one strip: a frame around borderless cells split by thin lines, so the food gets
   the room that boxes, padding and gaps would take on a phone. */
.onhand-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 44px 72px 60px 34px; align-items: stretch; }
.onhand-row:not(.onhand-head) { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.onhand-row:not(.onhand-head):focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.onhand-row:not(.onhand-head) > * + * { border-left: 1px solid var(--line); }
.onhand-head { padding: 0 1px; }
.onhand-head span { padding: 0 8px; }
.onhand-row input, .onhand-row .onhand-unit { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 10px 8px; min-width: 0; width: 100%; height: 100%; }
.onhand-row input:focus, .onhand-row .onhand-unit:focus { outline: none; box-shadow: none; background: var(--accent-soft); }
.onhand-row > :first-child input { border-radius: 11px 0 0 11px; }
.onhand-row input.missing { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.onhand-row .icon-btn { border-radius: 0 11px 11px 0; padding: 0; }
.onhand-packs, .onhand-row input[inputmode="decimal"] { text-align: center; }
.onhand-food { min-width: 0; }
.onhand-hits { position: absolute; z-index: 30; left: -1px; right: -1px; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.onhand-hits li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.onhand-hits li.on, .onhand-hits li:hover { background: var(--accent-soft); }
.onhand-hits li.none { cursor: default; background: none; }
.onhand-unit-wrap { position: relative; min-width: 0; }
.onhand-unit { display: flex; align-items: center; justify-content: center; gap: 3px; font: 15px Inter, sans-serif; color: var(--ink); cursor: pointer; }
.onhand-unit span { color: var(--muted); font-size: 11px; }
.onhand-units { left: auto; right: 0; min-width: 100%; }
/* Phones: the food gets the whole first line (names were cut to a few letters), packs, amount and
   unit go on the second. The header only names the second line's columns. */
@media (max-width: 480px) {
  .onhand-row { grid-template-columns: repeat(3, minmax(0, 1fr)) 40px; }
  .onhand-row > :first-child { grid-column: 1 / -1; }
  .onhand-row:not(.onhand-head) > :first-child { border-bottom: 1px solid var(--line); }
  .onhand-row:not(.onhand-head) > :nth-child(2) { border-left: 0; }
  .onhand-head > :first-child { display: none; }
  .onhand-row > :first-child input { border-radius: 11px 11px 0 0; }
  .onhand-row > :nth-child(2) { border-radius: 0 0 0 11px; }
  .onhand-row .icon-btn { border-radius: 0 0 11px 0; }
  .onhand-food { position: relative; }
  .onhand-food > .onhand-hits { left: -1px; right: -1px; }
}

/* Admin -> Foods: the foods' names in other languages. */
.food-names { align-items: center; gap: 8px 12px; margin: 4px 0 12px; }
.food-names p { margin: 0; }

/* Prep: a step whose time is up, ringing until someone says they heard it */
.alarm { display: grid; gap: 8px; margin: 8px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, var(--surface)); animation: alarm-pulse 1.2s ease-in-out infinite; }
.alarm .row { flex-wrap: wrap; gap: 8px; }
@keyframes alarm-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .alarm { animation: none; } }
/* Prep: how a batch goes into its boxes, and its weight on the scale */
.box-split { margin: 6px 0 0; display: grid; gap: 4px; }
.box-split .tag-box { font-size: 12px; padding: 1px 6px; }
/* In the fridge and freezer lists too: one line per box (the list's own rows are flex columns on phones). */
.containers .box-split li { display: block; }
/* A boxing step: which batch (when several), then where its boxes go. */
.box-split .box-what { margin-top: 4px; }
.box-split .box-where { margin-bottom: 2px; font-weight: 600; }
/* Inside a timeline step the box list keeps its own plain rows (not the timeline's). */
.timeline .box-split li { display: block; padding: 0; margin: 0; border: 0; background: none; }
.timeline li.done .box-split b { text-decoration: none; }
.weigh { flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.weigh .unit-input.num { width: 110px; }
/* Profile: BMI before the goal */
.body-info p { margin: 2px 0; }

/* ---- The guide: Mise the carrot (js/guide.js) ---- */
.guide { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.guide > * { pointer-events: auto; }
/* Her corner (c-<top|bottom><left|right>): she sits there, her bubble opens towards the middle. */
.guide.c-bl, .guide.c-tl { left: 16px; right: auto; align-items: flex-start; }
.guide.c-tl, .guide.c-tr { flex-direction: column-reverse; bottom: auto; top: 64px; }
.guide.dragging { left: 0; top: 0; right: auto; bottom: auto; width: auto; transform: translate(-50%, -50%); }
.guide.dragging .guide-mascot { animation: none; cursor: grabbing; }
@media (min-width: 901px) {
  .guide { bottom: 24px; right: max(16px, calc((100vw - 980px) / 2)); }
  .guide.c-bl, .guide.c-tl { left: max(16px, calc((100vw - 980px) / 2)); right: auto; }
  .guide.c-tl, .guide.c-tr { top: 76px; bottom: auto; }
}
.guide-bubble { position: relative; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 12px;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.45); transition: opacity .25s ease, transform .25s ease; }
/* One bubble, always there: it fades and shrinks away instead of vanishing, and pops in when it
   comes back. New words inside it fade in. */
.guide-bubble.gone { opacity: 0; transform: scale(.92) translateY(10px); pointer-events: none; }
.guide.c-tl .guide-bubble.gone, .guide.c-tr .guide-bubble.gone { transform: scale(.92) translateY(-10px); }
.guide-bubble:not(.gone) { animation: pop .45s cubic-bezier(.2, .8, .2, 1); }
.guide-bubble .spoken { animation: fade .25s ease; }
.guide.dragging .guide-bubble { display: none; }
/* Her way in: up from the corner. */
.guide-mascot { animation: bob 3.2s ease-in-out infinite; }
.guide-mascot.entering { animation: guide-in .7s cubic-bezier(.2, .8, .2, 1) backwards, bob 3.2s ease-in-out .7s infinite; }
@keyframes guide-in { from { transform: translateY(40px) scale(.6); opacity: 0; } }
.guide-bubble p { margin: 0 0 12px; font-size: 16px; line-height: 1.5; }
.guide-bubble .spoken { cursor: default; }
.guide-bubble .unsaid { visibility: hidden; }
/* Talking: the smile gives way to a mouth opening and closing. */
.mascot .mouth { display: none; transform-box: fill-box; transform-origin: center; }
.mascot.talking .smile { display: none; }
.mascot.talking .mouth { display: inline; animation: talk .16s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.guide-bubble .row { justify-content: flex-end; gap: 12px; }
/* The tail, towards Mise (below the bubble, or above it when she talks from the top). */
.guide-bubble::after { content: ''; position: absolute; right: 30px; bottom: -8px; width: 14px; height: 14px; background: var(--surface);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.guide.c-bl .guide-bubble::after, .guide.c-tl .guide-bubble::after { right: auto; left: 30px; }
.guide.c-tl .guide-bubble::after, .guide.c-tr .guide-bubble::after { bottom: auto; top: -8px; transform: rotate(225deg); }
/* Her menu: the choices one above the other. */
.guide-menu { display: flex; flex-direction: column; gap: 8px; }
.guide-menu > .btn { justify-content: flex-start; }
.guide-menu .spoken { margin-bottom: 4px; }
/* Choosing what to explain: everything is a question. */
body.guide-picking, body.guide-picking * { cursor: help !important; }
.guide-mascot { touch-action: none; }
.guide-mascot { border: 0; background: none; padding: 0; cursor: pointer; line-height: 0; --lift: -5px; --tilt: 3deg;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.mascot .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
/* What the tip is about: ringed, the rest of the screen dimmed a little (clicks still go through). */
.guide-ring { position: fixed; z-index: 35; border-radius: 16px; pointer-events: none; box-shadow: 0 0 0 3px var(--herb), 0 0 0 9999px rgba(20, 16, 10, .28);
  transition: top .2s, left .2s, width .2s, height .2s; }
.guide-replay { align-items: center; gap: 10px; }

/* This week and next week (planned ahead): which one the week screen shows. */
.week-switch { margin: 0 0 4px; }
.week-switch button { flex: 1; }
/* The new-plan screen, with a week under way: back to it. */

/* The "don't eat" food box keeps its matches under itself (no grid row around it). */
.restr-grid .onhand-food { position: relative; }

/* Settings, sync between devices: deleting the server copy reads as a warning without a red frame. */
.btn.danger-text { color: var(--danger); }

/* Welcome page, after signing in: sync between devices offered once. */
.sync-offer { text-align: left; margin: 0 0 16px; display: grid; gap: 6px; }
.sync-offer p { margin: 0; }

/* The passphrase hint, on a device joining sync. */
.sync-hint { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }

/* Settings, your data: how data is handled and deleting everything, under sync. */
#sync .data-more { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Settings, calendar: the app picked, then its connection and what goes in it. */
.int-chosen { display: grid; gap: 10px; margin-top: 4px; }
.int-connect { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.int-connect p { margin: 0; flex: 1 1 200px; }
.int-what { padding: 6px 0; border-top: 1px solid var(--line); }

/* This week, Shop: the list into a supermarket cart (the browser extension). */
.shop-cart { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.shop-cart > div { flex: 1 1 220px; }
.shop-cart p { margin: 4px 0 0; }

/* A button at work: its words hidden (it keeps its size), an endless spinner in their place */
.btn.is-busy, .btn.is-busy:disabled { position: relative; opacity: 1; cursor: progress; }
.btn.is-busy .btn-label { visibility: hidden; }
.btn.is-busy .spinner { position: absolute; inset: 0; margin: auto; }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-line { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.mascot-hint { margin: -4px 0 8px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.foods-table td:first-child { min-width: 220px; }
.menu-badge.warn { background: color-mix(in srgb, #f5a524 25%, var(--surface)); color: var(--ink); border: 1px solid #f5a524; white-space: nowrap; }
.admin code { white-space: nowrap; }
.update-line { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.admin-table caption { caption-side: top; text-align: left; padding: 0 2px 6px; }
@media (max-width: 640px) { .admin .chips .chip { flex: 0 1 auto; width: auto; text-align: left; } }
.cost-table td { overflow-wrap: anywhere; min-width: 0; }
/* Admin → Shops: "On offer" opens the offers; offers and a day's changes as lists */
.glance-link { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; text-align: inherit; display: flex; flex-direction: column; align-items: inherit; }
.glance-link span { color: var(--accent); }
.glance-link:hover b { text-decoration: underline; }
.offer-list li, .change-list li { align-items: flex-start; gap: 10px; }
.offer-img { width: 44px; height: 44px; flex: none; object-fit: contain; border-radius: 8px; background: #fff; }
.offer-price { text-align: right; white-space: nowrap; }
.change-diff { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.change-list .pill { flex: none; margin-top: 2px; }
.glance-stats:has(> .glance-link) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Admin → Shops → Worker log: one line per tick or event, errors in red */
.worker-log { list-style: none; margin: 8px 0 0; padding: 0; }
.worker-log li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.worker-log li.lvl-error .small:last-child { color: var(--danger); }
/* The path at the top of a subpage: 🏠 Admin › Shops › Worker log (the last step is the page's title). */
.crumbs-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0 0 4px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.crumb { display: inline-flex; align-items: center; gap: 4px; height: 28px; border: 0; background: none; padding: 0 2px; font: 600 14px/1 Inter, sans-serif; color: var(--accent); cursor: pointer; border-radius: 8px; }
.crumb:hover span { text-decoration: underline; }
.crumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crumb-home { flex: none; }
.crumb-sep { display: inline-flex; align-items: center; height: 28px; color: var(--muted); font-size: 16px; line-height: 1; }
.crumb-current { flex-basis: 100%; margin: 2px 0 0; overflow-wrap: anywhere; }
.crumbs-action { flex: none; }
/* A meal's buttons: Mark as eaten, and Skip beside it */
.eat-row { display: flex; border-top: 1px solid var(--line); }
.eat-row .eat-btn { border-top: 0; flex: 1; }
.eat-row .skip-btn { flex: 0 0 auto; width: auto; padding: 10px 18px; border-left: 1px solid var(--line); }
.meal.skipped { opacity: .72; }
.meal.skipped h3 { text-decoration: line-through; text-decoration-thickness: 1px; }
.meal.skipped .skip-btn { flex: 1; width: 100%; border-left: 0; color: var(--muted); }
.eat-btn.skipped-label { color: var(--muted); }
.changes-list { margin: 4px 0 0; padding-left: 20px; }
.changes-list li { margin: 4px 0; }
