/* Recipe Box
   Warm and editorial on the way in; calm, high-contrast and big once you're cooking.
   Body type is Atkinson Hyperlegible Next (the Braille Institute's low-vision typeface, variable weight),
   headings are Fraunces. --scale is set from the A− / A+ buttons and stored per device. */

/* Self-hosted fonts (SIL Open Font License, see fonts/). */
/* Atkinson Hyperlegible Next (Braille Institute, 2025): the low-vision typeface, as a variable font so any weight 200-800 is one file. */
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 200 800; font-display: swap; src: url("fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/fraunces-latin-opsz-normal.woff2") format("woff2"); }

:root {
  --scale: 1.3;
  font-size: calc(18px * var(--scale));
  /* Weights. Body text sits at 500 (a touch heavier than regular) and strong text at 700; the Bold
     button in the header lifts both for readers who need thicker strokes. */
  --w-body: 500;
  --w-bold: 700;
  /* Light: near-black on warm off-white rather than pure black on pure white, which glares for
     light-sensitive eyes. Still about 17:1 contrast. */
  --bg: #fbf8f3;
  --fg: #15120f;
  --paper: #f8f3ea;
  --paper-2: #efe7da;
  --muted: #4a443d;
  --line: #e2d9cb;
  --edge: #8a8176;
  --accent: #a8361a;
  --accent-text: #7d2410; /* accent as words, darker so it reads at arm's length */
  --accent-soft: #fbe8e1;
  --on-accent: #ffffff;
  --done: #6b6560;
  --have-bg: #e3f3e6;
  --have-fg: #0b5a1e;
  --warn-bg: #fff4d6;
  --warn-line: #8a6400;
  --badge-bg: #fde2e1;
  --badge-fg: #8a1c14;
  --shadow: rgba(60, 40, 20, 0.14);
  --radius: 1rem;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

:root[data-bold="on"] { --w-body: 650; --w-bold: 800; }

/* Dark: warm off-white on near-black. Pure white on pure black makes letters bloom (halation) for
   low-vision readers, so both ends are pulled in a little while keeping about 17:1 contrast. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0b0a; --fg: #f1ece4; --paper: #15130f; --paper-2: #1d1a17; --muted: #d4ccc2; --line: #2e2a26; --edge: #8c857c;
    --accent: #ff9f7c; --accent-text: #ffc9b3; --accent-soft: #2b1610; --on-accent: #000000; --done: #a39d96; --have-bg: #0f2e16; --have-fg: #a6f0b5;
    --warn-bg: #2e2508; --warn-line: #f0c24a; --badge-bg: #3d1210; --badge-fg: #ffc9c4; --shadow: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0b0a; --fg: #f1ece4; --paper: #15130f; --paper-2: #1d1a17; --muted: #d4ccc2; --line: #2e2a26; --edge: #8c857c;
  --accent: #ff9f7c; --accent-text: #ffc9b3; --accent-soft: #2b1610; --on-accent: #000000; --done: #a39d96; --have-bg: #0f2e16; --have-fg: #a6f0b5;
  --warn-bg: #2e2508; --warn-line: #f0c24a; --badge-bg: #3d1210; --badge-fg: #ffc9c4; --shadow: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-weight: var(--w-body);
  letter-spacing: 0.01em;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s, color 0.2s;
}
body.focus-open { overflow: hidden; }

a { color: var(--accent-text); text-underline-offset: 0.15em; }
h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -0.01em; font-optical-sizing: auto; }
h2 { font-size: 1.35rem; margin: 1.75rem 0 0.5rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.4rem; }
svg { width: 1.15em; height: 1.15em; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { max-width: 56rem; margin: 0 auto; padding: 0 1rem 6rem; }

/* ---------- header ---------- */

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 0.4rem 0.75rem;
  padding: 0.55rem 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
/* The Said & Served logo: fixed-colour files for light and dark (an <img> can't read the
   page's colours), the full wordmark on wide screens and the head-and-plate rebus on phones. */
.brand { display: inline-flex; align-items: center; min-width: 0; min-height: 2.2rem; text-decoration: none; }
.brand img, .splash img { display: block; height: 1.75rem; width: auto; }
.brand-wide { display: none; }
@media (min-width: 40rem) { .brand-wide { display: block; } .brand-rebus { display: none; } }
.brand .dark, .splash .dark { display: none; }
:root[data-theme="dark"] .brand .light, :root[data-theme="dark"] .splash .light { display: none; }
:root[data-theme="dark"] .brand .dark, :root[data-theme="dark"] .splash .dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .light, :root:not([data-theme="light"]) .splash .light { display: none; }
  :root:not([data-theme="light"]) .brand .dark, :root:not([data-theme="light"]) .splash .dark { display: block; }
}
.splash { margin: 0 0 1.5rem; }
.splash img { height: auto; width: min(100%, 18rem); }
.topbar-right { position: relative; display: flex; align-items: center; gap: 0.4rem; flex: none; }

/* Two fold-away menus keep the header to one short row on a phone: "Aa" (text size, bold,
   colours: set once, rarely touched) and "Menu" (the other pages, then Sign out). On a wide
   screen the pages sit inline instead. */
.menu { position: static; }
.menu > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.5rem; padding: 0.25rem 0.8rem; border-radius: 999px; background: var(--paper);
  font-size: 0.9rem; font-weight: var(--w-bold); white-space: nowrap; user-select: none;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--fg); color: var(--bg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 7;
  display: flex; flex-direction: column; align-items: stretch; gap: 0.35rem;
  min-width: 11rem; padding: 0.6rem; border-radius: var(--radius);
  background: var(--bg); border: 2px solid var(--edge); box-shadow: 0 12px 32px var(--shadow);
}
.menu-panel.text-size { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; min-width: 0; width: max-content; max-width: calc(100vw - 2rem); }
.text-size button { min-height: 2.6rem; padding: 0.25rem 0.8rem; border-radius: 999px; background: var(--paper); border-color: transparent; font-weight: var(--w-bold); white-space: nowrap; gap: 0.35rem; }
.text-size button:hover { background: var(--paper-2); }
.text-size button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
#text-bold b { font-weight: 800; }
.nav-link { font-weight: var(--w-bold); white-space: nowrap; text-decoration: none; color: var(--fg); padding: 0.45rem 0.8rem; border-radius: 999px; background: var(--paper); }
.nav-link:hover { background: var(--paper-2); }
.nav #sign-out { margin-top: 0.35rem; }
@media (min-width: 50rem) {
  .nav #sign-out { margin-top: 0; }
  .nav-menu > summary { display: none; }
  .nav-menu .menu-panel { position: static; flex-direction: row; min-width: 0; padding: 0; border: 0; box-shadow: none; background: none; gap: 0.5rem; }
  .nav-link { padding: 0.25rem 0.7rem; }
}

