/* Hearth — "kitchen notebook". Warm paper by day, warm charcoal by night.
   Tokens: docs/reviews/2026-09-24/ia-ux.md §5 (text pairs ≥ 4.8:1 in both themes). */

@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/static/fonts/fraunces-latin-full-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #FAF7F2; --surface: #FFFFFF; --sunken: #F1ECE4; --border: #E3DBCF; --edge: #6F655B;
  --text: #1F1A15; --text-2: #5B524A; --text-3: #6F655B;
  --accent: #B3431C; --on-accent: #FFFFFF; --accent-text: #A63D18; --accent-soft: #F7E4D9;
  --herb: #3D6B47; --herb-soft: #E3EEE4; --saffron: #8A5A0B; --danger: #A1261B;
  --shadow: 0 -8px 24px rgb(0 0 0 / .12);
  --fs-xs: .8125rem; --fs-sm: .9375rem; --fs-md: 1.0625rem; --fs-lg: 1.25rem; --fs-xl: 1.5rem; --fs-2xl: 1.875rem;
  --r-card: 18px; --r-input: 12px; --tabbar: 64px;
  --serif: "Fraunces", Georgia, serif; --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #15120F; --surface: #1E1A16; --sunken: #110E0C; --border: #3A332C; --edge: #A0968A;
  --text: #F3EDE5; --text-2: #C2B8AC; --text-3: #A0968A;
  --accent: #E8794A; --on-accent: #1A0E07; --accent-text: #F29166; --accent-soft: #3A2418;
  --herb: #8CC49A; --herb-soft: #1F2E23; --saffron: #E6B35A; --danger: #F08A80;
  --shadow: 0 -8px 24px rgb(0 0 0 / .5);
}}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: calc(var(--tabbar) + 24px); }
html:has(.timer) { scroll-padding-bottom: calc(var(--tabbar) + 96px); }
body:has(.timer) { padding-bottom: calc(var(--tabbar) + 88px + env(safe-area-inset-bottom)); }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-md)/1.55 var(--sans);
  font-feature-settings: "cv11" 1; min-height: 100dvh; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
a { color: var(--accent-text); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font: 600 var(--fs-2xl)/1.2 var(--serif); font-variation-settings: "SOFT" 50; }
h2 { font: 600 var(--fs-lg)/1.3 var(--sans); }
p { margin: 0 0 .75rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { width: 22px; height: 22px; flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.mt { margin-top: 16px; } .mt-sm { margin-top: 6px; } .fixed { flex: none !important; } .row-center { align-items: center; }
.chips-tight { margin-top: -6px; }
.narrow { width: 6.5rem; }

/* ---- layout ---------------------------------------------------------------------------------- */
.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 32px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 8px; }
.eyebrow { font: 600 var(--fs-xs)/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  min-height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-2); text-decoration: none; font: 600 .8125rem/1 var(--sans); white-space: nowrap;
}
.tabbar a[aria-current="page"] { color: var(--accent-text); }
.tabbar a[aria-current="page"] .icon { stroke-width: 2.25; }
.brand { font: 600 1.375rem/1 var(--serif); color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.brand .icon { color: var(--accent-text); }
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 8px 16px 0; }
.who { display: none; }

@media (max-width: 380px) {
  .tabbar a { white-space: normal; text-align: center; }
  .tabbar a span { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 26px; }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border); }
  .topbar-inner { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 0 24px; height: 64px; }
  .brand { display: inline-flex; }
  .tabbar { position: static; display: flex; border: 0; background: none; gap: 4px; }
  .tabbar a { flex-direction: row; gap: 6px; min-height: 44px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-sm); }
  .tabbar .icon { width: 20px; height: 20px; }
  .tabbar a[aria-current="page"] { background: var(--accent-soft); }
  .who { display: flex; margin-left: auto; align-items: center; gap: 8px; color: var(--text-2); font-size: var(--fs-sm); }
}

