/* Meal planner. Mobile-first: one column, big tap targets, no build step. */
/* Colours (rebrand, 2026-10-23, palette "M2+"; see BRIEF.md → Colours). Each colour is a
   range from darkest (0) to palest (5). Blue leads (text, main buttons, bars); green means
   fresh (cooking days, selected things, confirmations). Text only in the darkest blue.
   The older names below (navy, moss, ...) now point at the new colours, so every page
   picks them up. Ingredient icons keep their own colours. Light only. */
:root {
  color-scheme: light;
  --b0: #103546; --b1: #267397; --b2: #3394C1; --b3: #8ACCEA; --b4: #D2EDF9; --b5: #EDF8FD;
  --g0: #223A18; --g1: #4A7637; --g2: #60914B; --g3: #A3D090; --g4: #DBEFD2; --g5: #EFF9EB;
  --navy: var(--b0);      /* all text, headings, HOB, main buttons (13:1 on white) */
  --bottle: var(--b0);    /* main action buttons */
  --steel: var(--b1);     /* Edit on leftovers days, the current step's dot */
  --moss: var(--g1);      /* ticks, selected rings */
  --sage: var(--g3);      /* soft green accents */
  --sky: var(--b2);       /* Today ring */
  --pale-blue: var(--b5); /* leftovers backgrounds */
  --pale-green: var(--g5);/* cooking backgrounds */
  --bronze: #9A6412;      /* warnings only (icon and edge) */
  --white: #FFFFFF;
  --grey-bg: #F6F8F9;     /* page background */
  --grey-fill: #EEF2F3;   /* quiet fills */
  --grey: #E7ECEE;        /* soft grey: unselected pills, quiet fills, dividers */
  --grey-line: #D5DCE0;   /* disabled outlines, empty stars */
  --grey-chip: #E7ECEE;   /* bubbles: pills, chips, tags */

  /* What each part of the page uses. */
  --bg: var(--grey-bg);
  --surface: var(--white);
  --text: var(--navy);
  --muted: rgba(16, 53, 70, 0.76);   /* darkest blue, softened (7:1 on white) */
  --line: var(--grey);
  --link: var(--navy);    /* batch 6c: no steel blue text on white or grey */
  --accent: var(--bottle);
  --accent-text: var(--white);
  --selected: var(--moss);
  --selected-bg: var(--g4);
  --cue-bg: var(--pale-blue);
  --cue-line: var(--steel);
  --note-bg: var(--g5);
  --note-line: var(--moss);
  --step-ing-bg: var(--grey-fill);
  --nav-bg: var(--white);
  --nav-text: var(--navy);
  --nav-active: var(--moss);
  --error: var(--bronze);
  --action: var(--bottle);
  --action-text: var(--white);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 53, 70, 0.05), 0 2px 10px rgba(16, 53, 70, 0.07);
  --soft: var(--white);
  --soft-grey: var(--grey);
  --warn-bg: var(--white);
  --today-ring: var(--sky);
  --info-edge: var(--steel);
  --warn-edge: var(--bronze);
  --warn-card: var(--white);
  --pressed: var(--g1);              /* Lock in once pressed: mid green, white text (Z1) */
  --pressed-text: var(--white);
  --lock: var(--g0);
  --lock-text: var(--white);
  --topbar-h: 52px;
  --nav-h: 66px;
  font-size: 17px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.5 "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 42rem; margin: 0 auto; padding: 0 16px 48px; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 20px 0 6px; }
/* No underlines anywhere: links are bottle green, and bold when they sit in text. */
a { color: var(--accent); text-decoration: none; }
a:not([class]), a.back { font-weight: 600; }
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  height: calc(var(--topbar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0;
  background: var(--nav-bg); color: var(--nav-text);
}
.brand { font-weight: 700; margin-right: auto; }
.icons { display: flex; gap: 4px; }
.icon {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; color: var(--nav-text);
}
.icon[aria-current] { color: var(--nav-active); background: var(--pale-green); }
.topbar .icon svg, .mainnav svg {
  width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Main navigation: bottom bar on phones, inside the top bar on wider screens. */
.mainnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--nav-bg);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -1px 0 var(--grey), 0 -2px 10px rgba(16, 53, 70, 0.06);
}
.mainnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--nav-h); color: var(--nav-text); text-decoration: none; font-size: 0.82rem; font-weight: 600;
}
.mainnav a[aria-current] { color: var(--nav-active); box-shadow: inset 0 3px 0 var(--nav-active); }
body.with-nav main { padding-bottom: calc(var(--nav-h) + 48px + env(safe-area-inset-bottom)); }
body.with-nav .actions { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
@media (min-width: 768px) {
  .brand { margin-right: 0; }
  .mainnav {
    position: static; border: 0; padding: 0; margin-right: auto; background: none; gap: 4px;
  }
  .mainnav a { flex: none; flex-direction: row; gap: 8px; height: var(--topbar-h); padding: 0 12px; font-size: 0.95rem; }
  .mainnav a[aria-current] { box-shadow: inset 0 -3px 0 var(--nav-active); }
  body.with-nav main { padding-bottom: 48px; }
  body.with-nav .actions { bottom: 0; }
}

.button {
  display: inline-block; border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 10px 16px; font: inherit; font-weight: 600; text-decoration: none;
  background: var(--surface); color: var(--accent); cursor: pointer; min-height: 44px;
}
.button.small { padding: 6px 12px; min-height: 36px; font-size: 0.9rem; }
.button.primary { background: var(--accent); color: var(--accent-text); width: 100%; }

.meta, .hint, .empty { color: var(--muted); }
.meta { margin: 0 0 8px; font-size: 0.95rem; }
.hint { font-size: 0.875rem; }

/* Recipe list */
.recipe-list { list-style: none; padding: 0; margin: 0; }
.recipe-list a {
  display: block; padding: 12px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--text);
}
.recipe-list .title { display: block; font-weight: 600; }
.recipe-list .meta { display: block; margin: 0; font-size: 0.875rem; }

/* Recipe page */
.times { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; font-size: 0.95rem; }
.times .mine { color: var(--accent); font-weight: 600; }

.servings {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 16px;
}
.servings .label { font-weight: 600; }
.servings button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.servings button:disabled { opacity: 0.35; cursor: default; }
.servings output { min-width: 2ch; text-align: center; font-size: 1.25rem; font-weight: 700; }
.servings .hint { margin-left: 4px; }

.tabs {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 5;
  display: flex; background: var(--bg); border-bottom: 1px solid var(--line); margin: 0 -16px 12px; padding: 0 16px;
}
.tabs [role="tab"] {
  flex: 1; text-align: center; padding: 12px 8px; text-decoration: none; color: var(--muted);
  font-weight: 600; border-bottom: 3px solid transparent;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
/* Without JS every panel shows, one after another; tabs act as jump links. */
.js .tab-panel[data-inactive] { display: none; }

.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.q { font-weight: 700; }
.prep { color: var(--muted); }
.tag {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px;
}

.method { list-style: none; padding: 0; margin: 0; }
.method > li { margin: 0 0 20px; }
.lead-in {
  margin: 0 0 8px; padding: 8px 12px; border-left: 4px solid var(--cue-line);
  background: var(--cue-bg); border-radius: 0 var(--radius) var(--radius) 0; font-weight: 600;
}
.step { display: flex; gap: 12px; }
.step .num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; margin-top: 2px;
}
.step .body { flex: 1; min-width: 0; }
.step .body p { margin: 0 0 8px; }
.step-ingredients {
  list-style: none; margin: 0; padding: 8px 12px; background: var(--step-ing-bg); border-radius: var(--radius);
  font-size: 0.95rem;
}
.step-ingredients li { padding: 2px 0; }
.footer-links { margin-top: 32px; font-size: 0.9rem; }

/* Forms */
fieldset { border: 0; padding: 0; margin: 24px 0; }
legend { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=url], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zooming in */
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text);
}
textarea { resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; accent-color: var(--accent); }
.entry > div, .entry textarea { margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid .wide { grid-column: 1 / -1; }
.grid > * { min-width: 0; }
.field-box .errorlist { margin: 4px 0 0; }
.field-box .helptext { margin-top: 4px; }
.import-link { margin: 20px 0 8px; }
.import-link label { font-weight: 700; }
.import-link .hint { margin: 2px 0 8px; }
.import-row { display: flex; gap: 8px; }
.import-row input { flex: 1; min-width: 0; }
.send-link { margin: 4px 0 16px; }
.send-link .hint { display: block; }
.send-ready { margin: 12px 0 24px; padding: 14px 16px; border-radius: 10px; background: var(--cue-bg, transparent); }
.send-ready .hint { margin: 8px 0 0; }
.send-code { width: 100%; box-sizing: border-box; font-family: ui-monospace, Menlo, monospace; font-size: 0.75rem; word-break: break-all; }
.send-steps { margin: 12px 0; }
.send-steps summary { font-weight: 600; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.send-steps ol { padding-left: 1.4em; margin: 4px 0 8px; }
.send-steps li { margin: 4px 0; }
.cook-time { align-self: end; margin: 0 0 10px; color: var(--muted); font-size: 0.9rem; }
.rating-on-add .hint { margin: 6px 0 0; }
.grid .check label, .grid .check { display: flex; align-items: center; gap: 8px; margin: 0; }
.helptext { color: var(--muted); font-size: 0.8rem; }
.errorlist { color: var(--error); list-style: none; padding: 0; margin: 4px 0; font-size: 0.875rem; }
.errors { border: 1px solid var(--error); border-radius: var(--radius); padding: 8px 12px; }

.rows { list-style: none; padding: 0; margin: 0 0 12px; }
.rows .row {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; margin-bottom: 10px; display: grid; gap: 6px;
}
.rows .row.blank { border-style: dashed; }
.row-head { display: flex; justify-content: space-between; align-items: center; }
.remove { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 400; margin: 0; }
.line1 { display: grid; grid-template-columns: 4.5rem 4.5rem 1fr; gap: 6px; }
.line3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
/* Description and Prep note side by side (2026-11-09). */
.line2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.line2 label.mini { margin: 0; }
.shop-desc { font-weight: 400; color: var(--muted); }
.line3 label { margin: 0; }
.line3 select { font-size: 14px; padding: 8px 4px; }
.line4 { display: flex; justify-content: space-between; }
.line4 label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
/* Split on Edit recipe (2026-11-09). */
.line4 .ing-split { margin: 0 14px 0 auto; }
.line4 .ing-split[hidden] { display: none; }
.ing-splitp { display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--b4); }
.ing-splitp .hint { margin: 0; }
.ing-splitp input { max-width: 8em; font-size: 16px; }
.ing-splitb { display: flex; gap: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.actions { display: grid; gap: 12px; justify-items: center; position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); }

/* Shared bits */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.crumb { margin: 16px 0 0; font-size: 0.95rem; }
.crumb a { text-decoration: none; }
.messages { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.messages li {
  padding: 10px 12px; border-radius: var(--radius); border-left: 4px solid var(--accent);
  background: var(--note-bg); font-weight: 600;
}
.messages li.warning { border-left-color: var(--error); }
.banner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 16px 0 0; padding: 10px 12px; border-radius: var(--radius);
  background: var(--cue-bg); border-left: 4px solid var(--cue-line);
}
.banner p { margin: 0; }
.link-list { list-style: none; padding: 0; margin: 0 0 24px; }
.link-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.link-list a { font-weight: 600; }
.link-list .hint { display: block; }
.narrow { max-width: 24rem; }
.field { margin-bottom: 14px; }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--steel); outline-offset: 2px;
}

