:root {
  --bg:#0f1115; --card:#1a1d24; --border:#2a2e38; --text:#e8e9ec; --muted:#8b909c;
  --accent:#4f8cff; --good:#3ec97a; --low:#e0a83c; --bad:#e0553c;
}
* { box-sizing:border-box; }
body {
  margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg); color:var(--text); line-height:1.45;
  padding-bottom:calc(60px + env(safe-area-inset-bottom, 0px));
}

/* tabs */
.tabs {
  position:sticky; top:0; z-index:20; display:flex; align-items:center;
  gap:8px; flex-wrap:wrap;
  background:color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border); padding:8px 12px;
  /* Installed to the home screen the app runs full-bleed under the status bar
     (viewport-fit=cover + black-translucent), so the bar has to hold itself
     clear of the notch. Falls back to plain padding everywhere else. */
  padding-top:calc(8px + env(safe-area-inset-top, 0px));
  padding-left:calc(12px + env(safe-area-inset-left, 0px));
  padding-right:calc(12px + env(safe-area-inset-right, 0px));
}
.tab-links { display:flex; gap:2px; flex:1; min-width:0; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.tab-links::-webkit-scrollbar { display:none; }
.tab-right { display:flex; gap:6px; flex-shrink:0; }
.tabs a {
  padding:6px 10px; border-radius:8px; text-decoration:none; color:var(--muted);
  font-size:.88rem; font-weight:500; white-space:nowrap;
}
.tabs a:hover { color:var(--text); }
.tabs a.active { background:var(--card); color:var(--text); }
.tabs a.hidden { display:none; }

/* Utility. There were four scoped .hidden rules and no general one, so
   .hidden on anything else silently did nothing — an emptied card still
   painted its own padding as a stray bar. */
.hidden { display:none !important; }

/* Native controls default to a light-theme look; hand them the accent so
   checkboxes and the like sit in the dark palette rather than on top of it. */
input[type=checkbox], input[type=radio] { accent-color:var(--accent); }
.week-toggle { display:flex; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.week-toggle button {
  background:var(--card); color:var(--muted); border:none; border-radius:0;
  padding:7px 12px; font-size:.82rem; font-weight:600; white-space:nowrap;
}
.week-toggle button.on { background:var(--accent); color:#fff; }
.week-toggle button + button { border-left:1px solid var(--border); }
.nav-toggle {
  display:none; background:none; border:none; color:var(--text);
  font-size:1.3rem; padding:2px 4px; line-height:1; flex-shrink:0;
}
.nav-backdrop {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:19;
}

@media (max-width:560px) {
  .week-toggle button { padding:7px 9px; font-size:.76rem; }
  .nav-toggle { display:block; }
  /* Page navigation moves into a slide-out drawer on mobile — seven tabs in
     one horizontal scroll strip was the actual complaint, this fixes that
     without touching desktop at all. "This Week/Next Week" and "who am I"
     stay in the top bar since those get used constantly, not just at
     navigation time. */
  .tab-links {
    position:fixed; top:0; left:0; height:100vh; width:240px; z-index:21;
    padding-top:calc(60px + env(safe-area-inset-top, 0px));
    flex-direction:column; align-items:stretch; overflow-x:visible;
    background:var(--card); border-right:1px solid var(--border);
    padding:60px 10px 20px; gap:2px;
    transform:translateX(-100%); transition:transform .2s ease;
  }
  body.nav-open .tab-links { transform:translateX(0); }
  body.nav-open .nav-backdrop { display:block; }
  .tab-links a { padding:12px 14px; font-size:1rem; }
}

main { max-width:720px; margin:0 auto; padding:20px 16px 0; }

/* One row on every page, whatever actions it carries — a header that changes
   height page to page makes everything below it jump as you switch tabs.
   The 1fr/auto/1fr columns keep the title dead centre regardless of how many
   buttons sit on the right; the buttons shed their labels on a phone so they
   stay narrow enough not to crowd it. */
.block-head {
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center;
  gap:8px; margin-bottom:12px; min-height:38px;
}
/* Title left, week centred, actions right. The outer tracks are both 1fr so
   they stay equal, which is what keeps the date dead centre on the page
   whether or not the page has any buttons. */
.block-head h1 { grid-column:1; justify-self:start; text-align:left; }
.block-head .week-range { grid-column:2; justify-self:center; }
.block-head .actions { grid-column:3; justify-self:end; }
h1 { margin:0; font-size:1.45rem; }
/* Big enough to read at arm's length in a shop, and never split across lines. */
.week-range {
  font-size:1rem; font-weight:500; color:var(--muted);
  white-space:nowrap;
}
.sec-title { font-size:1.05rem; margin:26px 0 2px; }
.subtitle { color:var(--muted); margin:4px 0 14px; font-size:.86rem; }
.hint { color:var(--muted); font-size:.75rem; display:block; }
.empty { color:var(--muted); font-size:.85rem; font-style:italic; }

button {
  background:var(--card); border:1px solid var(--border); color:var(--text);
  padding:6px 12px; border-radius:8px; cursor:pointer; font-size:.85rem;
  transition:transform .08s ease, background .1s ease, opacity .1s ease;
}
button:hover { border-color:var(--accent); }
/* :hover means nothing on touch — this is what actually says "that tap
   registered" on a phone, and it fires the instant a finger presses, before
   any network round trip even starts. */
button:active { transform:scale(.96); background:color-mix(in srgb, var(--accent) 14%, var(--card)); }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }
button.primary:active { background:color-mix(in srgb, var(--accent) 80%, #000); }
button.ghost { background:none; color:var(--muted); font-size:.8rem; padding:4px 8px; }

/* Every async button/select in the app goes through busy(), which adds this
   class for exactly the length of its own network round trip: disabled (so a
   second tap during that window is genuinely ignored, not just discouraged)
   and visibly waiting, rather than looking identical to a normal idle button
   while secretly doing nothing. */
button.busy, select.busy {
  opacity:.6; cursor:wait; position:relative; color:transparent !important;
}
button.busy::after {
  content:""; position:absolute; inset:0; margin:auto; width:15px; height:15px;
  border-radius:50%; border:2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color:#fff; animation:busy-spin .6s linear infinite;
}
button.ghost.busy::after, button:not(.primary):not(.ghost).busy::after { border-top-color:var(--accent); }
select.busy { opacity:.6; cursor:wait; }
@keyframes busy-spin { to { transform:rotate(360deg); } }
.actions { display:flex; gap:8px; flex-shrink:0; }
/* Icon sits beside its label on a wide screen; on a phone the label is hidden
   and the icon stands alone (see the mobile block below). */
.actions button, .actions .btn-link { display:inline-flex; align-items:center; gap:6px; }

input:not([type=checkbox]):not([type=radio]), select, textarea {
  background:var(--bg); color:var(--text); border:1px solid var(--border);
  border-radius:7px; padding:6px 8px; font-size:.86rem; font-family:inherit;
}
input:focus, select:focus { outline:none; border-color:var(--accent); }

/* Checkboxes/radios are replaced elements — the text-input box styling above
   (padding/border/background) renders inconsistently on them across browsers
   (notably iOS Safari), causing an oversized box that overlaps nearby text.
   Give them their own clean, fixed-size reset instead. */
input[type=checkbox], input[type=radio] {
  width:16px; height:16px; min-width:16px; flex-shrink:0; margin:0;
  accent-color:var(--accent); background:none; border:none; padding:0;
}

.card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:4px 16px 12px; }

/* rows */
.row { display:flex; align-items:center; gap:10px; padding:3px 0; cursor:pointer; }
.row input[type=checkbox] { width:17px; height:17px; flex-shrink:0; margin:0; }
.row-label { flex:1; font-size:.92rem; }
.when { color:var(--muted); font-size:.72rem; margin-left:8px; }
.grams { color:var(--muted); font-size:.85rem; font-variant-numeric:tabular-nums; min-width:38px; text-align:right; }
.inline { display:inline-flex; align-items:center; gap:5px; font-size:.78rem; color:var(--muted); }
.inline input { width:15px; height:15px; }

/* days */

/* shopping */
.aisle { padding-top:10px; cursor:grab; }
.aisle.dragging { opacity:.4; }
.drag-handle {
  color:var(--muted); margin-right:4px; cursor:grab; padding:6px 10px; margin:-6px 2px -6px -10px;
  border-radius:6px; display:inline-block;
  /* Without this the browser tries to start a page-scroll gesture on the
     first touch move, which fights the drag and can cancel it outright. */
  touch-action:none; user-select:none;
}
.drag-handle:active { cursor:grabbing; background:color-mix(in srgb, var(--accent) 14%, transparent); }
.aisle.dragging { opacity:.6; }

.aisle h3 {
  font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted);
  margin:6px 0 4px; border-bottom:1px solid var(--border); padding-bottom:4px;
}
.shop-row { align-items:baseline; }
.qty { min-width:66px; font-variant-numeric:tabular-nums; color:var(--muted); font-size:.85rem; flex-shrink:0; }
.shop-item { flex:1; min-width:0; }   /* same reason: must be allowed to wrap */
.tag {
  font-size:.65rem; text-transform:uppercase; letter-spacing:.04em; background:var(--border);
  color:var(--muted); padding:1px 6px; border-radius:999px; margin-left:6px; vertical-align:middle;
}
.tag-protein { background:color-mix(in srgb, var(--accent) 15%, transparent); color:var(--accent); }
.tag-warn { background:color-mix(in srgb, var(--low) 18%, transparent); color:var(--low); text-transform:none; letter-spacing:0; }
.shop-source-inline { font-size:.74rem; color:var(--muted); margin-left:4px; }
.shop-source-inline .shop-source-btn {
  background:none; border:none; padding:0; color:var(--muted); font-size:.74rem;
  text-decoration:underline; cursor:pointer; font-family:inherit;
}
.shop-source-inline .shop-source-btn:hover { color:var(--accent); }
.extra-row { align-items:center; }
/* Fixed width, not min-width: these labels ("1 unit each" / "1 pack each")
   are long enough to exceed the .qty floor, so the column took its content
   width and every "pack" row pushed the item name 7px right of every "unit"
   row. The aisle list above only looks aligned because its shorter labels
   ("1 pack", "x 8") all stay under that floor. */
.extra-row .qty { width:96px; flex:0 0 96px; white-space:nowrap; }
.extra-row .del, .extra-row .editExtra { padding:2px 7px; font-size:.75rem; }
.extra-row.on { background:color-mix(in srgb, var(--good) 8%, transparent); border-radius:8px; padding:3px 6px; margin:0 -6px; }
.extra-stepper { display:flex; align-items:center; gap:2px; flex-shrink:0; }
.stepBtn {
  flex-shrink:0; width:34px; height:34px; padding:0; border-radius:9px;
  background:var(--card); border:1px solid var(--border); color:var(--text);
  font-size:1.2rem; font-weight:700; line-height:1; display:flex; align-items:center; justify-content:center;
}
.stepPlus { color:var(--good); border-color:color-mix(in srgb, var(--good) 40%, var(--border)); }
.stepMinus { color:var(--bad); }
.extra-qty-val { min-width:20px; text-align:center; font-weight:700; font-variant-numeric:tabular-nums; }
.extra-row:not(.on) .extra-qty-val { color:var(--muted); }
.add-extra { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); }
/* Two adjacent dropdowns both read "Household" — one meaning the aisle, one
   meaning who it's for — with nothing to say which was which. A small caption
   over each control costs one line and removes the guesswork entirely. */
.add-extra .mini { display:flex; flex-direction:column; gap:3px; min-width:0; }
.add-extra .mini > span {
  font-size:.63rem; text-transform:uppercase; letter-spacing:.05em;
  color:var(--muted); white-space:nowrap;
}
.add-extra .mini.grow { flex:1; min-width:150px; }
.add-extra .mini.grow input { width:100%; }
.add-extra .inline { align-self:center; padding-bottom:6px; }
.add-extra #exItem { flex:1; min-width:150px; }
.add-extra-top { margin-bottom:16px; }

/* The quick path: name + Add on one line, everything else folded away. */
.add-quick { display:flex; gap:8px; align-items:center; }
.add-quick #exItem { flex:1; min-width:0; }
.add-quick .primary { flex-shrink:0; }
.add-quick-foot {
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-top:7px; min-height:20px;
}
.aisle-hint { font-size:.76rem; color:var(--muted); min-width:0; }
.link-toggle {
  background:none; border:none; color:var(--muted); font-size:.76rem;
  padding:2px 4px; flex-shrink:0;
}
.link-toggle:hover { color:var(--accent); }
.add-options {
  display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end;
  margin-top:10px; padding-top:10px; border-top:1px solid var(--border);
}
.add-options .mini { display:flex; flex-direction:column; gap:3px; min-width:0; }
.add-options .mini > span {
  font-size:.68rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted);
}
.add-options .mini input, .add-options .mini select { min-width:0; }
.add-options #exAmt { max-width:76px; }
.add-options .inline { align-self:center; padding-bottom:6px; }
.add-extra-top .add-extra { margin-top:0; padding-top:0; border-top:none; }