/* ---- controls ------------------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: var(--r-input); border: 1.5px solid var(--edge); background: var(--surface); color: var(--text);
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button:disabled, [aria-disabled="true"] { cursor: wait; opacity: .65; }
.btn-block { width: 100%; }
.btn-quiet { border-color: transparent; background: none; color: var(--accent-text); padding: 0 10px; }
.btn-danger { color: var(--danger); border-color: var(--danger); background: none; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 999px; border: 0;
  background: none; color: var(--text-2); cursor: pointer; text-decoration: none;
}
.icon-btn:hover, .btn-quiet:hover { background: var(--sunken); }
.icon-btn[aria-pressed="true"] { color: var(--accent-text); }
.icon-btn[aria-pressed="true"] .icon { fill: currentColor; }

input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="date"], input[type="time"], input[type="url"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-input); border: 1.5px solid var(--edge);
  background: var(--surface); font-size: 1rem;
}
textarea { min-height: 160px; line-height: 1.5; resize: vertical; }
/* Native pickers keep their behavior; custom appearance makes WebKit honor the touch size. */
input[type="date"], input[type="time"] { appearance: none; min-width: 0; }
select { appearance: none; padding-right: 38px; background-image: url("/static/select-chevron.svg"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
label, .label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; }
.hint { font-size: var(--fs-xs); color: var(--text-2); margin-top: 4px; }
.field + .field { margin-top: 16px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
fieldset { border: 0; padding: 0; margin: 0; }

.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 44px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--edge); background: var(--surface); color: var(--text); text-decoration: none;
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; cursor: pointer;
}
.chip.is-on, .chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text); font-weight: 600; }
.chip.is-on::before, .chip:has(input:checked)::before { content: "✓"; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.filters { display: flex; gap: 8px; margin-top: 4px; }
.filters select { min-height: 44px; font-size: var(--fs-sm); }

/* ---- cards & rows -------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px; }
.tonight .title { font: 600 var(--fs-xl)/1.25 var(--serif); margin: 6px 0 4px; }
.tonight .btn { margin-top: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-2); font-size: var(--fs-sm); }
.meta .veg { color: var(--herb); font-weight: 600; }

.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.list > li + li { border-top: 1px solid var(--border); }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 10px 8px 10px 12px; color: inherit; text-decoration: none; }
a.list-row:hover, button.list-row:hover { background: var(--sunken); }
button.list-row { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; border-radius: var(--r-card); }
.list-row .body { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.monogram {
  width: 48px; height: 48px; flex: none; border-radius: 10px; background: var(--sunken); display: grid; place-items: center;
  font: 600 1.375rem/1 var(--serif); color: var(--text-2);
}
.count { color: var(--text-2); font-size: var(--fs-sm); margin: 16px 0 8px; }

.days { list-style: none; margin: 0; padding: 0; }
.day { display: grid; grid-template-columns: 64px 1fr; align-items: center; min-height: 60px; border-bottom: 1px solid var(--border); }
.day:first-child { border-top: 1px solid var(--border); }
.day .when { font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.2; }
.day .when b { display: block; color: var(--text); font-size: var(--fs-md); }
.day.is-today .when b { color: var(--accent-text); }
.day.is-past .when b, .day.is-past .meal .what .name { color: var(--text-2); }
.day .meals { display: flex; flex-direction: column; }
.meal { display: flex; align-items: center; gap: 4px; min-height: 56px; }
.meal .what { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; color: inherit; text-decoration: none; padding: 6px 0; }
.meal .what .name { font-weight: 600; }
.meal .what .sub { font-size: var(--fs-xs); color: var(--text-2); }
.meal .note .name { font-style: italic; font-weight: 500; }
.meal .plan-link { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 56px; color: var(--accent-text); text-decoration: none; font-weight: 500; }
.tag-meal { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-right: 6px; }
.week-nav { display: flex; align-items: center; gap: 4px; }
.week-nav .label { font-size: var(--fs-sm); color: var(--text-2); min-width: 7.5em; text-align: center; }

.empty { text-align: center; padding: 32px 16px; color: var(--text-2); }
.empty .icon { width: 36px; height: 36px; color: var(--text-3); }
.notice { border-radius: var(--r-input); padding: 12px 14px; background: var(--accent-soft); color: var(--text); font-size: var(--fs-sm); }
.notice.warn { background: none; border: 1.5px solid var(--saffron); color: var(--text); }
.errors { color: var(--danger); font-weight: 600; }

/* ---- recipe page --------------------------------------------------------------------------- */
.recipe-head h1 { margin: 4px 0 8px; }
.recipe-actions { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.add-to-plan { display: flex; gap: 8px; }
.add-to-plan select { flex: 1; min-width: 0; }
.add-to-plan .btn { flex: none; }
@media (min-width: 600px) { .recipe-actions { flex-direction: row; } .recipe-actions > * { flex: 1; } }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--sunken); border-radius: 999px; padding: 4px; position: sticky; top: 8px; z-index: 5; margin: 16px 0; }
.segmented button { min-height: 44px; border: 0; border-radius: 999px; background: none; font-weight: 600; color: var(--text-2); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.recipe-cols [role="tabpanel"][hidden] { display: none; }
.servings { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.servings output { min-width: 2ch; text-align: center; font-weight: 700; }
.ingredients, .steps { list-style: none; margin: 0; padding: 0; }
.ingredients li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ingredients li.sub, .steps li.sub { font-weight: 700; padding-top: 18px; border: 0; color: var(--text-2); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; }
.ingredients input[type="checkbox"] { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.ingredients label { font-weight: 400; font-size: var(--fs-md); margin: 0; }
.ingredients input:checked + label { color: var(--text-3); text-decoration: line-through; }
.qty { font-weight: 700; font-variant-numeric: tabular-nums; }
.steps { counter-reset: step; }
.steps li:not(.sub) { counter-increment: step; position: relative; padding: 12px 0 12px 44px; border-bottom: 1px solid var(--border); }
.steps li:not(.sub)::before {
  content: counter(step); position: absolute; left: 0; top: 12px; width: 30px; height: 30px; border-radius: 999px;
  background: var(--sunken); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm);
}
.notes { margin-top: 24px; }
.notes :is(h1, h2, h3) { font: 600 var(--fs-lg)/1.3 var(--sans); margin: 20px 0 8px; }
.timer-chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; margin: 2px 0; border-radius: 999px;
  border: 1.5px solid var(--accent-text); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; cursor: pointer;
}
.timer-chip::before { content: "⏱ "; }
@media (min-width: 900px) {
  .recipe-cols { display: grid; grid-template-columns: 5fr 7fr; gap: 40px; align-items: start; }
  .recipe-cols .segmented { display: none; }
  /* Desktop shows both columns, regardless of the selected phone tab. */
  .recipe-cols [role="tabpanel"][hidden] { display: block !important; }
  .page.wide { max-width: 1040px; }
}

/* cooking view */
.cook { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.cook[hidden] { display: none; }
.cook-top { display: flex; align-items: center; gap: 8px; }
.cook-top .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 4px; background: var(--sunken); border-radius: 999px; margin: 8px 0 20px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s ease-out; }
.cook-step { flex: 1; overflow-y: auto; font-size: clamp(22px, 5.5vw, 30px); line-height: 1.5; max-width: 36ch; }
.cook-step .timer-chip { font-size: 1rem; min-height: 44px; }
.cook-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-top: 16px; }
.cook-nav .btn { min-height: 72px; font-size: var(--fs-lg); }
.cook-ings { margin-top: 12px; }
.cook-ings summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.cook-ings ul { max-height: 30vh; overflow-y: auto; margin: 0; padding-left: 1.25rem; font-size: var(--fs-md); }