/* Ratings */
.rating .star { color: var(--moss); }
.rating .count, .rating.none { color: var(--muted); }
.recipe-list li.with-action { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.recipe-list li.with-action a { flex: 1; border-bottom: 0; }

/* My notes: pale green, clearly not the original recipe. */
.note {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 8px 0 0; padding: 8px 4px 8px 12px; border-left: 4px solid var(--note-line);
  background: var(--note-bg); border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.95rem;
}
.note p { flex: 1; margin: 0; }
.note p::before { content: "My note: "; font-weight: 700; color: var(--bottle); }
.note form { margin: 0; }
.note-delete {
  width: 32px; height: 32px; border: 0; background: none; color: var(--muted);
  font-size: 1.3rem; line-height: 1; cursor: pointer; border-radius: 50%;
}
.ingredients > li .note { margin-top: 6px; }
.button.cooked { margin-top: 12px; text-align: center; }

/* Review form */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { margin: 0; font-weight: 600; position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span {
  display: inline-block; padding: 10px 14px; min-height: 44px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.chip input:checked + span { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip input:focus-visible + span { outline: 3px solid var(--steel); outline-offset: 2px; }
/* Stars: inputs come 5..1 and are shown reversed, so "checked ~ label" fills it and every lower star. */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; position: relative; }
.stars input { position: absolute; opacity: 0; }
.stars label {
  margin: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: var(--line); cursor: pointer;
}
.stars input:checked ~ label { color: var(--moss); }
.stars input:focus-visible + label { outline: 3px solid var(--steel); outline-offset: -4px; border-radius: 8px; }
.review textarea { margin-bottom: 8px; }

/* --- Step 1c --- */
h2 { font-size: 1.2rem; margin: 28px 0 6px; }
.brand { color: var(--nav-text); text-decoration: none; font-size: 1.15rem; letter-spacing: 0.02em; }
.count { color: var(--muted); font-weight: 400; }
.link-list.later .title { font-weight: 600; color: var(--muted); }
.link-list .title { display: block; }

/* Small pale labels on form boxes */
label.mini, .mini-legend {
  display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted);
  margin: 0 0 2px; letter-spacing: 0.02em;
}
label.mini > input, label.mini > select, label.mini > textarea { margin-top: 2px; font-weight: 400; color: var(--text); }
.rows label.mini { margin-bottom: 4px; }
.line1 label.mini, .line3 label.mini { margin: 0; }

/* Step rows: move and insert */
.row-tools { display: inline-flex; align-items: center; gap: 4px; }
.tool {
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 1.1rem; cursor: pointer;
}
.insert {
  justify-self: start; border: 1px dashed var(--line); border-radius: 8px; background: none;
  color: var(--accent); font: inherit; font-size: 0.9rem; font-weight: 600; padding: 8px 12px; min-height: 40px; cursor: pointer;
}
.new-cuisine { margin-top: 8px; }
.tag-picker { margin: 0; }
.tag-picker .chips { margin-bottom: 10px; }

/* Recipe page */
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 10px; }
.tag-list li {
  font-size: 0.8rem; font-weight: 600; padding: 2px 10px; border-radius: 12px;
  background: var(--note-bg); color: var(--text);
}
.switch { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 12px; font-weight: 600; cursor: pointer; }
.switch input { width: 22px; height: 22px; }
.tag.flag { border-color: var(--moss); color: var(--bottle); }

/* Ticking off steps while cooking */
.method-hint { margin: 0 0 12px; }
.step .num { border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 0.9rem; }
.method > li.done .num { background: var(--line); color: var(--muted); }
.method > li.done .num::before { content: "✓"; }
.method > li.done .num { font-size: 0; }
.method > li.done .num::before { font-size: 0.9rem; }
.method > li.done:not(.peek) .lead-in,
.method > li.done:not(.peek) .step-detail { display: none; }
.method > li.done:not(.peek) .step-text {
  color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.method > li.done.peek .step-text { color: var(--muted); }
.method > li.done { margin-bottom: 10px; }

/* Cookbook filters */
.filters { margin: 0 0 12px; }
.filters > summary { list-style: none; display: inline-block; }
.filters > summary::-webkit-details-marker { display: none; }
.filters[data-active] > summary { background: var(--accent); color: var(--accent-text); }
.filters form {
  margin-top: 12px; padding: 4px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.filters fieldset { margin: 12px 0; }
.filters legend { font-size: 0.95rem; }
.filters .chip span { padding: 8px 12px; min-height: 40px; font-size: 0.95rem; }
.filter-actions { display: flex; align-items: center; gap: 16px; }
.filter-actions .button.primary { width: auto; }
.active-filters { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 4px; }
.active-filters a {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 36px;
  border-radius: 18px; background: var(--accent); color: var(--accent-text); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}

/* Back office */
.search { margin: 0 0 8px; }
input[type=search] {
  width: 100%; font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--text);
}
.field.check label { display: flex; align-items: center; gap: 8px; }
.danger-zone { margin-top: 32px; }
.button.danger { border-color: var(--error); color: var(--error); }
.banner-actions { display: flex; gap: 8px; align-items: center; }
.banner-actions form { margin: 0; }

/* --- Meal planning (MVP step 2) --- */
.week-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.week-head > div { text-align: center; flex: 1; }
.week-head .meta { margin: 0; }
span.tool { visibility: hidden; flex: none; }   /* keeps the heading centred where an arrow is hidden */
a.tool { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 1.5rem; }
.review-banner { align-items: flex-start; }
.review-banner ul { margin: 4px 0 0; padding-left: 18px; }
.review-banner li { margin: 4px 0; }

.entry-cards { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.entry-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.entry-main { display: grid; gap: 2px; padding: 10px 12px; text-decoration: none; color: var(--text); }
.entry-main .title { font-weight: 700; }
.entry-main .meta { margin: 0; font-size: 0.9rem; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 10px; }
.entry-actions form { margin: 0; }
.warn { color: var(--error); font-weight: 600; font-size: 0.9rem; }

.plan-entry select { font-size: 16px; }
.eaten-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.eaten-row label { margin: 0; font-weight: 600; }
.eaten-row.taken { color: var(--muted); min-height: 44px; }
.eaten-row.taken .eaten-day { font-weight: 600; }
.taken-by { font-size: 0.85rem; }
.eaten-out { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.stepper input { width: 3.2rem; text-align: center; }
.to-freeze { font-size: 1.05rem; margin: 14px 0 6px; }

/* --- Polish batch: navigation, wordmark, back buttons --- */
@media (max-width: 767px) { .mainnav svg { width: 30px; height: 30px; } }
@font-face {
  font-family: "Figtree"; font-weight: 300 900; font-style: normal; font-display: swap;
  src: url("fonts/figtree-latin-wght.woff2") format("woff2");   /* SIL OFL, see fonts/OFL-Figtree.txt */
}
@font-face {
  font-family: "Fraunces"; font-weight: 800; font-style: normal; font-display: swap;
  src: url("fonts/fraunces-latin-800.woff2") format("woff2");   /* SIL OFL, see fonts/OFL.txt */
}
.brand {
  display: inline-flex; align-items: center; text-decoration: none; color: var(--nav-text);
  font: 800 1.7rem/1 "Fraunces", Georgia, serif; letter-spacing: 0.06em;
}
/* iPhone Safari: while its toolbar slides, a strip below a fixed bar can show the
   page behind it. Extend the bar's colour well below the screen edge. */
.mainnav::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 160px; background: var(--nav-bg);
}
@media (min-width: 768px) { .mainnav::after { display: none; } }
.crumb .back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-right: 12px;
  font-weight: 600; text-decoration: none;
}
.crumb .back span { font-size: 1.6rem; line-height: 1; }
.crumb { margin: 4px 0 0; }
.head-actions { display: inline-flex; align-items: center; gap: 12px; }
.drafts-link { font-weight: 600; font-size: 0.95rem; }

/* Ratings: Loved / Liked / Wouldn't make again */
.rating { display: inline-flex; align-items: center; gap: 4px; }
.rating-icon { width: 1.05em; height: 1.05em; fill: currentColor; vertical-align: -0.15em; }
.rating-loved { color: var(--accent); }
.rating-liked { color: var(--moss); }
.rating-never { color: var(--error); }
.rating.none { color: var(--muted); }
.rating-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rate { margin: 0; position: relative; }
.rate input { position: absolute; opacity: 0; }
.rate span {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 10px 6px; min-height: 76px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.rate svg { width: 28px; height: 28px; fill: var(--muted); }
.rate input:checked + span { border-width: 2px; }
.rate-loved input:checked + span { border-color: var(--accent); background: var(--note-bg); }
.rate-loved input:checked + span svg { fill: var(--accent); }
.rate-liked input:checked + span { border-color: var(--moss); background: var(--note-bg); }
.rate-liked input:checked + span svg { fill: var(--moss); }
.rate-never input:checked + span { border-color: var(--error); }
.rate-never input:checked + span svg { fill: var(--error); }
.rate input:focus-visible + span { outline: 3px solid var(--steel); outline-offset: 2px; }
input.changed { color: var(--bottle); font-weight: 700; border-color: var(--moss); }
.tag-list-label { background: none !important; padding-left: 0 !important; color: var(--muted) !important; }

/* Cookbook tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 12px 0 8px; }
.tile {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px;
  padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none;
}
.tile-label { font-weight: 700; }
.tile-value { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.has-choice { border-color: var(--accent); background: var(--note-bg); }
.tile.has-choice .tile-value { color: var(--text); font-weight: 600; }
.tile[aria-expanded="true"] { border: 2px solid var(--accent); }
.tile-panel {
  margin: 0 0 12px; padding: 10px 12px 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.tile-panel .mini-legend { margin-bottom: 8px; }
.chip-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); text-decoration: none; font-weight: 600;
}
.chip-link.chosen { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.active-filters .clear a { background: none; color: var(--accent); border: 1px solid var(--line); }
.try-new { margin-top: 8px; }
.try-new h2 { margin-top: 16px; }

/* Planning: chosen recipe */
.plan-tabs { position: static; margin-top: 4px; }
.chosen-recipe .chosen-title { font-weight: 700; font-size: 1.1rem; margin: 2px 0 8px; }

/* Back office home and grouped lists */
.office-cards { list-style: none; padding: 0; margin: 12px 0 24px; display: grid; gap: 10px; }
.office-cards a {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none;
}
.office-icon {
  flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--note-bg);
  display: flex; align-items: center; justify-content: center;
}
.office-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.office-text .title { display: block; font-weight: 700; }
.office-text .hint { display: block; }
.advanced { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.advanced h2 { font-size: 1rem; margin-top: 0; }
.group-head { font-size: 0.95rem; margin: 18px 0 2px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Planner */
.button.suggest { margin: 0 0 12px; text-align: center; }
.leftovers {
  margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--cue-bg); border-left: 4px solid var(--cue-line);
}
.leftovers p { margin: 0 0 4px; }
.leftovers ul { margin: 0; padding-left: 18px; }
.pick-list { margin: 8px 0 16px; }
.pick-list summary { font-weight: 600; cursor: pointer; min-height: 44px; display: flex; align-items: center; }

/* --- Polish batch 2 --- */
/* Cookbook: one compact row of pills instead of tiles */
.pills {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; margin: 8px -16px 4px; padding-left: 16px; padding-right: 16px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 6px 14px;
  border-radius: 19px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  text-decoration: none; font-weight: 600; font-size: 0.92rem; white-space: nowrap;
}
.pill.has-choice { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pill[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--accent); }
/* Try something new: a billboard */
.billboard {
  margin: 12px 0; padding: 4px 14px 10px; border-radius: 14px;
  background: var(--cue-bg); border: 2px solid var(--cue-line);
}
.billboard h2 { margin: 10px 0 0; font-size: 1.15rem; }
.billboard .recipe-list a { border-bottom-color: var(--sage); }

/* Planner header and bubble tabs */
.week-title { font-size: 1.15rem; margin: 10px 0 2px; }
.week-dates { font-size: 0.85rem; margin: 0; }
.week-back { font-size: 0.85rem; margin: 2px 0 0; }
.plan-tabs { display: flex; gap: 8px; margin: 10px 0 12px; }
.plan-tabs [role="tab"] {
  flex: 1; text-align: center; padding: 10px 8px; border-radius: 22px; font-weight: 700;
  text-decoration: none; border: 2px solid; background: var(--surface);
}
#tab-plan-days { border-color: var(--cue-line); color: var(--cue-line); }
#tab-plan-days[aria-selected="true"] { background: var(--nav-bg); border-color: var(--nav-bg); color: var(--nav-text); }
#tab-meals { border-color: var(--accent); color: var(--accent); }
#tab-meals[aria-selected="true"] { background: var(--accent); color: var(--accent-text); }

/* Meal cards: × in the corner; dismissible warnings */
.entry-card { position: relative; }
.entry-card .entry-main { padding-right: 44px; }
.card-remove, .dismissible > form { position: absolute; top: 4px; right: 4px; margin: 0; }
.card-remove button, .dismiss {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--muted);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.leftovers.dismissible { position: relative; padding-right: 44px; }
.warn-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px 6px 12px; }
.warn-row form { margin: 0; }

/* Steppers (− / +) */
.stepper-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper-row label { margin: 0; }
.stepper-row .helptext { display: block; font-weight: 400; }
.stepper input { -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Searchable pickers */
.picker { margin: 14px 0; }
.picked { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 6px; }
.picked button {
  border: 0; border-radius: 16px; padding: 6px 12px; min-height: 34px; background: var(--accent);
  color: var(--accent-text); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.picker-list {
  max-height: 210px; overflow-y: auto; margin-top: 6px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface);
}
.picker-item { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; font-weight: 400; border-bottom: 1px solid var(--line); }
.picker-item:last-child { border-bottom: 0; }

/* Review: tighter sections; Today/Yesterday then five smaller days; equal rating boxes */
.review fieldset { margin: 14px 0; }
.review .grid { margin-bottom: 8px; }
.cooked-on { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.cooked-on .chip { grid-column: span 2; }
.cooked-on .chip:nth-child(-n+2) { grid-column: span 5; }
.cooked-on .chip span { display: block; text-align: center; padding: 8px 2px; min-height: 40px; font-size: 0.85rem; }
.cooked-on .chip:nth-child(-n+2) span { font-size: 0.95rem; }
.rating-choice .rate span { height: 84px; min-height: 0; justify-content: center; line-height: 1.15; }

/* --- Planner flow (3c) --- */
.page-kind { margin: 10px 0 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.week-title { margin-top: 2px; }
.plan-actions { display: grid; gap: 12px; justify-items: center; margin: 20px 0 8px; }
.plan-actions form { width: 100%; display: flex; justify-content: center; margin: 0; }
.plan-actions .button.primary { width: 100%; }

/* Plan the week: meal lines with Reroll and × */
.day-meals li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; padding: 4px 0; }
.meal-link { font-weight: 600; }
.meal-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.meal-tools form { margin: 0; }
.mini-button {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--accent);
  font: inherit; font-size: 0.8rem; font-weight: 600; padding: 4px 10px; min-height: 32px; cursor: pointer;
}

/* Meals this week: one row per day, coloured by kind */
.week-meals { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 6px; }
.wm-day {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 10px; align-items: start;
  padding: 12px; border-radius: var(--radius); border-left: 5px solid transparent;
}
.wm-date { font-weight: 700; }
.wm-cook { background: var(--note-bg); border-left-color: var(--accent); }
.wm-cook .wm-what a { font-weight: 700; }
.wm-leftovers { background: var(--cue-bg); border-left-color: var(--cue-line); }
.wm-off { background: var(--surface); border: 1px dashed var(--line); border-left: 5px solid var(--line); color: var(--muted); }
.wm-empty { background: var(--surface); border-left-color: var(--error); color: var(--muted); }
.wm-day.today { box-shadow: 0 0 0 2px var(--cue-line) inset; }
.wm-review { font-size: 0.85rem; font-weight: 700; font-style: italic; color: var(--bottle); margin-left: 4px; }
.wm-kind { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); margin-top: 2px; }

/* Compact pickers with a dropdown */
.picker-box { position: relative; }
.picker.enhanced .picker-list {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  max-height: 260px; margin: 0; box-shadow: 0 6px 18px rgba(16, 53, 70, 0.15);
}
.picker.enhanced .picker-list.open { display: block; }
.picker.enhanced .picker-item input { position: absolute; opacity: 0; }
.picker.enhanced .picker-item { cursor: pointer; }
.picker .picked { margin-top: 6px; }

/* Steppers match the recipe page's servings control: round − / + buttons with the
   number as bold text between them, not a box to type in (set by app.js). */
.stepper button { width: 44px; height: 44px; font-size: 1.4rem; }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper.shown input {
  width: 2.4ch; min-width: 2ch; padding: 0; border: 0; background: transparent; box-shadow: none;
  color: var(--text); font-size: 1.25rem; font-weight: 700; text-align: center; pointer-events: none;
}
.stepper.shown input.changed { color: var(--bottle); }
/* Edit meal: Refresh for me and Choose from Cookbook side by side. */
.recipe-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --- Shopping list (MVP step 4) --- */
.shop-note { display: block; }
.shop-add { margin: 16px 0 6px; }
.shop-add-row { display: flex; gap: 8px; }
.shop-add-row input { flex: 1; min-width: 0; }
.shop-progress { margin: 10px 0 0; }
.shop-group h2 { font-size: 1rem; margin: 20px 0 6px; color: var(--accent); }
.shop-group.staples h2 { color: var(--muted); }
.shop-group.staples .hint { margin: -2px 0 6px; font-size: 0.85rem; }
.shop-items { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.shop-item { display: flex; align-items: flex-start; gap: 10px; padding: 6px 10px; border-top: 1px solid var(--line); }
.shop-item:first-child { border-top: 0; }
.shop-tick { margin: 0; flex: none; }
.tick-box {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-top: 4px;
  border: 2px solid var(--accent); border-radius: 8px; background: var(--surface); color: transparent;
  font-size: 1.1rem; font-weight: 800; cursor: pointer;
}
.shop-item.ticked .tick-box { background: var(--accent); color: var(--accent-text); }
.shop-main { flex: 1; min-width: 0; padding: 8px 0; }
.shop-main summary { cursor: pointer; list-style: none; }
.shop-main summary::-webkit-details-marker { display: none; }
.shop-main summary::after { content: "›"; float: right; color: var(--muted); font-size: 1.2rem; line-height: 1; transition: transform 0.15s; }
.shop-main[open] summary::after { transform: rotate(90deg); }
.shop-text { margin-right: 4px; }
.shop-item.ticked .shop-text { color: var(--muted); text-decoration: line-through; }
.shop-item.ticked .shop-text strong { font-weight: 600; }
.staples .shop-text { color: var(--muted); }
.shop-more { display: block; color: var(--error); font-weight: 600; font-size: 0.9rem; }
.shop-swap { display: block; color: var(--bottle); font-weight: 600; font-size: 0.9rem; }
.shop-panel { padding: 8px 0 4px; }
.shop-panel form { margin: 0 0 10px; }
.shop-panel .mini-legend { margin: 6px 0 4px; }
.shop-swapped { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.shop-swapped form { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swap-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.swap-chip {
  font: inherit; font-size: 0.9rem; font-weight: 600; padding: 8px 14px; min-height: 40px; border-radius: 20px;
  border: 1px solid var(--accent); background: var(--surface); color: var(--accent); cursor: pointer;
}

/* Recipe page: this week's swap beside the ingredient */
.swap-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 2px; padding: 6px 10px; border-radius: var(--radius); background: var(--cue-bg); border-left: 4px solid var(--cue-line); font-size: 0.9rem; }
.swap-line form { margin: 0; }

/* --- Planner rework (2026-10-06): the setup form (page 1) and the plan for the week (page 2) --- */
.button:disabled { opacity: 0.45; cursor: default; }

/* Stage headers: a full-width green button with the number inside it, then the title.
   Named "stage", not "step": the recipe method already styles .step. */
.stage { margin: 12px 0; }
.stage-head { margin: 0; font-size: 1.05rem; }
.stage-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 16px 8px 8px;
  border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 700; text-align: left; cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.stage-num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent-text); color: var(--accent);
  font-weight: 800; font-size: 1.1rem; transition: background-color 0.2s, color 0.2s;
}
.stage-title { flex: 1; }
.stage-chevron {
  flex: none; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg); transition: transform 0.2s;
}
.stage.open .stage-chevron { transform: translateY(3px) rotate(-135deg); }
/* A stage I've been through greys out once another opens; tapping it reopens it. */
.stage.visited .stage-toggle { background: var(--line); color: var(--muted); }
.stage.visited .stage-num { background: var(--surface); color: var(--muted); }
/* With JavaScript only the open stage shows its body; without, all three stay open. */
.js .stage:not(.open) .stage-body { display: none; }
.stage-body { padding: 12px 2px 4px; }
.stage-intro { margin: 0 0 8px; color: var(--muted); font-size: 0.92rem; }

/* Stage 1: each day with Cook and Eat in pills. */
.cd-list, .pd-list { list-style: none; margin: 0; padding: 0; }
.cd-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.cd-name, .pd-name { font-weight: 700; }
.pill-toggle { display: inline-block; position: relative; margin: 0; cursor: pointer; }
.pill-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.pill-toggle span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 5.4rem; height: 40px; padding: 0 12px;
  border: 2px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--muted);
  font-size: 0.9rem; font-weight: 700; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.pill-toggle input:checked + span::before { content: "✓"; margin-right: 5px; }
