/* Pantry Planner — tokens (design.md §1) and components (design.md §3). Light only in v1. */

@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-latin.woff2') format('woff2');
  font-weight: 500 600;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ground: #F6F2E8; --surface: #FFFDF8; --ink: #1E2621; --muted: #5C6660;
  --line: #E2DCCD; --line-soft: #ECE6D8; --control: #CFC7B4; --control-strong: #9A9280;
  --dashed: #B5AD99; --track: #DDD6C6; --seg-bg: #E7E1D2;
  --green: #2E6A4B; --green-hover: #255A3F; --green-soft: #E3EEE6; --green-ink: #1F4D35; --disabled: #C4CEC7;
  --tomato: #B3452B; --tomato-soft: #F7E3DC; --tomato-ink: #8E3520; --alert-bg: #FBF1EC; --alert-line: #E6BFB2;
  --pill-planning-bg: #F8EDD3; --pill-planning: #6E4700;
  --pill-ordered-bg: #E3EEE6;  --pill-ordered: #1F4D35;
  --pill-cooking-bg: #F7E3DC;  --pill-cooking: #8E3520;
  --pill-done-bg: #E7E5DF;     --pill-done: #4A4F4B;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
  --font-mono: ui-monospace, Menlo, monospace;
  --r-card: 14px; --r-btn: 12px; --r-input: 10px; --r-sheet: 20px; --r-pill: 999px;
  --gutter: 20px; --gap-cards: 14px; --gap-chips: 8px; --touch: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--ground); font-size: 15px; }