.sample-banner { margin: 0; padding: 0.45rem 1rem; background: var(--warn-bg); font-size: 0.8rem; text-align: center; }

/* ---------- controls ---------- */

button, .button {
  font: inherit; font-size: 0.9rem; min-height: 2.6rem; padding: 0.3rem 0.95rem;
  border: 2px solid var(--edge); border-radius: 0.75rem; background: var(--bg); color: var(--fg);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
button:hover:not(:disabled) { border-color: var(--fg); }
button:active:not(:disabled) { transform: scale(0.97); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1:focus { outline: none; } /* focused by script on each screen change, for screen readers; no ring */
button[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); font-weight: var(--w-bold); }
button:disabled { opacity: 0.3; cursor: default; }
button.quiet { border-color: transparent; background: none; text-decoration: underline; text-underline-offset: 0.2em; padding-left: 0.5rem; padding-right: 0.5rem; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: var(--w-bold); }
button.primary:hover:not(:disabled) { border-color: var(--accent); filter: brightness(1.08); }
button.big { min-height: 3.1rem; font-size: 1rem; padding: 0.4rem 1.3rem; border-radius: 999px; }
.icon-btn { width: 2.6rem; min-width: 2.6rem; padding: 0; border-radius: 999px; border-color: var(--line); }
.icon-btn svg { width: 1.3rem; height: 1.3rem; }
.icon-btn.big { width: 3.6rem; height: 3.6rem; }
.icon-btn.big svg { width: 1.8rem; height: 1.8rem; }

input[type="search"], input[type="email"], input:not([type]), select, textarea {
  font: inherit; font-size: 1rem; color: var(--fg); background: var(--bg);
  border: 2px solid var(--edge); border-radius: 0.75rem; padding: 0.45rem 0.75rem; min-height: 2.75rem; max-width: 100%;
}
textarea { width: 100%; }
.field { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; font-weight: var(--w-bold); color: var(--muted); }
.field.wide { flex: 1 1 100%; }
.field.wide input, .field.wide textarea { width: 100%; }
.check-inline { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; min-height: 2.6rem; cursor: pointer; }
.check-inline input { width: 1.35rem; height: 1.35rem; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: 0.85rem; }
.empty { color: var(--muted); }
.badge { display: inline-block; align-self: flex-start; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--badge-bg); color: var(--badge-fg); font-size: 0.78rem; font-weight: var(--w-bold); }
ul.plain { padding-left: 1.2rem; }

.warning { margin: 1rem 0; padding: 0.85rem 1.1rem; background: var(--warn-bg); border-left: 6px solid var(--warn-line); border-radius: 0.75rem; font-size: 0.9rem; }
.warning ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

.progress { height: 0.45rem; border-radius: 999px; background: var(--paper-2); overflow: hidden; margin: 0.75rem 0; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }

/* ---------- home: the recipe list ---------- */