.cook-pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.eat-pill input:checked + span { background: var(--note-bg); border-color: var(--accent); color: var(--accent); }
.pill-toggle input:focus-visible + span { outline: 3px solid var(--cue-line); outline-offset: 2px; }
@media (max-width: 340px) { .pill-toggle span { min-width: 4.6rem; padding: 0 8px; } }

/* Stage 2: one row per day I'm eating in, with the same − / + counter as Edit meal. */
.pd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.js .pd-row.is-out { display: none; }
.pd-kind { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.pd-none { margin: 6px 0 0; }

/* The two buttons: Plan my week for me (main) and Let me do it myself (quiet). */
.setup-actions { display: grid; gap: 10px; justify-items: center; margin: 24px 0 8px; }
.button.plan-go {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px;
  border: 0; border-radius: 14px; font-size: 1.15rem; font-weight: 800; color: var(--action-text);
  background: var(--action);
  box-shadow: 0 4px 14px rgba(16, 53, 70, 0.2); transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.button.plan-go:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(16, 53, 70, 0.15); }
.button.plan-go svg { flex: none; width: 22px; height: 22px; fill: currentColor; }
.button.plan-go.busy { opacity: 0.85; }
.button.plan-go.busy svg { animation: hob-twinkle 0.9s ease-in-out infinite; }
@keyframes hob-twinkle { 50% { transform: scale(0.75) rotate(20deg); } }
.button.self-go { background: transparent; padding: 8px 24px; font-size: 0.95rem; }

/* Page 2: one panel per day I'm eating in. */
.pdays { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.pday {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); padding: 8px 10px 10px 12px;
}
.pday.filled { border-left-color: var(--accent); }
.pday.lo.filled { border-left-color: var(--cue-line); }
.pday.today { box-shadow: 0 0 0 2px var(--cue-line) inset; }
.pday.past:not(.today) .pday-date { color: var(--muted); }
.pday-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.pday-date { font-weight: 700; }
.pday-edit { margin-left: auto; }
.pday-meal { margin: 2px 0 0; }
.pday-meal + .pday-meal { margin-top: 6px; }
.pday-meta { display: block; font-size: 0.85rem; color: var(--muted); }
.pday-add { display: inline-block; font-weight: 700; padding: 4px 0; }

/* Desserts and extras: page 2 and Meals this week, no day */
.extras {
  margin: 14px 0 0; background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--sage); border-radius: var(--radius); padding: 8px 10px 10px 12px;
}
.extras h2 { font-size: 1rem; margin: 4px 0 6px; }
.extras .hint { margin: 0 0 4px; }
.extra-list { list-style: none; margin: 0 0 4px; padding: 0; }
.extra-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.extra-list li:last-child { border-bottom: 0; }
.extra-what { min-width: 0; }

/* Lock in: turns sage with a tick and a small pop, then moves on. */
.lock-in { margin: 20px 0 0; }
.lock-go { min-height: 52px; font-size: 1.05rem; transition: background-color 0.3s, border-color 0.3s; }
.lock-done { display: none; }
.lock-in.locking .lock-go { background: var(--pressed); border-color: var(--pressed); animation: hob-pop 0.45s ease-out; }
.lock-in.locking .lock-label { display: none; }
.lock-in.locking .lock-done { display: inline; }
@keyframes hob-pop { 40% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) {
  .lock-in.locking .lock-go, .button.plan-go.busy svg { animation: none; }
}
.clear-plan { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 0 8px; }
.clear-plan .hint { font-size: 0.85rem; }

/* Edit meal: Remove meal centred at the bottom. */
.danger-zone.centred { text-align: center; }
.danger-zone.centred .hint { display: block; margin-top: 4px; }

/* --- Batch 5 (2026-10-09): softer, more modern look. No dark outlines: cards get a
   faint shadow and no border, coloured edge stripes become tinted backgrounds,
   secondary buttons are pale filled, Today is a pale ring. --- */
.button { border-color: transparent; background: var(--soft); }
.button.primary { background: var(--accent); }
.button.danger { border-color: transparent; background: var(--warn-bg); color: var(--error); }
.mini-button, .tool, .servings button, .stepper button { border: 0; background: var(--soft); }
.tag { border: 0; background: var(--grey-chip); border-radius: 6px; padding: 1px 6px; }
.tag.flag { background: var(--note-bg); }
.errors { border: 0; background: var(--warn-bg); }
.lead-in, .banner, .leftovers, .swap-line { border-left: 0; border-radius: var(--radius); }
.messages li { border-left: 0; }
.messages li.warning { background: var(--warn-bg); }
.note { border-left: 0; border-radius: var(--radius); }
.billboard { border: 0; box-shadow: var(--shadow); }
.rows .row, .entry-card, .tile, .tile-panel, .office-cards a, .shop-items, .filters form {
  border: 0; box-shadow: var(--shadow);
}
.rows .row.blank { border: 1px dashed var(--line); box-shadow: none; }
.picker-list { border: 0; box-shadow: var(--shadow); }
.chip span, .chip-link, .pill, .rate span { border-color: transparent; background: var(--grey-chip); }
.chip input:checked + span, .chip-link.chosen, .pill.has-choice { border-color: transparent; }
.tick-box { border: 1.5px solid var(--sage); background: var(--white); }
.shop-item.ticked .tick-box { border-color: var(--accent); }

/* Planner form: rounder stage headers, softer pills. */
.stage-toggle { border-radius: var(--radius); }
.cd-row, .pd-row { border-bottom-color: var(--line); }
.pill-toggle span { border: 0; background: var(--grey-chip); }
.eat-pill input:checked + span { background: var(--note-bg); }
/* Stage 3: rows like stages 1 and 2. */
.pref-list { list-style: none; margin: 0; padding: 0; }
.pref-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--line); min-height: 52px;
}
.pref-row.pref-wide { display: block; padding: 10px 0; }
.pref-name { margin: 0; font-size: 1rem; font-weight: 700; }
.pref-row select { width: auto; min-width: 9.5rem; }
.pref-row .picker { margin: 0; }
.pref-row .picker .mini-legend { font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: 0; margin-bottom: 6px; }
.pref-errors { list-style: none; }
/* Let me do it myself: the same size and shape as Plan my week for me, but plain. */
.button.self-go {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 58px;
  border: 0; border-radius: 14px; padding: 8px 16px; font-size: 1.15rem; font-weight: 700;
  background: var(--soft); color: var(--accent);
}

/* Page 2 and Meals this week: tinted panels, a label under each date. */
.pday { border: 0; background: var(--surface); box-shadow: var(--shadow); }
.pday.filled { background: var(--note-bg); }
.pday.lo.filled, .pday.freezer { background: var(--cue-bg); }
.pday.today, .wm-day.today { box-shadow: 0 0 0 2px var(--today-ring) inset; }
.day-label, .wm-kind { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-top: 1px; }
.pday-top { align-items: flex-start; }
.wm-day { border-left: 0; }
.wm-off { border: 0; background: var(--surface); }
.wm-empty { background: var(--surface); box-shadow: var(--shadow); }
.extras { border: 0; box-shadow: var(--shadow); }
/* Clear plan: soft grey, not red. */
.button.clear-go { background: var(--soft-grey); color: var(--muted); }