/* timers */
.timers { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; gap: 6px; padding: 8px 16px; pointer-events: none; }
.timers:empty { display: none; }
.timer { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1.5px solid var(--edge); border-radius: 999px; padding: 4px 4px 4px 16px; box-shadow: var(--shadow); max-width: 420px; margin: 0 auto; width: 100%; }
.timer .left { font: 700 var(--fs-lg)/1 var(--sans); font-variant-numeric: tabular-nums; }
.timer .for { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer.done { border-color: var(--accent); background: var(--accent-soft); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.02); } }
.cook-timers { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cook-timers:empty { display: none; }
.cook-timers .timer { box-shadow: none; margin: 0; }
body:has(.cook:not([hidden])) .toast { bottom: auto; top: 16px; }
@media (min-width: 900px) { .timers { bottom: 16px; } }

/* ---- shopping & freezer -------------------------------------------------------------------- */
.checklist { list-style: none; margin: 0 0 8px; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--border); }
.checklist form { display: contents; }
.check {
  width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; cursor: pointer; flex: none; margin-left: -10px;
}
.check span { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--edge); display: grid; place-items: center; }
.check[aria-pressed="true"] span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check[aria-pressed="true"] span::after { content: "✓"; font-weight: 700; font-size: 15px; }
.checklist .text { flex: 1; min-width: 0; }
.checklist .for { display: block; font-size: var(--fs-xs); color: var(--text-2); }
.checklist li.done .text { color: var(--text-3); text-decoration: line-through; }
details.group summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
details.group summary::-webkit-details-marker { display: none; }
details.group summary::before { content: "›"; font-size: 1.5em; line-height: 1; color: var(--text-2); transition: transform .15s; }
details.group[open] summary::before { transform: rotate(90deg); }