a { color: var(--green); } a:hover { color: var(--green-ink); }
[x-cloak] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- type ---- */
.h { font-family: var(--font-display); }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.page-title { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.step-title { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.15; }
.section-title { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.lead { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.small { font-size: 13px; }
.field-label { font-weight: 600; font-size: 14px; }

/* ---- layout shell (design §2) ---- */
/* The frame is pinned to exactly the visible area and never scrolls; only its main area
   does, so the header and tab bar stay put. Not `height: 100dvh`: in Will's installed Android
   app that came out taller than the screen and pushed the tab bar below the edge (2026-10-26).
   `clip`, unlike `hidden`, also stops the browser scrolling it to show a focused field. */
.app { position: fixed; inset: 0; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; background: var(--ground); overflow: clip; }
.app-header { padding: 18px 20px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.app-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-main { flex-grow: 1; overflow-y: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: var(--gap-cards); }
.action-bar { padding: 10px 20px 12px; border-top: 1px solid var(--line); display: flex; gap: 10px; background: var(--ground); }
.tabbar { display: flex; border-top: 1px solid var(--line); background: var(--surface); padding: 4px 8px calc(10px + env(safe-area-inset-bottom)); }
.tab { font: inherit; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; font-size: 12px; color: var(--muted); font-weight: 500; text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--green); font-weight: 700; }

.avatars { display: flex; }
.avatar { width: 34px; height: 34px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--ground); flex-shrink: 0; }
.avatars .avatar + .avatar { margin-left: -8px; }
.avatar-lg { width: 34px; height: 34px; border: none; }

/* setup shell */
.setup-head { padding: 18px 20px 8px; display: flex; flex-direction: column; gap: 10px; }
.setup-head-row { display: flex; justify-content: space-between; align-items: center; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress > div { height: 6px; border-radius: 3px; background: var(--green); }
.setup-main { flex-grow: 1; overflow-y: auto; padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.setup-foot { padding: 12px 20px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; background: var(--ground); }
.setup-foot .btn { min-height: 48px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }

/* ---- components (design §3) ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.card-pad { padding: 14px 16px; }

.btn { font: inherit; font-weight: 600; font-size: 15px; border-radius: var(--r-btn); min-height: var(--touch); padding: 0 14px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { border-color: var(--control-strong); color: var(--ink); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-hover); border-color: var(--green-hover); color: #fff; }
.btn-primary:disabled { background: var(--disabled); border-color: var(--disabled); color: #fff; cursor: not-allowed; }
.btn-danger { background: var(--tomato); border-color: var(--tomato); color: #fff; }
.btn-danger:hover { background: var(--tomato-ink); border-color: var(--tomato-ink); color: #fff; }
.btn-grow { flex-grow: 1; }
.btn-square { width: 44px; padding: 0; }
.link-btn { background: none; border: none; font: inherit; font-size: 14px; color: var(--green); font-weight: 600; cursor: pointer; padding: 0 4px; min-height: var(--touch); display: inline-flex; align-items: center; text-decoration: none; }
.link-btn:hover { color: var(--green-ink); }
.link-danger { color: var(--tomato-ink); }
.link-danger:hover { color: var(--tomato); }

.chips { display: flex; flex-wrap: wrap; gap: var(--gap-chips); }
.chip { font: inherit; font-size: 14px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--control); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); font-weight: 600; }
.chip-out { background: var(--tomato-soft); border-color: var(--tomato); color: var(--tomato-ink); font-weight: 600; }
.chip-custom { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); font-weight: 600; }

.input { font: inherit; font-size: 15px; min-height: var(--touch); padding: 0 12px; border-radius: var(--r-input); border: 1px solid var(--control); background: #fff; color: var(--ink); width: 100%; }
.input:focus-visible, .btn:focus-visible, .chip:focus-visible, .choice:focus-visible, .seg:focus-visible, .link-btn:focus-visible, .tab:focus-visible, .row-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.add-row { display: flex; gap: 8px; }
.add-row .btn { flex-shrink: 0; }

.seg-track { display: flex; background: var(--seg-bg); border-radius: 12px; padding: 3px; }
.seg { flex: 1; font: inherit; font-size: 14px; min-height: var(--touch); border: none; background: transparent; border-radius: 9px; cursor: pointer; color: var(--ink); }
.seg[aria-pressed="true"] { background: var(--surface); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.12); }

.choice { font: inherit; color: inherit; width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--control); background: var(--surface); text-align: left; cursor: pointer; }
.choice[aria-pressed="true"] { border: 2px solid var(--green); background: var(--green-soft); }
.choice:disabled { opacity: .55; cursor: not-allowed; }
.radio-dot { width: 20px; height: 20px; border-radius: 999px; flex-shrink: 0; border: 2px solid var(--control-strong); background: #fff; }
.choice[aria-pressed="true"] .radio-dot { border: 6px solid var(--green); }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper-value { font-family: var(--font-display); font-size: 24px; font-weight: 600; width: 28px; text-align: center; }

.member-row { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line-soft); }
.member-row .name { flex-grow: 1; font-weight: 600; display: flex; flex-direction: column; }
.member-row .name small { font-weight: 400; color: var(--muted); font-size: 13px; }

.note { display: flex; gap: 8px; font-size: 13px; color: var(--green-ink); background: var(--green-soft); padding: 10px 12px; border-radius: 10px; line-height: 1.4; }
.note svg { flex-shrink: 0; margin-top: 1px; }
.note-warn { color: var(--tomato-ink); background: var(--alert-bg); border: 1px solid var(--alert-line); }
.errors { margin: 0; padding: 10px 12px 10px 28px; border-radius: 10px; background: var(--alert-bg); border: 1px solid var(--alert-line); color: var(--tomato-ink); font-size: 14px; }

.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.summary-row:last-child { border-bottom: none; }
.summary-row .v { font-weight: 600; text-align: right; }

/* settings rows */
.settings-list { padding: 0 16px; }
.settings-row { border-bottom: 1px solid var(--line-soft); }
.settings-row:last-child { border-bottom: none; }
.row-toggle { font: inherit; color: inherit; background: none; border: none; padding: 0; text-align: left; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 12px; min-height: 62px; }
.row-toggle .t { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.row-toggle .t b { font-weight: 600; font-size: 15px; }
.row-toggle .t span { font-size: 13px; color: var(--muted); }
.chev { transition: transform .15s; flex-shrink: 0; }
.row-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.row-body { display: flex; flex-direction: column; gap: 6px; padding: 0 0 14px; }
.row-body .line { font-size: 14px; line-height: 1.4; }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.saved { font-size: 13px; color: var(--green-ink); }
.edit-form { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 16px; }
.edit-actions { display: flex; gap: 10px; }

.empty { padding: 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.list-line { padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; display: flex; justify-content: space-between; gap: 12px; }
.list-line:last-child { border-bottom: none; }

.code-input { font-family: var(--font-mono); letter-spacing: .3em; font-size: 20px; text-align: center; }
.center-page { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 24px 20px; overflow-y: auto; }
.welcome-title { margin: 0; font-family: var(--font-display); font-size: 38px; font-weight: 600; line-height: 1.08; }
.num-dot { width: 26px; height: 26px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); font-family: var(--font-display); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.done-check { width: 56px; height: 56px; border-radius: 999px; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .chev { transition: none; }
}
.input::placeholder { color: #9A9280; }
.code-input::placeholder { color: #CFC7B4; }

/* ---- week planning (design §3: step progress, meal slots, review card, sheet, action bar) ---- */
.week-chips { display: flex; gap: 8px; overflow-x: auto; }
.week-chip { cursor: default; flex-shrink: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; min-height: var(--touch); padding: 5px 12px; border-radius: 12px; white-space: nowrap; }
.week-chip-range { font-size: 13px; font-weight: 600; line-height: 1.2; }
.week-chip .pill { font-size: 11px; padding: 1px 7px; line-height: 1.4; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: var(--r-pill); }
.pill-planning { background: var(--pill-planning-bg); color: var(--pill-planning); }
.steps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.steps li { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.steps li::before { content: ""; height: 4px; border-radius: 2px; background: var(--track); }
.steps li.on::before { background: var(--green); }
.steps li[aria-current="step"] { font-weight: 700; color: var(--ink); }
.plan { display: flex; flex-direction: column; gap: var(--gap-cards); }
.dinners { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.slot-empty { font: inherit; color: inherit; width: 100%; min-height: 76px; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px dashed var(--dashed); border-radius: var(--r-card); background: transparent; cursor: pointer; text-align: left; }
.slot-empty:hover { border-color: var(--green); background: var(--surface); }
.slot-empty .plus { width: 36px; height: 36px; border-radius: 999px; background: var(--green-soft); color: var(--green); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.meal-card { padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 4px; }
.meal-name { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.25; }
.meal-card.side { margin-left: 18px; }
.meal-card.error { border-color: var(--alert-line); background: var(--alert-bg); }
.working { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.working::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--green); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.add-side { align-self: flex-start; margin: -8px 0 0 14px; }
.review-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.review-card.approved { border-color: var(--green); }
.review-card.flagged { border-color: var(--tomato); }
.review-card.side { margin-left: 18px; }
.btn-approved { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: none; }
.btn-row .btn:first-child { flex-grow: 1; }
.change-note { font-size: 13px; font-style: italic; color: var(--muted); }
.flag-box { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--tomato-ink); background: var(--alert-bg); border: 1px solid var(--alert-line); padding: 10px 12px; border-radius: 8px; }
.serves-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.review-head .link-btn { white-space: nowrap; flex-shrink: 0; }
.action-wrap { padding: 10px 20px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; background: var(--ground); }
.action-hint { font-size: 12px; text-align: center; color: var(--muted); }
.action-row { display: flex; gap: 10px; }
.sheet-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; z-index: 5; }
.sheet-backdrop { position: absolute; inset: 0; border: none; background: rgba(30,38,33,.45); cursor: pointer; }
.sheet { position: relative; background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 10px 20px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px; max-height: 90%; overflow-y: auto; }
.grabber { width: 40px; height: 4px; border-radius: 2px; background: var(--control); align-self: center; margin-bottom: 8px; }
.sheet-title { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.opt { font: inherit; color: inherit; display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 8px 2px; background: none; border: none; border-bottom: 1px solid var(--line-soft); text-align: left; cursor: pointer; width: 100%; }
.opt:last-child { border-bottom: none; }
.opt:disabled { cursor: not-allowed; opacity: .55; }
.opt .tile { width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.opt .t { display: flex; flex-direction: column; gap: 2px; }
.opt .t b { font-weight: 600; font-size: 16px; }
.opt .t span { font-size: 13px; color: var(--muted); }
.opt:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
textarea.input { padding: 10px 12px; min-height: 88px; resize: vertical; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .working::before { animation: none; } }

/* ---- recipe view (design §3) ---- */
.recipe-bar { padding: 12px 12px 8px; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); border-radius: 10px; flex-shrink: 0; }
.icon-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.recipe-main { flex-grow: 1; overflow-y: auto; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.recipe-title { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1.15; }
.ingredients { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients li { font-size: 15px; line-height: 1.4; padding: 6px 0; border-bottom: 1px solid #F0EBDF; }
.ingredients li:last-child { border-bottom: none; }
.recipe-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.recipe-steps li { display: flex; gap: 12px; font-size: 15px; line-height: 1.45; }
.recipe-steps .n { font-family: var(--font-display); font-weight: 600; color: var(--green); width: 18px; flex-shrink: 0; }
.meal-link { color: inherit; text-decoration: none; }
.meal-link:hover { text-decoration: underline; color: inherit; }
.meal-link:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

/* ---- checklist row (design §3), extras, pantry check, send ---- */
.checklist { padding: 0 16px; }
.check-row { font: inherit; color: inherit; width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 8px 2px; background: none; border: none; border-bottom: 1px solid var(--line-soft); text-align: left; cursor: pointer; font-size: 15px; }
.check-row:last-child { border-bottom: none; }
.check-row:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
.check-row .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--control-strong); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.check-row[aria-pressed="true"] .box { background: var(--green); border-color: var(--green); }
.check-row .t { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.check-row .t small { font-size: 13px; color: var(--muted); }
.check-row .status { font-size: 12px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.check-row[aria-pressed="false"] .status { color: var(--tomato-ink); }
.extra-line { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-soft); }
.extra-line:last-child { border-bottom: none; }
.extra-line .check-row { border-bottom: none; }
.qty { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.qty .n { min-width: 20px; text-align: center; font-weight: 600; }
.spice-group summary { list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; gap: 8px; font-size: 15px; border-top: 1px solid var(--line-soft); }
.spice-group summary::-webkit-details-marker { display: none; }
.spice-group summary .chev { transition: transform .15s; flex-shrink: 0; }
.spice-group[open] summary .chev { transform: rotate(90deg); }
.list-preview { margin: 0; background: var(--ink); color: var(--ground); border-radius: 12px; padding: 14px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.chip-remove { background: none; border: none; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; min-width: 28px; min-height: 28px; justify-content: center; }

.list-edit { font-family: var(--font-mono); font-size: 13px; line-height: 1.6; min-height: 200px; }

/* ---- after ordering (M4): pills, shop list, meal rows, missing rows, next week ---- */
.pill-ordered { background: var(--pill-ordered-bg); color: var(--pill-ordered); }
.pill-cooking { background: var(--pill-cooking-bg); color: var(--pill-cooking); }
.pill-done { background: var(--pill-done-bg); color: var(--pill-done); }
a.week-chip { text-decoration: none; cursor: pointer; }
.alert-card { background: var(--alert-bg); border-color: var(--alert-line); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.alert-title { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #EBD3C8; }
.alert-row .t { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.alert-row .t b { font-weight: 600; font-size: 15px; }
.alert-row .t small { font-size: 13px; color: var(--muted); }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn-done { background: #E7E5DF; border-color: #B8B3A6; color: #4A4F4B; }
.meal-row { padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.meal-row .t { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.meal-row-name { font-weight: 600; font-size: 16px; line-height: 1.3; }
.meal-row-name.cooked { text-decoration: line-through; color: var(--muted); }
.missing-row[aria-pressed="true"] .box { background: var(--tomato); border-color: var(--tomato); }
.missing-row[aria-pressed="false"] .box { background: transparent; border-color: var(--control-strong); }
.missing-row .status { color: var(--muted) !important; font-weight: 500; max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-card { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font: inherit; width: 100%; text-align: left; cursor: pointer; }
.next-card .t { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.next-card .t b { font-weight: 600; font-size: 15px; }
.prev-shop { padding: 12px 14px; display: flex; align-items: center; gap: 12px; border-color: var(--alert-line); background: var(--alert-bg); }
.prev-shop .t { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }

/* ---- Pantry tab (spec §5.4) ---- */
.pantry-list { display: flex; flex-direction: column; }
.pantry-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.pantry-row .t { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.pantry-row .t small { font-size: 13px; color: var(--muted); }
.pantry-row .past { color: var(--tomato-ink); }
.pantry-card { padding: 0 16px; }
.pantry-card .pantry-row:last-child { border-bottom: none; }
.section-head { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* ---- Recipes tab and the sheet's pickers (M5; mockup recipes, recipes-favorites) ---- */
.star-btn { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: none; border: none; border-radius: 10px; color: var(--tomato); cursor: pointer; padding: 0; }
.star-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.recipe-card { padding: 6px 6px 6px 16px; display: flex; align-items: center; gap: 8px; }
.recipe-card .open { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; color: inherit; text-decoration: none; }
.recipe-card .open:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
.recipe-card .name { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.25; }
.recipe-card .sub { font-size: 13px; color: var(--muted); }
.recipe-list { display: flex; flex-direction: column; gap: 12px; }
.pick-list { display: flex; flex-direction: column; }
.pick { font: inherit; color: inherit; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 10px 2px; background: none; border: none; border-bottom: 1px solid var(--line-soft); text-align: left; cursor: pointer; width: 100%; }
.pick:last-child { border-bottom: none; }
.pick:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.pick b { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.pick span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.pick .star-mark { color: var(--tomato); }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 2px; border-bottom: 1px solid var(--line-soft); font-size: 15px; cursor: pointer; }
.check-row:last-child { border-bottom: none; }
.check-row input { width: 22px; height: 22px; accent-color: var(--green); flex-shrink: 0; }
.check-row .t { display: flex; flex-direction: column; gap: 2px; }
.check-row small { font-size: 13px; color: var(--muted); }

/* ---- M7: the List and Shop steps (spec §16; prototype docs/mockup/m7) ---- */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.list-group-h { margin: 4px 0 0; }
.line-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line-soft); }
.line-row:last-child { border-bottom: none; }
.line-row .check-row { border-bottom: none; min-width: 0; }
.list-row { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.list-row .name, .cart-row .name { overflow-wrap: anywhere; line-height: 1.3; }
.list-row[aria-pressed="false"] .name { text-decoration: line-through; color: var(--muted); }
.list-row[aria-pressed="true"] .status { color: var(--green-ink); }
.list-row[aria-pressed="false"] .status { color: var(--muted); }
.cart-row[aria-pressed="true"] .name { text-decoration: line-through; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--green-ink); background: var(--green-soft); border-radius: 999px; padding: 0 7px; vertical-align: 1px; text-decoration: none; }
.row-remove { min-width: 44px; min-height: 44px; color: var(--muted); }
.home-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 56px; }
.home-group summary::-webkit-details-marker { display: none; }
.home-group summary .chev { transition: transform .15s; flex-shrink: 0; }
.home-group[open] summary .chev { transform: rotate(90deg); }
.home-group summary .t { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-group summary .t small { font-size: 13px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.home-group .checklist { border-top: 1px solid var(--line-soft); }
.need-count { color: var(--green-ink); }
@media (prefers-reduced-motion: reduce) { .home-group summary .chev { transition: none; } }
.fix-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fix-grid .label { min-width: 0; font-size: 13px; }
.fix-rule { display: flex; align-items: center; gap: 8px; }
.fix-rule .line { flex-grow: 1; min-width: 0; }
.report-row { padding: 14px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-soft); }
.report-row .t { display: flex; flex-direction: column; gap: 2px; }
.report-row .t b { font-size: 15px; font-weight: 600; }
.report-row .t > span { font-size: 13px; color: var(--muted); }
.count-badge { font-size: 12px; font-weight: 700; color: #fff; background: var(--tomato); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