/* Leftovers into next week: the pop-up, the Freezer / leftovers line, Use on a night. */
.carry-ask {
  width: min(28rem, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto;
  border: 0; border-radius: 18px; padding: 18px 16px; background: var(--surface); color: var(--text);
  box-shadow: 0 10px 40px rgba(16, 53, 70, 0.3);
}
.carry-ask::backdrop { background: rgba(16, 53, 70, 0.45); }
html:not(.js) .carry-ask { display: block; position: static; width: auto; margin: 16px 0; box-shadow: var(--shadow); }
.carry-ask h2 { margin: 0 0 2px; font-size: 1.15rem; }
.carry-item { margin: 14px 0; }
.carry-item legend { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.carry-choices .chip span { padding: 8px 12px; min-height: 40px; font-size: 0.92rem; }
.carry-actions { display: grid; gap: 8px; margin-top: 16px; }
.carry-actions .button { width: 100%; }
.carry-line { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius); background: var(--cue-bg); }
.carry-line p { margin: 0; }
.carry-line ul { margin: 4px 0; padding-left: 18px; }
.carry-line .hint { margin-top: 2px; }
.pday-use { margin: 6px 0 0; }
.pday-use .mini-button { text-align: left; }

/* --- Batch 5b (2026-10-09): messages and warnings get their own look: a white card
   with a small icon and a coloured edge (slate for confirmations, amber for
   warnings), so they never look like part of the plan. --- */
.messages li, .leftovers, .banner {
  --edge: var(--info-edge);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1 8h2v7h-2zm0-4h2v2h-2z'/%3E%3C/svg%3E");
  position: relative; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  border: 0; border-left: 4px solid var(--edge); border-radius: var(--radius);
  padding-left: 42px; font-weight: 500;
}
.messages li::before, .leftovers::before, .banner::before {
  content: ""; position: absolute; left: 13px; top: 12px; width: 18px; height: 18px; background: var(--edge);
  -webkit-mask: var(--icon) no-repeat center / contain; mask: var(--icon) no-repeat center / contain;
}
.messages li.success {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E");
}
.messages li.warning, .messages li.error, .leftovers {
  --edge: var(--warn-edge);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2 1 21h22zm-1 7h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E");
  background: var(--warn-card); border-left-color: var(--edge);
}
.messages li { display: flex; align-items: flex-start; gap: 6px; padding: 10px 4px 10px 42px; }
.message-text { flex: 1; min-width: 0; padding-top: 1px; }
.messages .dismiss { flex: none; width: 32px; height: 32px; margin: -5px 0 -5px 0; }
html:not(.js) [data-dismiss], html:not(.js) [data-add-note] { display: none; }

/* Lock in: once pressed, sage with bottle green text. */
.lock-in.locking .lock-go { background: var(--pressed); border-color: var(--pressed); color: var(--pressed-text); }

/* Shopping list: the substitute panel in one font and size (16px, so iPhones don't zoom). */
.shop-panel, .shop-panel .button, .shop-panel input, .swap-chip { font-size: 16px; font-family: inherit; }
.shop-panel { padding: 4px 0 6px; }
.shop-panel p { margin: 0 0 6px; }
.shop-for a { font-weight: 600; }
.shop-label { color: var(--muted); }
.shop-swapped { gap: 6px 8px; margin-bottom: 8px; }
.swap-chips { margin: 0 0 8px; }
.swap-chip { border: 0; background: var(--soft); padding: 6px 14px; min-height: 40px; font-weight: 600; }

/* Review: several instruction edits, each on its own step. */
.note-edit { display: grid; gap: 6px; margin: 0 0 14px; }
.note-edit label.mini { margin: 0; }
.add-another {
  border: 0; background: none; padding: 6px 0; min-height: 40px; cursor: pointer;
  color: var(--accent); font: inherit; font-weight: 700;
}

/* Ingredient icons (batch 5d): Hob's illustrated drawings, one small SVG file each
   in static/meals/ingredients/, shown with <img>. */
.ing-icon { width: 24px; height: 24px; flex: none; vertical-align: -6px; margin-right: 8px; }
.shop-main summary .ing-icon, .shop-main > .ing-icon { margin-right: 6px; }
/* Back office: the icon grid to choose from, and rows with their icon. */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: 6px; }
.icon-pick { margin: 0; position: relative; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span {
  display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px;
  background: var(--step-ing-bg); font-size: 0.72rem; font-weight: 600; text-align: center; cursor: pointer;
}
.icon-pick .ing-icon { width: 30px; height: 30px; margin: 0; }
.icon-pick input:checked + span { background: var(--note-bg); box-shadow: 0 0 0 2px var(--accent) inset; }
.icon-pick input:focus-visible + span { outline: 3px solid var(--steel); outline-offset: 2px; }
.icon-rows { list-style: none; margin: 0 0 8px; padding: 0; }
.icon-rows a { display: flex; align-items: center; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.icon-rows .hint { margin-left: auto; color: var(--accent); font-weight: 600; }
.recipe-list a.with-icon { display: grid; grid-template-columns: 30px 1fr; column-gap: 0; }
.recipe-list a.with-icon .ing-icon { grid-row: span 2; align-self: center; }

/* Meals this week (batch 5c): the date column fits its label, which never wraps. */
.wm-day { grid-template-columns: max-content minmax(0, 1fr); }
.wm-kind { white-space: nowrap; }
.pref-settings { margin: 12px 0 0; }

/* --- Batch 5d (2026-10-09): the big buttons narrower; Meals this week in one column
   like the plan for the week; shopping ticks on the right. Batch 6: Lock in back at
   the bottom, one solid colour and shorter. --- */
.lock-in { margin: 12px 0 8px; display: flex; justify-content: center; }
.button.lock-go {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 16px;
  border: 0; border-radius: 14px; font-size: 1.05rem; font-weight: 800; color: var(--lock-text);
  background: var(--lock); box-shadow: 0 2px 8px rgba(16, 53, 70, 0.15); transition: transform 0.15s;
}
.button.lock-go svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button.lock-go:active { transform: scale(0.98); }
.lock-in.locking .lock-go { box-shadow: none; }
.lock-in.locking .lock-go svg { display: none; }
/* Narrower: centred, at most 19rem. */
.button.plan-go, .button.self-go, .button.lock-go, .plan-actions .button.primary { width: min(100%, 19rem); }
.setup-actions { justify-items: center; }
.plan-actions { margin: 14px 0 6px; }
/* Meals this week: one column per day (date, label, then the meal), like page 2. */
.wm-day { display: block; padding: 8px 10px 10px 12px; }
.wm-date { display: block; }
.wm-what { display: block; margin-top: 4px; }
/* Shopping list: tick boxes on the right, easier to reach with a thumb. */
.shop-tick { order: 2; }
.shop-main { order: 1; }
.shop-main summary::after { content: none; }

/* --- Batch 6 (2026-10-09): the new palette's roles. Links, secondary buttons and
   icons are steel blue; main actions bottle green; selected things moss on pale
   green (small text stays navy or bottle green: white on moss or steel blue is only
   for large bold text); warnings a thin bronze edge on a white card. --- */
a { color: var(--link); }
.meal-link, .wm-what a, .extra-list a, .shop-for a, .recipe-list a, .entry-main { color: var(--text); }
h1, h2, h3, legend, .shop-group h2 { color: var(--text); }
.shop-group.staples h2 { color: var(--muted); }

/* Top bar and bottom bar: white, navy wordmark and labels, steel blue icons, moss for the page I'm on. */
.topbar { box-shadow: 0 1px 0 var(--grey), 0 2px 10px rgba(16, 53, 70, 0.06); }
/* Batch 6b: icons and labels all navy; the page I'm on has a pale green bubble and a navy bar. */
.topbar .icon, .topbar .icon[aria-current], .mainnav a, .mainnav svg { color: var(--navy); }
.mainnav a[aria-current] { color: var(--navy); box-shadow: inset 0 3px 0 var(--navy); }
.mainnav a[aria-current] svg { box-sizing: content-box; padding: 2px 12px; border-radius: 14px; background: var(--pale-green); }
@media (min-width: 768px) { .mainnav a[aria-current] { box-shadow: inset 0 -3px 0 var(--navy); } }

/* Secondary buttons (batch 6b): filled navy with white text, no outlines. */
.button, .button.self-go, .mini-button, .swap-chip, .insert, .tool, .servings button, .stepper button {
  background: var(--navy); color: var(--white); border: 0;
}
.button.danger { background: var(--grey); color: var(--text); border: 0; }
.button.primary, .button.plan-go, .button.lock-go { border: 0; background: var(--accent); color: var(--accent-text); }
.button.plan-go { box-shadow: 0 2px 8px rgba(16, 53, 70, 0.15); }
.lock-in.locking .lock-go { background: var(--pressed); color: var(--pressed-text); }
/* Clear plan and Edit plan: the same quiet grey button. */
.button.clear-go { background: var(--grey); color: var(--text); border: 0; }
.add-another, .icon-rows .hint { color: var(--link); }
/* Back office tiles: navy icons on pale green (9.6:1). */
.office-icon { background: var(--pale-green); }
.office-icon svg { stroke: var(--navy); }
/* Back links: navy and bold. */
.crumb .back, a.back { color: var(--navy); font-weight: 700; }
/* Try something new: pale green (batch 6c). */
.billboard { background: var(--pale-green); }
/* The big planner buttons all match Lock in: 46px high, at most 19rem wide. */
.button.plan-go, .button.self-go {
  min-height: 46px; padding: 8px 16px; border-radius: 14px; font-size: 1.05rem; font-weight: 800; gap: 8px;
}
.button.plan-go svg { width: 20px; height: 20px; }

/* Selected: pale green with a moss ring, navy text. */
.chip input:checked + span, .chip-link.chosen, .pill.has-choice, .filters[data-active] > summary,
.active-filters a, .picked button, .cook-pill input:checked + span {
  background: var(--selected-bg); color: var(--text); box-shadow: 0 0 0 2px var(--selected) inset; border-color: transparent;
}
.eat-pill input:checked + span { background: var(--pale-blue); color: var(--text); box-shadow: 0 0 0 2px var(--steel) inset; }
.active-filters .clear a { background: var(--grey-chip); color: var(--link); box-shadow: none; border: 0; }
.pill[aria-expanded="true"], .tile[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--selected); border-color: transparent; }
.tile.has-choice { background: var(--selected-bg); box-shadow: 0 0 0 2px var(--selected) inset; }
.tabs [role="tab"][aria-selected="true"] { border-bottom-color: var(--selected); }
.plan-tabs [role="tab"] { background: var(--white); color: var(--text); border: 2px solid var(--sage); }
.plan-tabs [role="tab"][aria-selected="true"] { background: var(--selected-bg); color: var(--text); border-color: var(--selected); }
.icon-pick input:checked + span { background: var(--selected-bg); box-shadow: 0 0 0 2px var(--selected) inset; }
.rate input:checked + span { border-color: var(--selected); }
.rate-loved input:checked + span svg { fill: var(--moss); }
.rate-never input:checked + span { border-color: var(--grey-line); background: var(--grey); }
.rate-never input:checked + span svg, .rating-never { fill: var(--muted); color: var(--muted); }
.tick-box { color: transparent; }
.shop-item.ticked .tick-box { background: var(--moss); border-color: var(--moss); color: var(--white); }
.method > li.done .num { background: var(--grey); color: var(--muted); }
.stars label { color: var(--grey-line); }
.stars input:checked ~ label { color: var(--moss); }

/* Stage headers (batch 6b): bottle green with white text (13.4:1). */
.stage-toggle { background: var(--bottle); color: var(--white); font-size: 1.1rem; }
.stage-num { background: var(--white); color: var(--bottle); }
.stage.visited .stage-toggle { background: var(--grey); color: var(--text); }
.stage.visited .stage-num { background: var(--white); color: var(--muted); }

/* Days: cooking pale green, leftovers pale blue, Today a sky blue ring and tag. */
.pday.filled, .wm-cook { background: var(--pale-green); }
.pday.lo.filled, .pday.freezer, .wm-leftovers { background: var(--pale-blue); }
.pday.today, .wm-day.today { box-shadow: 0 0 0 2px var(--sky) inset; }
.today .tag { background: var(--sky); color: var(--text); }
/* Nothing planned: a white card with a thin bronze edge, like a warning. */
.wm-empty { background: var(--white); border-left: 3px solid var(--bronze); }

/* Warnings and errors: navy text; bronze only as the edge and the icon. */
.errorlist, .warn, .shop-more { color: var(--text); font-weight: 600; }
.errorlist li, .warn, .shop-more { border-left: 3px solid var(--bronze); padding-left: 8px; }
.errors { background: var(--white); border: 0; border-left: 3px solid var(--bronze); box-shadow: var(--shadow); }
.messages li, .leftovers, .banner { border-left-width: 3px; }

/* --- Batch 6c (2026-10-09): links navy (no steel blue text on white or grey); Edit meal's
   buttons and every − / + steel blue with navy, large bold text (navy on steel 3.6:1,
   fine for large text); each day's Edit button a darker shade of its panel. --- */
a:not([class]), .pday-add, .add-another, .crumb .back { color: var(--navy); font-weight: 700; }
.recipe-actions .button { background: var(--steel); color: var(--navy); font-size: 1.1rem; font-weight: 700; min-height: 44px; }
.servings button, .stepper button { background: var(--steel); color: var(--navy); font-weight: 700; }
/* Day panels: moss Edit on cooking days, steel blue on leftovers and freezer days, white text (accepted lower contrast). */
.pday.filled .pday-edit { background: var(--moss); color: var(--white); }
.pday.lo.filled .pday-edit, .pday.freezer .pday-edit { background: var(--steel); color: var(--white); }

/* --- Batch 7 (2026-10-16): Edit meal's Refresh for me and Choose from Cookbook as small,
   compact buttons (steel blue, navy bold text). --- */
.recipe-actions { gap: 6px; }
.recipe-actions .button { font-size: 0.85rem; font-weight: 700; min-height: 32px; padding: 4px 12px; line-height: 1.2; width: auto; }
/* One of each recipe: the warning under the title box while typing. */
.title-warn { margin: 6px 0 0; padding: 6px 10px; background: var(--white); border-left: 3px solid var(--bronze);
  border-radius: 8px; box-shadow: var(--shadow); font-size: 0.9rem; font-weight: 600; color: var(--text); }
.title-warn p { margin: 2px 0; }
.title-warn a { color: var(--navy); font-weight: 700; }
/* Cookbook search (batch 7): one rounded box above the pills; 16px so iPhone doesn't zoom. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cookbook-search { margin: 4px 0 10px; }
.cookbook-search input[type="search"] { width: 100%; box-sizing: border-box; font-size: 16px; font-family: inherit; color: var(--text);
  padding: 10px 14px 10px 38px; min-height: 44px; border: 0; border-radius: 999px; background-color: var(--grey-chip);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23103546' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; background-size: 18px; -webkit-appearance: none; appearance: none; }
.cookbook-search input[type="search"]:focus { outline: 2px solid var(--moss); outline-offset: 1px; }
.search-results { margin-top: 8px; }
/* Leftover portions for next week (batch 7). */
.wm-next { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.pd-next-week { border-top: 1px solid var(--grey-line); }
/* Batch cooking (batch 7): Batch: Base / Spin-off. */
.batch-base[hidden] { display: none; }
.batch-base { margin-top: 8px; }
.base-note { margin: 6px 0 10px; padding: 8px 12px; background: var(--pale-green); border-radius: var(--radius); font-weight: 600; color: var(--text); }
a.base-link { color: var(--navy); font-weight: 700; }
.ingredients .base-line { font-weight: 600; }
.spinoffs { margin-top: 18px; }
.spinoffs h2 { font-size: 1.1rem; }
.batch-for { display: block; }
.batch-made { margin: 12px 0; align-items: flex-start; }
.batch-made .helptext { display: block; font-weight: 400; }
/* Back to a recipe, plus the Cookbook (a base opened from its spin-off). */
.crumb .back-also { margin-left: 16px; }
/* Cookbook search: our own × to clear (the browser's own is hidden so there's only one). */
.search-box { position: relative; display: block; }
.cookbook-search input[type="search"] { padding-right: 44px; }
.cookbook-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: var(--navy); color: var(--white); font-size: 1.1rem; font-weight: 700;
  line-height: 1; padding: 0; cursor: pointer; display: grid; place-items: center; }
.search-clear[hidden] { display: none; }
.search-clear:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }

/* --- Batch 8 (2026-10-16): the Planner's progress strip and a compact week heading. --- */
/* Progress strip: a soft segmented bar; the current step lifts out as a white pill, the
   others are faded. A guide only (no links). */
.plan-steps { list-style: none; margin: 4px 0 10px; padding: 3px; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 3px; background: var(--grey-chip); border-radius: 999px; counter-reset: none; }
.plan-steps li { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px;
  padding: 4px 6px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; line-height: 1.15; text-align: center;
  color: var(--text); opacity: 0.5; }
.plan-steps .ps-num { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  font-size: 0.7rem; font-weight: 700; background: var(--white); color: var(--text); }
.plan-steps li.current { opacity: 1; background: var(--white); font-weight: 700; box-shadow: 0 1px 4px rgba(16, 53, 70, 0.16); }
.plan-steps li.current .ps-num { background: var(--moss); color: var(--white); }
@media (max-width: 370px) { .plan-steps .ps-num { display: none; } .plan-steps li { font-size: 0.74rem; } }

/* Compact week heading: ‹  This week  Mon 12th – Sun 18th Oct  ›  on one line (the dates
   drop under the name on a narrow phone). */
.week-head { align-items: center; gap: 6px; margin: 2px 0 8px; }
.week-head .week-arrow { width: 36px; height: 36px; min-height: 36px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.3rem; padding: 0; }
.week-head span.week-arrow { visibility: hidden; }
.week-mid { min-width: 0; text-align: center; flex: 1; }
.week-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 8px;
  margin: 0; font-size: 1rem; line-height: 1.25; }
.week-line .week-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.week-line .week-dates { font-size: 0.85rem; font-weight: 400; color: var(--text); opacity: 0.8; margin: 0; }
.week-head .week-back { margin: 2px 0 0; font-size: 0.8rem; }
.week-head .page-kind { margin: 0 0 2px; }