/* meals */
.meal-grid { display:flex; flex-direction:column; gap:8px; }
.meal-card {
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  padding:12px 16px; display:flex; align-items:center; gap:14px; flex-wrap:wrap;
}
/* min-width:0 on every flex item in the chain: the default min-width:auto
   refuses to shrink below the content's intrinsic width, and .ing-preview is
   white-space:nowrap — so one long ingredient list dragged the whole card to
   641px at a 375px viewport and gave the page a horizontal scroll. */
.meal-card-main { flex:1; min-width:0; }
.meal-card-head { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; min-width:0; }
.meal-card h3 { margin:0; font-size:.98rem; }
.meal-card-stats { display:flex; gap:14px; min-width:0; }
.meal-card-stats .hint { margin:0; }
.ing-preview {
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  display:block; max-width:100%; min-width:0;
}
.meal-card-actions { display:flex; gap:6px; flex-shrink:0; }
.meal-card-actions button { padding:3px 9px; font-size:.78rem; }
@media (max-width:560px) {
  .meal-card { flex-direction:column; align-items:stretch; min-width:0; }
  .meal-card-actions { justify-content:flex-end; }
  /* One nowrap line's min-content width propagates all the way up and drags
     the card past the viewport (the "Salad" card, with the longest ingredient
     list, was 641px at 375px wide). Wrapping to two clamped lines removes the
     min-content pressure entirely and shows more of the list, which is what
     you actually want on a phone. */
  .ing-preview {
    white-space:normal; text-overflow:clip;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
    overflow:hidden;
  }
}

/* history */
.hist { margin-bottom:12px; }
.hist-head { display:flex; justify-content:space-between; align-items:center; padding-top:10px; }
.hist-head h3 { margin:0; font-size:.98rem; }
.hist-days { display:grid; grid-template-columns:repeat(auto-fit,minmax(92px,1fr)); gap:6px; margin:10px 0 4px; }
.hist-day { display:flex; flex-direction:column; font-size:.76rem; padding:6px 8px; background:var(--bg); border-radius:7px; }
.hist-dow { color:var(--muted); font-size:.68rem; }

/* modal */
.modal { position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex; align-items:flex-start;
  justify-content:center; padding:24px 16px; overflow-y:auto; z-index:50; }
.modal.hidden { display:none; }
.modal-card { background:var(--card); border:1px solid var(--border); border-radius:14px;
  padding:18px 20px 22px; max-width:660px; width:100%; }
.modal-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.modal-head h2 { margin:0; font-size:1.1rem; }
.modal-head button { padding:2px 9px; }
.modal-actions { margin-top:18px; display:flex; justify-content:flex-end; }
.field { display:block; margin-bottom:10px; }
.field span { display:block; font-size:.76rem; color:var(--muted); margin-bottom:3px; }
/* Excludes checkbox/radio: this is a descendant selector, so it was also
   matching the Categories checkboxes nested inside .field > .tag-picker,
   stretching each one to the full label width — the actual cause of the
   checkbox/text overlap, confirmed by inspecting the live computed style. */