.stepper { display: flex; align-items: center; gap: 4px; }
.stepper .n { min-width: 2.5ch; text-align: center; font-weight: 700; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.stepper .icon-btn { border: 1.5px solid var(--edge); }
.freezer-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 8px 6px 14px; }
.freezer-row .body { flex: 1; min-width: 0; }

/* ---- forms --------------------------------------------------------------------------------- */
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-grid label { margin: 0; font-weight: 500; }

/* ---- login --------------------------------------------------------------------------------- */
.login { max-width: 420px; margin: 12vh auto 0; padding: 0 16px; }
.login h1 { font-size: 2.5rem; margin-bottom: 8px; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.people label { margin: 0; }
.people input { position: absolute; opacity: 0; }
.people span { display: flex; align-items: center; justify-content: center; min-height: 56px; border-radius: var(--r-input); border: 1.5px solid var(--edge); font-weight: 600; cursor: pointer; }
.people input:checked + span { background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text); }
.people input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- toast --------------------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 500; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }

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

/* ---- added after the round-2 UX review ------------------------------------------------------- */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 8px; }
#main:focus { outline: none; }
.account { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 760px; margin: 0 auto; padding: 8px 16px 24px; color: var(--text-2); font-size: var(--fs-sm); }
@media (min-width: 900px) { .account { display: none; } }
.back { margin-left: -10px; }
.mt-lg { margin-top: 28px; }
.chips-in-card { margin: 0 -16px; padding: 4px 16px 12px; }
.hero { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--r-card); margin-bottom: 12px; }
h3 { font: 600 var(--fs-md)/1.3 var(--sans); margin: 0; }
@media (min-width: 600px) { .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 10px 0; } .chips-in-card { margin: 0; padding: 4px 0 12px; } }