/* --- Batch 9 (2026-10-16): recipe photos. --- */
.photo-field { display: grid; gap: 6px; }
.photo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-preview { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; background: var(--grey-fill); flex: none; }
.photo-controls { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.photo-field input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.photo-pick { cursor: pointer; }
.photo-remove { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.photo-field .hint { margin: 0; }
/* Recipe page: the photo under the title. */
.recipe-photo { display: block; width: 100%; aspect-ratio: 4 / 3; max-height: 420px; object-fit: cover;
  border-radius: var(--radius); margin: 4px 0 12px; background: var(--grey-fill); }
/* Cookbook rows: a small square thumbnail at the left, only when the recipe has a photo. */
.recipe-list a.has-thumb { display: grid; grid-template-columns: 56px 1fr; column-gap: 12px; align-items: center; }
.recipe-list a.has-thumb .row-thumb { grid-row: 1 / span 2; width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.recipe-list a.has-thumb .title, .recipe-list a.has-thumb .meta { grid-column: 2; min-width: 0; }

/* Batch 10: the Cookbook's full list, A–Z under small letter dividers */
.a-to-z { margin-top: 28px; }
.a-to-z h2 { margin: 0 0 4px; font-size: 1.15rem; }
.a-to-z h2 .count { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.az-letter { margin: 12px 0 0; padding: 0 0 2px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); border-bottom: 1px solid var(--line); }

/* Batch 11: Cook soon — a toggle on the recipe page, a small chip on Cookbook rows */
.cook-soon { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 12px; }
.cook-soon .hint { font-size: 0.85rem; }
.button.soon-toggle[aria-pressed="true"] { background: var(--selected-bg); border-color: var(--selected); color: var(--bottle); font-weight: 700; }
.soon-chip { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--selected-bg); color: var(--bottle); font-size: 0.72rem; font-weight: 700; vertical-align: 2px; white-space: nowrap; }
.soon-note { margin: 0 0 10px; }

/* --- Photos on the planning pages (2026-10-16): 56px like All recipes A–Z, beside the
   name; a plate placeholder when a recipe has no photo, so names line up; faded on a
   leftovers day so cooking days stand out. --- */
.with-thumb { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; align-items: center; }
.thumb-text { min-width: 0; }
.plan-thumb { display: block; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; }
.plan-thumb img { display: block; width: 56px; height: 56px; object-fit: cover; }
.plan-thumb.placeholder { display: flex; align-items: center; justify-content: center; background: var(--step-ing-bg); color: var(--muted); }
.plan-thumb.placeholder svg { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: 0.7; }
.plan-thumb.faded { opacity: 0.55; }
.pday-meal.with-thumb { margin-top: 6px; }
.extra-what.with-thumb { flex: 1; }
.wm-item { margin-top: 6px; }
.wm-item:first-child { margin-top: 2px; }
.chosen-recipe .chosen-title.with-thumb { font-size: 1.05rem; }

/* --- Batch 12 (2026-10-19) --- */
/* Page 2: the refresh icon under a cooking day's Edit, same colours as Edit; the page
   comes back at that day (#day-N), clear of the top bar. */
.pday { scroll-margin-top: 88px; }
.pday-tools { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pday-tools .pday-edit { margin-left: 0; }
.pday-refresh { margin: 0; }
/* The icon hangs beside the meal line rather than making the top row taller; the
   recipe name keeps clear of it. */
.pday.has-refresh .pday-tools { margin-bottom: -38px; position: relative; z-index: 1; }
.pday.has-refresh .pday-meal { padding-right: 46px; }
.mini-button.refresh-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; min-height: 32px; padding: 0; border-radius: 14px; }
.refresh-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pday.filled .refresh-icon { background: var(--moss); color: var(--white); }
/* Meals this week: Edit plan and Clear plan side by side. */
.clear-plan.plan-end form { margin: 0; }
/* Freezer / leftovers line: a × like the other warnings. */
.carry-line.dismissible { position: relative; padding-right: 44px; }
/* The carry-over pop-up: a − / + counter per state, laid out like stage 2's rows. */
.carry-counts { list-style: none; margin: 0; padding: 0; }
.carry-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.carry-count label { font-weight: 600; }
.carry-sum { margin: 6px 0 0; font-size: 0.85rem; }
.carry-item.unsorted .carry-sum { color: var(--navy); font-weight: 700; }
.carry-actions .button:disabled { opacity: 0.5; cursor: default; }
/* Recipe page: Cooking Mode (MK3, 2026-11-09), a pale green strip edge to edge straight under the tabs; on: mid green, white words.
   Darkest green on g4 10.6:1; white on g1 5.3:1. */
.making-toggle { display: flex; align-items: center; gap: 10px; width: calc(100% + 32px); min-height: 48px; margin: -12px -16px 12px; padding: 10px 16px; border: 0; border-radius: 0; background: var(--g4); box-shadow: none; color: var(--g0); font: inherit; font-size: 0.9rem; font-weight: 800; cursor: pointer; }
.making-toggle[hidden] { display: none; }
.making-toggle svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.making-label { flex: 1; display: flex; flex-direction: column; text-align: left; }
.making-sub { font-size: 0.75rem; font-weight: 600; opacity: 0.9; }
.making-sub[hidden] { display: none; }
.making-state { position: relative; flex: none; width: 42px; height: 26px; border-radius: 999px; background: var(--white); transition: background 0.2s; }
.making-state::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--g1); transition: transform 0.2s, background 0.2s; }
.making-toggle[aria-pressed="true"] { background: var(--g1); color: var(--white); }
.making-toggle[aria-pressed="true"] .making-state { background: var(--g0); }
.making-toggle[aria-pressed="true"] .making-state::after { background: var(--white); transform: translateX(16px); }
/* The Cookbook icon's dot while a recipe is being made. */
.mainnav a { position: relative; }
.mainnav a.making::after { content: ""; position: absolute; top: 9px; left: calc(50% + 14px); width: 9px; height: 9px; border-radius: 50%; background: var(--moss); box-shadow: 0 0 0 2px var(--white); }
@media (min-width: 768px) { .mainnav a.making::after { top: 14px; left: 28px; } }
@media (prefers-reduced-motion: reduce) { .making-state, .making-state::after { transition: none; } }
/* Shopping list: category headings fold a finished category away (with JS only). */
.shop-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.shop-head-label { flex: 0 1 auto; }
.shop-head-tick, .shop-head-count { display: none; }
.shop-head-count { font-weight: 600; color: var(--muted); }
.shop-head-chevron { margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: 0.6; transition: transform 0.2s; }
html:not(.js) .shop-head-chevron { display: none; }
html.js .shop-group.folded .shop-items, html.js .shop-group.folded > .hint { display: none; }
html.js .shop-group.folded .shop-head { padding: 10px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
html.js .shop-group.folded .shop-head-tick { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--moss); color: var(--white); font-size: 0.8rem; }
html.js .shop-group.folded .shop-head-count { display: inline; }
html.js .shop-group.folded .shop-head-chevron { transform: rotate(-45deg); }
/* You're all set: a soft card above the bottom bar that fades by itself. */
.all-set { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 30; display: flex; justify-content: center; transition: opacity 0.5s, transform 0.5s; }
.all-set[hidden] { display: none; }
.all-set.leaving { opacity: 0; transform: translateY(8px); }
.all-set-card { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; max-width: 22rem; padding: 14px 18px; border-radius: 18px; background: var(--pale-green); box-shadow: inset 0 0 0 2px var(--sage), 0 6px 24px rgba(16, 53, 70, 0.16); color: var(--navy); animation: all-set-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.all-set-tick { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--moss); color: var(--white); font-size: 1.2rem; font-weight: 700; }
.all-set-text strong { display: block; font-size: 1.1rem; }
.all-set-text span { font-size: 0.88rem; color: var(--muted); }
.all-set-dot { position: absolute; left: var(--x); top: 40%; width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: 0; animation: all-set-rise 1.8s ease-out var(--d) forwards; pointer-events: none; }
@keyframes all-set-in { from { opacity: 0; transform: translateY(12px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes all-set-rise { 0% { opacity: 0; transform: translateY(0) scale(0.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-70px) scale(1); } }
@media (min-width: 768px) { .all-set { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .all-set-card { animation: none; } .all-set, .shop-head-chevron { transition: none; } }

/* ===== Rebrand, chunk 1 (2026-10-23): the shared pieces (BRIEF.md → Colours → Pieces).
   Later rules win, so this section restyles what the batches above set up. ===== */
body { font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3, legend { font-weight: 800; }

/* Top bar: white, HOB on the left, back office and account in soft round buttons. */
.topbar { box-shadow: 0 1px 0 rgba(16, 53, 70, 0.06); }
.topbar .icons { gap: 8px; }
.topbar .icon { width: 40px; height: 40px; background: var(--grey-bg); }
.topbar .icon svg { width: 22px; height: 22px; }
.topbar .icon[aria-current] { background: var(--g4); }
/* Bottom bar as before: a darkest blue line on the current tab, pale green behind its icon. */
.mainnav a[aria-current] svg { background: var(--g4); }

/* Buttons (B3, soft depth). Main buttons darkest blue with a gentle sheen; the rest
   white and raised with darkest blue text. */
.button, .button.self-go, .mini-button, .swap-chip, .insert, .tool {
  background: var(--white); color: var(--b0); border: 0;
  box-shadow: 0 1px 2px rgba(16, 53, 70, 0.08), 0 3px 10px rgba(16, 53, 70, 0.1);
}
.button { border-radius: 12px; font-weight: 700; }
.button.primary, .button.plan-go {
  background: linear-gradient(180deg, #1D4B5F 0%, var(--b0) 100%); color: var(--white);
  box-shadow: 0 6px 16px rgba(16, 53, 70, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.button.lock-go {
  background: linear-gradient(180deg, #33532A 0%, var(--g0) 100%); color: var(--white);
  box-shadow: 0 6px 16px rgba(34, 58, 24, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
/* Locked in (Z1): mid green with a tick and "Locked in". */
.lock-in.locking .lock-go { background: var(--g1); color: var(--white); box-shadow: 0 6px 16px rgba(74, 118, 55, 0.3); }
/* Main buttons full width, matching the cards; Let me do it myself the same size. */
.button.plan-go, .button.self-go, .button.lock-go, .plan-actions .button.primary { width: 100%; min-height: 48px; border-radius: 14px; }
.lock-in { display: block; }
.button.danger, .button.clear-go { background: var(--white); color: var(--b0); }
.button:disabled { box-shadow: none; }
/* Edit meal's Refresh for me and Choose from Cookbook: pale green. */
.recipe-actions .button { background: var(--g4); color: var(--g0); }
.mini-button { border-radius: 10px; }

/* Counters (− / +): round, white and raised, the number in a fixed slot between. */
.servings button, .stepper button {
  background: var(--white); color: var(--b0); font-weight: 700; border: 0;
  box-shadow: 0 1px 2px rgba(16, 53, 70, 0.1), 0 2px 8px rgba(16, 53, 70, 0.1);
}
.stepper.shown input, .servings output { min-width: 2ch; font-variant-numeric: tabular-nums; }

/* Pills (P1): Cook pale green, Eat in pale blue, each with a darker ring and a tick when
   chosen; plain grey with no tick when not; both always the same width. */
.cd-row { grid-template-columns: 1fr 6.6rem 6.6rem; }
.pill-toggle span { width: 100%; min-width: 0; height: 40px; border-radius: 999px; background: var(--grey); color: var(--b0); box-shadow: none; }
.pill-toggle span::before { content: "✓"; margin-right: 5px; visibility: hidden; font-weight: 800; }
.pill-toggle input:checked + span::before { visibility: visible; }
.cook-pill input:checked + span { background: var(--g4); color: var(--b0); box-shadow: inset 0 0 0 2px var(--g1); }
.cook-pill input:checked + span::before { color: var(--g1); }
.eat-pill input:checked + span { background: var(--b4); color: var(--b0); box-shadow: inset 0 0 0 2px var(--b1); }
.eat-pill input:checked + span::before { color: var(--b1); }
@media (max-width: 340px) { .cd-row { grid-template-columns: 1fr 5.6rem 5.6rem; } }

/* Steps strip (S2): three numbered dots joined by a line, labels under each. The
   current step blue with a pale halo; finished steps green with a tick; steps to come
   white with a light blue ring. */
.plan-steps { margin: 6px 0 12px; padding: 0; background: none; border-radius: 0; display: block; }
.plan-steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.plan-steps li { position: relative; display: block; min-height: 0; padding: 0; opacity: 1; background: none; box-shadow: none; border-radius: 0; }
.plan-steps li + li::before { content: ""; position: absolute; top: 14px; right: 50%; width: 100%; height: 3px; background: var(--b4); }
.plan-steps li.done + li::before { background: var(--g2); }
.plan-steps form { margin: 0; }
.ps-go { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%;
  padding: 0 2px; border: 0; background: none; font: inherit; font-size: 0.76rem; font-weight: 600; line-height: 1.2;
  text-align: center; color: var(--muted); text-decoration: none; cursor: default; }
a.ps-go, button.ps-go { cursor: pointer; color: var(--b0); }
.ps-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800;
  background: var(--white); color: var(--b0); box-shadow: inset 0 0 0 2px var(--b3); }
.ps-dot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.plan-steps li.done .ps-dot { background: var(--g1); color: var(--white); box-shadow: none; }
.plan-steps li.on .ps-dot { background: var(--b1); color: var(--white); box-shadow: 0 0 0 4px var(--b4); }
.plan-steps li.on .ps-go, .plan-steps li.done .ps-go { color: var(--b0); }
.plan-steps li.on .ps-go { font-weight: 800; }
.ps-go:focus-visible { outline: 3px solid var(--b1); outline-offset: 2px; border-radius: 8px; }

/* Week banner (W2): a white card; the week and dates, ‹ › in round pale buttons, then
   the seven days as circles with a key. */
.week-head { display: block; margin: 0 0 12px; padding: 12px 12px 10px; background: var(--white); border-radius: 18px; box-shadow: var(--shadow); }
.week-row { display: flex; align-items: center; gap: 6px; }
.week-head .week-mid { flex: 1; min-width: 0; text-align: left; }
.week-line { justify-content: flex-start; gap: 2px 8px; }
.week-line .week-title { font-size: 1.1rem; font-weight: 800; }
.week-line .week-dates { color: var(--muted); opacity: 1; }
.week-head .week-arrow { width: 34px; height: 34px; min-height: 34px; background: var(--b5); color: var(--b0); box-shadow: none; font-size: 1.25rem; font-weight: 700; }
.week-head .week-back { margin: 4px 0 0; }
.week-days { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.week-days li { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.68rem; font-weight: 700; color: var(--muted); }
.week-days b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; font-weight: 800; color: var(--b0); }
.week-days .wd-c b { background: var(--g4); }
.week-days .wd-l b { background: var(--b4); }
.week-days .wd-o b { box-shadow: inset 0 0 0 1.5px var(--grey); color: var(--muted); font-weight: 600; }
/* Today: a ring in the day's own colour. */
.week-days .wd-c.now b { box-shadow: 0 0 0 2.5px var(--white), 0 0 0 4.5px var(--g1); }
.week-days .wd-l.now b { box-shadow: 0 0 0 2.5px var(--white), 0 0 0 4.5px var(--b1); }
.week-days .wd-o.now b { box-shadow: inset 0 0 0 1.5px var(--grey), 0 0 0 2.5px var(--white), 0 0 0 4.5px rgba(16, 53, 70, 0.45); }
.week-key { display: flex; justify-content: center; gap: 14px; margin: 8px 0 0; font-size: 0.68rem; color: var(--muted); }
.week-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.week-key .k-c { background: var(--g4); } .week-key .k-l { background: var(--b4); } .week-key .k-o { box-shadow: inset 0 0 0 1.5px var(--grey); }
@media (max-width: 360px) { .week-days b { width: 30px; height: 30px; } }

/* ===== Rebrand, chunk 2 (2026-10-23): Set Preferences (H3, I3, T3; stage 2 counters). ===== */
/* Stage headers (H3): the open stage has a darkest blue ring and a pale blue header;
   finished stages (number becomes a green tick) and stages to come are slim and
   see-through. Stage numbers in darkest blue circles with white numbers. */
.stage { margin: 0 0 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.65); overflow: hidden; }
.stage.open { background: var(--white); box-shadow: 0 0 0 2px var(--b0), var(--shadow); }
.stage-toggle, .stage.visited .stage-toggle { min-height: 0; padding: 9px 14px; gap: 12px; border-radius: 0; background: transparent; color: var(--muted); font-size: 0.95rem; font-weight: 800; }
.stage.open .stage-toggle { padding: 13px 14px; background: var(--b5); color: var(--b0); font-size: 1rem; }
.stage-num, .stage.visited .stage-num { width: 28px; height: 28px; font-size: 0.8rem; background: var(--b0); color: var(--white); }
.stage.visited:not(.open) .stage-num { font-size: 0; background: var(--g1); }
.stage.visited:not(.open) .stage-num::after { content: "✓"; font-size: 0.85rem; font-weight: 800; color: var(--white); }
.stage-chevron { color: var(--b0); }
.stage-body { padding: 12px 14px 14px; }
.stage-intro { font-size: 0.85rem; }
/* Rows: white with thin dividers; names bold. */
.cd-row, .pd-row, .pref-row { border-bottom-color: var(--grey); }
.pd-row:last-child, .pref-row:last-child { border-bottom: 0; }
/* Stage 2's counters (Q4): pale green on cooking days, pale blue on leftovers nights, plain
   grey otherwise; no rings (2026-10-26, like the recipe page's Serves). */
.pd-row .stepper button { background: var(--grey); color: var(--muted); box-shadow: none; }
.pd-row.pd-c .stepper button { background: var(--g4); color: var(--g0); box-shadow: none; }
.pd-row.pd-l .stepper button { background: var(--b4); color: var(--b0); box-shadow: none; }
.pd-row .stepper button:disabled { opacity: 0.4; }

/* Pickers (I3): a bold name, a one-line description, a search box, then chips. */
.pick-two { margin: 0; }
.pk-label { margin: 0; font-weight: 800; font-size: 0.95rem; }
.pk-desc { margin: 0 0 8px; font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.pick-two input[type=search] { min-height: 42px; border: 0; border-radius: 12px; background: var(--grey-bg); box-shadow: inset 0 0 0 1px var(--grey);
  padding-left: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23103546' stroke-opacity='.76' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center; background-size: 18px; }
.picker-item { gap: 8px; }
.picker-item .pi-kind { margin-left: auto; font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.picked { gap: 6px; margin-top: 8px; }
.picked button.pc { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 32px; padding: 4px 5px 4px 10px; border-radius: 999px;
  font: 700 0.8rem/1.2 inherit; font-family: inherit; color: var(--b0); background: var(--g4); box-shadow: none; }
.pk-out .picked button.pc { background: var(--grey); }
.picked button.pc svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--g1); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pk-out .picked button.pc svg { stroke: var(--muted); stroke-width: 2.2; }
.pc-t { text-align: left; }
.pc-x { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.75); font-size: 0.95rem; line-height: 1; }

/* Cook soon (T3): a small pale green card with the recipe's photo. */
.soon-card { margin: 0 0 10px; padding: 8px; border-radius: 14px; background: var(--g5); align-items: center; }
.soon-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.soon-k { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--g0); }
.soon-n { font-weight: 800; font-size: 0.9rem; line-height: 1.25; color: var(--b0); }
.soon-d { font-size: 0.78rem; color: var(--muted); }

/* ===== Rebrand, chunk 3 (2026-10-23): Plan the Week (C2, L3, E0, A1, F2+F3, G3, X2, Z1). ===== */
html.js .nojs-only, html:not(.js) .js-only { display: none !important; }
.pdays { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; padding: 0; }
/* Each day a white card: the date in a pale chip (green cooking, blue leftovers). */
.pday, .pday.freezer, .pday.lo { display: flex; flex-direction: column; gap: 6px; padding: 11px 12px 12px; background: var(--white); border: 0; border-radius: 18px; box-shadow: var(--shadow); }
.pday-top { display: flex; align-items: center; gap: 8px; min-height: 0; }
.pday-date { padding: 3px 10px; border-radius: 999px; background: var(--g4); font-weight: 800; font-size: 0.85rem; line-height: 1.3; white-space: nowrap; }
.pday.lo .pday-date, .lorow .pday-date { background: var(--b4); }
.pday.past:not(.today) .pday-date { color: var(--b0); opacity: 0.75; }
.day-label { margin: -2px 0 0; font-size: 0.78rem; }
/* Today: a ring in the day's own colour, and the tag filled in it. */
.pday.today, .pgroup.today { box-shadow: 0 0 0 2.5px var(--g1), var(--shadow); }
.pday.lo.today, .pgroup.today.tlo { box-shadow: 0 0 0 2.5px var(--b1), var(--shadow); }
.tag.today-tag { padding: 3px 9px; border-radius: 999px; background: var(--g1); color: var(--white); font-size: 0.68rem; font-weight: 800; text-transform: none; letter-spacing: 0; }
.pday.lo .tag.today-tag, .tag.today-tag.lo { background: var(--b1); }
/* Edit and swap: pale with no outline and a soft shadow; green on cooking days, blue otherwise. */
.pday-tools { margin-left: auto; display: flex; flex-direction: row; align-items: center; gap: 6px; }
.mini-button.pday-edit, .mini-button.refresh-icon { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; min-height: 30px; padding: 0 12px;
  border-radius: 10px; font-size: 0.78rem; font-weight: 700; background: var(--g4); color: var(--g0);
  box-shadow: 0 1px 2px rgba(16, 53, 70, 0.08), 0 2px 6px rgba(16, 53, 70, 0.1); }
.mini-button.refresh-icon { width: 34px; padding: 0; }
.pday-edit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pday.lo .mini-button.pday-edit { background: var(--b4); color: var(--b0); }
.pday.filled .refresh-icon, .pday .refresh-icon { background: var(--g4); color: var(--g0); }
.pday-refresh { margin: 0; }
.pday-meal { margin: 0; }
.pday-meal .meal-link { font-weight: 700; }
.pday-meta { font-size: 0.78rem; }
/* L3: a cooking day with its leftovers nights joined on underneath, as pale blue rows. */
.pgroup { background: var(--white); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.pgroup .pday, .pgroup .pday.today { box-shadow: none; border-radius: 0; }
.lorow { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--b5); border-top: 1px solid var(--b4); scroll-margin-top: 88px; }
.lorow .pday-date { font-size: 0.8rem; }
.lo-arrow { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--b1); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lo-kind { font-size: 0.78rem; color: var(--muted); }
.lorow .mini-button.pday-edit { margin-left: auto; background: var(--white); color: var(--b0); }
/* An empty day (A1): a full-width pale green + Add meal, then the drag hint. */
a.pday-add { display: flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0; border-radius: 12px; background: var(--g4); color: var(--g0); font-weight: 700; text-decoration: none; }
.pday-add svg, .add-plus svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.pday-hint { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-size: 0.78rem; color: var(--muted); }
.pday-hint svg { width: 14px; height: 14px; fill: none; stroke: var(--b1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pday-use { margin: 0; }
/* Batch cooking on its day (G3): the base first, then the meal; later spin-offs just mention it. */
.pbase { align-items: start; padding-bottom: 9px; margin-bottom: 2px; border-bottom: 1px solid var(--grey); }
.pbase-k { display: block; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.pbase .meal-link { display: block; font-weight: 700; font-size: 0.88rem; line-height: 1.3; }
.pbase-chip { display: inline-block; margin: 4px 0 2px; padding: 4px 9px; border-radius: 999px; background: var(--g4); color: var(--g0); font-size: 0.72rem; font-weight: 800; }
.pbase.made .pbase-chip { background: var(--b4); color: var(--b0); }
.puses { display: flex; align-items: center; gap: 7px; margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--grey); font-size: 0.78rem; color: var(--muted); }
.puses strong { color: var(--b0); }
.puses svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--g1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Notes (F2 + F3): tinted pale blue (freezer and fridge) or pale green (fresh food), a thin
   ring and the card shadow; the icon tight to the title; items as white pills. */
.pnote { position: relative; margin: 0 0 12px; padding: 12px; border-radius: 16px; background: var(--b5); box-shadow: inset 0 0 0 1px var(--b4), var(--shadow); }
.pnote.fresh-note { background: var(--g5); box-shadow: inset 0 0 0 1px var(--g4), var(--shadow); }
.note-title { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; padding-right: 32px; font-weight: 800; font-size: 0.92rem; line-height: 19px; }
.note-title svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--b1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fresh-note .note-title svg { stroke: var(--g1); }
.pnote.dismissible > form { top: 5px; right: 6px; }
.pnote .dismiss { background: transparent; color: var(--b0); }
.note-pills { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.fz-pill { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 5px 8px 5px 5px; border-radius: 14px; background: var(--white);
  box-shadow: 0 1px 2px rgba(16, 53, 70, 0.1), 0 2px 6px rgba(16, 53, 70, 0.12); }
.fz-pill.drag { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.fz-pill img, .fz-ph { width: 38px; height: 38px; flex: none; border-radius: 10px; object-fit: cover; background: var(--grey-fill); }
.fz-t { display: flex; flex-direction: column; min-width: 0; }
.fz-t b { font-size: 0.85rem; line-height: 1.25; }
.fz-t small { font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.fz-grip { width: 14px; height: 14px; flex: none; margin-left: auto; fill: var(--b1); }
.fz-pill.sel { box-shadow: 0 0 0 2.5px var(--b1); }
.fz-pill:focus-visible { outline: 3px solid var(--b1); outline-offset: 2px; }
.fz-pill.lifted { opacity: 0.35; }
.fz-pill.ghost { position: fixed; z-index: 50; width: min(20rem, 80vw); pointer-events: none; transform: translate(-50%, -60%) scale(1.04); box-shadow: 0 8px 22px rgba(16, 53, 70, 0.3); }
.fz-pill.shake { animation: hob-shake 0.35s; }
@keyframes hob-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pnote .hint { margin: 8px 0 0; font-size: 0.78rem; }
.fresh-pills { grid-template-columns: max-content; max-width: 100%; }
.npill { display: flex; align-items: center; gap: 5px; min-height: 34px; padding: 6px 14px; border-radius: 999px; background: var(--white); font-size: 0.82rem;
  box-shadow: 0 1px 2px rgba(16, 53, 70, 0.1), 0 2px 6px rgba(16, 53, 70, 0.12); }
.npill small { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
/* While dragging (or after tapping a pill): nights it fits are ringed in green. */
.pdays.dragging [data-day].fits { box-shadow: inset 0 0 0 2.5px var(--g2); }
.pdays.dragging [data-day].fits.over { box-shadow: inset 0 0 0 3.5px var(--g1); background: var(--g5); }
.pdays.dragging [data-day].over.nofit { box-shadow: inset 0 0 0 3px var(--bronze); }
.drop-toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 40; max-width: 24rem; margin: 0 auto;
  padding: 11px 12px 11px 40px; border-radius: 14px; background: var(--white); color: var(--b0); font-weight: 600; font-size: 0.9rem; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(16, 53, 70, 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239A6412' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 16H3z'/%3E%3Cpath d='M12 10v4.5M12 17.5v.01'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px 11px; background-size: 20px; }
.drop-toast[hidden] { display: none; }
@media (min-width: 768px) { .drop-toast { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .fz-pill.shake { animation: none; } }

/* Extra dishes: one white section card; Add an extra dish full width, pale green with a ring (X2). */
.extras { margin: 0 0 12px; padding: 12px; background: var(--white); border: 0; border-radius: 18px; box-shadow: var(--shadow); }
.extras h2 { margin: 0 0 8px; font-size: 0.95rem; }
.extra-list li { border-bottom-color: var(--grey); }
a.add-extra { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; margin-top: 8px; border-radius: 12px; background: var(--g4); color: var(--g0);
  box-shadow: inset 0 0 0 2px var(--g1); font-weight: 700; text-decoration: none; }
.add-plus { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--g1); color: var(--white); }
.add-plus svg { width: 13px; height: 13px; stroke-width: 2.8; }
/* Lock in and Clear plan. */
.lock-in { margin: 6px 0 0; }
.button.clear-go { display: inline-flex; align-items: center; gap: 6px; }
.button.clear-go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Rebrand, chunk 4 (2026-10-23): Edit meal (U2, Y2, EO1, Batch cook, move pop-up). ===== */
.em-title { margin: 8px 0 12px; font-size: 1.35rem; }
.em-card { margin: 0 0 12px; padding: 12px; background: var(--white); border-radius: 18px; box-shadow: var(--shadow); }
.em-h { margin: 0 0 10px; font-weight: 800; font-size: 0.95rem; }
.em-h.sub { margin: 10px 0 4px; padding-top: 10px; border-top: 1px solid var(--grey); width: 100%; }
/* The recipe (U2): a wide photo, the name, then two equal pale green buttons. */
.em-recipe { padding: 0; overflow: hidden; }
.em-banner { display: block; aspect-ratio: 16 / 7; background: var(--grey-fill); }
.em-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.em-banner.none { display: none; }
.em-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.em-name { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 1rem; line-height: 1.3; color: var(--b0); }
.em-name svg { width: 18px; height: 18px; margin-left: auto; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.em-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recipe-actions.em-btns .button { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 38px; padding: 0 8px; border-radius: 11px;
  font-size: 0.82rem; white-space: nowrap; background: var(--g4); color: var(--g0); box-shadow: 0 1px 2px rgba(16, 53, 70, 0.08), 0 2px 6px rgba(16, 53, 70, 0.1); }
.em-btns svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Cook on (Y2): day circles. The meal's day pale green with a darkest green ring and a
   tick; other meals' days pale blue; free cooking days palest green; days not cooking
   white with a dashed light blue ring. */
.em-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.emd { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 0; font-size: 0.68rem; font-weight: 700; color: var(--muted); text-decoration: none; cursor: pointer; }
.emd input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.emd b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; font-weight: 800; color: var(--b0); background: var(--g5); box-shadow: inset 0 0 0 1.5px var(--g3); }
.emd.has b { background: var(--b4); box-shadow: none; }
.emd.off b { background: var(--white); box-shadow: none; outline: 1.5px dashed var(--b3); outline-offset: -1.5px; color: var(--muted); font-weight: 600; }
.emd.on b, .emd input:checked + span + b { background: var(--g4); box-shadow: inset 0 0 0 2px var(--g0); color: var(--g0); }
.emd b svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.emd.no { cursor: default; opacity: 0.45; }
.emd:focus-visible b, .emd input:focus-visible + span + b { outline: 3px solid var(--b1); outline-offset: 2px; }
.em-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 8px 0 0; font-size: 0.68rem; color: var(--muted); }
.em-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.em-key .k-on { background: var(--g4); box-shadow: inset 0 0 0 1.5px var(--g0); }
.em-key .k-has { background: var(--b4); }
.em-key .k-off { outline: 1.5px dashed var(--b3); outline-offset: -1.5px; }
/* Portions, Eaten on, For next week, To freeze (EO1): one card of rows; the numbers line up. */
.em-rows .field, .em-rows fieldset { margin: 0; }
.em-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 4px 0; border-bottom: 0; }
.em-row label, .em-row > span:first-child, .em-rl { margin: 0; font-weight: 700; font-size: 0.92rem; }
.em-row .helptext, .em-row .eaten-out, .em-rl small { display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.eaten-row.taken .eaten-day { color: var(--muted); font-weight: 700; font-size: 0.92rem; }
.eaten-row.taken .taken-by { display: block; font-size: 0.75rem; font-style: italic; font-weight: 600; }
.em-row .stepper button { background: var(--grey); color: var(--muted); box-shadow: none; }
.em-row.c .stepper button { background: var(--g4); color: var(--g0); box-shadow: none; }
.em-row.l .stepper button { background: var(--b4); color: var(--b0); box-shadow: none; }
.freeze-row { margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--grey); }
/* To freeze's number in the same slot as the counters' numbers (44px buttons, 6px gaps). */
.freeze-num { display: inline-flex; align-items: center; justify-content: center; width: calc(44px * 2 + 12px + 2.4ch); }
.freeze-num output { min-width: 2.4ch; text-align: center; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.em-actions { margin: 4px 0 0; }
/* Batch cook: the base with a switch, then what it makes and Extra to freeze. */
.batch-panel .bp-head { align-items: center; }
.batch-panel .bp-head .thumb-text { display: flex; flex-direction: column; }
.bp-switch { position: relative; flex: none; width: 46px; height: 28px; margin: 0 0 0 auto; cursor: pointer; }
.batch-panel .bp-head { grid-template-columns: 56px minmax(0, 1fr) auto; }
.bp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bp-switch span[aria-hidden] { position: absolute; inset: 0; border-radius: 999px; background: var(--grey); box-shadow: inset 0 0 0 1.5px rgba(16, 53, 70, 0.45); transition: background 0.15s; }
.bp-switch span[aria-hidden]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.bp-switch input:checked + span { background: var(--g1); box-shadow: none; }
.bp-switch input:checked + span::after { transform: translateX(18px); }
.bp-switch input:focus-visible + span { outline: 3px solid var(--b1); outline-offset: 2px; }
.bp-what { margin: 10px 0 4px; font-size: 0.85rem; line-height: 1.4; }
.batch-panel .hint { margin: 10px 0 0; }
.bp-save { margin-top: 6px; }
/* The move pop-up: a white card, the amber sign or a green tick, short sections, Continue / Cancel. */
.move-dialog { width: min(24rem, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 0; border: 0; border-radius: 20px; background: var(--white); color: var(--b0); box-shadow: 0 12px 36px rgba(16, 53, 70, 0.3); }
.move-dialog::backdrop { background: rgba(16, 53, 70, 0.45); }
.move-card, .move-note { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.move-page { max-width: 24rem; margin: 16px auto; background: var(--white); border-radius: 20px; box-shadow: var(--shadow); }
.move-note { margin: 0 0 12px; background: var(--white); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; }
.move-title { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-weight: 800; font-size: 1rem; line-height: 1.3; }
.move-icon svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--bronze); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.move-icon.ok svg { stroke: var(--g1); }
.move-sec { display: flex; flex-direction: column; gap: 4px; }
.move-sec + .move-sec { padding-top: 9px; border-top: 1px solid var(--grey); }
.move-sec.check { padding: 9px 10px; border-top: 0; border-radius: 12px; background: #FBF1E1; }
.move-h { margin: 0; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.move-sec ul { margin: 0; padding-left: 18px; font-size: 0.88rem; line-height: 1.4; display: flex; flex-direction: column; gap: 3px; }
.move-actions { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 0; }
.move-actions .button { width: 100%; text-align: center; }

/* ===== Rebrand, chunk 5 (2026-10-23): Meals This Week (MW1 + J3, MB3, MX1), the review
   line (MR2) and the leftovers pop-up (ML1). ===== */
.week-meals { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; padding: 0; }
/* Cooking days: wide photo banners, pale green below; the date in a green chip on the photo. */
.mw-banner { display: block; border-radius: 18px; overflow: hidden; background: var(--g5); box-shadow: var(--shadow); color: var(--b0); text-decoration: none; }
.mw-banner.today { box-shadow: 0 0 0 2.5px var(--g1), var(--shadow); }
.mw-photo { position: relative; display: block; aspect-ratio: 16 / 7; background: var(--grey-fill); }
.mw-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mw-photo.none { display: none; }
.mw-chips { position: absolute; left: 10px; top: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.mw-chip { padding: 4px 10px; border-radius: 999px; background: var(--g1); color: var(--white); font-size: 0.78rem; font-weight: 800; }
.mw-chip.white { background: var(--white); color: var(--b0); }
.mw-below { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; }
.mw-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.mw-text b, .mw-name { font-weight: 800; font-size: 0.98rem; line-height: 1.25; color: var(--b0); }
.mw-text small { font-size: 0.78rem; color: var(--muted); }
.mw-date { font-size: 0.78rem; font-weight: 800; color: var(--g0); }
.mw-go { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--b0); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.wm-review { align-self: flex-start; margin: 4px 0 0; padding: 3px 10px; border-radius: 999px; background: var(--b4); color: var(--b0); font-size: 0.78rem; font-weight: 800; font-style: normal; }
/* A batch cook joined on above the meal that needs it (MB3): full size when it's being
   cooked, small when it comes from the freezer. */
.mw-base.small { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--g5); box-shadow: inset 0 0 0 1px var(--g4), var(--shadow); color: var(--b0); text-decoration: none; }
.mw-base.small img, .mw-base.small .fz-ph { width: 40px; height: 40px; flex: none; border-radius: 10px; object-fit: cover; }
.mw-bt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mw-bt b { font-size: 0.88rem; line-height: 1.25; }
.pbase-chip.made { background: var(--b4); color: var(--b0); flex: none; margin: 0; }
.mw-base .mw-photo { aspect-ratio: 16 / 6; }
.mw-join { display: block; width: 3px; height: 18px; margin: -10px 0 -10px 34px; border-radius: 2px; background: var(--g2); }
/* Leftovers nights: compact pale blue cards; days not eating in white. */
.mw-day { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 16px; background: var(--b5); box-shadow: var(--shadow); }
.mw-day.out, .mw-day.empty { background: var(--white); }
.mw-day.lo.today { box-shadow: 0 0 0 2.5px var(--b1), var(--shadow); }
.mw-day.out.today, .mw-day.empty.today { box-shadow: 0 0 0 2.5px rgba(16, 53, 70, 0.45), var(--shadow); }
.mw-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.mw-dt { font-weight: 800; font-size: 0.9rem; }
.mw-kind { font-size: 0.78rem; color: var(--muted); }
.mw-day.out .mw-dt, .mw-none { color: var(--muted); }
.mw-none { font-size: 0.88rem; }
.mw-day .tag.today-tag { background: var(--grey); color: var(--b0); }
.mw-day.lo .tag.today-tag { background: var(--b1); color: var(--white); }
.wm-item { margin: 2px 0 0; }
/* Extra dishes (MX1): rows that open the recipe, with an arrow. */
.extra-list .mx-row { flex: 1; color: var(--b0); text-decoration: none; }
.extra-list li { gap: 10px; }

/* Review last week's meals (MR2): one slim pale blue line; tap it for the list. */
.review-line { margin: 0 0 12px; border-radius: 14px; background: var(--b5); box-shadow: inset 0 0 0 1px var(--b4), var(--shadow); }
.review-line summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; list-style: none; cursor: pointer; font-size: 0.92rem; }
.review-line summary::-webkit-details-marker { display: none; }
.rl-star { width: 19px; height: 19px; flex: none; fill: var(--b4); stroke: var(--b1); stroke-width: 1.8; stroke-linejoin: round; }
.rl-photos { display: flex; }
.rl-photos img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--b5); }
.rl-photos img + img { margin-left: -9px; }
.rl-count { margin-left: auto; min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: var(--b1); color: var(--white); font-size: 0.78rem; font-weight: 800; }
.rl-chev { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--b0); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.review-line[open] .rl-chev { transform: rotate(180deg); }
.review-line ul { list-style: none; margin: 0; padding: 0 12px 10px; display: grid; gap: 8px; }
.review-line li { grid-template-columns: 56px minmax(0, 1fr) auto; }
.review-line li .thumb-text { display: flex; flex-direction: column; }
.review-line li b { font-size: 0.88rem; line-height: 1.25; }
.review-line li small { font-size: 0.75rem; color: var(--muted); }
.mini-button.rl-go { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; background: var(--b4); color: var(--b0); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .rl-chev { transition: none; } }

/* Leftovers from last week (ML1): each dish a pale card with its photo; Still in the
   fridge, Frozen and Gone with − / + (pale blue, pale blue, grey); "4 of 4 sorted" turns
   green with a tick; Save waits until every dish adds up. */
.carry-ask { border-radius: 20px; padding: 16px; }
.carry-ask h2 { font-size: 1.05rem; }
.carry-item { margin: 12px 0 0; padding: 10px; border-radius: 16px; background: var(--grey-bg); }
.carry-item legend { float: left; width: 100%; margin: 0 0 4px; padding: 0; font-size: 0.92rem; align-items: center; }
.carry-item legend + * { clear: both; }
.ca-photo { width: 44px; height: 44px; border-radius: 11px; object-fit: cover; }
.carry-item legend.with-thumb { grid-template-columns: 44px minmax(0, 1fr); }
.carry-item .pd-kind { display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.carry-count { border-bottom: 0; padding: 4px 0; }
.carry-count label { font-size: 0.88rem; }
.carry-count .stepper button { background: var(--grey); color: var(--b0); box-shadow: none; }
.carry-count.c-fridge .stepper button, .carry-count.c-frozen .stepper button { background: var(--b4); color: var(--b0); box-shadow: none; }
.carry-sum { font-weight: 700; color: var(--g1); }
.carry-sum::before { content: "✓ "; }
.carry-item.unsorted .carry-sum { color: var(--muted); }
.carry-item.unsorted .carry-sum::before { content: none; }
.carry-actions .button[data-carry-later] { background: var(--white); }

/* ===== Planner tweaks (2026-10-23, after the rebrand phone check) ===== */
/* The steps strip stays at the top of the screen, just under the Hob bar; the week
   panel, then messages and warnings, come under it. */
.plan-steps { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 8;
  margin: 0 -16px 10px; padding: 8px 16px; background: var(--bg); box-shadow: 0 6px 8px -8px rgba(16, 53, 70, 0.3); }
.week-head + .messages { margin: 0 0 12px; }
/* Lock in meal plan: darkest blue with the sheen, like Plan my week for me; mid blue once locked in. */
.button.lock-go {
  background: linear-gradient(180deg, #1D4B5F 0%, var(--b0) 100%); color: var(--white);
  box-shadow: 0 6px 16px rgba(16, 53, 70, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.lock-in.locking .lock-go { background: var(--b1); color: var(--white); box-shadow: 0 6px 16px rgba(38, 115, 151, 0.3); }
/* Cook / Eat in: the word centred in the pill. A hidden tick on the right balances the tick on the left. */
.pill-toggle span::after { content: "✓"; margin-left: 5px; visibility: hidden; font-weight: 800; }
/* Counters (− / +) across the app: 34px circles, each with an invisible 44px-tall tap area. */
.servings button, .stepper button { position: relative; width: 34px; height: 34px; min-height: 34px; padding: 0; font-size: 1.15rem; line-height: 1; }
.servings button::after, .stepper button::after { content: ""; position: absolute; inset: -5px -3px; }
.freeze-num { width: calc(34px * 2 + 12px + 2.4ch); }
/* Set Preferences: the two buttons sit under the stages; a hint until all three are opened. */
.setup-actions { margin: 16px 0 8px; }
.setup-wait { text-align: center; margin: 12px 0 8px; }
.setup-actions[hidden] { display: none; }
/* Meals This Week: Review in darkest green with white text, so it stands out. */
.wm-review { margin: 6px 0 0; padding: 6px 14px; border-radius: 999px; background: var(--g0); color: var(--white); font-size: 0.82rem; font-weight: 800; text-decoration: none; }
/* Meals This Week, today first (K4): a heading, today's meal, a line, then the rest slightly greyed. */
.mw-sec { margin: 4px 2px 8px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.mw-sec-top { color: var(--g0); }
/* K6 (2026-10-25): the Cookbook's thin line and even gaps, measured outside today's 3px ring: heading 12px above it, line 20px below it, 20px from the line to the next heading, 10px from that heading to its first card. */
.mw-split { height: 1px; margin: 23px 0 20px; border: 0; background: rgba(16, 53, 70, 0.12); }
.mw-sec-top { margin-bottom: 15px; }
.mw-featured { margin-bottom: 0; }
.mw-split + .mw-sec { margin-top: 0; margin-bottom: 10px; }
.mw-rest { opacity: 0.72; filter: saturate(0.55); }
.mw-banner.today { box-shadow: 0 0 0 3px var(--g1), var(--shadow); }
/* Cooking-day dates on the photo: pale green with darkest green text. */
.mw-chip { background: var(--g4); color: var(--g0); }

/* ===== Cookbook (round 7b, 2026-10-23) ===== */
/* A–Z, search and filtered lists (AZ3): a plain list, thin lines between, letters as bold headings. */
.recipe-list a.has-thumb { grid-template-columns: 52px 1fr; padding: 9px 2px; border-bottom: 1px solid rgba(16, 53, 70, 0.12); color: var(--b0); }
.recipe-list a.has-thumb .row-thumb { width: 52px; height: 52px; border-radius: 11px; }
.recipe-list .title { font-weight: 800; font-size: 0.95rem; line-height: 1.25; color: var(--b0); }
.row-thumb.none { display: grid; place-items: center; background: var(--g5); color: var(--g2); }
.row-thumb.none svg { width: 42%; height: 42%; fill: none; stroke: currentColor; stroke-width: 1.6; }
.az-letter { margin: 16px 2px 0; padding: 0; border: 0; font-size: 1.05rem; font-weight: 800; letter-spacing: 0; color: var(--b0); }
.rmeta { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 3px !important; font-size: 0.76rem !important; color: var(--muted); }
.rmeta .rating-icon { width: 14px; height: 14px; vertical-align: 0; }
.rmeta .rating-loved { color: var(--b0); }
.rmeta .rating-liked { color: var(--g1); }
.rm-time { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--b0); }
.rm-time svg, .tile-time svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.prc { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; background: var(--grey); color: var(--b0); }
.prc-veggie, .prc-vegan { background: var(--g4); color: var(--g0); }
.prc-fish { background: var(--b4); color: var(--b0); }
.prc-batch { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--g3); color: var(--g0); }
.soon-chip { margin-left: 4px; padding: 1px 8px; background: var(--b0); color: var(--white); font-weight: 800; }
/* Try something new: photo tiles that swipe sideways. */
.try-new h2 { margin: 18px 0 2px; font-size: 1.05rem; }
.try-new > .meta { margin: 0 0 8px; }
.try-tiles { list-style: none; display: flex; gap: 10px; margin: 0 -16px; padding: 2px 16px 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.try-tiles::-webkit-scrollbar { display: none; }
.try-tile { flex: none; width: 150px; scroll-snap-align: start; }
.tile-link { display: flex; flex-direction: column; height: 100%; border-radius: 16px; overflow: hidden; background: var(--white); box-shadow: var(--shadow); color: var(--b0); text-decoration: none; }
.tile-photo { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--g5); }
.tile-photo img, .tile-photo .row-thumb { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.tile-time { position: absolute; left: 7px; bottom: 7px; display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--white); font-size: 0.72rem; font-weight: 800; color: var(--b0); }
.tile-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 10px 10px; }
.tile-text .title { font-weight: 800; font-size: 0.85rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-text .soon-chip { margin: 0; }
.tile-text .rmeta { margin-top: 0 !important; }
/* AZ4 (2026-10-25): the A–Z, search and filtered lists in one raised white card; thin lines between recipes, each letter a bold heading inside the card with a thin line above it. */
.az-card { margin: 8px 0 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.az-card .az-letter { margin: 0; padding: 12px 12px 2px; }
.az-card .az-letter:not(:first-child) { border-top: 1px solid rgba(16, 53, 70, 0.12); }
.az-card a.has-thumb { grid-template-columns: 48px 1fr; column-gap: 11px; padding: 8px 12px 8px 8px; border-bottom: 0; }
.az-card a.has-thumb .row-thumb { width: 48px; height: 48px; }
.az-card .title { font-size: 0.875rem; }
.az-card li:not([hidden]) ~ li > a { border-top: 1px solid rgba(16, 53, 70, 0.12); }
/* Round 8 (2026-10-25): Cookbook header CH3, search SB2, pills FP3, panel FO1, chosen filters FA2. */
/* CH3: a pale blue band across the top, square corners; darkest blue text (grey and mid blue are under 5.6:1 on it). */
.cb-band { margin: 0 -16px 12px; padding: 16px; background: var(--b4); border-radius: 0; align-items: center; }
.cb-band-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cb-band h1 { margin: 0; font-size: 1.4rem; line-height: 1.2; color: var(--b0); }
.cb-count-line { font-size: 0.8rem; font-weight: 600; color: var(--b0); }
.cb-count-line .drafts-link { font-size: inherit; font-weight: 800; color: var(--b0); text-decoration: underline; }
.cb-add { flex: none; }
/* SB2: pale blue with round ends and a thin outline, no shadow. */
.cookbook-search input[type="search"] { background-color: var(--b5); box-shadow: inset 0 0 0 1.5px var(--b4); border-radius: 999px; }
/* FP3: the darkest blue Filters button (count of chosen filters), chosen filters with ×, then quick picks. */
.cb-pills { gap: 6px; }
.cb-pills .pill { min-height: 34px; padding: 0 12px; border: 0; background: var(--surface); color: var(--b0); font-size: 0.82rem; font-weight: 700;
  box-shadow: 0 1px 2px rgba(16, 53, 70, 0.08), 0 2px 6px rgba(16, 53, 70, 0.08); }
.cb-pills .cb-filters, .cb-pills .cb-chosen, .cb-pills .cb-quick.chosen { background: var(--b0); color: var(--white); }
.cb-pills .cb-filters { gap: 6px; }
.cb-pills .cb-filters[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--b3); }
.cb-filters svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.cb-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: var(--g3); color: var(--g0); font-size: 0.7rem; font-weight: 800; }
/* FO1: one white panel with every category's chips. */
.cb-panel { display: grid; gap: 14px; padding: 12px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.cb-panel[hidden] { display: none; }
.cb-group .mini-legend { margin: 0 0 8px; }
.cb-group .mini-legend span { font-weight: 600; }
/* FA2: "6 recipes · Clear" above the list. */
.cb-count .cb-clear { font-weight: 800; color: var(--b0); }
/* UK units on the edit screen (2026-10-26): what a converted line was, a cup the table
   can't convert, and Convert to American / UK units. */
.converted-from { margin: 2px 0 6px; font-size: 0.8rem; }
.cup-ask { margin: 4px 0 8px; padding: 8px 10px; border-radius: 12px; background: var(--b5); }
.cup-ask .hint { margin: 0 0 6px; }
.cup-ask input { max-width: 8rem; }
.units-switch .hint { margin: 0 0 8px; }

/* ===== Batch and Hosting days (BH1, built 2026-11-08) ===== */
/* Set Preferences stage 1: double tap Cook = Batch (mid green), triple tap = Hosting (darkest
   green), each with white words and an icon instead of the tick. No outline on any pill: Cook
   and Eat in lose their rings. White on mid green 5.3:1, on darkest green 12.5:1. */
.cook-pill input:checked + span, .eat-pill input:checked + span { box-shadow: none; }
.cook-pill { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.bh-word { font-weight: inherit; }
.bh-ic { display: none; width: 15px; height: 15px; flex: none; margin-right: 5px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cook-pill.bh-batch input:checked + span { background: var(--g1); color: var(--white); }
.cook-pill.bh-host input:checked + span { background: var(--g0); color: var(--white); }
.cook-pill.bh-batch input:checked + span::before, .cook-pill.bh-host input:checked + span::before,
.cook-pill.bh-batch input:checked + span::after, .cook-pill.bh-host input:checked + span::after { display: none; }
.cook-pill.bh-batch input:checked + span .bh-ic-batch, .cook-pill.bh-host input:checked + span .bh-ic-host { display: block; }
@media (max-width: 340px) { .cook-pill.bh-batch span, .cook-pill.bh-host span { padding: 0 4px; } }
/* The select for each day is only for no JavaScript (planning.js hides it). */
.cd-kind { grid-column: 2 / -1; justify-self: end; font: inherit; font-size: 0.85rem; }
.cd-kind[hidden] { display: none; }
.bh-hint { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--g5); font-size: 0.8rem; line-height: 1.45; color: var(--b0); }
.bh-hint b { color: var(--g0); }
.bh-sum { margin: 8px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--b5); font-size: 0.8rem; font-weight: 700; color: var(--b0); }
.bh-sum[hidden] { display: none; }
html:not(.js) .bh-hint { display: none; }

/* ===== Review page (rebrand RV3 + round 10f, built 2026-11-08) ===== */
/* A pale green header with a square photo, then white section cards. Class names start
   with rv (checked: no other rules use them). */
.rvh3 { margin: 8px -16px 12px; padding: 16px 16px 14px; background: var(--g5); display: grid; grid-template-columns: 60px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center; }
.rvh3 img { grid-row: 1 / 4; width: 60px; height: 60px; border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 3px var(--white); }
.rvh3.no-photo { grid-template-columns: minmax(0, 1fr); }
.rveb { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--g1); }
.rvh3 .rvt { margin: 0; font-size: 1.2rem; line-height: 1.25; font-weight: 800; color: var(--b0); }
/* The title, editable on Review (2026-11-11): looks like the heading, a pencil beside it, a dashed line while typing. */
.rvh3 .rvt-wrap { display: flex; align-items: flex-start; gap: 6px; margin: 0; cursor: text; }
.rvh3 textarea.rvt-in { flex: 1; min-width: 0; width: auto; min-height: 0; margin: 0; padding: 0 0 2px; border: 0; border-bottom: 2px dashed transparent; border-radius: 0; background: transparent; box-shadow: none; font: inherit; font-size: 1.2rem; line-height: 1.25; font-weight: 800; color: var(--b0); resize: none; overflow: hidden; field-sizing: content; }
.rvh3 textarea.rvt-in:focus { outline: none; border-bottom-color: var(--b2); }
.rvh3 .rvt-pen { flex: none; width: 18px; height: 18px; margin-top: 3px; fill: none; stroke: var(--muted); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rvt-err { margin: 4px 0 0; font-size: 0.85rem; font-weight: 700; color: var(--error); }
.rvsub { font-size: 0.82rem; color: var(--muted); }
.rvform { display: flex; flex-direction: column; gap: 12px; }
.rvc { margin: 0; min-width: 0; background: var(--white); border: 0; border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.rvc[hidden] { display: none; }
.rvc-h, .rvc legend.rvc-h { float: left; width: 100%; margin: 0 0 10px; padding: 0; font-size: 0.95rem; font-weight: 800; color: var(--b0); }
h2.rvc-h { float: none; margin: 0; }
.rvc legend.rvc-h + * { clear: both; }
.rvhint { margin: 0; font-size: 0.8rem; color: var(--muted); }
/* When did you cook it? Day circles: the date, a tick once chosen. */
.rvdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px 2px; }
.rvday { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 0; font-size: 0.7rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.rvday input, .rvrate-k input, .rvchip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.rvday b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; font-weight: 800; color: var(--b0); background: var(--white); box-shadow: inset 0 0 0 1.5px var(--b3); }
.rvtick { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rvday .rvtick { display: none; }
.rvday input:checked ~ b { background: var(--g4); box-shadow: inset 0 0 0 2px var(--g1); color: var(--g1); }
.rvday input:checked ~ b .rvday-n { display: none; }
.rvday input:checked ~ b .rvtick { display: block; }
.rvday:has(input:checked) { color: var(--g0); }
.rvday input:focus-visible ~ b, .rvrate-k input:focus-visible + span, .rvchip input:focus-visible + span { outline: 3px solid var(--b2); outline-offset: 2px; }
/* How was it? Three equal boxes. */
.rvrate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rvrate-k { position: relative; margin: 0; }
.rvrate-k > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 78px; padding: 8px 4px; border-radius: 14px; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--grey); font-size: 0.8rem; font-weight: 700; text-align: center; line-height: 1.25; color: var(--b0); cursor: pointer; }
.rvrate-k svg { width: 22px; height: 22px; fill: currentColor; }
.rvrate-k input:checked + span { background: var(--g4); box-shadow: inset 0 0 0 2px var(--g1); color: var(--g0); }
.rvrate-k.k-never input:checked + span { background: var(--grey); box-shadow: inset 0 0 0 2px var(--b0); color: var(--b0); }
.rv-never-hint { display: none; }
.rvc:has(.k-never input:checked) .rv-never-hint { display: block; }
/* Good for: chips with a tick once on. */
.rvchips { display: flex; flex-wrap: wrap; gap: 6px; }
.rvchip { position: relative; margin: 0; }
.rvchip > span { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--grey); font-size: 0.8rem; font-weight: 700; color: var(--b0); cursor: pointer; }
.rvchip .rvtick { display: none; width: 13px; height: 13px; }
.rvchip input:checked + span { background: var(--g4); box-shadow: none; color: var(--g0); }
.rvchip input:checked + span .rvtick { display: block; }
/* Portions made and Actual cooking time: rows with a counter / a box on the right. */
.rvrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.9rem; font-weight: 700; color: var(--b0); }
.rvrow + .rvrow { padding-top: 10px; border-top: 1px solid rgba(16, 53, 70, 0.12); }
.rvrow .tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rvrow label { margin: 0; font-size: inherit; font-weight: inherit; }
.rvrow small { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.rvstep { flex: none; gap: 12px; }
.rvstep button { background: var(--b4); color: var(--b0); box-shadow: none; }
.rvstep input { width: 2.6ch; padding: 0; border: 0; background: transparent; font-size: 1.05rem; font-weight: 800; color: var(--b0); }
.rvstep input.changed { color: var(--g1); }
.rvminw { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.rvminw .rvmin { width: 72px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: var(--b5); box-shadow: inset 0 0 0 1.5px var(--b4); font-size: 16px; font-weight: 800; color: var(--b0); text-align: center; }
.rvminw .rvmin:focus { outline: none; box-shadow: inset 0 0 0 2.5px var(--b1); }
/* The method: each step a header (tap to fold), the words, my note, its ingredients. */
.rvmove { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--g4); color: var(--g0); font-size: 0.8rem; font-weight: 700; }
.rvmove[hidden] { display: none; }
.rvlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; min-width: 0; }
.rvx { min-width: 0; margin: 0 -14px; padding: 0 14px; }
.rvx + .rvx { border-top: 1px solid rgba(16, 53, 70, 0.12); }
.rvsh { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.rvst { flex: 1; font-size: 0.9rem; font-weight: 800; color: var(--b0); }
.rvm { flex: none; height: 20px; padding: 0 7px; border-radius: 99px; font-size: 0.7rem; font-weight: 800; display: inline-flex; align-items: center; }
.rvm[hidden] { display: none; }
.rvm.ed { background: var(--b4); color: var(--b0); }
.rvchev { flex: none; width: 16px; height: 16px; margin: 0 6px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.rvx.shut .rvchev { transform: rotate(180deg); }
.rvbody { display: flex; flex-direction: column; gap: 8px; padding: 0 0 14px; min-width: 0; }
.rvbody[hidden] { display: none; }
.rvform .rvfree { display: block; width: 100%; box-sizing: border-box; min-height: 2.6em; margin: 0; padding: 6px 9px; border: 0; border-radius: 10px; background: var(--b5); box-shadow: inset 0 0 0 1.5px var(--b4); font: inherit; font-size: 16px; line-height: 1.5; color: var(--b0); white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; resize: none; field-sizing: content; cursor: text; }
.rvform .rvfree[hidden] { display: none; }
.rvform .rvfree:focus { outline: none; background: var(--white); box-shadow: inset 0 0 0 2px var(--b1); }
.rvshow b { font-weight: 800; }
.rvedl { margin: 0; font-size: 0.8rem; }
.rvedl[hidden] { display: none; }
.rvundo { margin: 0; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--b1); text-decoration: underline; cursor: pointer; }
.rvnb { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 8px 12px; border-radius: 14px; background: var(--g5); }
.rvnb > label { margin: 0; font-size: 0.8rem; font-weight: 800; color: var(--b0); }
.rvform .rvfree.rvnote { min-height: 1.6em; padding: 2px 6px; margin: 0 -6px; width: calc(100% + 12px); background: transparent; box-shadow: none; font-size: 16px; }
.rvform .rvfree.rvnote:focus { background: var(--white); box-shadow: inset 0 0 0 2px var(--g1); }
.rvform .rvfree.rvnote::placeholder { color: var(--muted); }
.rving { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; border-radius: 14px; background: var(--grey-fill); }
.rvingh { font-size: 0.75rem; font-weight: 800; color: var(--muted); }
.rvchipz { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.rvnone { font-size: 0.8rem; color: var(--muted); }
.rvnone[hidden] { display: none; }
.rvic { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 34px; padding: 0 10px 0 6px; border-radius: 10px; background: var(--white); box-shadow: 0 1px 2px rgba(16, 53, 70, 0.1), 0 2px 6px rgba(16, 53, 70, 0.08); font-size: 0.8rem; color: var(--b0); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.rvic .ing-icon { width: 20px; height: 20px; flex: none; }
.rvic-t { min-width: 0; }
.rvic .q { font-weight: 800; }
.rvic .grip { width: 14px; height: 14px; flex: none; fill: var(--muted); opacity: 0.7; }
.rvic .rvsel { width: auto; margin-left: 4px; padding: 4px; font-size: 16px; }
.rvic .rvsel[hidden] { display: none; }
.rvic.sel { box-shadow: inset 0 0 0 2px var(--g1), 0 2px 6px rgba(16, 53, 70, 0.12); background: var(--g5); }
.rvic.lifted { opacity: 0.35; }
.rvic.ghost { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -60%) scale(1.04); box-shadow: 0 8px 20px rgba(16, 53, 70, 0.25); }
.rvform.dragging [data-rv-target] { transition: background-color 0.15s; }
.rvform.dragging [data-rv-target]:not(.from) { background: var(--g5); box-shadow: inset 3px 0 0 var(--g3); }
.rvform.dragging [data-rv-target].over { background: var(--g4); box-shadow: inset 4px 0 0 var(--g1); }
.rvtray .rvchipz { padding: 8px 10px 10px; border-radius: 14px; background: var(--grey-fill); }
/* Cross out, split and add on Review (2026-11-09). */
.rvtray .rvchipz:not(:has(.rvic)) { display: none; }
.rvtray .rvnone { display: block; margin-top: 2px; }
.rvic-out { flex: none; position: relative; display: inline-grid; place-items: center; min-width: 28px; height: 28px; margin: 0 -4px 0 2px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 0.75rem; font-weight: 800; cursor: pointer; }
.rvic .grip { margin-left: 2px; }
.rvic-out input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rvic-out:focus-within { outline: 2px solid var(--b0); }
.rvic-x { font-size: 1.15rem; line-height: 1; font-weight: 600; }
.rvic-u { display: none; }
.rvic.rvgone { background: var(--grey-fill); box-shadow: none; cursor: default; }
.rvic.rvgone .rvic-t { text-decoration: line-through; color: var(--muted); }
.rvic.rvgone .ing-icon, .rvic.rvgone .grip { opacity: 0.35; }
.rvic.rvgone .rvic-out { color: var(--b0); background: var(--white); }
.rvic.rvgone .rvic-x { display: none; }
.rvic.rvgone .rvic-u { display: inline; }
.rvic.rvnew { box-shadow: inset 0 0 0 1.5px var(--g3), 0 1px 2px rgba(16, 53, 70, 0.1); }
.rvabs[hidden] { display: none; }
/* Add an ingredient: the Edit recipe row's boxes (2026-11-11). */
.rvadd { margin: 12px 0 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 6px; }
.rvadd-l { padding: 0; margin: 0 0 2px; font-weight: 800; font-size: 0.85rem; color: var(--b0); }
.rvadd .line1 input, .rvadd-prep input { font-size: 16px; }
.rvadd-prep { margin: 0; }
.rvadd-err { margin: 0; font-size: 0.8rem; font-weight: 700; color: var(--error); }
.rvadd-err[hidden] { display: none; }
.rvadd-go { justify-self: start; }
.rvadd-go[hidden] { display: none; }
.rvadd-h { margin: 0; font-size: 0.75rem; color: var(--muted); }
.rvform .lnote textarea { font-size: 16px; }
/* Save review: darkest blue with the sheen, full width. */
.button.primary.rvgo { width: 100%; margin-top: 4px; border-radius: 14px; background: linear-gradient(180deg, #1D4B5F 0%, var(--b0) 100%); color: var(--white); box-shadow: 0 6px 16px rgba(16, 53, 70, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
/* Leave without saving? */
.rvleave-in { padding: 18px 18px 16px; }
.rvleave-h { margin: 0 0 6px; font-size: 1.1rem; color: var(--b0); }
.rvleave-in p { margin: 0 0 14px; color: var(--b0); }
.rvleave-btns { display: flex; flex-direction: column; gap: 8px; }
.rvleave-btns .button { width: 100%; }
.button.rvleave-go { background: var(--grey); color: var(--b0); }

/* ===== Recipe page (round 9 + TB3a, built 2026-11-08) ===== */
/* RH2: a wide photo edge to edge, then a white card overlapping its bottom. Cook soon is a
   sticker on the photo's top right (white with + off, darkest blue with a tick on). */
.rtop { position: relative; display: flex; flex-direction: column; margin: 0 0 12px; }
.rtop-ph { margin: 0 -16px; aspect-ratio: 16 / 9.5; max-height: 440px; overflow: hidden; background: var(--grey-fill); }
.rtop-ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: var(--white); box-shadow: var(--shadow); }
.rtop.has-photo .rcard { margin-top: -28px; }
.rtitle { margin: 0; font-size: 1.4rem; line-height: 1.2; font-weight: 800; color: var(--b0); }
.rsoon { position: absolute; right: 14px; top: 14px; z-index: 2; margin: 0; }
.rtop:not(.has-photo) .rsoon { top: 12px; right: 12px; }
.rtop:not(.has-photo) .rtitle { padding-right: 7.5rem; }
.rsoon-b { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--white); color: var(--b0); font: inherit; font-size: 0.82rem; font-weight: 800; box-shadow: 0 2px 8px rgba(16, 53, 70, 0.3); cursor: pointer; }
.rtop:not(.has-photo) .rsoon-b { background: var(--b5); box-shadow: inset 0 0 0 1.5px var(--b4); }
.rsoon-b[aria-pressed="true"], .rtop:not(.has-photo) .rsoon-b[aria-pressed="true"] { background: var(--b0); color: var(--white); box-shadow: 0 2px 8px rgba(16, 53, 70, 0.3); }
.rsoon-b svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
/* RI3: rating first, then the times in darkest green with a green clock, then Good for. */
.rinfo { display: flex; flex-direction: column; gap: 5px; font-size: 0.82rem; color: var(--muted); }
.rlv { display: inline-flex; align-items: center; gap: 3px; color: var(--b0); font-weight: 800; }
.rlv svg { width: 13px; height: 13px; fill: currentColor; }
.rlv.rating-never { color: var(--muted); }
.rtime { display: flex; align-items: flex-start; gap: 5px; color: var(--g0); font-weight: 600; }
.rtime b { font-weight: 800; }
.rtime svg { flex: none; width: 15px; height: 15px; margin-top: 1px; fill: none; stroke: var(--g1); stroke-width: 2.2; stroke-linecap: round; }
.rgood b { color: var(--b0); font-weight: 700; }
.rsoon-hint { color: var(--b0); }
/* RS5: Serves as the last row of the card, under a thin line. Counter ringless, pale blue. */
.servings.rserves { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px -14px 0; padding: 10px 14px 0; border-top: 1px solid rgba(16, 53, 70, 0.12); }
.rserves-tx { display: flex; flex-direction: column; gap: 1px; font-size: 0.9rem; font-weight: 700; color: var(--b0); }
.rserves-tx .hint { margin: 0; font-size: 0.75rem; font-weight: 600; }
.rserves-tx .hint[hidden] { display: none; }
.rserves-c { display: inline-flex; align-items: center; gap: 12px; }
.rserves-c button { background: var(--b4); color: var(--b0); box-shadow: none; }
.rserves-c output { font-size: 1.05rem; font-weight: 800; color: var(--b0); }
/* TB3a: one darkest green bar edge to edge, white words (the closed one 80% white), a 4px light green line under the open tab. White on darkest green 12.5:1, light green 7.1:1. */
.tabs.rtabs { background: var(--g0); border-bottom: 0; margin: 0 -16px 12px; padding: 0 16px; }
.tabs.rtabs [role="tab"] { display: grid; place-items: center; height: 46px; padding: 0 8px; border-bottom: 0; color: rgba(255, 255, 255, 0.8); font-size: 0.9rem; font-weight: 800; box-shadow: inset 0 -4px 0 transparent; }
.tabs.rtabs [role="tab"][aria-selected="true"] { color: var(--white); box-shadow: inset 0 -4px 0 var(--g3); }
.tabs.rtabs [role="tab"]:focus-visible { outline: 3px solid var(--g3); outline-offset: -3px; }
/* RG1: the ingredients in one white card, recipe order, thin lines, icon, amount in bold, prep in grey, an Optional tag. */
.recipe .ingredients { background: var(--white); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.recipe .ingredients > li { padding: 9px 12px; border-bottom: 0; font-size: 0.9rem; }
.recipe .ingredients > li + li { border-top: 1px solid rgba(16, 53, 70, 0.12); }
.recipe .ingredients .tag { margin-left: 4px; }
/* Each step's ingredients in bold in its words (round 10f, answer 5). */
.step-text b { font-weight: 800; }
/* Notes: a pencil beside the ×; editing happens in place. */
.note-pencil { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); }
.note-pencil svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.note.note-editing { display: grid; gap: 6px; padding: 10px 12px; }
.note-edit-label { margin: 0; font-weight: 800; color: var(--b0); }
.note-editing textarea { min-height: 5em; }
.note-edit-hint { font-size: 0.8rem; color: var(--muted); }
.note-edit-btns { display: flex; gap: 8px; }
.note-edit-btns .button { width: auto; flex: 1; text-align: center; }
/* The time-limit warning inside the Batch / Hosting hint (2026-11-08): bronze icon, as other warnings. */
.bh-warn { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; }
.bh-warn svg { flex: none; width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: var(--bronze); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