.field input:not([type=checkbox]):not([type=radio]), .field select { width:100%; }
/* Checkbox settings read as a switch-style row: label left, control right. */
.field-check { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.field-check span { margin-bottom:0; font-size:.9rem; color:var(--fg); }
.field-check input[type=checkbox] { width:20px; height:20px; flex:0 0 auto; }
#modalBody h4 { margin:18px 0 6px; font-size:.85rem; }
#modalBody h4 .hint { display:inline; font-weight:400; }
.grid-row { display:flex; gap:5px; margin-bottom:5px; align-items:center; }
.grid-row input, .grid-row select { min-width:0; }
.grid-row.ing .i-item { flex:3; } .grid-row.ing .i-amt { flex:1; }
.grid-row.ing .i-unit, .grid-row.ing .i-aisle { flex:1.4; }
.grid-row .rm { padding:3px 8px; font-size:.75rem; flex-shrink:0; }

.vote-fab {
  position:fixed; right:16px; bottom:16px; z-index:30;
  display:flex; align-items:center; gap:8px;
  background:linear-gradient(135deg,var(--accent),#7c4dff);
  color:#fff; text-decoration:none; font-weight:700; font-size:.95rem;
  padding:13px 20px; border-radius:999px; box-shadow:0 6px 20px rgba(0,0,0,.35);
  animation:vote-fab-pulse 1.8s ease-in-out infinite;
}
.vote-fab.hidden { display:none; }
/* The drawer (21) and its backdrop (19) must cover the FAB (30), or it hovers
   over the open menu and stays tappable through the overlay. */
body.nav-open .vote-fab { display:none; }
@keyframes vote-fab-pulse {
  0%, 100% { transform:scale(1); }
  50% { transform:scale(1.06); }
}
@media (max-width:560px) {
  .vote-fab { right:12px; bottom:calc(76px + env(safe-area-inset-bottom, 0px)); padding:12px 18px; font-size:.9rem; }
}

.reward-balance-card {
  text-align:center; background:var(--card); border:1px solid var(--border);
  border-radius:14px; padding:22px; margin-bottom:18px;
}
.reward-balance-big { font-size:2.4rem; font-weight:700; color:var(--accent); }
.reward-grid { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.reward-card {
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  padding:11px 16px; display:flex; align-items:center; gap:14px; flex-wrap:wrap; text-align:left;
}
.reward-card.locked { opacity:.55; }
.reward-card .reward-name { flex:1; min-width:140px; }
.reward-card .reward-cost { margin:0; }
@media (max-width:560px) { .reward-card { flex-direction:column; align-items:stretch; text-align:center; } }
.reward-name { font-weight:600; margin-bottom:4px; }
.reward-cost { color:var(--accent); font-size:.85rem; margin-bottom:6px; }
.redemption-row { flex-wrap:wrap; border-bottom:1px solid var(--border); padding:8px 0; }
.redemption-row:last-child { border-bottom:none; }
.vote-type-filter { margin-bottom:10px; }

/* notices */
/* Flat tinted panels rather than outlined boxes — an outline on every notice
   made three stacked messages read as three competing alerts. The tint alone
   separates them from the page, and severity is carried by hue. */
.notice {
  background:color-mix(in srgb, var(--accent) 10%, transparent); border:none;
  border-radius:12px; padding:11px 14px; font-size:.85rem; margin-bottom:12px;
}
.notice.small { font-size:.8rem; padding:9px 12px; }
.notice a { color:var(--accent); }
.notice.at-cap { background:color-mix(in srgb, var(--low) 14%, transparent); }
.notice.warn { background:color-mix(in srgb, var(--bad) 13%, transparent); }
.notice.info { background:color-mix(in srgb, var(--low) 13%, transparent); }
.notice.good { background:color-mix(in srgb, var(--good) 13%, transparent); }

/* simple plan (default view) */
/* Holds every meal in the library, so the option text is long. Without a cap
   the select takes its intrinsic content width and pushes the page sideways. */
.dayMealSelect { max-width:100%; min-width:0; flex:1; }
.simple-meal { color:var(--text); font-size:.9rem; }
/* Tapping the meal name opens a read-only peek at what's in it. Styled to
   look like the plain text it replaced, not like a button. */
button.meal-peek {
  background:none; border:none; padding:0; font:inherit; color:var(--text);
  text-align:left; cursor:pointer; border-bottom:1px dotted var(--border);
}
button.meal-peek:hover { color:var(--accent); border-bottom-color:var(--accent); }
.peek-ings { list-style:none; padding:0; margin:0; }
.peek-ings li { display:flex; gap:10px; padding:4px 0; border-bottom:1px solid var(--border); font-size:.88rem; }
.peek-ings li:last-child { border-bottom:none; }
.peek-ings .pk-qty { min-width:74px; color:var(--muted); font-variant-numeric:tabular-nums; }
@media (max-width:560px) {
  .day.simple .day-header { flex-direction:column; align-items:flex-start; gap:6px; }
}

.attend-confirm { margin-bottom:16px; }
.attend-confirm > .hint { margin:2px 0 10px; }

.suggest-box {
  margin-top:16px; padding:13px 15px; border-radius:12px;
  background:var(--card); border:1px dashed var(--border);
}
.suggest-box h3 { margin:0 0 3px; font-size:.9rem; }
.suggest-row { display:flex; gap:8px; margin-top:8px; }
.suggest-row input { flex:1; }

/* vote — same vocabulary as the Plan timeline and the shopping list: round tap
   target, quiet meta line above, the name doing the talking. No borders. */
.vote-grid { display:flex; flex-direction:column; gap:2px; }
.vote-row {
  display:flex; align-items:flex-start; gap:12px; flex-wrap:wrap;
  padding:10px 4px; position:relative;
}
.vote-hit {
  all:unset; display:flex; align-items:flex-start; gap:12px;
  flex:1; min-width:0; cursor:pointer;
}
.vote-hit[aria-disabled="true"] { cursor:not-allowed; }
.vote-check {
  flex:0 0 26px; width:26px; height:26px; border-radius:50%; margin-top:2px;
  box-shadow:inset 0 0 0 2px var(--border); position:relative;
  transition:background .15s ease, box-shadow .15s ease;
}
.vote-row.voted .vote-check {
  background:var(--accent); box-shadow:inset 0 0 0 2px var(--accent);
}
.vote-row.voted .vote-check::after {
  content:"✓"; position:absolute; inset:0; display:flex;
  align-items:center; justify-content:center; color:#fff;
  font-size:.82rem; font-weight:700;
}
.vote-body { display:flex; flex-direction:column; gap:1px; min-width:0; }
.vote-meta {
  font-size:.66rem; font-weight:600; text-transform:uppercase;
  letter-spacing:.07em; color:var(--muted);
}
.vote-name { font-size:1.02rem; font-weight:600; line-height:1.25; }
/* Chosen is the good outcome, so it reads in the positive colour rather than
   as another ring competing with the liked state. */
.vote-row.chosen .vote-meta { color:var(--good); }
/* Vetoed rows sort to the top now, so they read as a warning band rather
   than fading into the list — full opacity, red-tinted, same vocabulary as
   .notice.warn elsewhere. The like checkbox is left alone: it still shows
   your own real pick independently of the veto, which is the whole point of
   being able to unpick something after it's been vetoed. */
.vote-row.vetoed {
  opacity:1; background:color-mix(in srgb, var(--bad) 11%, transparent);
  border-radius:10px; margin:0 -8px; padding-left:8px; padding-right:8px;
}
.vote-row.vetoed .vote-meta { color:var(--bad); }
.vote-row.vetoed .vote-name { text-decoration:line-through; color:color-mix(in srgb, var(--bad) 55%, var(--text)); }
/* Distinct from vetoed on purpose — vetoed means "nobody wants this again",
   capped just means "no room left in your picks right now". Muted, not red;
   nothing permanent about it, it un-greys the instant a slot frees up. */
.vote-row.capped { opacity:.45; }
.vote-row.capped .vote-check { box-shadow:inset 0 0 0 2px var(--border); opacity:.6; }
.veto-btn {
  flex-shrink:0; align-self:center; font-size:.7rem; padding:4px 9px;
  border-radius:999px; background:none; border:none; color:var(--muted);
  opacity:.65;
}
.veto-btn:hover { opacity:1; color:var(--bad); }
.veto-btn.on { color:var(--bad); opacity:1; }
.tag-chosen { border-color:var(--good); color:var(--good); }
.vote-ing-warn { display:flex; align-items:center; gap:8px; flex-wrap:wrap; flex:1 1 100%; }
.addIngBtn { padding:3px 11px; font-size:.72rem; flex-shrink:0; margin-left:auto; }
@media (max-width:560px) {
  .vote-ing-warn { justify-content:space-between; }
  .addIngBtn { margin-left:0; }
}

.access-row { border-bottom:1px solid var(--border); padding:10px 0; }
.access-row:last-child { border-bottom:none; }
.access-row-name { font-weight:600; margin-bottom:6px; }
.access-row .accessSave { margin-top:8px; }
.color-swatches { display:flex; flex-wrap:wrap; gap:8px; }
.swatch {
  width:32px; height:32px; border-radius:50%; border:2px solid transparent;
  padding:0; cursor:pointer;
}
.swatch.on { border-color:var(--text); box-shadow:0 0 0 2px var(--bg), 0 0 0 4px currentColor; }
.swatch-clear { background:var(--card); border:1px solid var(--border); color:var(--muted); font-size:.85rem; }
.vote-tags { display:flex; flex-wrap:wrap; gap:3px; }
.winner-box {
  margin-top:18px; padding:14px 16px; border-radius:12px; border:none;
  background:color-mix(in srgb, var(--good) 11%, transparent);
}
.winner-box h3 { margin:0 0 5px; font-size:.92rem; color:var(--good); }
.winner-box p { margin:0 0 4px; font-size:.86rem; }
.winner-box h3 ~ h3 { margin-top:16px; padding-top:14px; border-top:1px solid var(--border); }

.overview-toggle {
  width:100%; margin-bottom:10px; background:none; border:none;
  color:var(--muted); text-align:left; padding:8px 4px; font-size:.85rem;
}
.overview-toggle:hover { color:var(--text); }
.overview-days { display:flex; flex-direction:column; gap:14px; margin-top:8px; }
.overview-day h4 { margin:0 0 6px; font-size:.88rem; }
.overview-day h4 .hint { font-size:.76rem; font-weight:400; }
/* Same shape as a vote row: round tick, standing on a quiet line above, name
   below. The voters used to be a full-width element that wrapped under the
   row with no indent, so it read as belonging to the NEXT meal along. */
.overview-row {
  display:flex; align-items:flex-start; gap:11px;
  padding:7px 0; font-size:.85rem; cursor:pointer;
}
.overview-row .finalizeCb {
  appearance:none; -webkit-appearance:none; flex:0 0 22px; width:22px; height:22px;
  margin:1px 0 0; border-radius:50%; box-shadow:inset 0 0 0 2px var(--border);
  background:none; position:relative; cursor:pointer;
}
.overview-row .finalizeCb:checked {
  background:var(--good); box-shadow:inset 0 0 0 2px var(--good);
}
.overview-row .finalizeCb:checked::after {
  content:"✓"; position:absolute; inset:0; display:flex; align-items:center;
  justify-content:center; color:#fff; font-size:.72rem; font-weight:700;
}
.ov-body { display:flex; flex-direction:column; gap:1px; min-width:0; flex:1; }
.ov-meta {
  font-size:.64rem; font-weight:600; text-transform:uppercase;
  letter-spacing:.07em; color:var(--muted);
}
.ov-name { font-size:.95rem; font-weight:600; line-height:1.25; }
.overview-row.winner .ov-name { color:var(--good); }
.overview-row.applied .ov-meta { color:var(--good); }
.dropMeal { padding:2px 9px; font-size:.72rem; flex-shrink:0; color:var(--muted); }
.dropMeal:hover { color:var(--bad); border-color:var(--bad); }

/* filters */
.filter-bar { margin-bottom:14px; }
.filter-bar input { width:100%; margin-bottom:8px; }
.tag-filters { display:flex; flex-wrap:wrap; gap:5px; }
.tagf { font-size:.76rem; padding:4px 10px; border-radius:999px; color:var(--muted); }
.tagf.on { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }
.tag-picker { display:flex; flex-wrap:wrap; gap:4px 12px; padding:6px 0; }
.tag-opt {
  font-size:.82rem; color:var(--text);
  /* .inline centers vertically, which is fine for one-line text — but
     "Kids' favourite" / "Batch cook" wrap to two lines, and centering the
     checkbox against a two-line-tall block puts it visually mid-text. */
  align-items:flex-start !important;
}
.tag-opt input[type=checkbox] { margin-top:2px; }

/* settings */
.card.pad { padding:14px 16px; }
.person-row { border-bottom:1px solid var(--border); padding:7px 0; flex-wrap:wrap; }
/* The row gained a vote-link and a regenerate button, which pushed it past
   375px as one line — the name takes the full width and the controls wrap
   underneath rather than overflowing the page. */
.person-row .row-label { flex:1 1 100%; }
.person-row .roleSel { flex:0 1 auto; }
.person-row:last-of-type { border-bottom:none; }
.person-row .delPerson { padding:2px 8px; font-size:.75rem; }
.btn-link {
  display:inline-block; background:var(--card); border:1px solid var(--border);
  color:var(--text); padding:7px 13px; border-radius:8px; text-decoration:none; font-size:.85rem;
}
.btn-link:hover { border-color:var(--accent); }

/* mobile */
@media (max-width:560px) {
  main { padding:14px 12px 0; }
  /* Icon-only actions, and a smaller title. The date can only sit dead centre
     while both outer grid tracks fit their content, and the widest of those is
     the title — at desktop size it alone eats the room the centring needs. */
  .actions .btn-label { display:none; }
  .actions button, .actions .btn-link { padding:5px 7px; font-size:1rem; line-height:1; }
  .actions { gap:5px; }
  .block-head { gap:6px; }
  .block-head h1 { font-size:1.15rem; white-space:nowrap; }
  .block-head .week-range { font-size:.95rem; }
  h1 { font-size:1.25rem; }
  .day { padding:12px 13px; }
  .qty { min-width:56px; font-size:.8rem; }
  /* 90px clears the realistic worst case ("12 bottle each" measures 87px);
     below that the label spills over the item name rather than wrapping. */
  .extra-row .qty { width:90px; flex:0 0 90px; }
  .grid-row { flex-wrap:wrap; }
  .grid-row.ing .i-item { flex:1 1 100%; }
  .modal { padding:10px 8px; }
  .modal-card { padding:14px 14px 18px; }
}

.error-box {
  background:var(--card); border:1px solid var(--bad); border-left-width:4px;
  border-radius:12px; padding:16px 18px;
}
.error-box h2 { margin:0 0 8px; font-size:1.05rem; color:var(--bad); }
.error-box pre {
  white-space:pre-wrap; word-break:break-word; background:var(--bg);
  border:1px solid var(--border); border-radius:8px; padding:10px;
  font-size:.8rem; color:var(--text); margin:0 0 10px;
}
.error-box code { background:var(--bg); padding:2px 6px; border-radius:5px; font-size:.78rem; }
.error-box button { margin-top:10px; }

.login-gate { padding:60px 16px; text-align:center; max-width:360px; margin:0 auto; }
.login-gate h1 { margin:0 0 6px; }
.login-gate .subtitle { margin-bottom:24px; }
.login-gate .field { text-align:left; }
/* Fun theme — opt-in per person, from Settings. Brighter and rounder, but
   still uses the same structure so nothing breaks; a parent who never
   switches it on never sees it. */
:root[data-fun-theme="1"] {
  --bg:#1a1033; --card:#2a1a4a; --border:#4a3070; --text:#fff3fa;
  --muted:#c9a8e8; --accent:#ff5fa2; --good:#3ee08a; --low:#ffc93c; --bad:#ff5f6d;
}
:root[data-fun-theme="1"] body { font-family:"Comic Sans MS", -apple-system, sans-serif; }
:root[data-fun-theme="1"] .tabs { border-bottom-color:var(--border); }
:root[data-fun-theme="1"] .tabs a.active { background:linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #7c4dff)); color:#fff; }
:root[data-fun-theme="1"] .day, :root[data-fun-theme="1"] .card,
:root[data-fun-theme="1"] .vote-row, :root[data-fun-theme="1"] .meal-card {
  border-radius:18px; border-width:2px;
}
:root[data-fun-theme="1"] button.primary { background:linear-gradient(135deg,#ff5fa2,#7c4dff); border:none; }
:root[data-fun-theme="1"] .vote-row.voted .vote-check { box-shadow:inset 0 0 0 2px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
:root[data-fun-theme="1"] h1::after { content:" 🎉"; }

@media print {
  body { background:#fff; color:#000; }
  .no-print, .tabs, .block, .modal { display:none !important; }
  .card { border:none; background:#fff; padding:0; }
  .aisle h3 { color:#000; border-color:#999; }
  .qty, .hint { color:#333; }
  .tag { border:1px solid #999; color:#000; background:none; }
}

/* ---- Plan: today at a glance -------------------------------------------
   The page is opened far more often to answer "what am I cooking tonight?"
   than to edit anything, so today gets its own card at the top and the rest
   of the week stays as a compact reference below it. */
.today-card {
  border:1px solid var(--accent); border-radius:14px; padding:13px 16px 15px;
  background:color-mix(in srgb, var(--accent) 12%, transparent); margin-bottom:16px;
}
.today-when {
  font-size:.68rem; text-transform:uppercase; letter-spacing:.07em;
  color:var(--accent); font-weight:700; margin-bottom:5px;
}
.today-meal {
  font-size:1.4rem; font-weight:700; line-height:1.2; color:var(--text);
  background:none; border:none; padding:0; text-align:left; font-family:inherit; cursor:pointer;
}
.today-meal:hover { color:var(--accent); }
.today-card.empty .today-meal {
  font-size:1.05rem; font-weight:500; font-style:italic; color:var(--muted); cursor:default;
}
/* Lunch heads its own block on the today card, so the rule that used to sit
   above the dinner's list moves here and does double duty as the divider. */
.today-lunch {
  font-size:.82rem; color:var(--muted); margin-top:12px;
  border-top:1px solid var(--border); padding-top:10px;
}
.today-ings.sub { margin-top:4px; border-top:none; padding-top:0; }
.today-ings.sub li { font-size:.82rem; }
.today-lunch button { font-size:.82rem; }

/* .day.simple is a column flex container, so a bare button stretches to the
   full card width and reads like an empty input rather than a small action. */
.addLunch { align-self:flex-start; margin-top:8px; padding:4px 10px; font-size:.72rem; }

/* ---- offline notice ---------------------------------------------------- */
.toast {
  position:fixed; left:50%; bottom:20px; transform:translate(-50%, 140%);
  max-width:min(420px, calc(100vw - 24px)); z-index:60;
  background:var(--card); border:1px solid var(--border); border-radius:10px;
  padding:11px 15px; font-size:.85rem; color:var(--text);
  box-shadow:0 8px 26px rgba(0,0,0,.45); text-align:center;
  opacity:0; visibility:hidden; pointer-events:none;
  transition:transform .22s ease, opacity .22s ease, visibility 0s linear .22s;
}
.toast.show { transform:translate(-50%, 0); opacity:1; visibility:visible; pointer-events:auto;
  transition:transform .22s ease, opacity .22s ease, visibility 0s; }
.toast.bad { border-color:var(--bad); }
@media (max-width:560px) { .toast { bottom:calc(20px + env(safe-area-inset-bottom, 0px)); } }

/* ---- Plan: swap days ---------------------------------------------------- */
.swapDaySelect { flex:1; min-width:0; font-size:.82rem; padding:5px 7px; }

/* ---- Shopping: whole-row tap target + trolley -------------------------- */
/* A checkbox alone is a tiny, easy-to-miss target on a phone. The whole row
   becomes the button — bordered like a card, with visible pressed/checked
   states — while staying a native <label>, so tapping anywhere in it still
   just toggles the checkbox with no extra JS. */
.shop-row {
  padding:9px 12px; margin:5px 0; border-radius:10px;
  border:1px solid var(--border); background:var(--bg);
  transition:background .15s ease, border-color .15s ease, opacity .28s ease, transform .28s ease;
}
.shop-row:active { background:color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.shop-row:has(input:checked) {
  border-color:color-mix(in srgb, var(--good) 45%, var(--border));
  background:color-mix(in srgb, var(--good) 10%, var(--bg));
}
.aisle-items .shop-row:first-child { margin-top:8px; }

.aisle.aisle-empty { display:none; }

.trolley-card { margin-top:16px; }
.trolley-heading { font-size:.92rem; margin:2px 0 2px; display:flex; align-items:center; gap:6px; }
.trolley-heading #trolleyCount {
  font-size:.72rem; color:var(--muted); background:var(--bg);
  border-radius:999px; padding:1px 8px;
}
.trolley-card.hidden { display:none; }
.trolley-item .shop-row { border-color:var(--border); background:var(--bg); opacity:.72; }
.trolley-item .aisle-tag { font-size:.68rem; color:var(--muted); margin-left:6px; }

/* fade+collapse out of the aisle list, fade+settle into the trolley (and the
   reverse on undo) — 280ms, matched to the setTimeout in app.js */
.row-leaving { opacity:0; transform:translateX(10px) scale(.98); }
.row-entering { opacity:0; transform:translateY(-4px); }

/* ---- in-app confirm / PIN pad -------------------------------------------
   Replaces confirm()/alert()/prompt() throughout the app — native dialogs
   block the page, can't be styled, and prompt() gives no guarantee of a
   numeric keypad, which is the one place (PIN entry) that actually matters. */
.modal-actions .danger { background:var(--bad); border-color:var(--bad); }

.form-error, .pin-error {
  min-height:1.2em; text-align:center; color:var(--bad); font-size:.8rem;
  margin:4px 0 0; opacity:0; transition:opacity .15s ease;
}
.pin-error.show { opacity:1; }
.toast.good { border-color:var(--good); }

/* ---- Plan: today's ingredients, inline -------------------------------- */
.today-ings {
  list-style:none; padding:0; margin:12px 0 0; border-top:1px solid var(--border); padding-top:10px;
}
.today-ings li { display:flex; gap:10px; padding:3px 0; font-size:.86rem; }
.today-ings .pk-qty { min-width:70px; flex-shrink:0; color:var(--muted); font-variant-numeric:tabular-nums; }
.today-ings-empty { margin:10px 0 0; font-size:.8rem; color:var(--muted); font-style:italic; }

/* ---- meal ratings (anonymous) -------------------------------------------- */
.meal-rating { display:flex; align-items:center; gap:10px; margin-top:6px; flex-wrap:wrap; }
.rating-avg { font-size:.8rem; color:var(--text); font-variant-numeric:tabular-nums; }
.rating-picker { display:inline-flex; gap:1px; }
.star-btn {
  background:none; border:none; padding:1px 2px; font-size:1rem; line-height:1;
  color:var(--border); cursor:pointer;
}
.star-btn.on, .star-btn:hover { color:var(--low); }
.star-btn:active { transform:scale(1.15); }

/* ---- Vote: "need anything else" CTA -------------------------------------- */
.extras-cta {
  display:block; text-decoration:none; color:var(--text);
  background:color-mix(in srgb, var(--good) 12%, transparent);
}
.extras-cta:hover { background:color-mix(in srgb, var(--good) 18%, transparent); }

/* ---- extra-request page --------------------------------------------------- */
.chip-row { display:flex; flex-wrap:wrap; gap:8px; }
.chip {
  border-radius:999px; padding:6px 14px; font-size:.85rem;
  background:var(--bg); border:1px solid var(--border); color:var(--text);
}
.chip:active { background:color-mix(in srgb, var(--accent) 16%, var(--bg)); }

/* ---- weekly cycle strip -------------------------------------------------
   Vote -> Plan -> Shop, the order things actually happen in. The nav bar is
   ordered for daily use instead (Plan first), so this carries the sequence
   without fighting that — current step highlighted, all three tappable. */
.cycle-strip { display:flex; gap:6px; margin:10px 0 14px; }
.cycle-step {
  flex:1; text-align:center; text-decoration:none; padding:7px 4px;
  font-size:.74rem; font-weight:600; letter-spacing:.02em;
  border-radius:8px; border:1px solid var(--border);
  background:var(--card); color:var(--muted); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis;
}
.cycle-step.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.cycle-step:not(.on):hover { border-color:var(--accent); color:var(--text); }

/* "you've finished this step, here's the next one" handoff */
.next-step {
  display:block; text-decoration:none; color:var(--text); margin-top:16px;
  border-color:color-mix(in srgb, var(--good) 45%, var(--border));
  background:color-mix(in srgb, var(--good) 10%, transparent);
}
.next-step:hover { border-color:var(--good); }

/* Link from Shopping to the usual-items page */
.regulars-link { display:block; text-decoration:none; color:var(--text); }
.regulars-link:hover { background:color-mix(in srgb, var(--accent) 17%, transparent); }

/* Extras row on a phone: stepper + qty + name fill the first line, and the
   two labelled action buttons wrap to a second line as a pair. Before this
   they fought the item name for the same ~12px of leftover space and the
   text overlapped the buttons — the row got too wide when the bare 🗑/✏️
   icons gained visible labels. */
.extra-actions { display:flex; gap:6px; flex-shrink:0; margin-left:auto; }
@media (max-width:560px) {
  .extra-row { flex-wrap:wrap; row-gap:8px; }
  .extra-row .shop-item { flex:1 1 120px; }
  .extra-row .qty { width:78px; flex:0 0 78px; font-size:.76rem; }
}

/* ---- Plan: week as a timeline -------------------------------------------
   Structural cues taken from Structured (Apple Design Award winner): no
   borders at all, a vertical spine threading circular colour badges, and
   hierarchy carried by weight/size/space instead of boxes. Colour does the
   scanning work the borders used to — you find the day by hue first. Their
   palette is light + coral; this keeps our dark theme and encodes meal type
   in the badge rather than copying their colours. */
.timeline { list-style:none; margin:6px 0 0; padding:0; position:relative; }
.timeline::before {
  content:""; position:absolute; left:21px; top:24px; bottom:26px; width:2px;
  background:var(--border); border-radius:1px;
}
.tl-day { display:flex; gap:14px; padding:0 0 20px; position:relative; }
.tl-badge {
  flex:0 0 44px; width:44px; height:44px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:.95rem; font-weight:700; color:#fff;
  position:relative; z-index:1; background:var(--badge, var(--border));
  /* ring in the page colour so the spine appears to pass behind the badge */
  box-shadow:0 0 0 4px var(--bg);
}
.tl-badge[data-kind="proper"]   { --badge:#4f7fe8; }
.tl-badge[data-kind="light"]    { --badge:#2f9e6b; }
.tl-badge[data-kind="pudding"]  { --badge:#9a5fc8; }
.tl-badge[data-kind="takeaway"] { --badge:#c8873a; }
.tl-badge[data-kind="none"] {
  background:transparent; color:var(--muted);
  box-shadow:0 0 0 4px var(--bg), inset 0 0 0 2px var(--border);
}
.tl-day.is-today .tl-badge { box-shadow:0 0 0 4px var(--bg), 0 0 0 7px color-mix(in srgb, var(--accent) 55%, transparent); }

.tl-body { flex:1; min-width:0; padding-top:1px; }
.tl-meta {
  margin:0 0 2px; font-size:.68rem; font-weight:600;
  text-transform:uppercase; letter-spacing:.07em; color:var(--muted);
}
.tl-today { color:var(--accent); }
.tl-title { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:1.05rem; font-weight:600; }
.tl-title .simple-meal { font-size:1.05rem; font-weight:600; }
.tl-title .simple-meal.none { font-weight:400; color:var(--muted); font-style:italic; }
.tl-title .dayMealSelect { flex:1; min-width:0; font-size:.86rem; }
.tl-title .unassign { flex-shrink:0; }

/* Days already eaten. Smaller, quieter and (unless historic edits are turned
   on) with no controls at all, so the eye slides straight past them to today.
   The badge keeps its 44px slot so the spine still runs dead centre. */
/* Folded away by default — see .past-toggle. */
.timeline.past-hidden .tl-day.is-past { display:none; }
.past-toggle {
  font-size:.76rem; padding:4px 12px; margin:2px 0 8px; border-radius:999px; color:var(--muted);
}
.past-toggle[aria-expanded="true"] { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }
.past-toggle:hover { color:var(--text); }
.past-toggle[aria-expanded="true"]:hover { color:#fff; }

.tl-day.is-past { padding-bottom:10px; opacity:.5; }
.tl-day.is-past .tl-badge {
  flex-basis:30px; width:30px; height:30px; margin:2px 7px 0; font-size:.78rem;
  filter:saturate(.45);
}
.tl-day.is-past .tl-meta { font-size:.6rem; margin-bottom:0; }
.tl-day.is-past .tl-title,
.tl-day.is-past .tl-title .simple-meal { font-size:.86rem; font-weight:500; }
.tl-day.is-past .tl-extras { margin-top:4px; font-size:.8rem; }
/* Today is the anchor of the page — give it air after the compressed history. */
.tl-day.is-past + .tl-day.is-today { padding-top:6px; }

.tl-extras { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin-top:8px; }
.tl-ctl { display:flex; align-items:center; gap:6px; min-width:0; }
.tl-ctl > span { font-size:.68rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); white-space:nowrap; }
.tl-ctl select { font-size:.8rem; padding:4px 6px; min-width:0; max-width:190px; }
/* Read-only days carry lunch inline after the dinner, so a finished day is one
   line. Lighter weight than the dinner it trails, and it wraps as a unit. */
.tl-lunch {
  margin:0; font-size:.8rem; font-weight:400; color:var(--muted);
  white-space:nowrap; display:inline-flex; align-items:baseline; gap:4px;
}
.tl-lunch button { font-size:.8rem; font-weight:400; }
.tl-day.is-past .tl-lunch, .tl-day.is-past .tl-lunch button { font-size:.76rem; }

/* Today's hero: tinted panel rather than another bordered box */
.today-card {
  border:none; border-radius:16px; padding:15px 18px 17px; margin-bottom:20px;
  background:linear-gradient(140deg, color-mix(in srgb, var(--accent) 20%, var(--card)), var(--card) 70%);
}
.today-card.empty { background:var(--card); }
.today-meal { font-size:1.5rem; }

/* ---- Shopping in the Plan page's vocabulary ------------------------------
   Borders off; the row is still the whole tap target (it's a <label>), but it
   now reads as a line item rather than a boxed control. The big outline
   circle is what signals "tappable" — same device Structured uses for task
   completion, and a far bigger target than the 17px square it replaces. */
.shop-row {
  border:none; background:none; padding:11px 6px; margin:0;
  align-items:center; gap:12px; border-radius:10px;
}
.aisle-items .shop-row:first-child { margin-top:6px; }
.shop-row:active { background:color-mix(in srgb, var(--accent) 12%, transparent); }
.shop-row:has(input:checked) { background:none; }

.shop-row input[type=checkbox] {
  appearance:none; -webkit-appearance:none;
  width:26px; height:26px; min-width:26px; border-radius:50%;
  border:2px solid color-mix(in srgb, var(--muted) 55%, transparent);
  background:transparent; position:relative; cursor:pointer;
  transition:background .15s ease, border-color .15s ease;
}
.shop-row input[type=checkbox]:checked { background:var(--good); border-color:var(--good); }
.shop-row input[type=checkbox]:checked::after {
  content:"✓"; position:absolute; inset:0; display:flex;
  align-items:center; justify-content:center; color:#fff; font-size:.8rem; font-weight:700;
}

.shop-row .qty { align-self:flex-start; padding-top:1px; }
.shop-item { display:flex; flex-direction:column; gap:2px; }
.shop-name { font-weight:600; font-size:.98rem; line-height:1.25; }
.shop-meta { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; font-size:.74rem; color:var(--muted); }
.shop-meta .hint { display:inline; }
.shop-meta .tag { margin-left:0; }
.shop-row input:checked ~ .qty,
.shop-row input:checked ~ .shop-item .shop-name { color:var(--muted); text-decoration:line-through; }
.shop-row input:checked ~ .shop-item .shop-meta { opacity:.6; }

/* Aisle heading: colour dot instead of a rule under it */
.aisle h3 { border-bottom:none; padding-bottom:0; display:flex; align-items:center; gap:7px; margin:14px 0 2px; }
.aisle-dot { width:9px; height:9px; border-radius:50%; background:var(--dot, var(--muted)); flex-shrink:0; }
.trolley-item .shop-row { background:none; opacity:.6; }

/* Nothing left to buy — say so rather than leaving an empty card */
.all-done { text-align:center; padding:26px 16px 22px; }
.all-done-tick {
  display:inline-flex; align-items:center; justify-content:center;
  width:52px; height:52px; border-radius:50%; background:var(--good);
  color:#fff; font-size:1.5rem; font-weight:700; margin-bottom:10px;
}
.all-done p { margin:0; color:var(--muted); font-size:.9rem; }

/* Very narrow phones: one more notch so the title still fits beside a centred
   date without wrapping the header onto a second line. */
@media (max-width:345px) {
  .block-head h1 { font-size:1.02rem; }
  .block-head .week-range { font-size:.88rem; }
}

/* Meal photos */
.meal-photo { width:100%; max-height:180px; object-fit:cover; border-radius:10px; margin-bottom:8px; display:block; }
.vote-photo { width:52px; height:52px; object-fit:cover; border-radius:8px; flex:0 0 auto; }
.meal-photo-edit { width:100%; max-height:200px; object-fit:cover; border-radius:10px; margin:4px 0 8px; display:block; }

/* Notepad theme — cream ruled paper, ink-blue handwriting, red margin line. */
:root[data-notepad="1"] {
  --bg:#efe6cf; --card:#fffbea; --border:#d9cfae; --text:#1f2a55; --muted:#6b6f86;
  --accent:#c2412d; --good:#2f7d4a; --low:#b27a12; --bad:#b3261e;
  color-scheme:light;
}
:root[data-notepad="1"] body {
  font-family:"Noteworthy","Chalkboard SE","Comic Sans MS","Segoe Print",-apple-system,sans-serif;
  font-size:16.5px; letter-spacing:.01em;
}
:root[data-notepad="1"] input, :root[data-notepad="1"] select,
:root[data-notepad="1"] textarea, :root[data-notepad="1"] button { font-family:inherit; }
:root[data-notepad="1"] .card, :root[data-notepad="1"] .day,
:root[data-notepad="1"] .meal-card, :root[data-notepad="1"] .modal > * {
  background-color:var(--card);
  background-image:
    linear-gradient(to right, transparent 12px, var(--pad-margin) 12px, var(--pad-margin) 13px, transparent 13px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 29px, var(--pad-rule) 29px, var(--pad-rule) 30px);
  border:none; box-shadow:0 2px 6px rgba(80,60,20,.18);
  padding-left:36px;
}
:root[data-notepad="1"] .shop-row { min-height:30px; border-bottom:none; }
:root[data-notepad="1"] .shop-row input:checked ~ .shop-item .shop-name {
  color:var(--muted); text-decoration:line-through 2px var(--text);
}
:root[data-notepad="1"] .tabs { background:#e4d8b8; }

.redeemed-table { width:100%; border-collapse:collapse; font-size:.88rem; }
.redeemed-table th { text-align:left; color:var(--muted); font-weight:600; padding:4px 6px; }
.redeemed-table td { padding:6px; border-top:1px solid var(--border); }

.votes-left {
  position:fixed; left:16px; bottom:calc(16px + env(safe-area-inset-bottom, 0px)); z-index:29;
  background:var(--card); color:var(--text); border:2px solid var(--accent);
  padding:10px 16px; border-radius:999px; font-size:.95rem; box-shadow:0 6px 20px rgba(0,0,0,.35);
}
.votes-left strong { font-size:1.2rem; color:var(--accent); }
.votes-left.done { border-color:var(--good); color:var(--good); }
body.nav-open .votes-left { display:none; }
.vote-meta-inline { display:inline; font-size:.78rem; font-weight:400; margin:0; }

/* ---- App feel: bottom tab bar on phones, native-ish taps, big titles ---- */
* { -webkit-tap-highlight-color:transparent; }
button, a, label, select { touch-action:manipulation; }
button { transition:transform .08s ease, opacity .08s ease; }
button:active:not(:disabled) { transform:scale(.96); opacity:.85; }

@media (max-width:560px) {
  body { padding-bottom:calc(84px + env(safe-area-inset-bottom, 0px)); }
  .nav-toggle, .nav-backdrop { display:none !important; }
  .tab-links {
    position:fixed; top:auto; bottom:0; left:0; right:0; width:auto; height:auto;
    transform:none; transition:none; z-index:40;
    flex-direction:row; justify-content:space-around; align-items:stretch; gap:0;
    padding:6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background:var(--card); backdrop-filter:none; -webkit-backdrop-filter:none;  /* opaque: a blurred fixed bar drifted to mid-screen on iOS while scrolling */
    border-right:none; border-top:1px solid var(--border); overflow:visible;
  }
  .tab-links a {
    flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
    padding:4px 0; font-size:.62rem; font-weight:600; border-radius:10px; min-width:0;
    color:var(--muted); background:none !important;
  }
  .tab-links a::before { font-size:1.35rem; line-height:1.1; filter:grayscale(1); opacity:.7; }
  .tab-links a.active { color:var(--accent); }
  .tab-links a.active::before { filter:none; opacity:1; }
  .tab-links a[data-tab="plan"]::before { content:"📅"; }
  .tab-links a[data-tab="shopping"]::before { content:"🛒"; }
  .tab-links a[data-tab="meals"]::before { content:"🍽️"; }
  .tab-links a[data-tab="vote"]::before { content:"🗳️"; }
  .tab-links a[data-tab="rewards"]::before { content:"⭐"; }
  .tab-links a[data-tab="history"]::before { content:"🕘"; }
  .tab-links a[data-tab="extras"]::before { content:"🛍️"; }
  .tab-links a[data-tab="settings"]::before { content:"⚙️"; }
  .tabs { justify-content:flex-end; backdrop-filter:none; -webkit-backdrop-filter:none; background:var(--bg); }

  .vote-fab { bottom:calc(92px + env(safe-area-inset-bottom, 0px)); }
  .votes-left { bottom:calc(92px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom:calc(96px + env(safe-area-inset-bottom, 0px)); }

  button:not(.swatch):not(.rm):not(.tagf) { min-height:40px; }
  main { padding:12px 14px 0; }
  h1 { font-size:1.75rem; letter-spacing:-.02em; }
  .block-head { margin-bottom:8px; }
  .card { margin-bottom:10px; }
}
.tl-lunch-row { margin:2px 0 4px; }

.plan-done-btn {
  position:sticky; bottom:calc(12px + env(safe-area-inset-bottom, 0px)); z-index:28;
  display:block; text-align:center; text-decoration:none; margin:16px 0 8px;
  background:var(--good); color:#fff; font-weight:700; font-size:1.02rem;
  padding:15px 18px; border-radius:14px; box-shadow:0 6px 20px rgba(0,0,0,.35);
}
@media (max-width:560px) { .plan-done-btn { bottom:calc(84px + env(safe-area-inset-bottom, 0px)); } }
body:has(.plan-done-btn) .vote-fab { display:none; }
@media (max-width:560px) {
  .notice { font-size:.92rem; padding:14px 15px; line-height:1.5; }
  .notice button, #shopCloseBtn {
    display:block; width:100%; min-height:46px; margin:10px 0 0 !important;
    font-size:1rem; font-weight:600;
  }
  .notice .hint { font-size:.8rem; margin-top:6px; }
}
/* Main next-step actions share the "Plan done" look. */
#headingOutBtn, #shopCloseBtn[data-closed="1"], #advanceWeekBtn, .extras-cta, #finalizeBtn, .regulars-link, .next-step {
  display:block; width:100%; text-align:center; text-decoration:none;
  background:var(--good) !important; color:#fff !important; border:none !important;
  font-weight:700; font-size:1.02rem; padding:15px 18px; min-height:50px;
  border-radius:14px; box-shadow:0 6px 20px rgba(0,0,0,.3); margin:10px 0 !important;
}
/* Extras: roomier rows, big thumb-sized steppers, consistent green actions. */
.extra-row { gap:10px; padding:10px 8px; border-bottom:1px solid var(--border); margin:0; border-radius:0; }
.extra-row:last-child { border-bottom:none; }
.extra-row.on { padding:10px 8px; margin:0; border-radius:10px; }
.extra-row .shop-item { flex:1; min-width:0; font-weight:600; }
.extra-row .shop-item .hint { font-weight:400; }
.extra-actions { display:flex; gap:4px; flex-shrink:0; }
.extra-row .del, .extra-row .editExtra { padding:6px 9px; font-size:.95rem; min-height:40px; }
#exAdd { background:var(--good); color:#fff; border:none; font-weight:700; border-radius:12px; padding:0 18px; }
.modal-actions .plan-done-btn { position:static; width:100%; }
@media (max-width:560px) {
  .stepBtn { width:42px; height:42px; font-size:1.35rem; border-radius:12px; }
  .extra-row { flex-wrap:wrap; }
  .extra-row .qty { display:none; }
  .extra-row .shop-item { order:-1; flex:1 1 60%; }
  .extra-stepper { order:0; }
  .extra-actions { order:1; margin-left:auto; }
}
.pantry-intro { font-size:.95rem; border-left:4px solid var(--good); }
.regulars-link:hover, .extras-cta:hover { filter:brightness(1.08); }
.regulars-link strong { color:#fff; }
.tabs a[data-tab="extras"], .tabs a[data-tab="rewards"] { position:relative; }
.tabs a[data-badge]:not([data-badge=""])::after {
  content:attr(data-badge); position:absolute; top:0; right:4px;
  background:var(--bad); color:#fff; font-size:.62rem; font-weight:700;
  min-width:17px; height:17px; line-height:17px; border-radius:9px; padding:0 4px; text-align:center;
}
/* Phones have the Vote tab in the bottom bar — a dot on it replaces the floating button. */
@media (max-width:560px) {
  .vote-fab { display:none !important; }
  .tabs a[data-tab="vote"] { position:relative; }
  .tabs a.needs-vote::after {
    content:""; position:absolute; top:2px; right:calc(50% - 16px);
    width:10px; height:10px; border-radius:50%; background:var(--bad);
  }
}
@media (max-width:560px) { .cycle-strip { display:none !important; } }
.shop-done-btn {
  display:block; width:100%; margin:0 0 12px; padding:14px 18px; min-height:50px;
  border-radius:14px; font-weight:700; font-size:1rem; text-align:center;
  background:color-mix(in srgb, var(--good) 14%, var(--card)); color:var(--good);
  border:2px solid var(--good);
}

/* Extras: one tight line per item on phones */
@media (max-width:560px) {
  .extra-row { flex-wrap:nowrap; padding:6px 4px; gap:6px; }
  .extra-row.on { padding:6px 4px; }
  .extra-row .shop-item { order:0; flex:1; font-size:.95rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .extra-stepper { order:1; }
  .extra-actions { order:2; margin-left:0; }
  .stepBtn { width:36px; height:36px; }
  .extra-row .del, .extra-row .editExtra { padding:4px 6px; min-height:36px; }
}

/* Add-item sheet */
.big-input { width:100%; font-size:1.15rem; padding:14px; border-radius:12px; margin-bottom:12px; }
.add-sheet-row { display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 0; border-top:1px solid var(--border); font-size:.95rem; }
.add-sheet-row select { max-width:55%; }
.ex-amt { width:48px; text-align:center; font-weight:700; font-size:1.05rem; padding:6px 2px; }
.ex-unit { width:auto; }
.ex-switch { width:24px; height:24px; }
/* Picks-left: a slim strip docked above the bottom menu, never over the list. */
@media (max-width:560px) {
  .votes-left {
    left:0; right:0; bottom:calc(61px + env(safe-area-inset-bottom, 0px));
    border-radius:0; border:none; border-top:1px solid var(--border);
    padding:7px 12px; text-align:center; font-size:.9rem; box-shadow:0 -4px 12px rgba(0,0,0,.12);
    background:var(--card); backdrop-filter:none; -webkit-backdrop-filter:none;
  }
  .votes-left strong { font-size:1.05rem; }
  .votes-left.done { border-top:2px solid var(--good); }
  body:has(.votes-left) { padding-bottom:calc(124px + env(safe-area-inset-bottom, 0px)); }
}

/* ===== QA round fixes ===== */
/* 4: This/Next week switch only on Plan and Shopping */
body:not([data-tab="plan"]):not([data-tab="shopping"]) .week-toggle { display:none; }
/* 6: per-day ⋯ menu */
.day-hidden { display:none !important; }
.dayMenu { font-size:1.2rem; font-weight:700; padding:2px 12px; min-height:36px; line-height:1; }
.addLunch { display:none !important; }
.action-sheet { display:flex; flex-direction:column; gap:8px; }
.sheetBtn { width:100%; text-align:left; padding:14px 16px; font-size:1rem; border-radius:12px; min-height:50px; }
.danger-text { color:var(--bad) !important; }
.modal-actions:has(#delMeal), .modal-actions:has(#exEditDel) { justify-content:space-between; }
/* 7: meals — one scrolling row of filters, tap card to edit */
@media (max-width:560px) {
  .tag-filters { flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; -webkit-overflow-scrolling:touch; }
  .tag-filters::-webkit-scrollbar { display:none; }
  .tag-filters .tagf { flex:0 0 auto; }
}
.meal-card.tappable { cursor:pointer; }
.meal-card.tappable:active { transform:scale(.99); }
/* 11 */
@media (max-width:560px) { .desktop-only { display:none !important; } }
/* 13: green action buttons are always full width */
.plan-done-btn { width:100%; }
#openAddExtra, #exAdd { width:100%; }
/* 14: "[− 1 +] each" reads left to right */
.add-sheet-row .extra-stepper { order:1; margin-left:auto; }
.add-sheet-row .ex-unit { order:2; }
/* 15: one calm colour for planned days, outline for empty, ring for today */
.tl-badge[data-kind] { --badge:var(--accent); }
.tl-badge[data-kind="none"] { --badge:transparent; }
/* 12: notepad — each row IS a ruled line, so text always sits on one */
:root[data-notepad="1"] .card, :root[data-notepad="1"] .day,
:root[data-notepad="1"] .meal-card, :root[data-notepad="1"] .modal > * {
  background-image:linear-gradient(to right, transparent 12px, var(--pad-margin) 12px, var(--pad-margin) 13px, transparent 13px);
}
:root[data-notepad="1"] .card .row, :root[data-notepad="1"] .shop-row,
:root[data-notepad="1"] .extra-row, :root[data-notepad="1"] .redeemed-table td,
:root[data-notepad="1"] .add-sheet-row, :root[data-notepad="1"] .vote-row {
  border-bottom:1px solid var(--pad-rule) !important; border-top:none !important;
}
.tl-title .tl-lunch { flex-basis:100%; font-size:.82rem; font-weight:500; color:var(--muted); margin-bottom:-4px; }

/* ---- Pricing (desktop admin) ---- */
@media (max-width:560px) { .tab-links a[data-tab="pricing"] { display:none !important; } }
.pricing-bar { display:flex; gap:8px; margin:0 0 12px; }
.pricing-bar input { flex:1; }
.pricing-table-wrap { overflow-x:auto; padding:0; }
.pricing-table { width:100%; border-collapse:collapse; font-size:.86rem; }
.pricing-table th { text-align:left; color:var(--muted); font-weight:600; padding:8px; border-bottom:1px solid var(--border); }
.pricing-table td { padding:8px; border-bottom:1px solid var(--border); vertical-align:top; }
.pt-item { font-weight:600; white-space:nowrap; }
.pt-meals { color:var(--muted); font-size:.78rem; max-width:220px; }
.pt-range { font-weight:700; white-space:nowrap; }
.price-chip { display:inline-flex; align-items:center; gap:4px; background:color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius:8px; padding:3px 6px; margin:0 4px 4px 0; }
.price-chip.missing { opacity:.5; text-decoration:line-through; }
.price-chip button { padding:0 4px; min-height:0; font-size:.75rem; background:none; border:none; color:var(--muted); }
.aldi-results { max-height:60vh; overflow-y:auto; }
.aldi-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); }
.aldi-row > span:first-child { flex:1; }
.aldi-price { font-weight:700; white-space:nowrap; }
.shop-price { margin-left:6px; font-size:.75rem; color:var(--muted); font-weight:400; }
.shop-estimate strong { font-size:1.05rem; }
body[data-tab="pricing"] main { max-width:1150px; }
body[data-tab="pricing"] #modal > * { max-width:820px; }
.shop-total-line { display:block; width:100%; text-align:center; border:none; color:var(--text); margin:-4px 0 12px; cursor:pointer; }

.usual-row { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:-2px 0 12px; }
.usualChip { border-radius:999px; padding:6px 12px; font-size:.85rem; min-height:36px;
  background:color-mix(in srgb, var(--good) 12%, var(--card)); border:1px solid color-mix(in srgb, var(--good) 40%, var(--border)); }

.install-banner { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.install-banner button { min-height:36px !important; width:auto !important; margin:0 !important; display:inline-block !important; }
.install-steps { padding-left:20px; line-height:1.9; font-size:1rem; }
.extra-row .shop-item .tag { display:inline-block; width:auto; margin-left:6px; vertical-align:middle; }
.extra-row .shop-item .tag { align-self:flex-start; flex:0 0 auto; }

.size-picker { display:flex; gap:6px; }
.sizeBtn { min-width:44px; min-height:40px; padding:4px 10px; font-weight:700; border-radius:10px; }
.sizeBtn.on { background:var(--accent); color:#fff; border-color:var(--accent); }

.plan-edit-btn { min-height:36px; min-width:40px; padding:4px 8px; font-size:1.05rem; border-radius:8px; line-height:1; }
.plan-edit-btn.on { background:var(--accent); border-color:var(--accent); }

/* Today card: the one thing people open the app for, so it reads big. */
.today-card .today-meal { font-size:1.55rem; font-weight:700; line-height:1.2; }
.today-card .today-lunch { font-size:1.1rem; }
.today-card .today-lunch .meal-peek { font-size:1.2rem; font-weight:700; }
.today-card .today-lunch .meal-peek { font-size:1.55rem; }
.today-card .today-ings li, .today-card .today-ings.sub li { font-size:1.02rem; padding:4px 0; }
.today-card .today-ings .pk-qty { min-width:78px; }
.today-card .today-ings li, .today-card .today-ings.sub li { padding:3px 0; }

/* Today card: fold-out ingredients */
.today-det summary { list-style:none; cursor:pointer; }
.today-det summary::-webkit-details-marker { display:none; }
.today-line { display:flex; align-items:baseline; gap:8px; margin:6px 0 2px; }
.today-name { font-size:1.55rem; font-weight:700; }
.today-arrow { margin-left:auto; font-size:1.2rem; color:var(--muted); transition:transform .15s ease; }
.today-det[open] .today-arrow { transform:rotate(180deg); }
.today-card .today-ings li, .today-card .today-ings.sub li { font-size:1.18rem; padding:3px 0; }
.today-card .today-ings .pk-qty { min-width:88px; }
.today-line .today-lunch { border:none; padding:0; margin:0; }
.today-name, .today-line .today-meal { color:var(--text); }
.today-card > .today-det, .today-card > .today-line { border-top:1px solid var(--border); padding-top:10px; margin-top:10px; }
.today-card > .today-when + .today-det, .today-card > .today-when + .today-line { border-top:none; margin-top:4px; padding-top:0; }

.today-arrow { font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size:1rem; }

/* Compact view (per person, per device): same text sizes, tighter spacing. */
.compact main { padding-top:8px; }
.compact .card { padding:8px 10px; margin-bottom:8px; }
.compact .card .row, .compact .shop-row, .compact .extra-row { padding-top:4px !important; padding-bottom:4px !important; }
.compact .notice { padding:8px 11px; margin-bottom:8px; }
.compact .block-head { margin-bottom:6px; }
.compact .tl-day { padding-bottom:6px; }
.compact .tl-day .tl-meta { margin-bottom:0; }
.compact .today-card { padding:10px 14px; }
.compact .today-card .today-ings li { padding:1px 0; }
.compact .today-card > .today-det, .compact .today-card > .today-line { padding-top:6px; margin-top:6px; }
.compact .vote-row { padding-top:4px; padding-bottom:4px; }
.compact .meal-card { margin-bottom:8px; }
.compact .sec-title { margin-top:16px; }
/* Timeline: lunch sits tight above dinner (the 40px phone tap-size rule was padding them apart). */
.tl-title { row-gap:0; }
.tl-title .tl-lunch { margin:0 0 -2px; line-height:1.3; }
.tl-title .tl-lunch button, .tl-title .simple-meal { min-height:0 !important; padding-top:1px; padding-bottom:1px; }
.tl-lunch-row { margin:0 0 2px; }
/* iPhone home-screen app: stop the rubber-band bounce dragging the fixed bottom menu. */
/* no overscroll-behavior: none: on iOS it left fixed bars mis-placed after a scroll */
@media (max-width:560px) {
  .tab-links { -webkit-transform:translateZ(0); transform:translateZ(0); will-change:transform; }
}

/* Noteworthy (iPhone's notepad font) has very tall built-in line spacing;
   pin the line height so the Today card spacing is the same on every device. */
.today-card .today-line, .today-card .today-name, .today-card .today-meal,
.today-card .today-lunch, .today-card .today-when { line-height:1.15; }
.today-card .today-line { margin:4px 0 0; }
.tl-day .tl-meta, .tl-title, .tl-title .simple-meal, .tl-title .tl-lunch { line-height:1.2; }
/* iOS home-screen apps only use the full screen height while the page can
   scroll; a short page (e.g. compact Plan) shrinks the viewport and strands
   the fixed bottom menu above the screen edge. Keep the page 1px taller than
   the largest viewport so it's always scrollable. */
body { min-height:calc(100vh + 1px); min-height:calc(100lvh + 1px); }

/* ---- Shopping list: tighter rows (name + price on one line, meals/aisle under) ---- */
.shop-row { padding:6px 4px; gap:10px; }
.aisle-items .shop-row:first-child { margin-top:2px; }
.shop-item { flex-direction:row; flex-wrap:wrap; align-items:baseline; column-gap:8px; row-gap:0; }
.shop-item .shop-name { line-height:1.2; }
.shop-item .shop-price { margin-left:0; }
.shop-item .shop-meta { flex-basis:100%; line-height:1.25; font-size:.72rem; }
.shop-row input[type=checkbox] { width:24px; height:24px; min-width:24px; }
.shop-row .qty { line-height:1.2; }
.aisle h3 { margin:10px 0 0; }
.all-done { display:flex; align-items:center; justify-content:center; gap:10px; text-align:left; padding:8px 12px 12px; }
.all-done .all-done-tick { width:30px; height:30px; min-width:30px; font-size:1rem; margin:0; }
.all-done p { font-size:.85rem; }
.trolley-card h3, .trolley-card .hint { margin-top:0; margin-bottom:2px; }
.compact .shop-row { padding:3px 2px !important; }
.shop-item .shop-meta { flex-wrap:nowrap; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block; }
.shop-item .shop-meta > * { display:inline; }
.shop-item .shop-meta > * + * { margin-left:8px; }
.shop-row { padding:4px 4px; }
.shop-meta button, .shop-source-btn { min-height:0 !important; padding:0 !important; line-height:1.25; }

.vote-emojis { font-size:.9em; letter-spacing:.08em; white-space:nowrap; }
.veto-btn { font-size:1.15rem; min-width:40px; }

.inline-edit { background:none; border:none; padding:0 2px; min-height:0 !important; font-size:.95em; cursor:pointer; vertical-align:baseline; }
.finalize-toggle { position:static !important; width:100%; margin:4px 0 10px; }
.finalize-toggle.open { min-height:40px; border-radius:12px; }
.winner-box .overview-row { padding:9px 4px; font-size:1rem; gap:10px; align-items:center; border-bottom:1px solid var(--border); }
.winner-box .overview-row input[type=checkbox] { width:22px; height:22px; flex:0 0 auto; }
.winner-box .field input { font-size:1rem; }

.vote-body { display:flex; flex-direction:column; gap:3px; }
.vote-who { display:flex; gap:4px; align-items:center; }
.voter-chip { display:inline-flex; align-items:center; justify-content:center; width:1.35rem; height:1.35rem;
  border-radius:50%; color:#fff; font:700 .72rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.vetoed-note { font-size:.8rem; color:var(--bad); font-weight:600; }
.ov-name .vote-who { display:inline-flex; margin-left:6px; vertical-align:middle; }

.voter-emoji { font-size:1.15rem; line-height:1; }
.icon-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(48px, 1fr)); gap:6px; }
.icon-grid .iconPick { font-size:1.6rem; min-height:48px; padding:0; border-radius:12px; }
.icon-current { display:inline-flex; align-items:center; gap:6px; font-size:.9rem; }
/* Pop-ups clear the status bar/notch and sit a little down the screen. */
.modal { padding-top:calc(24px + env(safe-area-inset-top, 0px)); padding-bottom:calc(24px + env(safe-area-inset-bottom, 0px)); }
/* Icon picker: calmer, tighter grid; no notepad margin line through it. */
.modal-card:has(.icon-grid) { background-image:none !important; padding-left:18px !important; max-width:420px; }
.icon-grid { grid-template-columns:repeat(8, 1fr); gap:4px; }
.icon-grid .iconPick { font-size:1.35rem; min-height:40px !important; border:none; background:transparent; border-radius:10px; }
.icon-grid .iconPick:hover, .icon-grid .iconPick:active { background:color-mix(in srgb, var(--accent) 14%, transparent); }
@media (max-width:420px) { .icon-grid { grid-template-columns:repeat(6, 1fr); } }
.icon-own { display:flex; gap:8px; margin-top:12px; }
.icon-own input { flex:1; font-size:1.1rem; }
/* iPhone zooms into any field under 16px and stays zoomed; keep fields at 16px+ on phones. */
@media (max-width:560px) {
  input, select, textarea { font-size:max(16px, 1rem) !important; }
}

.person-line { align-items:center; gap:10px; padding:8px 0; }
.person-line .row-label { flex:1; }
.person-icon { font-size:1.4rem; width:1.6rem; text-align:center; }
.personMenu { font-size:1.2rem; font-weight:700; padding:2px 12px; min-height:36px !important; }
.sheet-swatches { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:6px; }
.person-row-full { border-bottom:1px solid var(--border); }
.person-row-full:last-of-type { border-bottom:none; }
/* My colour: description under the label instead of squeezed beside swatches */
.row:has(.color-swatches) { flex-wrap:wrap; }
.row:has(.color-swatches) .row-label { flex-basis:100%; }

/* No top bar any more: who-you-are lives in Settings/Rewards, week switch in the page title. */
.tab-right { display:none !important; }
@media (max-width:560px) {
  .tabs { padding:0 !important; border:none !important; background:none !important; position:static !important; min-height:0; }
  main { padding-top:calc(14px + env(safe-area-inset-top, 0px)); }
}
.week-nav { display:inline-flex; align-items:center; gap:2px; }
.weekNavBtn { background:none; border:none; font-size:1.3rem; line-height:1; padding:0 8px; min-height:44px !important; min-width:44px; color:var(--accent); cursor:pointer; }
.weekNavBtn:disabled { color:var(--border); cursor:default; }
.block-head .actions { display:flex; gap:6px; }
.me-badge { display:inline-flex; align-items:center; justify-content:center; font-size:1.05rem; min-width:1.5rem; height:1.5rem;
  border-radius:50%; background:color-mix(in srgb, var(--accent) 15%, transparent); vertical-align:middle; }

.meal-card.needs-ings { outline:2px dashed var(--low); outline-offset:-2px; }
.dupes h3 { margin:0 0 4px; }
.dup-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 0; border-top:1px solid var(--border); }
.dup-names { flex:1 1 280px; }
.dup-acts { display:flex; flex-wrap:wrap; gap:6px; }
.link-btn { background:none; border:none; padding:0; font:inherit; font-weight:600; color:inherit; cursor:pointer; text-align:left; min-height:0 !important; }
.use-row { display:flex; gap:6px; align-items:center; padding:5px 0; border-bottom:1px solid var(--border); }
.use-meal { flex:1; min-width:0; }
.use-row .useAmt { width:80px; }

.picker-pop { position:absolute; left:0; right:0; z-index:70; margin-top:4px; max-height:320px; overflow-y:auto;
  background:var(--card); border:1px solid var(--border); border-radius:12px; box-shadow:0 10px 28px rgba(0,0,0,.25); padding:4px; }
.pk-head { font-size:.7rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); padding:6px 8px 2px; }
.pk-row { display:flex; gap:6px; align-items:baseline; width:100%; text-align:left; background:none; border:none; border-radius:8px;
  padding:8px; min-height:0 !important; font-size:.95rem; color:var(--text); cursor:pointer; }
.pk-row:hover, .pk-row:active { background:color-mix(in srgb, var(--accent) 12%, transparent); }
.pk-price { margin-left:auto; font-weight:700; white-space:nowrap; }
.pk-sub { color:var(--muted); font-size:.8rem; }
.grid-row.ing { position:relative; }

.pk-wrap, .grid-row.ing { position:relative; }
.picker-pop { top:100%; }
.pk-wrap .big-input { margin-bottom:0; }
.pk-wrap { margin-bottom:12px; }

.store-tabs { display:flex; gap:6px; margin-bottom:10px; }
.storeTab { flex:1; min-height:38px; border-radius:10px; }
.storeTab.on { background:var(--accent); color:#fff; border-color:var(--accent); }
.store-badge { display:inline-flex; align-items:center; justify-content:center; width:1.1rem; height:1.1rem; border-radius:4px;
  font:700 .65rem/1 -apple-system, sans-serif; color:#fff; background:#00539f; }
.store-badge.morrisons { background:#00563f; }
.good-text { color:var(--good); font-weight:700; }
.compare-card h3 { margin:0 0 4px; }
@media (max-width:760px) { .compare-card { display:none !important; } }
.alt-row .link-btn { color:var(--accent); font-weight:600; margin-left:4px; text-decoration:underline; }
.cmp-progress { height:10px; border-radius:6px; background:var(--border); overflow:hidden; margin:8px 0 4px; }
.cmp-bar { height:100%; background:var(--good); transition:width .3s ease; }
@media (max-width:560px) { .tab-links a[data-tab="compare"] { display:none !important; } }
body[data-tab="compare"] main { max-width:1150px; }
.compare-total { font-size:1rem; }

.receipt-summary { margin-top:-4px; }
.rc-summary { font-weight:700; font-size:1.05rem; margin:8px 0; }
.rc-lines { display:flex; flex-direction:column; }
.rc-line { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; padding:7px 0; border-bottom:1px solid var(--border); }
.rc-line.open { background:color-mix(in srgb, var(--low) 10%, transparent); padding-left:6px; padding-right:6px; border-radius:8px; }
.rc-name { flex:1; min-width:0; }
.rc-amt { font-weight:700; }
.rc-kind { font-size:.8rem; color:var(--muted); flex-basis:100%; }
.rc-choices { display:flex; flex-wrap:wrap; gap:4px; flex-basis:100%; }
.rcPick { font-size:.8rem; padding:4px 8px; min-height:32px !important; border-radius:999px; }
.rcPick.on { background:var(--accent); color:#fff; border-color:var(--accent); }

/* Notepad variants. Margin line: thin and close to the edge. */
:root[data-notepad="1"] { --pad-rule:#b9cbe6; --pad-margin:#e8a3a3; }
:root[data-notepad="1"] .card, :root[data-notepad="1"] .day,
:root[data-notepad="1"] .meal-card, :root[data-notepad="1"] .modal > * { padding-left:22px !important; }
:root[data-notepad="1"][data-pad="dark"] {
  --bg:#171a22; --card:#232836; --border:#343b4d; --text:#ece6d6; --muted:#9aa0b0;
  --accent:#ff8a65; --good:#3a9a64; --low:#f0b64a; --bad:#ff6b6b; --pad-rule:#3a4257; --pad-margin:#7a4450;
  color-scheme:dark;
}
:root[data-notepad="1"][data-pad="dark"] .tabs { background:#1d212c; }
:root[data-notepad="1"][data-pad="mint"] {
  --bg:#dfece3; --card:#f3faf5; --border:#c2dccb; --text:#1d3a2c; --muted:#5d7a6b;
  --accent:#2e7d5b; --good:#2e7d5b; --low:#b27a12; --bad:#b3261e; --pad-rule:#bcd9c8; --pad-margin:#e8b4a3;
}
:root[data-notepad="1"][data-pad="mint"] .tabs { background:#d3e5d9; }
:root[data-notepad="1"][data-pad="rose"] {
  --bg:#f2e2e7; --card:#fff6f8; --border:#e6cbd4; --text:#4a2334; --muted:#8a6573;
  --accent:#c2416c; --good:#2f7d4a; --low:#b27a12; --bad:#b3261e; --pad-rule:#eccdd8; --pad-margin:#d99aae;
}
:root[data-notepad="1"][data-pad="rose"] .tabs { background:#ecd6dd; }

/* Dark notepad: big action buttons in a deep green with light text, not pastel mint. */
:root[data-notepad="1"][data-pad="dark"] .plan-done-btn,
:root[data-notepad="1"][data-pad="dark"] #openAddExtra,
:root[data-notepad="1"][data-pad="dark"] #exAdd { background:#2f7d52 !important; color:#f3efe4 !important; }
:root[data-notepad="1"][data-pad="dark"] .usualChip { background:color-mix(in srgb, var(--good) 18%, var(--card)); border-color:color-mix(in srgb, var(--good) 45%, var(--border)); color:var(--text); }

/* Parents' one-tap reminders (Vote: who still has picks; Extras: nudge to add extras). */
.remind-row { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:0 0 12px; }
.remind-row .hint { width:100%; margin:0; }
.remind-row button { padding:8px 12px; border-radius:999px; }

/* Full-width, thumb-sized secondary action (e.g. Auto-pick fairly). */
.big-action {
  display:block; width:100%; margin:4px 0 10px; padding:15px 18px; border-radius:14px;
  font-weight:700; font-size:1.02rem; background:var(--card); color:var(--accent);
  border:2px solid var(--accent);
}
.big-action:active { background:color-mix(in srgb, var(--accent) 15%, var(--card)); }

.rc-as { display:block; font-size:.85rem; margin-top:2px; }
.rc-as .link-toggle { margin-left:6px; }
.rc-choices select { font-size:16px; max-width:100%; }

#receiptSummary .rcKind { padding:6px 10px; border-radius:999px; margin:3px 2px; font-size:.9rem; }

.pt-parent { cursor:pointer; }
.pt-tri { display:inline-block; width:1em; transition:transform .15s; color:var(--muted); }
.pt-tri.open { transform:rotate(90deg); }
.pt-variant td { background:var(--surface-2, rgba(127,127,127,.07)); }
.pt-variant .pt-item { padding-left:22px; color:var(--muted); }

.pantry-parts { display:flex; flex-wrap:wrap; gap:4px 8px; margin-top:2px; font-size:.78rem; color:var(--muted); }
.pantry-parts .part.extra { color:var(--accent, #b4690e); }
.pantry-price { margin-left:auto; padding-left:10px; font-size:.82rem; font-weight:700; white-space:nowrap; align-self:center; }

.idea-actions { display:flex; gap:8px; margin-top:8px; }
.idea-actions button { flex:1; }

.idea-price { margin:4px 0; font-size:.9rem; }
.meal-cost { display:inline-block; font-weight:700; font-size:.82rem; margin-right:8px; }

.bored-btn { background:none; border:none; font-size:1.05rem; padding:2px 6px; border-radius:999px; opacity:.45; cursor:pointer; flex-shrink:0; align-self:center; }
.bored-btn:hover, .bored-btn.has { opacity:.9; }
.bored-btn.on { opacity:1; background:var(--chip-bg, rgba(127,127,127,.18)); }
.bored-n { font-size:.72rem; font-weight:700; margin-left:2px; }
.last-had, .vote-lasthad { font-size:.75rem; color:var(--muted); }
.vote-lasthad { display:block; }
.tidy-list { max-height:45vh; overflow:auto; margin:8px 0; }
.tidy-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:5px 0; }


.tag-when { font-style:italic; opacity:.85; }
.vote-lasthad { display:inline-block; margin-top:3px; }

/* Notepad theme: the Plan timeline as a sheet of paper, one ruled line under each day. */
:root[data-notepad="1"] .timeline {
  background:var(--card); border-radius:6px; box-shadow:0 2px 6px rgba(80,60,20,.18);
  padding:4px 14px 0 12px; margin-top:8px;
}
:root[data-notepad="1"] .timeline::before { display:none; }
:root[data-notepad="1"] .tl-day { padding:12px 0; border-bottom:1px solid var(--pad-rule); }
:root[data-notepad="1"] .tl-day:last-child { border-bottom:none; }
:root[data-notepad="1"] .tl-badge { box-shadow:0 0 0 3px var(--card); }
:root[data-notepad="1"] .tl-day.is-today .tl-badge { box-shadow:0 0 0 3px var(--card), 0 0 0 6px color-mix(in srgb, var(--accent) 55%, transparent); }
:root[data-notepad="1"] .tl-day.is-past { padding-bottom:10px; }

/* The week you're looking at is the most important context on every page: make it stand out. */
.week-date {
  color:var(--text); font-weight:700;
  background:color-mix(in srgb, var(--accent) 14%, transparent);
  padding:3px 12px; border-radius:999px;
}
.week-date .weekNavBtn { color:var(--accent); font-weight:700; }
.pantry-go { display:flex; align-items:center; gap:8px; margin:0 0 10px; }
.pantry-intro { position:relative; }
.notice .pantry-x { position:absolute; top:2px; right:2px; left:auto; display:block; width:auto; min-height:0; margin:0 !important; background:none; border:none; color:var(--muted); font-size:.95rem; font-weight:400; padding:6px 10px; }


.info-btn { background:none; border:none; padding:0 0 0 4px; color:var(--accent); font-size:1rem; line-height:1; cursor:pointer; }

/* "Your usuals": one swipeable row of big, readable tiles instead of a wrapped heap of small pills. */
.usual-card { margin:0 0 14px; }
.usual-title { font-weight:700; font-size:.95rem; margin:0 2px 6px; }
.usual-scroll { display:flex; gap:8px; overflow-x:auto; scroll-snap-type:x proximity; padding:2px 2px 8px;
  -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.usual-scroll::-webkit-scrollbar { display:none; }
.usualChip { flex:0 0 auto; scroll-snap-align:start; display:flex; flex-direction:column; align-items:flex-start; gap:2px;
  min-width:104px; max-width:150px; min-height:64px; padding:8px 12px; border-radius:12px; text-align:left;
  background:var(--card); border:1px solid var(--border); border-left:4px solid var(--good); box-shadow:0 1px 3px rgba(0,0,0,.08); }
.uc-plus { color:var(--good); font-weight:700; font-size:1rem; line-height:1; }
.uc-name { font-weight:600; font-size:.9rem; line-height:1.15; white-space:normal; }
.uc-n { font-size:.7rem; color:var(--muted); }

/* Crisper text on the phone: no fractional letter-spacing (it puts every glyph on a sub-pixel), and ask for precise glyph rendering. */
:root[data-notepad="1"] body { letter-spacing:0; }
h1, .week-date, .tl-title, .simple-meal { text-rendering:geometricPrecision; }

/* iOS softens whatever sits in the top strip of the screen (the same blur you see while scrolling).
   Start the page content just below that strip, so headings are sharp at rest and only soften as they scroll up into it. */
@media (max-width:700px) { main { padding-top:18px; } }

/* Meal cards: title, then one tidy row of pills, then the ingredients, then price and rating along the bottom. */
.meal-card h3 { display:block; line-height:1.25; }
.meal-pills { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 4px; }
.meal-pills .tag { margin-left:0; }
.tag-when { font-style:normal; }
.meal-card .ing-preview { margin:2px 0 0; }
.meal-foot { display:flex; align-items:center; justify-content:space-between; gap:4px 12px; flex-wrap:wrap; margin-top:8px; }
.meal-foot .meal-rating { margin-top:0; }
.meal-cost { white-space:nowrap; font-weight:700; font-size:.9rem; margin:0; }

/* Week arrows: a proper finger-sized target (44px), not a sliver of text. */
.week-nav { display:inline-flex; align-items:center; gap:2px; padding:0 4px; }
.weekNavBtn { min-width:44px; min-height:44px; padding:0 8px; font-size:1.6rem; line-height:1; background:none; border:none; border-radius:999px; }
.weekNavBtn:disabled { opacity:.25; }

/* One size for the week pill on every page, with or without arrows or an (i). */
.week-date { display:inline-flex; align-items:center; justify-content:center; gap:2px; box-sizing:border-box;
  min-height:44px; padding:0 14px; font-size:1.05rem; line-height:1; white-space:nowrap; }
.week-date.week-nav { padding:0 4px; }
.week-date .info-btn { min-width:32px; min-height:44px; font-size:1.1rem; }
@media (max-width:560px) { .block-head .week-range.week-date { font-size:1rem; } }

/* Notepad theme: meal cards written on ruled paper, a faint line under each part of the entry. */
:root[data-notepad="1"] .meal-card h3 { padding-bottom:5px; border-bottom:1px solid var(--pad-rule); }
:root[data-notepad="1"] .meal-card .meal-pills { margin:0; padding:7px 0 7px; border-bottom:1px solid var(--pad-rule); }
:root[data-notepad="1"] .meal-card .ing-preview { margin:0; padding:6px 0 6px; border-bottom:1px solid var(--pad-rule); }
:root[data-notepad="1"] .meal-card .meal-foot { margin-top:0; padding-top:6px; }

.receipt-due { display:flex; align-items:center; gap:10px; flex-wrap:wrap; position:relative; padding-right:36px; }
.receipt-due span { flex:1 1 180px; }
.receipt-due .primary { width:auto; margin:0; }
.notice.receipt-due .pantry-x { position:absolute; top:2px; right:2px; }

/* The ✕ on dismissible notices: a real, finger-sized button (44px) with its own background. */
.notice .pantry-x, .notice.receipt-due .pantry-x {
  position:absolute; top:6px; right:6px; left:auto; display:flex; align-items:center; justify-content:center;
  width:44px; height:44px; min-width:44px; min-height:44px; padding:0; margin:0 !important;
  border-radius:50%; background:var(--card); border:1px solid var(--border); color:var(--text);
  font-size:1.25rem; line-height:1; font-weight:400; box-shadow:0 1px 2px rgba(0,0,0,.08);
}
.notice.pantry-intro, .notice.receipt-due { padding-right:60px; }
.notice.receipt-due .primary { margin:0 !important; }
.pantry-go .link-btn, .info-btn { min-width:44px; min-height:44px; font-size:1.2rem; }

.spend-row { border-bottom:1px solid var(--border); }
.spend-row:last-child { border-bottom:none; }
.spend-row summary { display:flex; align-items:center; gap:10px; padding:10px 0; cursor:pointer; list-style:none; min-height:44px; }
.spend-row summary::-webkit-details-marker { display:none; }
.sp-date { flex:1; font-weight:600; }
.sp-total { font-weight:700; font-size:1.05rem; }
.sp-diff { font-size:.8rem; font-weight:700; min-width:64px; text-align:right; }
.sp-diff.over { color:var(--bad); }
.sp-diff.under { color:var(--good); }
.sp-split { display:flex; flex-wrap:wrap; gap:6px; margin:2px 0 8px; }
.sp-split .tag { margin-left:0; }
.sp-lines { font-size:.85rem; padding-bottom:10px; }
.sp-line { display:flex; justify-content:space-between; gap:12px; padding:2px 0; color:var(--muted); }

.sp-saved { margin:4px 0 10px; padding:8px 10px; border-radius:10px; background:color-mix(in srgb, var(--good) 10%, transparent); }
.sp-saved-head { margin-bottom:4px; }
.sp-group summary { cursor:pointer; padding:6px 0; min-height:36px; font-size:.9rem; }
.sp-group .sp-line { padding-left:12px; }

.sp-headline { border-radius:12px; padding:12px 14px; margin:0 0 10px; background:var(--card); border:1px solid var(--border); border-left:6px solid var(--muted); }
.sp-headline.good { border-left-color:var(--good); background:color-mix(in srgb, var(--good) 10%, var(--card)); }
.sp-headline.bad { border-left-color:var(--bad); background:color-mix(in srgb, var(--bad) 10%, var(--card)); }
.sp-big { font-size:1.15rem; font-weight:700; margin-bottom:2px; }
.sp-diff { line-height:1.15; }
.sp-diff-word { font-size:.68rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }

.sp-impulse { margin:4px 0 10px; padding:8px 10px; border-radius:10px; background:color-mix(in srgb, var(--low, #b27a12) 14%, transparent); }
.sp-impulse .sp-line { padding-left:12px; }

/* History: Spending */
.seg { display:flex; gap:6px; margin:4px 0 14px; }
.seg-btn { flex:1; min-height:44px; border-radius:999px; font-weight:600; }
.seg-btn.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.sp-hero { border-radius:16px; padding:14px 14px 8px; margin:0 0 12px; background:var(--card); border:1px solid var(--border); box-shadow:0 2px 6px rgba(0,0,0,.08); }
.sp-hero.good { border-top:5px solid var(--good); }
.sp-hero.bad { border-top:5px solid var(--bad); }
.sp-hero-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:8px; }
.sp-when { font-size:.8rem; color:var(--muted); }
.sp-amount { font-size:2rem; font-weight:800; line-height:1.1; }
.sp-pill { text-align:right; padding:6px 12px; border-radius:12px; font-weight:800; font-size:1.05rem; background:var(--border); line-height:1.1; }
.sp-pill span { display:block; font-size:.68rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.sp-pill.good { background:color-mix(in srgb, var(--good) 18%, transparent); color:var(--good); }
.sp-pill.bad { background:color-mix(in srgb, var(--bad) 18%, transparent); color:var(--bad); }
.sp-chart { width:100%; height:auto; display:block; margin-top:4px; }
.sp-bar { cursor:pointer; }
.sp-card { border-radius:16px; padding:12px 14px; margin:0 0 12px; background:var(--card); border:1px solid var(--border); }
.sp-stack { display:flex; height:14px; border-radius:999px; overflow:hidden; background:var(--border); }
.sp-stack span { display:block; height:100%; }
.sp-legend { display:flex; flex-wrap:wrap; gap:6px 14px; margin-top:10px; font-size:.82rem; }
.sp-legend i { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:5px; }
.sp-block { border-radius:14px; margin:0 0 10px; background:var(--card); border:1px solid var(--border); overflow:hidden; }
.sp-block.calm { border-left:5px solid var(--good); }
.sp-block.warm { border-left:5px solid #d9a441; }
.sp-block summary { display:flex; align-items:center; gap:10px; padding:0 14px; min-height:52px; cursor:pointer; list-style:none; }
.sp-block summary::-webkit-details-marker { display:none; }
.sp-ic { font-size:1.2rem; }
.sp-title { flex:1; font-weight:600; }
.sp-chev { color:var(--muted); transition:transform .15s; }
.sp-block[open] .sp-chev { transform:rotate(90deg); }
.sp-inner { padding:0 14px 12px; }
.sp-sub { margin-top:6px; }
.sp-sub-head { display:flex; justify-content:space-between; font-size:.82rem; font-weight:700; padding:6px 0 2px; border-bottom:1px solid var(--border); }
.sp-line { display:flex; justify-content:space-between; gap:12px; padding:3px 0; font-size:.88rem; color:var(--muted); }

/* Meals: the same card look as Spending (rounded, bordered, one clear footer), in every theme. */
.meal-grid { display:grid; gap:12px; }
.meal-card, :root[data-notepad="1"] .meal-card {
  border-radius:16px; border:1px solid var(--border); background-color:var(--card); background-image:none;
  box-shadow:0 2px 6px rgba(0,0,0,.08); padding:14px 16px !important;
}
.meal-card h3 { font-size:1.08rem; line-height:1.25; }
:root[data-notepad="1"] .meal-card h3, :root[data-notepad="1"] .meal-card .meal-pills,
:root[data-notepad="1"] .meal-card .ing-preview { border-bottom:none; padding-bottom:0; }
.meal-card .meal-pills { margin:8px 0 6px; padding:0; }
.meal-card .ing-preview { margin:0; padding:0; }
.meal-card .meal-foot, :root[data-notepad="1"] .meal-card .meal-foot {
  margin-top:12px; padding-top:10px; border-top:1px solid var(--border);
}
.meal-cost { background:color-mix(in srgb, var(--accent) 12%, transparent); padding:4px 10px; border-radius:999px; }
/* "Not rated yet" is implied by empty stars; dropping it keeps price and stars on one line. */
.meal-foot .rating-avg > .hint { display:none; }
.meal-foot .rating-avg:has(> .hint) { display:none; }

.aisle-toggle { display:flex; align-items:center; gap:8px; margin:0 0 8px 2px; font-size:.82rem; color:var(--muted); }
.aisle-chip { background:color-mix(in srgb, var(--muted) 16%, transparent); color:var(--muted); text-transform:none; letter-spacing:0; }