.hero { padding: 2.25rem 0 0.75rem; }
/* Under a back link the heading sits close to it, and a section heading right after the hero sits close to the lede. */
p:has(> .back) + .hero { padding-top: 0.5rem; }
.hero + h2 { margin-top: 0; }
.hero:has(+ h2) .lede-text { margin-bottom: 0.25rem; }
.eyebrow { margin: 0; font-size: 0.78rem; font-weight: var(--w-bold); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); }
.hero h1 { margin: 0.2rem 0 0; font-size: clamp(2.1rem, 7vw, 3.6rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: var(--w-bold); }

.filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; margin: 1rem 0 0.5rem; align-items: flex-end; }
.search input { min-height: 3.4rem; font-size: 1.1rem; padding-left: 1.2rem; border-radius: 999px; border-color: var(--line); background: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='%238a8176' stroke-width='2.4'/%3E%3Cpath d='M15.5 15.5 21 21' stroke='%238a8176' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1.1rem center; background-size: 1.3rem; padding-right: 3rem; }
.search input:focus { border-color: var(--accent); background-color: var(--bg); }
.more-filters { flex: 1 1 100%; }
.more-filters summary { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0.2rem 0.95rem; border-radius: 999px; background: var(--paper); font-weight: var(--w-bold); font-size: 0.9rem; cursor: pointer; list-style: none; }
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters summary::after { content: "▾"; margin-left: 0.45rem; transition: transform 0.2s; }
.more-filters[open] summary::after { transform: rotate(180deg); }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; padding: 0.9rem 0 0.25rem; }
.count { color: var(--muted); font-size: 0.85rem; margin: 0.75rem 0; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.card-wrap { --course: var(--accent); display: flex; flex-direction: column; gap: 0.35rem; }
.card-wrap[data-course="main"] { --course: #a8361a; }
.card-wrap[data-course="baking"], .card-wrap[data-course="dessert"] { --course: #8a5a00; }
.card-wrap[data-course="side"], .card-wrap[data-course="salad"] { --course: #2f6b2a; }
.card-wrap[data-course="soup"], .card-wrap[data-course="sauce"] { --course: #1f5f8b; }
.card-wrap[data-course="cocktail"], .card-wrap[data-course="drink"] { --course: #6b2f7a; }
:root[data-theme="dark"] .card-wrap { --course: var(--accent) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card-wrap { --course: var(--accent) !important; } }
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 0.35rem; height: 100%;
  padding: 1.2rem 1.25rem 1.1rem; border-radius: var(--radius);
  background: var(--paper); color: var(--fg); text-decoration: none;
  border: 1px solid var(--line);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 0.35rem; background: var(--course); }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px var(--shadow); border-color: var(--course); }
.card-kicker { font-size: 0.72rem; font-weight: var(--w-bold); letter-spacing: 0.12em; text-transform: uppercase; color: var(--course); }
.card-title { font-family: var(--display); font-weight: 650; font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.015em; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; color: var(--muted); font-size: 0.85rem; margin-top: auto; padding-top: 0.5rem; }
.card-source { color: var(--muted); font-size: 0.8rem; font-style: italic; }
.list-btn { align-self: flex-start; font-size: 0.8rem; min-height: 2.3rem; border-radius: 999px; border-color: var(--line); }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }

/* ---------- shopping list ---------- */

.shop-recipes { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.shop-recipes li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.shop-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }

/* ---------- recipe ---------- */

.back { display: inline-block; margin-top: 1rem; font-size: 0.9rem; font-weight: var(--w-bold); text-decoration: none; }
.recipe-title { font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.05; letter-spacing: -0.025em; margin: 0.5rem 0 0.6rem; font-weight: var(--w-bold); }
.meta { margin: 0.15rem 0; color: var(--muted); }
.version-pick { margin: 0.75rem 0 0; max-width: 24rem; }

.tabs {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 1.25rem 0 1rem; padding: 0.3rem;
  background: var(--paper); border-radius: 1.6rem; width: fit-content; max-width: 100%;
}
.tabs a { flex: none; padding: 0.5rem 1.05rem; border-radius: 999px; text-decoration: none; color: var(--fg); font-weight: var(--w-bold); font-size: 0.92rem; white-space: nowrap; }
.tabs a:hover { background: var(--paper-2); }
.tabs a[aria-current="page"] { background: var(--fg); color: var(--bg); }

.cook-controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; margin-bottom: 0.5rem; }
.scale { display: inline-flex; flex-wrap: wrap; max-width: 100%; align-items: center; gap: 0.15rem; padding: 0.2rem; background: var(--paper); border-radius: 999px; }
.scale > span { font-weight: var(--w-bold); font-size: 0.85rem; margin: 0 0.4rem 0 0.6rem; color: var(--muted); }
.scale button { min-height: 2.3rem; padding: 0.15rem 0.7rem; border: none; border-radius: 999px; background: none; font-weight: var(--w-bold); }
.scale button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* ---------- checklists ---------- */

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist .section { font-family: var(--display); font-weight: 650; margin-top: 1.1rem; color: var(--muted); }
.item { padding: 0.75rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.item label { display: flex; gap: 0.8rem; align-items: flex-start; flex: 1 1 12rem; cursor: pointer; }
.item input[type="checkbox"] { width: 1.65rem; height: 1.65rem; margin-top: 0.12rem; flex: none; accent-color: var(--accent); cursor: pointer; }
.item .text { transition: color 0.2s; }
.item.done .text { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--done); }
.step { padding: 1rem 0; }
.step .text { font-size: 1.12rem; line-height: 1.55; }
.num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9rem; height: 1.9rem; margin-right: 0.35rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-family: var(--display); font-weight: var(--w-bold); font-size: 0.95rem; vertical-align: 0.05em; }
.done .num { background: var(--paper-2); color: var(--done); }
.prep { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-left: auto; }
.actions button { font-size: 0.8rem; min-height: 2.4rem; padding: 0.2rem 0.75rem; border-radius: 999px; border-color: var(--line); }
.actions .icon-btn { padding: 0; }
.move { min-width: 2.6rem; font-weight: var(--w-bold); }
.moved { color: var(--muted); font-size: 0.85rem; }
.changed-tag { display: inline-block; padding: 0 0.45rem; margin-right: 0.15rem; border: 2px solid var(--accent); border-radius: 999px; color: var(--accent-text); font-size: 0.72rem; font-weight: var(--w-bold); vertical-align: 0.15em; }
.is-changed .text { font-weight: var(--w-bold); }

.timer.running { border-color: var(--accent); color: var(--accent-text); font-variant-numeric: tabular-nums; font-weight: var(--w-bold); }
.timer.ringing { background: var(--warn-line); border-color: var(--warn-line); color: var(--on-accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .timer.ringing { animation: none; } }

/* ---------- cook layout: ingredients beside steps on wide screens, a drawer on narrow ones ---------- */

.cook-layout { display: grid; gap: 0 2.5rem; margin-top: 0.5rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.head-actions { display: flex; gap: 0.25rem; }
.panel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; }
.panel-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.close-drawer, .ings-fab { display: none; }

.ing.onhand { background: var(--have-bg); border-radius: 0.75rem; padding-left: 0.5rem; padding-right: 0.5rem; }
.onhand-btn[aria-pressed="true"] { background: var(--have-fg); border-color: var(--have-fg); color: var(--bg); }
.need-only .ing.onhand { display: none; }
.amt.converted { text-decoration: underline dotted; text-underline-offset: 0.2em; }
.conv-note { flex: 1 1 100%; margin: 0.2rem 0 0 2.45rem; color: var(--muted); font-size: 0.85rem; }
.conv-note details { display: inline; }
.conv-note summary { display: inline; cursor: pointer; text-decoration: underline; list-style: none; }
.conv-note summary::-webkit-details-marker { display: none; }
.conv-note details[open] summary { display: block; margin-top: 0.2rem; }

@media (min-width: 60rem) {
  main { max-width: 82rem; }
  .cook-layout { grid-template-columns: minmax(20rem, 2fr) 3fr; align-items: start; }
  .cook-layout.ings-hidden { grid-template-columns: minmax(0, 46rem); }
  .ing-panel { position: sticky; top: 4.5rem; max-height: calc(100vh - 5.5rem); overflow-y: auto; padding: 0.25rem 1.25rem 1rem; background: var(--paper); border-radius: var(--radius); }
  .ing-panel .item { border-color: var(--line); }
}
.cook-layout.ings-hidden:not(.drawer-open) .ing-panel { display: none; }

/* The floating Ingredients button: on narrow screens once the list has scrolled off the top
   (ings-away, set by the page), and on wide screens whenever the panel is hidden. */
@media (max-width: 59.99rem) { .cook-layout.ings-away ~ .ings-fab { display: inline-flex; } }
.cook-layout.ings-hidden ~ .ings-fab { display: inline-flex; }
.ings-fab {
  position: fixed; right: 0.75rem; bottom: max(0.75rem, env(safe-area-inset-bottom)); z-index: 3;
  min-height: 2.4rem; padding: 0.2rem 0.85rem; border-radius: 999px; font-size: 0.85rem;
  background: var(--fg); color: var(--bg); border-color: var(--fg);
  font-weight: var(--w-bold); box-shadow: 0 8px 24px var(--shadow);
}
/* Room under the last step, so the pill never sits on what you are reading. */
@media (max-width: 59.99rem) { .cook-layout.ings-away .steps-panel { padding-bottom: 4rem; } }
.cook-layout.drawer-open ~ .ings-fab { display: none; }
.drawer-open .ing-panel {
  display: block; position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; top: auto;
  max-height: 78vh; overflow-y: auto; padding: 0.5rem 1rem 1.5rem;
  background: var(--bg); border-radius: 1.25rem 1.25rem 0 0; box-shadow: 0 -8px 40px var(--shadow);
  animation: rise 0.22s ease-out;
}
/* The page above the drawer dims; tapping it closes the drawer (the page handles the tap). */
.drawer-open .ing-panel::before { content: ''; position: fixed; inset: 0; z-index: -1; background: rgba(0, 0, 0, 0.28); }
.drawer-open .ing-panel .panel-head { position: sticky; top: -0.5rem; z-index: 1; margin: 0 -1rem; padding: 0.5rem 1rem 0.25rem; background: var(--bg); }
.drawer-open .ing-panel .panel-head h2 { margin: 0.2rem 0; }
/* In the drawer, one line per ingredient: small buttons in one row. */
.drawer-open .ing { padding: 0.5rem 0; }
.drawer-open .ing .actions { flex-wrap: nowrap; }
.drawer-open .ing .actions button { min-height: 2.2rem; font-size: 0.82rem; padding: 0.1rem 0.6rem; }
.drawer-open .ing .actions .icon-btn { width: 2.2rem; min-width: 2.2rem; }
.drawer-open .ing .actions .icon-btn svg { width: 1.1rem; height: 1.1rem; }
@keyframes rise { from { transform: translateY(30%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drawer-open .ing-panel { animation: none; } }
.drawer-open .close-drawer { display: inline-flex; }

.adapt { border-left: 6px solid var(--accent); padding-left: 1rem; }

/* Link a sub-recipe: tucked under the ingredient list, open only when wanted. */
.link-sub { margin-top: 0.75rem; }
.link-sub > summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.link-sub-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; margin-top: 0.5rem; }
.link-sub-form .hint { flex: 1 1 100%; margin: 0; }
.link-sub-form .field { flex: 1 1 12rem; min-width: 0; max-width: 100%; margin: 0; }
.link-sub-form select { width: 100%; max-width: 100%; }

/* ---------- step by step ---------- */

.focus {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(1rem, env(safe-area-inset-bottom));
  background: var(--bg); color: var(--fg); overflow-y: auto;
  animation: fade 0.18s ease-out;
}
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .focus { animation: none; } }
.focus-top { display: flex; align-items: center; justify-content: space-between; max-width: 50rem; width: 100%; margin: 0 auto; }
.focus-count { font-family: var(--display); font-weight: var(--w-bold); font-size: 1.3rem; }
.focus-count span { color: var(--muted); font-weight: var(--w-body); }
.focus .progress { max-width: 50rem; width: 100%; margin: 0.6rem auto 0; }
.focus-body { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; max-width: 50rem; width: 100%; margin: 0 auto; padding: 1.5rem 0; }
.focus-text { font-size: clamp(1.4rem, 5.5vw, 2.6rem); line-height: 1.3; font-weight: var(--w-bold); margin: 0; letter-spacing: -0.01em; }
.focus-needs { margin: 1.25rem 0 0; font-size: 1.05rem; color: var(--muted); }
.focus-needs span { display: block; font-size: 0.75rem; font-weight: var(--w-bold); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.focus-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1.5rem; }
.focus-tools .timer { min-height: 3.6rem; font-size: 1.05rem; }
/* Back and Next stay at the bottom of the screen however long the step is; Coming up scrolls under them. */
.focus-nav { position: sticky; bottom: 0; z-index: 1; display: grid; grid-template-columns: 1fr 2fr; gap: 0.75rem; max-width: 50rem; width: 100%; margin: 0 auto; padding: 0.6rem 0 0.25rem; background: var(--bg); }
.focus-nav button { min-height: 3.8rem; font-size: 1.1rem; }
.focus-auto { max-width: 50rem; width: 100%; margin: 0 auto 0.4rem; justify-content: center; }

/* ---------- versions, AI, mise en place and divide & conquer ---------- */

.lede { padding: 1.25rem 1.4rem; background: var(--paper); border-radius: var(--radius); }
.lede h2 { margin-top: 0; }
.lede p:last-child { margin-bottom: 0; }
.whats-this > summary { display: inline-block; min-height: 2.2rem; line-height: 2.2rem; color: var(--accent-text); font-weight: var(--w-bold); cursor: pointer; list-style: none; }
.whats-this > summary::-webkit-details-marker { display: none; }
.whats-this > summary::before { content: "ⓘ "; }
.whats-this[open] > summary { margin-bottom: 0.4rem; }
.whats-this p { margin: 0 0 0.6rem; }
.whats-this p:last-child { margin-bottom: 0; }
#ai-form .field.wide, #plan-form .field.wide { margin: 0.75rem 0; }
.version-note { margin: 1rem 0; padding: 0.85rem 1.1rem; border: 2px solid var(--accent); border-radius: var(--radius); font-size: 0.92rem; }
.version-note p { margin: 0.2rem 0; }
.version-note ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.chip { border-radius: 999px; border-color: var(--line); background: var(--paper); }
.draft { margin-top: 1.5rem; padding-top: 1rem; border-top: 3px solid var(--line); }
.draft-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.variant-cols { display: grid; gap: 1rem 2rem; }
@media (min-width: 60rem) { .variant-cols { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.versions { margin-top: 2rem; }
.version-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
ul.plain .version-row { list-style: none; margin-left: -1.2rem; }
.row-actions { display: flex; gap: 0.5rem; align-items: center; }
.cook-count { border: none; padding: 0; margin: 0.75rem 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.cook-count legend { font-weight: var(--w-bold); margin-bottom: 0.3rem; }
.cooks { display: grid; gap: 0.5rem; }
.cook-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: flex-end; }
.cook-row .field { flex: 1 1 10rem; min-width: 0; }
.cook-row .field input { width: 100%; }
/* Kid is a chip you can actually hit, not a 13-pixel box. */
.kid-check { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.6rem; padding: 0.2rem 0.9rem; border: 2px solid var(--line); border-radius: 999px; background: var(--paper); font-weight: var(--w-bold); cursor: pointer; align-self: center; }
.kid-check input { width: 1.35rem; height: 1.35rem; margin: 0; accent-color: var(--accent); }
.kid-check:has(input:checked) { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.kid-check:has(input:checked) input { accent-color: var(--bg); }
.kid-check:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.plan-tools { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; margin: 1rem 0; }
.who { display: inline-block; margin-right: 0.35rem; font-weight: var(--w-bold); color: var(--accent-text); }
.timeline .at { display: inline-block; min-width: 5.5rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.mise-summary { margin-top: 1.5rem; }
.for-steps { display: inline-block; margin-left: 0.5rem; padding: 0 0.5rem; border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: 0.75rem; font-weight: var(--w-bold); vertical-align: 0.1em; }

.original { margin: 1rem 0; }
.original figcaption { margin-top: 0.5rem; }
.original-frame { width: 100%; height: 85vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.original-open { margin: 0 0 0.75rem; }
.original-img { max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
/* A PDF scan drawn page by page; the zoom widens the sheet and the figure scrolls sideways. */
.pdf-pages { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pdf-sheet { width: 100%; transition: width 0.15s; }
.pdf-sheet canvas { display: block; width: 100%; height: auto; margin-bottom: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.zoom { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.zoom button { min-width: 2.7rem; font-size: 1.3rem; }
.zoom-level { min-width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- divide & conquer: setup, who's-jobs switch, shared ticks ---------- */

.subs-made { display: grid; gap: 0.35rem; margin: 1rem 0; padding: 0.8rem 1rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.subs-made .hint { margin: 0; }
.plan-setup { margin: 1rem 0; }
.plan-setup > summary { display: inline-flex; align-items: center; min-height: 2.6rem; padding: 0; font-family: var(--display); font-size: 1.35rem; font-weight: var(--w-bold); cursor: pointer; list-style: none; }
.plan-setup > summary::-webkit-details-marker { display: none; }
.plan-setup > summary::after { content: "▾"; margin-left: 0.45rem; font-family: var(--body); color: var(--muted); }
.plan-setup[open] > summary::after { content: "▴"; }
.plan-setup[open] > summary::after { content: "▴"; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 0.15rem; padding: 0.2rem; background: var(--paper); border-radius: 999px; max-width: 100%; }
.seg button { min-height: 2.4rem; border: none; border-radius: 999px; background: none; font-weight: var(--w-bold); padding: 0.2rem 0.9rem; }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.by { margin-left: 0.4rem; color: var(--have-fg); font-size: 0.8rem; font-weight: var(--w-bold); text-decoration: none; display: inline-block; }
.item.done .text .by { text-decoration: none; }

/* ---------- step by step: what's coming up ---------- */

.focus-ahead { max-width: 50rem; width: 100%; margin: 1.25rem auto 0; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.focus-ahead-label { margin: 0 0 0.3rem; font-size: 0.75rem; font-weight: var(--w-bold); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.focus-ahead ol { list-style: none; margin: 0; padding: 0; }
.ahead { display: flex; align-items: flex-start; gap: 0.5rem; width: 100%; min-height: 2.6rem; padding: 0.4rem 0; border: none; background: none; text-align: left; color: var(--muted); font-size: 0.95rem; line-height: 1.4; border-radius: 0.5rem; justify-content: flex-start; }
.ahead:hover { color: var(--fg); }
.ahead .num { flex: none; }
button.inline { min-height: 0; padding: 0; display: inline; font-size: inherit; }

/* ---------- cooked it ---------- */

.rating-line { margin: 0.25rem 0; color: var(--muted); }
.stars { color: var(--accent); letter-spacing: 0.08em; font-size: 1.05em; }
.card-stars { font-size: 0.95rem; }
.cooked { margin-top: 2.5rem; padding-top: 0.5rem; border-top: 3px solid var(--line); }
.log { list-style: none; padding: 0; margin: 0 0 1rem; }
.log li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.log p { margin: 0.2rem 0; }
.log-head { color: var(--muted); }
.log-head strong { color: var(--fg); }
.adjust { padding: 0.5rem 0.75rem; background: var(--accent-soft); border-radius: 0.75rem; }
.cooked-form > summary { list-style: none; display: inline-flex; width: fit-content; }
.cooked-form > summary::-webkit-details-marker { display: none; }
summary.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: var(--w-bold); cursor: pointer; }
summary.button.big { min-height: 3.1rem; font-size: 1rem; padding: 0.4rem 1.3rem; border-radius: 999px; }
.cooked-form[open] > summary { display: none; }
/* The stars are written 5 to 1 and shown reversed, so the row reads 1 to 5 and a picked star lights
   the ones before it (its later siblings in the markup). Arrow keys follow the order on screen. */
.star-pick { border: none; padding: 0; margin: 0.75rem 0; display: flex; gap: 0.25rem; flex-direction: row-reverse; justify-content: flex-end; }
.star-pick legend { font-weight: var(--w-bold); margin-bottom: 0.3rem; float: left; width: 100%; }
.star-pick label { cursor: pointer; font-size: 2.2rem; line-height: 1; color: var(--line); padding: 0.1rem; }
.star-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-pick label:hover, .star-pick label:hover ~ label, .star-pick input:checked + span, .star-pick label:has(input:checked) ~ label { color: var(--accent); }
.star-pick label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 0.4rem; }

/* ---------- printed pages, one per cook ---------- */

#print-sheets { display: none; }
@media print {
  body.printing-sheets > *:not(#print-sheets) { display: none !important; }
  body.printing-sheets #print-sheets { display: block; }
  .print-sheet { break-after: page; font-size: 13pt; color: #000; }
  .print-sheet:last-child { break-after: auto; }
  .print-sheet h1 { font-size: 26pt; margin: 0.1rem 0 0.3rem; }
  .print-sheet h2 { font-size: 15pt; margin: 1rem 0 0.3rem; }
  .print-sheet .eyebrow { color: #000; }
  .boxes { list-style: none; padding: 0; margin: 0; }
  .boxes li { padding: 0.15rem 0 0.15rem 1.6rem; position: relative; }
  .boxes li::before { content: ""; position: absolute; left: 0; top: 0.35rem; width: 0.9rem; height: 0.9rem; border: 1.5pt solid #000; border-radius: 2pt; }
  .jobs { padding-left: 0; list-style: none; }
  .jobs li { padding: 0.35rem 0 0.35rem 1.6rem; position: relative; break-inside: avoid; border-bottom: 0.5pt solid #999; }
  .jobs li::before { content: ""; position: absolute; left: 0; top: 0.55rem; width: 0.9rem; height: 0.9rem; border: 1.5pt solid #000; border-radius: 2pt; }
  .jobs .at { display: inline-block; min-width: 4.5rem; font-weight: var(--w-bold); }
  .step-text { margin: 0.2rem 0 0; font-size: 11pt; }
}

/* ---------- linked recipes (a sauce from another page) ---------- */

.linked { margin-top: 1.5rem; display: grid; gap: 0.75rem; }
.linked-recipe { border: 2px solid var(--line); border-radius: var(--radius); padding: 0 1.1rem; scroll-margin-top: 5rem; }
.linked-recipe[open] { border-color: var(--accent); padding-bottom: 0.75rem; }
.linked-recipe > summary { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.9rem 0; cursor: pointer; list-style: none; }
.linked-recipe > summary::-webkit-details-marker { display: none; }
.linked-title { font-family: var(--display); font-weight: 650; font-size: 1.3rem; }
.linked-title::after { content: " ▾"; color: var(--muted); font-size: 0.9rem; }
.linked-recipe[open] .linked-title::after { content: " ▴"; }
.link-btn { border-color: var(--accent) !important; color: var(--accent-text); font-weight: var(--w-bold); }
.source a { font-weight: var(--w-bold); }

/* ---------- sign in ---------- */

.signin { max-width: 32rem; padding-top: 3rem; }
.signin h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); line-height: 1.05; margin: 0.25rem 0 0.75rem; letter-spacing: -0.03em; }

/* ---------- phones: item buttons sit under the text, not floating on their own row ---------- */

@media (max-width: 40rem) {
  .item .actions { margin-left: 2.45rem; justify-content: flex-start; }
  .step .actions { margin-left: 2.45rem; }
  .scale button { padding: 0.15rem 0.55rem; }
  /* A lone speaker button stays on the same line as its text. */
  .item:has(.actions > .say:only-child) label { flex: 1 1 0; min-width: 0; }
  .item:has(.actions > .say:only-child) .actions { margin-left: auto; }
}

/* ---------- small phones ---------- */

@media (max-width: 30rem) {
  .topbar { padding: 0.5rem 0.75rem; }
  .brand img { height: 1.6rem; }
}

@media print {
  .topbar, .cook-controls, .tabs, .back, .actions, .ings-fab, .panel-foot, .panel-tools, .sample-banner, .version-pick, #plan-form, #ai-form, .plan-tools, .draft-actions, .head-actions, .recipe-actions, .lede button { display: none; }
  :root { --scale: 1; }
  .ing-panel { position: static; max-height: none; background: none; }
}

/* ---------- shelves, cooking tonight, Ask ---------- */

.shelf { display: flex; flex-wrap: wrap; margin-top: 1rem; }
.seg.shelf > button, .seg.shelf > .ask-link { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; padding: 0.2rem 0.7rem; font-size: 0.9rem; white-space: nowrap; }
.seg button svg, .seg .ask-link svg { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.3em; margin-right: 0.4em; }
.seg .dish { width: 1.5em; height: 1.5em; vertical-align: -0.42em; margin-right: 0.3em; }
.seg .dish .steam { fill: none; stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round; }
.seg [aria-pressed="true"] .dish .steam { stroke: var(--bg); opacity: 0.7; }
.seg .ask-link { display: inline-flex; align-items: center; min-height: 2.4rem; padding: 0.2rem 0.9rem; border-radius: 999px; font-weight: var(--w-bold); color: var(--fg); text-decoration: none; }
.seg .ask-link svg { color: var(--accent); }
.seg .ask-link:hover { background: var(--accent-soft); }
.more-filters .badge { display: inline-grid; place-items: center; min-width: 1.3em; height: 1.3em; margin-left: 0.4em; padding: 0 0.3em; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: 0.8em; }

.tonight { margin: 1rem 0 0; padding: 0.9rem 1.2rem; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--line); }
.tonight ul { margin: 0.35rem 0 0; padding: 0; list-style: none; }
.tonight li { display: flex; align-items: center; gap: 0.5rem; padding: 0.15rem 0; }
.tonight li a { flex: 1; min-width: 0; }
.tonight a { font-family: var(--display); font-size: 1.25rem; font-weight: var(--w-bold); color: var(--fg); }
.tonight .small { min-height: 2.2rem; padding: 0 0.7rem; margin-left: auto; }
.recipe-actions { margin: 0.5rem 0; }
.recipe-end { margin-top: 1.5rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.recipe-end .recipe-actions { margin: 0.75rem 0; }
.tonight-btn { border-radius: 999px; font-size: 0.9rem; min-height: 2.5rem; }
.tonight-btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.ask-hero { padding-top: 0.5rem; }
.ask-hero .eyebrow svg { width: 1em; height: 1em; vertical-align: -0.12em; }
.ask-hero .lede-text { margin: 0.4rem 0 0.8rem; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chips-label { align-self: center; font-size: 0.9rem; font-weight: var(--w-bold); color: var(--muted); }
.chip svg { width: 1.1em; height: 1.1em; vertical-align: -0.2em; margin-right: 0.3em; }
.kitchen-cooks { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.8rem; }
.kitchen-cooks .chip.cook { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.7rem; border: 1px solid var(--line); }
.kitchen-cooks .chip.cook button { padding: 0 0.3rem; min-height: 0; }
.kitchen-cooks .field { margin: 0; }
.cook-picks { margin-bottom: 0.25rem; }
.kitchen-pick { display: inline-block; margin-left: 0.5rem; vertical-align: middle; }
.tonight-where { margin: 1rem 0 0; }
.kitchen-pick select { font-size: 0.95rem; padding: 0.2rem 0.5rem; min-height: 0; }
.tonight .eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; }
.tonight .eyebrow .hint { text-transform: none; letter-spacing: normal; font-weight: normal; }
.tonight.party { background: var(--paper); border-color: var(--accent-text); }
.kitchen-note { margin: 1rem 0 0; padding: 0.8rem 1.2rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.kitchen-note button { margin-left: 0.4rem; }
.pages.ask-pages { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); margin: 0.5rem 0; }
.pages.ask-pages[hidden] { display: none; }
.ask-q .tweak { display: block; margin-top: 0.3rem; font-size: 0.85rem; font-weight: 400; opacity: 0.85; }
.lede-text { color: var(--muted); max-width: 38rem; margin: 0.6rem 0 1rem; }
.ask-turn { margin: 1.5rem 0; }
.ask-q { margin: 0 0 0.75rem auto; max-width: 85%; width: fit-content; padding: 0.7rem 1.1rem; border-radius: 1.2rem 1.2rem 0.3rem 1.2rem; background: var(--fg); color: var(--bg); font-weight: var(--w-bold); }
.ask-a > p:first-child { font-size: 1.1rem; }
.picks { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.pick { padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); border-top: 0.4rem solid var(--course); }
.pick p { margin: 0.35rem 0; }
.pick-title { font-family: var(--display); font-size: 1.35rem; font-weight: var(--w-bold); color: var(--fg); line-height: 1.15; }
.shortcut { padding: 0.55rem 0.8rem; border-radius: 0.7rem; background: var(--bg); border: 1px dashed var(--edge); }
.pick .row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.ideas-head { font-size: 1.1rem; margin: 1.2rem 0 0.3rem; }
.ideas li { margin: 0.3rem 0; }
.ask-form { padding: 0.8rem 0 0.4rem; border-top: 1px solid var(--line); }

/* ---------- inbox ---------- */
.inbox-link { background: var(--accent); color: var(--on-accent); }
.inbox-link:hover { background: var(--accent); filter: brightness(1.1); }
.inbox { display: grid; gap: 1rem; list-style: none; padding: 0; }
.inbox-item { padding: 1.2rem 1.3rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.inbox-item h2 { margin: 0.2rem 0; }
.inbox-item .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* ---------- read aloud: pause, again, stop ---------- */

.speech-bar { position: fixed; left: 50%; bottom: max(0.75rem, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; display: flex; gap: 0.5rem; padding: 0.5rem; border-radius: 999px; background: var(--fg); border: 2px solid var(--fg); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); }
.speech-bar.inline { position: static; transform: none; display: inline-flex; margin: 0.5rem 0 0.25rem; }
.speech-bar[hidden] { display: none; }
.speech-bar button { border-radius: 999px; background: var(--bg); color: var(--fg); border-color: var(--bg); font-weight: var(--w-bold); }
.speech-bar button.quiet { background: var(--fg); color: var(--bg); border-color: var(--bg); }
body.speaking main { padding-bottom: 5.5rem; }
body.speaking .focus { padding-bottom: 6rem; }

/* ---------- mise en place: cooks, prep, start cooking ---------- */

.cook-row .remove-cook { align-self: center; }
.plan h3 .hint, .plan h4 .hint { font-weight: 500; margin-left: 0.5rem; }
.plan h4 { margin: 1rem 0 0.25rem; }
.bowl { color: var(--accent-text); }
.plan .uses { margin-left: 0; }
.start-cooking { margin: 1.75rem 0; padding: 1.25rem; border-radius: var(--radius); background: var(--paper); border: 2px solid var(--accent); }
.start-cooking .hint { margin: 0.6rem 0 0; }
.uses, .still-prep, .more-later { display: block; margin-top: 0.3rem; font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.uses em { font-style: normal; font-weight: var(--w-bold); color: var(--fg); }
.still-prep { color: var(--accent-text); font-weight: var(--w-bold); }
.item.done .text .uses, .item.done .text .still-prep, .item.done .text .more-later { text-decoration: none; }
.focus-who { margin: 0 0 0.4rem; font-size: 0.85rem; font-weight: var(--w-bold); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.focus-waiting { margin: 1.25rem 0 0; }
.focus-waiting ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.focus-waiting li { margin: 0.3rem 0; }

/* ---------- inbox: pick, queue, watch ---------- */

.inbox-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin: 0 0 1.25rem; }
.inbox-tools .field { flex: 1 1 14rem; }
.inbox-tools .field input { width: 100%; }
.inbox-head { display: flex; gap: 0.75rem; align-items: flex-start; }
.inbox-head .pick { margin-top: 0.4rem; }
.inbox-item.busy { border-color: var(--accent); }
.inbox-item.failed { border-color: #c2410c; }
.busy-note { color: var(--accent); font-weight: var(--w-bold); }

/* ---------- add a recipe from photos ---------- */

.add-form { display: grid; gap: 1rem; }
.add-pick { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.add-btn { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.add-btn svg { width: 1.4em; height: 1.4em; }
.add-btn:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.75rem; list-style: none; margin: 0; padding: 0; }
.pages li { position: relative; display: grid; gap: 0.35rem; }
.pages img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); }
.pages .num { position: absolute; top: 0.4rem; left: 0.4rem; }
.add-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

/* We made this, from the mise en place tab */
.made-this { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1.25rem 0; padding: 0.9rem 1.1rem; border: 2px solid var(--line); border-radius: var(--radius); }
.made-this.all-done { border-color: var(--accent); background: var(--accent-soft); }
#describe { margin-top: 2rem; }

/* A prep bowl named in a cooking step ("the crumb mix"): boxed so it reads as prep, not an ingredient */
.prep-ref { background: var(--accent-soft); color: var(--fg); padding: 0.02em 0.35em; border-radius: 0.4em; box-shadow: inset 0 0 0 2px var(--accent); font-weight: var(--w-bold); }
.prep-chips { display: block; margin-top: 0.35rem; }
.prep-chip { display: inline-block; margin: 0.15rem 0.35rem 0 0; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--accent-soft); color: var(--fg); box-shadow: inset 0 0 0 2px var(--accent); font-size: 0.85rem; font-weight: var(--w-bold); }
.prep-chip::before { content: "Prep: "; font-weight: 400; color: var(--muted); }
.focus-needs .prep-chip { font-size: 1rem; }
.item.done .text .prep-chips { text-decoration: none; }

/* ---------- review: the scan beside the typed recipe ---------- */
.reviewed-mark { color: var(--have-fg); font-weight: var(--w-bold); font-size: 0.85rem; }
.card .reviewed-mark { align-self: flex-start; }
.check-again { margin-left: 0.5rem; font-weight: 500; color: var(--muted); }
.review-switch, .phone-note { display: none; }
.review-switch { margin: 0.75rem 0; }
.review-layout { display: grid; gap: 1.5rem; margin-top: 0.75rem; }
.review-scan .original { margin: 0 0 1rem; }
.review-lines { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.5rem; }
.review-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; padding: 0.3rem 0.4rem; border-radius: 0.6rem; }
.review-row.changed { background: var(--accent-soft); }
.review-row .num { flex: 0 0 auto; }
.review-row input, .review-row textarea { font: inherit; min-width: 0; }
.review-row .small { width: 5.5rem; }
.review-row .grow { flex: 1 1 11rem; }
.review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
@media (min-width: 60rem) {
  .review-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .review-scan { position: sticky; top: 4.5rem; max-height: calc(100vh - 5.5rem); overflow-y: auto; }
  .review-row[data-kind="ingredients"] { display: grid; grid-template-columns: auto 5.5rem 5.5rem minmax(0, 1.4fr) minmax(0, 1fr); }
  .review-row[data-kind="ingredients"] .small, .review-row[data-kind="ingredients"] .grow { width: 100%; }
}
@media (max-width: 59.99rem) {
  .phone-note { display: block; }
  .review-switch { display: inline-flex; position: sticky; top: 4.25rem; z-index: 2; }
  .review-layout.show-scan .review-typed, .review-layout.show-typed .review-scan { display: none; }
}

/* ---------- people (admins) ---------- */
.people-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.people-form .field { flex: 1 1 14rem; min-width: 0; }
.people-form .field input { width: 100%; }
.people { display: grid; gap: 0.6rem; list-style: none; padding: 0; }
.person { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.8rem 1.1rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.person-who { min-width: 0; overflow-wrap: anywhere; }
.person-who strong { display: block; font-size: 1.05rem; }
.kitchen { margin-top: 1rem; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.kitchen h2 { margin-top: 0; }
.kitchen h2 .hint { font-family: var(--body); font-size: 0.85rem; font-weight: normal; margin-left: 0.4rem; }
.kitchen-questions { margin: 0.75rem 0; padding: 0.75rem 1rem; border-radius: 0.75rem; background: var(--accent-soft); }
.kitchen-questions p, .kitchen-questions ul { margin: 0.25rem 0; }
.kitchen-facts { margin: 0.5rem 0 0; }
.kitchen-facts dt { font-weight: var(--w-bold); margin-top: 0.6rem; }
.kitchen-facts dd { margin: 0.15rem 0 0; }
.kitchen-facts ul { margin: 0; padding-left: 1.2rem; }
.party-kitchen-text[hidden] { display: none; }
.kitchen .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }

/* ---------- ask: make something up (the personal chef) ---------- */
.ask-segs { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.chef-questions { margin: 0.6rem 0; }
.chef-q { display: inline-block; padding: 0.5rem 0.9rem; border-radius: 0.8rem; background: var(--paper); border: 1px dashed var(--edge); font-weight: var(--w-bold); }
.chef-draft { margin-top: 1rem; }
.chef-done { font-weight: var(--w-bold); }
.tonight-all { margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.ideas .row-actions { margin: 0.3rem 0 0.6rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ideas .chef-draft { margin: 0.6rem 0 1rem; }
.cook-turn { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 1rem 0 0.4rem; }

/* Dinner time on a plan: the time next to the clock button, and the countdown line under them. */
.dinner-at { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: var(--w-bold); }
.dinner-at input { font: inherit; padding: 0.35rem 0.5rem; border: 2px solid var(--line); border-radius: 0.5rem; background: var(--paper); color: inherit; }
.service { margin: 0 0 0.75rem; font-weight: var(--w-bold); }

/* Dinner party mode, inside the plan form. */
.party-setup { margin: 0.75rem 0; padding: 0.5rem 0.75rem; border: 2px solid var(--line); border-radius: var(--radius); }
.party-setup summary { font-weight: var(--w-bold); cursor: pointer; }
.party-grid { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.party-grid .field { flex: 1 1 12rem; }
.party-setup select, .party-setup input[type="datetime-local"] { font: inherit; padding: 0.4rem 0.5rem; border: 2px solid var(--line); border-radius: 0.5rem; background: var(--paper); color: inherit; max-width: 100%; }

/* Add time to a running timer: small taps beside it. */
.timer-more { display: inline-flex; gap: 0.3rem; margin-left: 0.3rem; vertical-align: middle; }
.timer-more button { padding: 0.35rem 0.6rem; font-size: 0.9rem; min-height: 2.4rem; }