/* ---- meal slots and the wide-screen week grid ---------------------------------------------- */
.meal .plan-link.secondary { color: var(--text-2); font-weight: 500; min-height: 48px; font-size: var(--fs-sm); }
.meal + .meal { border-top: 1px dashed var(--border); }
.monogram .icon { width: 24px; height: 24px; }
@media (min-width: 1000px) {
  .page.week { max-width: 1200px; }
  .week .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .week .day { display: flex; flex-direction: column; align-items: stretch; border: 1px solid var(--border);
    border-radius: var(--r-card); background: var(--surface); padding: 10px; min-height: 180px; }
  .week .day:first-child { border-top: 1px solid var(--border); }
  .week .day.is-today { border-color: var(--accent-text); box-shadow: inset 0 3px 0 var(--accent); }
  .week .day .when { padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
  .week .day .when b { display: inline; margin-right: 4px; }
  .week .meal { flex-direction: column; align-items: flex-start; gap: 0; min-height: 0; padding: 6px 0; }
  .week .meal .icon-btn { width: 32px; height: 32px; align-self: flex-end; margin-top: -30px; }
  .week .meal .what { padding: 0; padding-right: 30px; }
  .week .meal .plan-link { min-height: 40px; }
  .week .tonight { max-width: 760px; }
}
.cook-step p { margin: 0 0 12px; }
.cook-step .cook-section { font: 600 var(--fs-sm)/1.3 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }

/* family calendar events on the week */
.event { display: flex; gap: 8px; align-items: baseline; padding: 6px 0 2px; font-size: var(--fs-sm); }
.event-when { flex: none; font-weight: 600; color: var(--herb); font-variant-numeric: tabular-nums; }
.event-title { min-width: 0; }
@media (min-width: 1000px) { .week .event { flex-direction: column; gap: 0; padding: 4px 0; } }

/* Family preparation: inherit the existing light/dark palette and generous phone controls. */
.source-text, .task-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.source-image { display: block; max-width: 100%; height: auto; margin-top: 12px; }
.choice { display: flex; gap: 12px; align-items: center; min-height: 48px; }
.choice input[type="checkbox"] { width: 24px; height: 24px; flex: none; }
.routine-now { text-align: center; }
.routine-picture { display: block; width: 160px; height: 160px; margin: 12px auto; color: var(--accent-text); }
.routine-next .routine-picture { width: 72px; height: 72px; margin: 8px 0; }
fieldset { min-width: 0; border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px; }
input[type="file"] { width: 100%; min-width: 0; font-size: var(--fs-sm); }
.page > .actions, .card .actions, .family-task .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Display setup stays outside the daily navigation. */
.display-settings, .display-preview { overflow-wrap: anywhere; }
.display-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.display-check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.display-check input { width: 22px; height: 22px; }

/* One visible form owns recipe discovery on phones and larger screens. */
.browse-toggles, .browse-actions { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.check-label { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; cursor: pointer; }
.check-label input { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; }
.browse-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0; }
.browse-grid label { min-width: 0; }
.browse-grid select { margin-top: 5px; text-overflow: ellipsis; }
.browse-more { margin: 8px 0; }
.browse-more summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 600; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.active-filters .chip { white-space: normal; overflow-wrap: anywhere; max-width: 100%; gap: 8px; }
#recipe-browser[aria-busy="true"] #recipe-results { opacity: .65; }
@media (max-width: 480px) { .browse-more .browse-grid { grid-template-columns: minmax(0, 1fr); } }
/* Recipe metadata: wraps on phones, native details and readable new-name review. */
.recipe-metadata { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.recipe-metadata details { flex-basis: 100%; }
.recipe-metadata summary, .recipe-source summary, .metadata-choices summary, .metadata-new summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
.recipe-source { margin-top: 12px; overflow-wrap: anywhere; }
.recipe-source p { margin: 0; }
.recipe-source details p { padding-bottom: 8px; }
.metadata-choices, .metadata-new { border: 1px solid var(--border); border-radius: var(--r-card); padding: 0 12px 8px; }
.metadata-choices > summary, .metadata-new > summary { font-weight: 600; }
.metadata-choices fieldset { border: 0; padding: 0; }
.metadata-review { background: var(--surface); }
.metadata-confirm { display: flex; gap: 10px; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.metadata-confirm input { flex: 0 0 auto; width: 20px; height: 20px; }

.plan-time-check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.plan-time-check input { width: 22px; height: 22px; min-height: 22px; flex: none; }
.plan-recipe-link { display: flex; flex-direction: column; min-height: 44px; color: inherit; text-decoration: none; }
.plan-recipe-link .small { color: var(--accent-text); }
.segmented[hidden] { display: none; }

.plan-moods { flex-wrap: wrap; overflow: visible; }

/* Help: the exact words to send Hearth, in the page's own font so they read as words, not code. */
kbd { font: inherit; font-weight: 600; background: var(--sunken); border-radius: 6px; padding: 0 4px; overflow-wrap: anywhere; }
.help ul { margin: 8px 0 0; padding-left: 20px; }
.help li + li { margin-top: 6px; }

/* Plain text from household owners remains escaped, including untrusted event titles. */
.ask-answer { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Calendar evidence and exact previews stay readable on a phone, without a new navigation tab. */
.calendar-review { overflow-wrap: anywhere; }
.meal-review { overflow-wrap: anywhere; }
.calendar-review input, .calendar-review select, .calendar-review textarea { min-width: 0; max-width: 100%; }
.calendar-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.calendar-fields input { display: block; margin-top: 5px; }
.calendar-evidence summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-weight: 600; }
.calendar-details { margin: 0; }
.calendar-details dt { font-weight: 600; margin-top: 12px; }
.calendar-details dd, .calendar-evidence dd { margin: 3px 0 0; }
.calendar-item { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 480px) { .calendar-fields { grid-template-columns: minmax(0, 1fr); } }
