/* ============================================================
   HOMAURA design system
   Photographs and words. No icons.
   Palette and type: HOMAURA UI and Brand Guide v1.0.
   ============================================================ */

/* ---------- Tokens ----------
   Straight from the HOMAURA UI and Brand Guide v1.0, with the
   darker steps of the same ramps added where text has to be read.
   ---------------------------------------------------------------- */
:root {
  /* ---- The brand guide, as given ---- */
  --primary: #E67E00;       /* primary orange: CTAs, active states, highlights */
  --amber: #FFB300;         /* secondary amber: accents, badges, gradients */
  --gold: #FFD54F;          /* accent gold: soft highlights, tags */
  --porcelain: #FAF8F5;     /* background */
  --chalk: #FFFFFF;         /* card */
  --ink: #383838;           /* foreground: primary text */
  --chalk-2: #F5F0E8;       /* muted: subtle backgrounds */
  --hairline: #EDE8DC;      /* border: dividers, card outlines */
  --destructive: #EF4444;   /* errors, urgent alerts */

  /* ---- The steps the guide does not include ----
     Every one of these is the same hue as a guide colour, taken
     darker so it can carry text. The guide's own swatches are
     beautiful as fills and fail as text: primary orange reads at
     2.70:1 on the background, and white on the gradient bottoms
     out at 1.79:1. These are the readable ends of the same ramp,
     used only where something has to be read. */
  --primary-ink: #8A4B00;         /* orange text, pill tags, links */
  --primary-btn-a: #A35900;       /* the CTA gradient, white passes on both ends */
  --primary-btn-b: #B05F00;
  --primary-btn-hover-a: #8F4E00;
  --primary-btn-hover-b: #9C5400;
  --destructive-ink: #C42B2B;     /* red text and outlines */
  --slate: #6B6B6B;               /* muted text, at a readable weight */
  --slate-2: #6B6B6B;
  --ink-2: #4A4A4A;
  --hairline-2: #F3EFE6;

  /* ---- Gradients, exactly as specified ---- */
  --grad-primary: linear-gradient(135deg, var(--primary) 0%, var(--amber) 100%);
  --grad-highlight: linear-gradient(135deg, var(--amber) 0%, var(--gold) 100%);
  /* The primary button. It was the guide's own gradient, where white
     read 2.86:1 at the orange end and 1.79:1 at the amber end. Matt, 16
     November: that fails WCAG AA, which the proposal promised, on Start
     cooking of all buttons. The darker pair passes with white, 5.27:1 and
     4.68:1, and the hover darkens it further. */
  --grad-cta: linear-gradient(135deg, var(--primary-btn-a) 0%, var(--primary-btn-b) 100%);
  --grad-cta-hover: linear-gradient(135deg, #8A4B00 0%, #A35900 100%);
  --btn-ink: #FFFFFF;             /* the text on the CTA gradient */

  /* ---- Kept from the app's own system ----
     Status has to survive colour blindness, so it is never carried
     by hue alone. Every status is also a word. */
  --petrol: var(--primary-btn-a);   /* the action colour, now the brand */
  --petrol-deep: var(--primary-btn-hover-a);
  --petrol-wash: #FBEEDC;
  --jade: #106B44;          /* home / in stock / done */
  --jade-wash: #E4F2EA;
  --amber-text: #8A5A00;    /* use soon, as text */
  --amber-wash: #FFF4DC;
  --rust: var(--destructive-ink);   /* expired / away / stop */
  --rust-wash: #FCE9E9;
  --violet: #6A4A8C;        /* voting open */
  --violet-wash: #F0EAF6;

  --flame: var(--primary);
  --flame-deep: var(--primary-ink);
  --gold-pale: #FFE9A8;
  --ember: var(--destructive);
  --star: var(--primary-ink);
  --brand-ink: #383838;
  --brand-grad: var(--grad-primary);

  --shadow-1: 0 1px 2px rgba(56,40,16,.05), 0 2px 8px rgba(56,40,16,.05);
  --shadow-2: 0 2px 4px rgba(56,40,16,.06), 0 12px 28px rgba(56,40,16,.09);
  --shadow-3: 0 10px 20px rgba(56,40,16,.10), 0 32px 64px rgba(56,40,16,.16);
  --shadow-primary: 0 6px 18px rgba(230,126,0,.20);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  --rail: 136px;
  --bar: 68px;

  --tap: 60px;              /* minimum interactive height */
  --step: 1;                /* text-size multiplier */
  --dur: 200ms;
  --ease: cubic-bezier(.22,.61,.36,1);

  --font-display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
}

/* Evening (dark). Warm charcoal rather than cold, so the same brand
   flame sits on it the way it sits on the logo's black lockup. */
[data-theme="evening"] {
  --porcelain: #14100B;
  --chalk: #1E1913;
  --chalk-2: #262019;
  --ink: #F4EEE2;
  --ink-2: #D8D0C1;
  --slate: #A79C89;
  --slate-2: #9C9280;
  --hairline: #3A3226;
  --hairline-2: #2C261D;
  /* The same brand hues, lifted so they carry on a dark surface. */
  --primary: #FF9E33;
  --amber: #FFC04D;
  --gold: #FFD97A;
  --destructive: #FF7A7A;
  --primary-ink: #FFB25C;
  --amber-text: #FFC97A;
  --destructive-ink: #FF9A9A;
  --grad-primary: linear-gradient(135deg, #FF9E33 0%, #FFC04D 100%);
  --grad-highlight: linear-gradient(135deg, #FFC04D 0%, #FFD97A 100%);
  --grad-cta: linear-gradient(135deg, #A35900 0%, #B05F00 100%);
  --grad-cta-hover: linear-gradient(135deg, #8A4B00 0%, #A35900 100%);
  --btn-ink: #FFFFFF;
  --petrol: #FFB25C;
  --petrol-deep: #FFC98A;
  --petrol-wash: #3A2810;
  --jade: #5BC38C;
  --jade-wash: #122C21;
  --amber-wash: #3A2E14;
  --rust: #FF9A9A;
  --rust-wash: #3A1D1D;
  --violet: #C4A8E0;
  --violet-wash: #2A2136;
  --flame: #FF9E33;
  --flame-deep: #FFB25C;
  --gold-pale: #FFE9A8;
  --ember: #FF7A7A;
  --star: #FFC04D;
  --shadow-primary: 0 6px 18px rgba(0,0,0,.45);
  /* Selected chips use the light brand tint as a fill, so their text
     has to be dark. */
  --chip-solid-ink: #241703;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 2px 6px rgba(0,0,0,.45), 0 14px 32px rgba(0,0,0,.5);
  --shadow-3: 0 12px 28px rgba(0,0,0,.55), 0 40px 72px rgba(0,0,0,.6);
}

/* True high contrast. Yellow is the accessible-HC convention for focus/action. */
[data-contrast="high"] {
  --porcelain: #000000;
  --chalk: #000000;
  --chalk-2: #000000;
  --ink: #FFFFFF;
  --ink-2: #FFFFFF;
  --slate: #FFFFFF;
  --slate-2: #FFFFFF;
  --hairline: #FFFFFF;
  --hairline-2: #FFFFFF;
  --primary: #FFB000;
  --amber: #FFE300;
  --gold: #FFE300;
  --destructive: #FF8A7A;
  --primary-ink: #FFE300;
  --amber-text: #FFE300;
  --destructive-ink: #FF8A7A;
  --grad-primary: none;
  --grad-highlight: none;
  --grad-cta: none;
  --grad-cta-hover: none;
  --shadow-primary: none;
  --petrol: #FFE300;
  --petrol-deep: #FFE300;
  --petrol-wash: #000000;
  --jade: #4DFF9B;
  --jade-wash: #000000;
  --amber-wash: #000000;
  --rust: #FF8A7A;
  --rust-wash: #000000;
  --flame: #FFB000;
  --flame-deep: #FFE300;
  --gold: #FFE300;
  --gold-pale: #FFF7C2;
  --ember: #FF8A7A;
  --star: #FFE300;
  --chip-solid-ink: #000;
  --violet: #C7A6FF;
  --violet-wash: #000000;
  --shadow-1: none; --shadow-2: none; --shadow-3: none;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* Nothing behind an open sheet, panel or cooking overlay may scroll. The class
   is added and removed by a counter in app.js, never by an individual caller,
   because two overlays can be open at once. */
html.scroll-locked, html.scroll-locked body { overflow: hidden; touch-action: none; }
/* The display text size multiplies the ROOT font size. Everything in this
   sheet is sized in rem, and rem resolves against html rather than body, so
   scaling body alone moved almost nothing. 16px times step, with body at
   1.0625rem, means Normal renders exactly as it did before. */
html { font-size: calc(16px * var(--step)); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--porcelain);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
h1,h2,h3,h4,p,ul,ol,figure { margin: 0; }
ul, ol { list-style: none; padding: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--petrol);
  outline-offset: 3px;
  border-radius: 4px;
}
[data-contrast="high"] :focus-visible { outline: 4px solid #FFE300; }

::selection { background: var(--petrol); color: #fff; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.03;
  color: var(--ink);
}
/* 1.46.0. Labels in sentence case at reading size. Small spaced
   capitals were the hardest words on the screen to read. */
.eyebrow {
  font-family: var(--font-body);
  font-size: .98rem;
  font-weight: 700;
  letter-spacing: -.005em;
  color: var(--ink-2);
}
.num { font-variant-numeric: tabular-nums; }

/* ---------- App frame ---------- */
.app {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Nav rail: words, never icons ---------- */
.rail {
  background: var(--chalk);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  padding: 18px 0 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  /* Focus Mode makes every button taller. On a tablet held sideways the
     rail then ran off the bottom of the screen and took Help Me with it,
     which is the one thing that must never disappear from somebody who
     has just said it is all too much. It scrolls now, and Help Me is
     pinned to the bottom of it either way. */
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 40;
}
.brand {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; padding: 6px 10px 20px;
}
/* Mark and wordmark keep the lockup's own proportion, about 1.5
   times the cap height, so it does not read as two logos stacked. */
.brand-mark { width: 48px; height: auto; display: block; }
.brand-word { width: 104px; height: auto; display: block; }
[data-theme="evening"] .brand-word, [data-contrast="high"] .brand-word { filter: invert(1) brightness(2); }
.brand span {
  display: block; font-size: .56rem; letter-spacing: .2em; color: var(--slate-2);
  font-family: var(--font-body); font-weight: 600; margin-top: 1px;
}
.rail-list { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rail-btn {
  position: relative;
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 10px 12px 18px;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--slate);
  letter-spacing: -.01em;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.rail-btn:hover { color: var(--ink); background: var(--chalk-2); }
/* 1.46.0. The screen you are on has a soft orange ground, the same on
   the tablet and the phone, rather than a stripe at the edge. */
.rail-btn[aria-current="page"] { color: var(--primary-ink); background: var(--petrol-wash); }
.rail-badge {
  display: inline-block; margin-left: 7px; min-width: 24px; padding: 1px 7px;
  background: var(--petrol); color: var(--chalk); border-radius: 20px;
  font-family: var(--font-body); font-size: .68rem; font-weight: 700; text-align: center;
  vertical-align: 2px;
}
[data-contrast="high"] .rail-badge { color: #000; }
.rail-foot { border-top: 1px solid var(--hairline); padding-top: 8px; margin-top: auto;
  position: sticky; bottom: 0; background: var(--chalk); }

/* One cog in the bar instead of three setting buttons on every screen. */
.cog {
  width: 46px; height: 46px; flex: none; display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--hairline);
  background: var(--chalk); color: var(--ink); cursor: pointer;
}
.cog:hover { background: var(--chalk-2); }
.cog[data-on="1"] { border-color: var(--primary); color: var(--primary-ink); }

/* Help Me. Visible without competing with the one primary action on the
   screen, so an outline rather than a second filled orange. It arrives once
   when the screen settles and then holds still, because a control that
   pulses forever is the wrong signal for the people this is built for. */
.rail-foot .rail-btn[data-view="help"] {
  border: 1.5px solid var(--primary); border-radius: 11px;
  color: var(--primary-ink); font-weight: 600;
  /* Centred, unlike the menu above it. Left aligned words inside an
     outlined box read as a mistake. */
  text-align: center; padding-left: 10px; padding-right: 10px;
  animation: helpIn .45s ease-out .6s both;
}
.rail-foot .rail-btn[data-view="help"]:hover { background: var(--primary); color: var(--btn-ink); }
@keyframes helpIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
[data-motion="reduced"] .rail-foot .rail-btn[data-view="help"] { animation: none; }

/* Back to More. Quiet, consistent, above the heading on every screen that
   can only be reached from the More page. */
.backlink {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; padding: 4px 0; margin-bottom: 6px;
  color: var(--slate); font: inherit; font-size: .92rem; cursor: pointer;
}
.backlink:hover { color: var(--ink); }
.backlink span[aria-hidden] { font-size: 1.05rem; line-height: 1; }

/* More, grouped under headings but still one page. */
.more-group { margin-top: 26px; }
.more-group:first-of-type { margin-top: 8px; }
/* Words only. Short forms swap in on phones so nothing truncates. */
.nav-long { display: inline; }
.nav-short { display: none; }

/* ---------- Top bar ---------- */
.bar {
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  background: color-mix(in srgb, var(--porcelain) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 30;
}
.bar-date { display: flex; flex-direction: column; line-height: 1.15; }
.bar-date b { font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; }
.bar-date small { color: var(--slate); font-size: .78rem; }
.bar-spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--tap); padding: 0 26px;
  border-radius: var(--r-lg);
  font-family: var(--font-display); font-weight: 600;
  font-size: 1rem; letter-spacing: -.005em;
  border: 1.5px solid transparent;
  transition: transform 120ms var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.995); }
/* The CTA, per the guide: gradient fill, rounded, semibold, with the
   brand's own coloured shadow under it. */
.btn-primary { background: var(--grad-cta); color: var(--btn-ink); box-shadow: var(--shadow-primary); }
.btn-primary:hover { background: var(--grad-cta-hover); }
[data-contrast="high"] .btn-primary { background: var(--petrol); color: #000; box-shadow: none; }
.btn-quiet { background: var(--chalk); color: var(--ink); border-color: var(--hairline); }
.btn-quiet:hover { border-color: var(--slate-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn-ghost:hover { background: var(--chalk-2); }
.btn-rust { background: var(--rust); color: #fff; border-color: var(--rust); }
.btn-rust:hover { background: #7d211a; }
[data-contrast="high"] .btn-rust { color: #000; }
.btn-on-photo { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.5); backdrop-filter: blur(10px); }
.btn-on-photo:hover { background: rgba(255,255,255,.28); }
[data-contrast="high"] .btn-on-photo { background:#000; border-color:#fff; }
.btn-sm { min-height: 46px; padding: 0 17px; font-size: .92rem; border-radius: var(--r-sm); }
.btn-lg { min-height: 76px; padding: 0 38px; font-size: 1.3rem; border-radius: var(--r-lg); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .42; pointer-events: none; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 30px;
  font-size: .8rem; font-weight: 700; letter-spacing: .005em;
  background: var(--chalk-2); color: var(--slate);
  border: 1px solid var(--hairline);
}
/* A chip you can press is a control, so it gets a control's height
   everywhere, not just on a phone. */
button.chip, a.chip { min-height: 40px; padding: 0 15px; }
.chip-jade  { background: var(--jade-wash);  color: var(--jade);  border-color: color-mix(in srgb, var(--jade) 24%, transparent); }
.chip-amber { background: var(--amber-wash); color: var(--amber-text); border-color: color-mix(in srgb, var(--amber-text) 30%, transparent); }
.chip-rust  { background: var(--rust-wash);  color: var(--rust);  border-color: color-mix(in srgb, var(--rust) 28%, transparent); }
.chip-petrol{ background: var(--petrol-wash);color: var(--petrol);border-color: color-mix(in srgb, var(--petrol) 26%, transparent); }
.chip-violet{ background: var(--violet-wash);color: var(--violet);border-color: color-mix(in srgb, var(--violet) 28%, transparent); }
.chip-solid { background: var(--petrol); color: var(--chip-solid-ink, #fff); border-color: var(--petrol); }
/* An add button sitting in a row of value chips looked like another
   value. It is an action, so it says so: dashed edge, a plus, and the
   ink colour rather than the muted one. */
.chip-add { background: transparent; color: var(--primary-ink, var(--petrol));
  border-style: dashed; border-width: 2px;
  border-color: color-mix(in srgb, var(--petrol) 45%, transparent); }
.chip-add::before { content: "+"; font-weight: 800; margin-right: 2px; }
.chip-add:hover { background: var(--petrol-wash); }
[data-contrast="high"] .chip { border-width: 2px; }
[data-contrast="high"] .chip-solid { color:#000; }
/* Pill tag: rounded-full, primary at 10 percent, primary ink text. */
.chip-tag { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary-ink);
  border-color: color-mix(in srgb, var(--primary) 26%, transparent); }
/* Icon action button: 40 by 40, rounded, gradient fill. */
.btn-icon {
  width: 44px; height: 44px; min-height: 44px; padding: 0; flex: none;
  border-radius: var(--r-lg); background: var(--grad-cta); color: #fff;
  box-shadow: var(--shadow-primary); font-size: 1.2rem; font-weight: 600;
}
.btn-icon:hover { background: var(--grad-cta-hover); }
.chip-photo { padding: 4px 13px 4px 4px; }
.chip-photo img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ---------- Cards ---------- */
.card {
  background: var(--chalk);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
[data-contrast="high"] .card { border-width: 2px; }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 17px; }
.card-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.16rem; }
.card-head .rest { margin-left: auto; }

/* ---------- Main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.view { padding: 26px; flex: 1; width: 100%; max-width: 1720px; margin: 0 auto; }
.view-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 28px; flex-wrap: wrap; }
/* A rhythm for anything sitting directly on a screen that does not already
   set its own margin. Inline styles at the call sites still win, so this only
   fills the gaps rather than fighting them. */
.view > section, .view > .card, .view > .grid-2, .view > .grid-3,
.view > .kpi, .view > .zone-grid, .view > .tiles, .view > .cards { margin-bottom: 24px; }
.view > :last-child { margin-bottom: 0; }
.view-head h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
.view-head .rest { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
/* Air between a heading and the line under it. The global margin reset put
   them flush against each other on every screen. And a wider measure so an
   instruction line fits on one row rather than wrapping under itself. */
.lede { margin-top: 9px; color: var(--slate); font-size: 1.02rem; max-width: 104ch; }

/* ---------- Avatars ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }

/* ---------- Today grid ---------- */
.today {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: stretch;
}
.today > .hero, .today > .card { height: 100%; }
.today-wide { grid-column: 1 / -1; height: auto !important; }
.today-split { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; height: auto !important; }
.today-split > .card { height: 100%; }

/* ---------- Hero meal card ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  min-height: 430px;
  display: flex; flex-direction: column; justify-content: flex-end;
  box-shadow: var(--shadow-2);
  isolation: isolate;
  background: var(--ink);
}
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
  transform: scale(1.04);
  animation: driftIn 1400ms var(--ease) both;
}
@keyframes driftIn { from { transform: scale(1.12); opacity: 0 } to { transform: scale(1.04); opacity: 1 } }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(183deg, rgba(6,14,13,.02) 0%, rgba(6,14,13,.20) 26%, rgba(6,14,13,.62) 58%, rgba(6,14,13,.93) 92%);
}
[data-contrast="high"] .hero { border: 3px solid #fff; }
[data-contrast="high"] .hero::after { background: rgba(0,0,0,.9); }
[data-contrast="high"] .hero-img { filter: grayscale(1) contrast(.7) brightness(.5); }
.hero-body { position: relative; z-index: 2; padding: 34px 36px 32px; color: #fff; }
.hero-body .eyebrow { color: rgba(255,255,255,.92); }
.hero h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.3rem, 4.6vw, 3.9rem); line-height: .98; letter-spacing: -.028em;
  color: #fff; margin: 10px 0 14px; max-width: 15ch;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0,0,0,.45);
}
[data-contrast="high"] .hero h2 { text-shadow: none; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
/* Who is not on this plate, said on the picture rather than further
   down the page. */
.hero-aside {
  color: rgba(255,255,255,.9);
  font-size: .92rem;
  font-weight: 600;
  margin: -8px 0 16px;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
}
.hero-meta .chip { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.34); backdrop-filter: blur(8px); }
[data-contrast="high"] .hero-meta .chip { background:#000; border-color:#fff; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
/* Her 9 October: on a profile the section headings are bigger, darker
   and orange, so the page reads in parts. */
.sheet[data-sheet^="person:"] .sheet-body .eyebrow,
.sheet[data-sheet^="person:"] .eyebrow { font-size: .98rem; font-weight: 800; color: var(--primary-ink); letter-spacing: 0; }
/* And each medication in a beige box. */
.med-box { background: #F1E6D2; border-radius: 14px; padding: 6px 6px 10px; }
.med-box .mini-row { background: transparent; }
[data-theme="evening"] .med-box { background: #3A2E1E; }
[data-contrast="high"] .med-box { background: #000; border: 2px solid #fff; }
.lo-line { text-align: left; white-space: normal; }
.lo-line .lo-line-act { font-weight: 500; color: var(--primary-ink); }
.reminder .rem-note { display: block; margin-top: 2px; font-style: italic; }
.cal-ev .cal-more { font-style: normal; opacity: .8; }
/* Above the body. Both sat on 2 and the body comes later, so the Tonight
   label lay over the change cook button at every width, her 9 October. */
.hero-corner { position: absolute; z-index: 3; top: 22px; right: 24px; display: flex; gap: 8px; }
.hero-corner .chip { background: rgba(8,16,15,.8); color: #fff; border-color: rgba(255,255,255,.35); backdrop-filter: blur(12px); }
[data-contrast="high"] .hero-corner .chip { background: #000; border-color: #fff; border-width: 2px; }

/* ---------- Presence strip: real faces, the family board ---------- */
.presence { padding: 18px 22px; }
.presence-row { display: flex; gap: 12px; flex-wrap: wrap; }
.person {
  --pc: var(--slate);
  display: flex; align-items: center; gap: 12px;
  padding: 8px 18px 8px 8px;
  border-radius: 60px;
  border: 1.5px solid var(--hairline);
  background: var(--chalk);
  min-height: var(--tap);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform 120ms var(--ease);
  text-align: left;
}
.person:hover { transform: translateY(-1px); border-color: var(--slate-2); }
.person:active { transform: translateY(0); }
.person img {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2.5px var(--chalk), 0 0 0 5px var(--pc);
  transition: filter var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.person b { font-family: var(--font-display); font-weight: 700; font-size: 1rem; display: block; line-height: 1.2; }
.person small { font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.person[data-state="home"] { border-color: color-mix(in srgb, var(--jade) 45%, transparent); background: var(--jade-wash); }
.person[data-state="home"] small { color: var(--jade); }
.person[data-state="away"] img { filter: grayscale(1); opacity: .5; }
.person[data-state="away"] small { color: var(--rust); }
.person[data-state="away"] { border-color: color-mix(in srgb, var(--rust) 34%, transparent); }
.person[data-state="unknown"] img { filter: grayscale(.75); opacity: .72; }
.person[data-state="unknown"] small { color: var(--slate-2); }
[data-contrast="high"] .person { border-width: 3px; }

.faces { display: flex; }
.faces img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2.5px var(--chalk);
  margin-right: -11px;
}
.faces.on-photo img { box-shadow: 0 0 0 2.5px rgba(0,0,0,.35); }
.faces img:last-child { margin-right: 0; }
.faces .away { filter: grayscale(1); opacity: .45; }
/* In a ballot the faces are the point, so they do not overlap and they are
   large enough to recognise. Elsewhere the stacked treatment is fine. */
.faces.faces-clear { gap: 6px; }
.faces.faces-clear img { width: 34px; height: 34px; margin-right: 0; box-shadow: 0 0 0 2px var(--chalk); }

/* ---------- Reminder list ---------- */
.reminder {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px; border-radius: var(--r-md);
  border: 1px solid var(--hairline); background: var(--chalk);
  margin-bottom: 10px; text-align: left; width: 100%;
  min-height: var(--tap);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.reminder:hover { background: var(--chalk-2); }
.rem-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: none;
  border-radius: var(--r-sm); background: var(--violet-wash); color: var(--violet); }
.rem-mark .mark { --mark-size: 26px; }
.reminder img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.reminder .txt { flex: 1; min-width: 0; }
.reminder .txt b { display: block; font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.reminder .txt small { color: var(--slate); font-size: .82rem; }
.tickbox {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  border: 2.5px solid var(--hairline); background: var(--chalk);
  display: grid; place-items: center;
  transition: all var(--dur) var(--ease);
}
.tickbox::after {
  content: ""; width: 15px; height: 9px; border-left: 3px solid transparent; border-bottom: 3px solid transparent;
  transform: rotate(-45deg) translate(1px,-3px);
}
.reminder:hover .tickbox { border-color: var(--petrol); }
.reminder.done .tickbox { background: var(--jade); border-color: var(--jade); }
.reminder.done .tickbox::after { border-color: #fff; }
.reminder.done { opacity: .5; }
.reminder.done .txt b { text-decoration: line-through; }
/* A row with two presses: the words open it, the circle marks it off. */
.reminder.rem-split { padding: 0; gap: 0; }
.rem-split .rem-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px;
  padding: 15px 4px 15px 16px; min-height: var(--tap);
  text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
}
.rem-split .rem-tick {
  flex: none; align-self: stretch; display: grid; place-items: center;
  padding: 8px 16px 8px 10px; background: none; border: 0; cursor: pointer;
}
.rem-split .rem-tick:hover .tickbox, .rem-split .rem-tick:focus-visible .tickbox { border-color: var(--petrol); }
@media (max-width: 700px) {
  .rem-split .rem-open { padding: 10px 2px 10px 14px; }
  .rem-split .rem-tick { padding: 6px 14px 6px 8px; }
}

/* ---------- Photo tiles (inventory / options) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
/* Her 9 October: the meal chooser was a lot of scrolling. Smaller tiles,
   more to a row, a shorter picture. Still big enough to press. */
.tiles.pm-tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tiles.pm-tiles .tile-img { aspect-ratio: 16/10; }
.tiles.pm-tiles .tile-body { padding: 8px 10px; }
.tiles.pm-tiles .tile-body b { font-size: .9rem; }
.tiles.pm-tiles .tile-body small { font-size: .76rem; }
/* A child gets three big tiles rather than a row of small ones. Three
   choices is the whole rule, so they can afford the room. */
.kids .tiles { grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); max-width: 760px; }
.tile {
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--chalk); overflow: hidden; text-align: left;
  transition: transform 150ms var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  display: flex; flex-direction: column;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--slate-2); }
.tile-img { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--chalk-2); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
/* A photograph of a meal is a scene and cropping it is fine. A
   photograph of a thing you buy is the thing, and cropping a square
   product shot into a wide tile reads as zoomed in and half cut off.
   Those are shown whole, on the tile colour, which also means nobody
   has to resize a picture before uploading it. */
.tile-img.item { background: var(--chalk); }
.tile-img.item img { object-fit: contain; padding: 9px; }
.mini-img.item img { object-fit: contain; padding: 4px; }
.illus-img img { object-fit: contain; padding: 6px; background: var(--chalk); }
.tile-flag {
  position: absolute; left: 8px; top: 8px;
  padding: 3px 9px; border-radius: 20px; font-size: .68rem; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
  background: var(--chalk); color: var(--ink); box-shadow: var(--shadow-1);
}
.tile-flag.amber { background: var(--amber-text); color: #fff; }
.tile-flag.rust { background: var(--rust); color: #fff; }
.tile-flag.jade { background: var(--jade); color: #fff; }
[data-contrast="high"] .tile-flag { border: 2px solid #fff; }

/* Something they have not settled into, worth more stars. It sits at
   the other end of the picture from the star count so the two do not
   land on top of each other on a narrow tile. */
.tile-flag.stretch-flag {
  /* Under the star count rather than beside it. On a narrow tile the
     two sat on top of each other and the stars won. */
  top: auto; bottom: 8px; left: 8px; right: auto;
  background: var(--violet, #5B3A78); color: #fff;
}
.tile.stretch { border-color: color-mix(in srgb, var(--violet, #5B3A78) 45%, transparent); }
.tile-body { padding: 11px 13px 13px; }
.tile-body b { display: block; font-weight: 700; font-size: .98rem; line-height: 1.25; }
.tile-body small {
  color: var(--slate);
  font-size: .8rem;
  /* Two lines, not one. A tile carries what it takes to make it and why
     it is being offered, and inline they ran together into
     "No cookingEverything is already in the kitchen". */
  display: block;
  line-height: 1.35;
}
.tile-body small + small { margin-top: 3px; }

/* ---------- Compact photo row ---------- */
.mini-row {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: var(--r-md); min-height: var(--tap);
  border: 1px solid var(--hairline); background: var(--chalk);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.mini-row:hover { background: var(--chalk-2); border-color: var(--slate-2); }
.mini-img { width: 56px; height: 56px; flex: none; border-radius: 9px; overflow: hidden; background: var(--chalk-2); }
.mini-img img { width: 100%; height: 100%; object-fit: cover; }
.mini-row .txt { flex: 1; min-width: 0; }
.mini-row .txt b { display: block; font-weight: 700; font-size: 1rem; line-height: 1.2; }
.mini-row .txt small { color: var(--slate); font-size: .8rem; }
.mini-row .chip { flex: none; }
/* A missed dose with its three answers. The answers wrap under the name
   when the row is too narrow for all of it on one line. */
/* Any compact row on a phone. The words keep at least 140px and whatever
   sits after them, a chip, Edit, Switch off, drops to the next line when
   there is no room. Held on one line, a reward's name went one word to a
   line under its own Edit button, and a reminder read "Bins / out". */
@media (max-width: 560px) {
  .mini-row { flex-wrap: wrap; row-gap: 8px; }
  .mini-row .txt { flex: 1 1 140px; }
}
.dose-alert { flex-wrap: wrap; row-gap: 8px; }
.dose-alert .txt { flex: 1 1 180px; }
.dose-alert-answers { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

/* ---------- Week navigation ---------- */
.weekbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; margin-bottom: 22px;
  background: var(--chalk); border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.weekbar-now { display: flex; flex-direction: column; line-height: 1.2; min-width: 150px; }
.weekbar-now b { font-size: 1.16rem; }
.weekbar-now small { font-size: .8rem; }
[data-contrast="high"] .weekbar { border-width: 2px; }

/* ---------- Week strip ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 12px; }
.day {
  border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--chalk);
  overflow: hidden; text-align: left; display: flex; flex-direction: column;
  transition: transform 150ms var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  min-height: 320px;
}
.day:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.day[data-today="1"] { border-color: var(--petrol); border-width: 2.5px; box-shadow: var(--shadow-2); }
.day-head { padding: 12px 13px 10px; border-bottom: 1px solid var(--hairline-2); }
.day-head b { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; display: block; }
.day-head small { color: var(--slate); font-size: .78rem; }
.day-img { aspect-ratio: 5/4; background: var(--chalk-2); position: relative; }
.day-img img { width: 100%; height: 100%; object-fit: cover; }
.day-empty { display: grid; place-items: center; height: 100%; color: var(--slate-2); font-size: .84rem; padding: 12px; text-align: center; }
/* A meal with no picture of its own is drawn as its name on a tile, the
   same tile an item with no picture gets. The name is in the picture, the
   tile colour comes from the theme. Point build of 1.41.0. */
img[src*="meal-name-tile"] { background: var(--chalk-2); object-fit: cover; }
/* On the big picture the name is the white headline over it, so the tile
   there is the warm charcoal of the evening theme, which white reads on. */
.hero .hero-img[src*="meal-name-tile"] { background: linear-gradient(135deg, #4A3F33 0%, #1E1913 100%); }
.day-body { padding: 12px 13px 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.day-body b { font-weight: 700; font-size: 1rem; line-height: 1.22; }
.day-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.day .faces img { width: 28px; height: 28px; margin-right: -8px; box-shadow: 0 0 0 2px var(--chalk); }

/* The tile is a div now, so that the shared dinner and each personal
   meal can be separate targets. This is the dinner part, and it has to
   look and behave exactly as the whole tile used to. */
.day-open {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.day-open:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }

/* This person's own meals, underneath the shared dinner in the same
   column. Her note was that the week read as two screens. */
.day-mine {
  border-top: 1px solid var(--hairline-2);
  background: var(--chalk-2);
  display: flex;
  flex-direction: column;
}
.day-meal {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--hairline-2);
  padding: 8px 13px;
  cursor: pointer;
  min-height: 46px;
  justify-content: center;
}
.day-meal:last-child { border-bottom: 0; }
.day-meal:hover { background: var(--chalk); }
.day-meal:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.dm-slot {
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--slate);
}
.dm-meal {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A day set differently to the standing meal says so without words. */
.day-meal.on { background: var(--petrol-wash); }
.day-meal.on .dm-slot { color: var(--petrol); }
.dm-flag {
  font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--jade); margin-top: 1px;
}

/* ---------- Calendar ----------
   A month of real photographs. The grid is fixed at six rows so the
   page does not change height between months, and every cell keeps
   its date number in the same corner so the eye can scan a column. */
.cal-jump { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cal-jump > span { color: var(--slate); font-size: .84rem; white-space: nowrap; }
.cal-jump select {
  min-height: 44px; padding: 6px 12px; border-radius: var(--r-sm);
  border: 1.5px solid var(--hairline); background: var(--chalk); color: var(--ink);
  font: inherit; font-size: .92rem;
}
[data-contrast="high"] .cal-jump select { border-width: 2.5px; }

.cal {
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--chalk); overflow: hidden;
}
[data-contrast="high"] .cal { border-width: 2.5px; }

.cal-dow {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--chalk-2); border-bottom: 1px solid var(--hairline);
}
.cal-dow span { padding: 10px 12px; }
.cal-dow b {
  font-family: var(--font-display); font-weight: 700;
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--slate);
}

.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px; background: var(--hairline-2);
  border-top: 1px solid var(--hairline-2);
}
.cal-cell {
  background: var(--chalk); text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 8px 10px; min-height: 132px;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
button.cal-cell:hover { background: var(--petrol-wash); box-shadow: inset 0 0 0 2px var(--petrol); }
.cal-cell[data-in="0"] { background: var(--chalk-2); }
.cal-cell[data-in="0"] .cal-photo img { opacity: .42; }
.cal-cell[data-in="0"] .cal-name, .cal-cell[data-in="0"] .cal-num { color: var(--slate-2); }
.cal-cell.is-before, .cal-cell.is-outside { background: var(--chalk-2); }
.cal-cell.is-before .cal-num { color: var(--slate-2); }
.cal-cell[data-today="1"] { box-shadow: inset 0 0 0 3px var(--petrol); }
/* Ahead of today is a pencil mark, not a record. Quieter photo,
   quieter name, and the word "Planned" on it so nobody has to
   work it out from the position of the ring. */
.cal-cell[data-future="1"] .cal-name { color: var(--slate); }
.cal-cell[data-future="1"] .cal-photo img { opacity: .74; }
.cal-cell[data-future="1"][data-in="1"] { background: var(--chalk-2); }

.cal-num {
  display: flex; align-items: baseline; gap: 6px;
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: .92rem; line-height: 1;
}
.cal-num i {
  font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--petrol);
}
.cal-photo {
  position: relative; aspect-ratio: 4/3; border-radius: var(--r-sm);
  overflow: hidden; background: var(--chalk-2);
}
.cal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-none { display: block; width: 100%; height: 100%; background: var(--hairline-2); }
[data-contrast="high"] .cal-none { background: transparent; box-shadow: inset 0 0 0 2px var(--hairline); }
.cal-flag {
  position: absolute; left: 5px; bottom: 5px; font-style: normal;
  padding: 2px 7px; border-radius: 20px; font-size: .6rem; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
  background: var(--petrol); color: #fff;
}
.cal-flag-out { background: var(--amber-text); }
.cal-flag-plan { background: var(--chalk); color: var(--slate); box-shadow: var(--shadow-1); }
[data-contrast="high"] .cal-flag-plan { background: #000; color: #fff; }
[data-contrast="high"] .cal-flag { border: 2px solid #fff; }
.cal-name {
  font-size: .82rem; font-weight: 700; line-height: 1.22;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cal-ev { font-size: .72rem; color: var(--slate); line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Simple mode: fewer things, not smaller things. The days either side
   of the month go, the meal name gets bigger, the extras go. */
[data-simple="on"] .cal-cell { min-height: 152px; padding: 10px; }
[data-simple="on"] .cal-name { font-size: .95rem; -webkit-line-clamp: 2; }
[data-simple="on"] .cal-ev { display: none; }

/* ---------- Shopping ---------- */
.aisle { margin-bottom: 26px; }
.aisle-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 2px solid var(--hairline);
}
.aisle-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: .04em; text-transform: uppercase; }
.aisle-head small { color: var(--slate); font-size: .82rem; margin-left: auto; }
/* On a phone a heading keeps its own width and the note beside it goes
   under it, rather than squeezing "Nights that never change" to a word a
   line next to its note. */
@media (max-width: 560px) {
  .card-head, .aisle-head { flex-wrap: wrap; row-gap: 4px; }
}
/* A name with buttons after it keeps at least 140px. Below that the
   buttons go under it. A low medicine on Today read "4 / capsules / left"
   beside Add to shopping, on a phone and in the narrow column of a
   tablet on its side. */
.qty-row > b[style*="flex:1"], .prn-block .row > b[style*="flex:1"] { flex: 1 1 140px !important; }

/* ---------- Batch 4 ---------- */
/* This week and its date range sit in the middle of the bar rather than
   squashed against the Earlier button. */
.weekbar-now { flex: 1 1 auto; align-items: center; text-align: center; }

/* Statistics stop shouting over the tasks they describe. */
.kpi .big-num { font-size: 1.9rem; }
.kpi .card-pad { padding: 15px 17px; }

/* The rules worth knowing read as a list: the rule on the left, the guidance
   on the right, rather than two columns of paragraphs. */
.ruleset { display: block; }
.rule-row { display: flex; gap: 26px; align-items: baseline;
  padding: 15px 0; border-bottom: 1px solid var(--hairline-2); }
.rule-row:last-child { border-bottom: 0; }
.rule-row > b { flex: 0 0 clamp(180px, 26%, 300px); }
.rule-row > span { flex: 1 1 auto; min-width: 0; }
@media (max-width: 760px) {
  .rule-row { display: block; }
  .rule-row > b { display: block; margin-bottom: 4px; }
}
.shop-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 10px 14px; border-radius: var(--r-md); min-height: var(--tap);
  border: 1px solid transparent; transition: background var(--dur) var(--ease);
}
.shop-row:hover { background: var(--chalk); border-color: var(--hairline); }
.shop-row img { width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover; flex: none; }
.shop-row .txt { flex: 1; min-width: 0; }
.shop-row .txt b { display: block; font-weight: 700; font-size: 1.04rem; }
.shop-row .txt small { color: var(--slate); font-size: .82rem; }
.shop-row .price { font-variant-numeric: tabular-nums; color: var(--slate); font-size: .95rem; }
.shop-row .price { flex: none; }
/* On a phone the tick, the picture, the name and the price had about
   120px left once Change and Remove took their share, so the name went
   one word to a line and the price sat on top of Change. The two buttons
   now take their own line under the item. */
@media (max-width: 560px) {
  .shop-row { flex-wrap: wrap; row-gap: 0; }
  .shop-row .shop-tick { flex: 1 1 100%; }
  .shop-row .shop-drop { min-height: 36px; margin-left: auto; }
  .shop-row .shop-drop + .shop-drop { margin-left: 0; }
}
.shop-row.checked { opacity: .48; }
.shop-row.checked .txt b { text-decoration: line-through; }

/* ---------- Meter ---------- */
.meter { height: 12px; border-radius: 20px; background: var(--hairline-2); overflow: hidden; border: 1px solid var(--hairline); }
.meter span { display: block; height: 100%; background: var(--brand-grad); border-radius: 20px; transition: width 700ms var(--ease); }
.meter.over span { background: var(--rust); }

/* ---------- Cooking mode ---------- */
.cook {
  position: fixed; inset: 0; z-index: 200; background: var(--porcelain);
  display: flex; flex-direction: column;
}
/* Wraps at every width. Only wrapping below 760 left an upright tablet,
   768 wide, with Reading aloud, Fewer and More past the right edge. */
.cook-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 26px; border-bottom: 1px solid var(--hairline); background: var(--chalk); }
.cook-bar b { font-family: var(--font-display); font-weight: 700; font-size: 1.16rem; }
.cook-prog { flex: 1; height: 10px; border-radius: 20px; background: var(--hairline-2); overflow: hidden; max-width: 420px; }
.cook-prog span { display: block; height: 100%; background: var(--brand-grad); transition: width 400ms var(--ease); }
.cook-main { flex: 1; overflow: auto; display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,.85fr); gap: 0; }
.cook-step { padding: 46px 54px; display: flex; flex-direction: column; justify-content: center; }
.cook-step .eyebrow { margin-bottom: 18px; }
.cook-step h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.13; letter-spacing: -.02em;
  max-width: 20ch; text-wrap: pretty;
}
.cook-side { background: var(--chalk); border-left: 1px solid var(--hairline); padding: 30px 28px; overflow: auto; }
.cook-foot { display: flex; gap: 14px; padding: 18px 26px; border-top: 1px solid var(--hairline); background: var(--chalk); }
.cook-foot .btn-primary { flex: 1; }
/* A quantity is short and should not wrap. A sentence in the same
   row is not, and forcing it onto one line pushed the whole page
   sideways on every screen it appeared on. */
.qty-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 2px; border-bottom: 1px solid var(--hairline-2); flex-wrap: wrap; }
.qty-row b { font-weight: 600; min-width: 0; }
.qty-row span { font-variant-numeric: tabular-nums; color: var(--slate); min-width: 0; overflow-wrap: anywhere; text-align: right; flex: 0 1 auto; }
.qty-row b { flex: 1 1 auto; }
.qty-row.used b { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.qty-row.used b, .qty-row.used span { color: var(--slate); }
.variant-note {
  background: var(--violet-wash);
  padding: 14px 16px; border-radius: var(--r-md); margin-top: 18px;
}
.variant-note b { color: var(--violet); display: block; font-size: .95rem; margin-bottom: 4px; }

/* ---------- Timers ---------- */
.seg-read {
  min-height: 50px; display: grid; place-items: center; padding: 0 16px;
  font-weight: 700; font-size: .92rem;
  border-left: 1.5px solid var(--hairline); border-right: 1.5px solid var(--hairline);
}
.timer-inline {
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 10px 18px; border-radius: var(--r-md);
  background: var(--petrol-wash); border: 1.5px solid color-mix(in srgb, var(--petrol) 32%, transparent);
}
.timer-inline b { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; color: var(--petrol); font-variant-numeric: tabular-nums; line-height: 1; }
.timer-inline span { color: var(--slate); font-size: .86rem; }
.timer-inline.rang { background: var(--rust-wash); border-color: color-mix(in srgb, var(--rust) 40%, transparent); }
.timer-inline.rang b { color: var(--rust); }

.timer-card {
  border: 1.5px solid var(--hairline); border-radius: var(--r-md);
  background: var(--chalk); padding: 13px 15px 14px; margin-bottom: 10px;
}
.timer-card.rang { border-color: var(--rust); background: var(--rust-wash); animation: ring 1.1s ease-in-out infinite; }
@keyframes ring { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rust) 42%, transparent) } 55% { box-shadow: 0 0 0 7px transparent } }
.timer-clock {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.62rem; line-height: 1; color: var(--petrol);
  font-variant-numeric: tabular-nums; min-width: 84px;
}
.timer-card.rang .timer-clock { color: var(--rust); }
.timer-card.paused .timer-clock { color: var(--slate); }
.timer-label { display: block; font-weight: 700; font-size: .96rem; line-height: 1.22; }
.timer-bar { height: 6px; border-radius: 20px; background: var(--hairline-2); overflow: hidden; margin-top: 10px; }
.timer-bar span { display: block; height: 100%; background: var(--petrol); transition: width 1s linear; }
.timer-card.rang .timer-bar span { background: var(--rust); }
.timer-card.paused .timer-bar span { background: var(--slate-2); }

/* Global tray. timers stay visible on every screen */
.tray {
  position: fixed; right: 18px; bottom: 18px; z-index: 240;
  width: min(348px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: flex; flex-direction: column;
  background: var(--chalk); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  padding: 13px 14px 4px;
  animation: rise 240ms var(--ease) both;
}
.tray.ringing { border-color: var(--rust); border-width: 2px; }
.tray-head { display: flex; align-items: center; margin-bottom: 10px; flex: none; }
.tray-head b { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.tray-list { overflow: auto; min-height: 0; }
.tray .timer-card { padding: 11px 12px 12px; }
.tray .timer-clock { font-size: 1.44rem; min-width: 74px; }
.tray .timer-label { font-size: .92rem; }
.tray .timer-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .76rem; }
.tray .timer-card .btn { min-height: 44px; padding: 0 10px; font-size: .86rem; flex: 1; }
[data-contrast="high"] .tray, [data-contrast="high"] .timer-card { border-width: 2px; }

/* ---------- The timer at three sizes ----------
   A corner card while you get on with something else, a pill when it is
   only there to be heard, and the whole screen when somebody is standing
   at the bench watching it. */
.tray-btn {
  width: 40px; height: 40px; min-height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--chalk-2); color: var(--slate);
}
.tray-btn:hover { background: var(--chalk); color: var(--ink); }
.tray-btn svg { width: 20px; height: 20px; }

.tray-pill {
  position: fixed; right: 18px; bottom: 18px; z-index: 240;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; min-height: var(--tap);
  background: var(--chalk); border: 1px solid var(--hairline);
  border-radius: 999px; box-shadow: var(--shadow-3);
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  animation: rise 240ms var(--ease) both;
}
.tray-pill.ringing { border-color: var(--rust); border-width: 2px; color: var(--rust); }

.timer-full {
  position: fixed; inset: 0; z-index: 250;
  background: var(--chalk);
  display: flex; flex-direction: column;
  animation: fade 180ms var(--ease) both;
}
.timer-full.ringing { box-shadow: inset 0 0 0 5px var(--rust); }
.timer-full-bar {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: 16px 22px; border-bottom: 1px solid var(--hairline);
}
.timer-full-bar b { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.timer-full-body {
  flex: 1 1 auto; overflow: auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 40px; padding: 30px 22px 44px;
}
.big-timer { width: min(720px, 100%); text-align: center; }
.big-timer-clock {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: clamp(4.5rem, 22vw, 13rem); line-height: 1; letter-spacing: -.02em;
  margin: 10px 0 6px;
}
.big-timer.rang .big-timer-clock { color: var(--rust); }
.big-timer.paused .big-timer-clock { color: var(--slate); }
.big-timer-label { font-size: 1.25rem; margin-bottom: 22px; }
.big-timer .timer-bar { max-width: 620px; margin: 0 auto; }
[data-contrast="high"] .tray-pill, [data-contrast="high"] .tray-btn { border-width: 2px; }
/* One timer on a phone still fills the screen, it just fills less of it. */
@media (max-width: 640px) {
  .timer-full-body { gap: 26px; padding: 20px 16px 30px; }
  .big-timer-label { font-size: 1.05rem; }
}

/* ---------- The illustrated recipe ----------
   The method as a card you could pin on a fridge. A cream page, white
   boxes, one column per step with a capped header, the things that go
   in stacked with a plus between them, and an arrow into the next step.
   It reads left to right on a bench and stacks on a phone. */
.illus {
  background: var(--porcelain, #FAF4E8);
  border-radius: var(--r-lg);
  padding: 26px 24px 20px;
  margin: -4px 0 0;
}
.illus-head { text-align: center; margin-bottom: 18px; }
.illus-head h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.015em;
  text-transform: uppercase; color: var(--primary-ink, var(--ink));
}
.illus-head p { color: var(--slate); margin-top: 2px; font-size: .96rem; }
.illus-head p::first-letter { text-transform: uppercase; }

/* The band before step one: the oven, the pan, who it feeds. */
.illus-prep {
  display: flex; flex-wrap: wrap; align-items: stretch;
  border: 1.5px solid var(--hairline); border-radius: var(--r-md);
  background: var(--chalk); margin-bottom: 22px; overflow: hidden;
}
.illus-prep-item {
  flex: 1 1 150px; padding: 12px 16px; text-align: center;
  border-right: 1px dashed var(--hairline);
}
.illus-prep-item:last-child { border-right: 0; }
.illus-prep-item b {
  display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--slate); margin-bottom: 3px;
}
.illus-prep-item span { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }

/* The flow. Steps and the arrows between them, on one line where there
   is room and stacked where there is not. */
.illus-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; }
.illus-step {
  flex: 1 1 152px; max-width: 240px; min-width: 142px;
  display: flex; flex-direction: column;
  border: 1.5px solid var(--hairline); border-radius: var(--r-md);
  background: var(--chalk); overflow: hidden;
}
.illus-cap {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; background: color-mix(in srgb, var(--primary) 12%, var(--chalk));
  border-bottom: 1.5px solid var(--hairline);
}
.illus-n {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--primary); color: var(--btn-ink, #fff);
  display: grid; place-items: center; font-weight: 800; font-size: .82rem;
}
.illus-verb {
  font-family: var(--font-display); font-weight: 700; font-size: .98rem;
  text-transform: uppercase; letter-spacing: .05em; line-height: 1.1;
}
/* Centred, so a step with one ingredient does not leave a hole above
   the action while the columns stay the same height as each other. */
.illus-body {
  padding: 14px 10px 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; flex: 1;
}

/* Ingredients down the column, with a plus between them. */
.illus-ings { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.illus-ings.illus-none { color: var(--slate); font-size: .84rem; padding: 6px 0 2px; }
.illus-plus { font-weight: 800; color: var(--slate); font-size: 1.05rem; line-height: 1; margin: 1px 0; }
.illus-ing { width: 100%; max-width: 112px; }
.illus-img {
  display: block; width: 74px; height: 74px; margin: 0 auto; border-radius: 13px;
  overflow: hidden; background: var(--chalk-2); border: 1px solid var(--hairline-2);
}
.illus-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.illus-img .day-empty { display: grid; place-items: center; font-size: .7rem; padding: 4px; text-align: center; height: 100%; }
.illus-ing b { display: block; font-size: .82rem; margin-top: 5px; }
.illus-ing small { display: block; color: var(--slate); font-size: .74rem; line-height: 1.25; }

/* Down into the action. */
.illus-down {
  display: block; width: 2px; height: 16px; margin: 10px 0 8px;
  background: var(--hairline); position: relative;
}
.illus-down::after {
  content: ""; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 7px solid var(--hairline);
}
.illus-t { font-size: .95rem; font-weight: 700; }
.illus-rest { font-size: .84rem; color: var(--slate); margin-top: 4px; }
/* The action, pinned to the foot of every column so the captions line
   up across the row rather than floating at whatever height the
   ingredients above them happened to reach. */
.illus-tail {
  margin-top: auto; padding: 10px 12px 12px; text-align: center;
  border-top: 1px dashed var(--hairline);
  background: color-mix(in srgb, var(--primary) 5%, var(--chalk));
}
.illus-mins { margin-top: 8px; }

/* The arrow between two steps. */
.illus-arrow { flex: 0 0 26px; align-self: center; position: relative; height: 26px; }
.illus-arrow::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 0; height: 0;
  border-top: 8px solid transparent; border-bottom: 8px solid transparent;
  border-left: 11px solid var(--primary);
}

.illus-also {
  margin-top: 20px; padding: 16px 18px; background: var(--chalk);
  border: 1.5px dashed var(--hairline); border-radius: var(--r-md);
}
.illus-also-head { text-align: center; margin-bottom: 10px; }
.illus-also-head b { display: block; font-family: var(--font-display); font-weight: 700; }
.illus-also-head small { color: var(--slate); font-size: .84rem; }
.illus-also .illus-ings { flex-direction: row; flex-wrap: wrap; gap: 14px; justify-content: center; }
.illus-also .illus-plus { align-self: center; }

.illus-foot {
  display: flex; align-items: center; gap: 14px; margin-top: 18px;
  padding-top: 14px; border-top: 1.5px solid var(--hairline);
  color: var(--slate); font-size: .82rem;
}
.illus-foot img { height: 20px; width: auto; margin-left: auto; opacity: .75; }

[data-contrast="high"] .illus-step, [data-contrast="high"] .illus-prep { border-width: 2.5px; }
[data-simple="on"] .illus-step { min-width: 210px; }
[data-simple="on"] .illus-t { font-size: 1.04rem; }

@media (max-width: 700px) {
  .illus { padding: 18px 14px 14px; }
  .illus-flow { flex-direction: column; }
  .illus-step { max-width: none; }
  /* Pointing down the page rather than off the side of it. */
  .illus-arrow { flex: none; height: 22px; width: 100%; }
  .illus-arrow::before {
    border-left: 8px solid transparent; border-right: 8px solid transparent;
    border-top: 11px solid var(--primary); border-bottom: 0;
  }
}

/* Printing it puts the card on the page and nothing else, so it can go
   on a fridge door. */
@media print {
  html.printing-illus, html.printing-illus body { background: #fff; height: auto; overflow: visible; }
  html.printing-illus .app, html.printing-illus .bar, html.printing-illus .rail,
  html.printing-illus #panel, html.printing-illus #tray, html.printing-illus #overlay,
  html.printing-illus .toasts, html.printing-illus .sheet-head, html.printing-illus .sheet-foot { display: none !important; }
  html.printing-illus .scrim { position: static; background: none; padding: 0; display: block; backdrop-filter: none; }
  html.printing-illus .sheet { width: auto; max-height: none; box-shadow: none; border: 0; overflow: visible; animation: none; }
  html.printing-illus .sheet-body { padding: 0; overflow: visible; }
  html.printing-illus .illus { background: #fff; padding: 0; }
  html.printing-illus .illus-step { break-inside: avoid; }
}

/* ---------- Sheet / modal ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 260;
  background: rgba(8,16,15,.52); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 26px;
  animation: fade 180ms var(--ease) both;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  background: var(--chalk); border-radius: var(--r-xl); box-shadow: var(--shadow-3);
  width: min(760px, 100%); max-height: 88vh; overflow: auto;
  border: 1px solid var(--hairline);
  animation: rise 260ms var(--ease) both;
}
@keyframes rise { from { transform: translateY(22px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
/* After .sheet in the file, and doubled up, so the wide one actually
   wins rather than losing to the 760px default. */
.sheet.sheet-wide { width: min(1240px, 100%); }
/* The sheet is what scrolls, not its body, so the head used to scroll
   away with everything else. That was survivable while the only thing up
   there was a close button, and it is not now: landing straight on the
   safe foods section of a long profile put the way back off the top of
   the screen. The foot has been sticky for the same reason all along. */
.sheet-head {
  display: flex; align-items: flex-start; gap: 16px; padding: 24px 26px 16px;
  position: sticky; top: 0; z-index: 3; background: var(--chalk);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.sheet-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; }
.sheet-head p { color: var(--slate); margin-top: 4px; }
.sheet-body { padding: 0 26px 32px; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 12px; padding: 18px 26px; border-top: 1px solid var(--hairline); background: var(--chalk-2); position: sticky; bottom: 0; border-radius: 0 0 var(--r-xl) var(--r-xl); }
.x {
  margin-left: auto; flex: none; width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid var(--hairline); display: grid; place-items: center;
  font-size: 1.4rem; line-height: 1; color: var(--slate);
}
.x:hover { background: var(--chalk-2); color: var(--ink); }

/* The way back out of a sheet that was opened from inside another one.
   It sits before the title rather than after it, because it goes
   backwards and the close button goes away, and it is only drawn when
   there is somewhere to go back to. */
.sheet-head .sheet-back { margin-left: 0; margin-right: 2px; }

/* ---------- Option grid (max 3, per spec) ---------- */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; }
.option {
  border: 2px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden;
  background: var(--chalk); text-align: left; display: flex; flex-direction: column;
  transition: border-color var(--dur) var(--ease), transform 150ms var(--ease), box-shadow var(--dur) var(--ease);
}
.option:hover { border-color: var(--petrol); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.option[aria-pressed="true"] { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-wash); }
.option img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.option .ob { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.option .ob b { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; line-height: 1.18; }
.option .ob small { color: var(--slate); font-size: .84rem; }
.votes { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 6px; flex-wrap: wrap; }
/* Her 61. One treatment on every ballot, never more than three faces. */
.vote-faces { align-items: center; flex-wrap: wrap; row-gap: 4px; max-width: 100%; }
.faces.vote-faces img { width: 34px; height: 34px; margin-right: 0; box-shadow: 0 0 0 2px var(--chalk); }
.vote-faces .faces-more { font-size: .82rem; font-weight: 700; color: var(--slate); white-space: nowrap; margin-left: 2px; }

/* ---------- Form bits ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field input[type="text"], .field input[type="number"], .field input[type="search"],
.field input[type="email"], .field input[type="password"], .field input[type="time"],
.field input[type="date"],
.field select, .field textarea {
  width: 100%; min-height: 54px; padding: 12px 14px;
  border: 1.5px solid var(--hairline); border-radius: var(--r-sm);
  background: var(--chalk); color: var(--ink);
}
/* Her 82. The date field was missing from the list above, so it kept the
   browser's own white box while its words took the evening ink, pale on
   white. It is on the list now, and the page tells the browser which way
   round its own parts go, so the little calendar and the picker that
   opens from it are dark in evening and high contrast as well. */
:root { color-scheme: light; }
[data-theme="evening"], [data-contrast="high"] { color-scheme: dark; }
.field textarea { min-height: 100px; resize: vertical; }
/* Tabs never run off the edge. Where they cannot fit they scroll
   sideways rather than hiding the last one, which on Kitchen was
   Medicine. */
.seg { display: inline-flex; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--chalk); max-width: 100%; }
.seg-scroll { display: flex; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll > .seg { flex: none; }
.seg button {
  min-height: 50px; padding: 0 18px; font-weight: 700; font-size: .92rem; color: var(--slate);
  border-right: 1.5px solid var(--hairline);
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--petrol); color: var(--chip-solid-ink, #fff); }

.switch-row {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 15px 4px; border-bottom: 1px solid var(--hairline-2); min-height: var(--tap);
}
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 34px; height: 34px; flex: none; margin: 0;
  border: 2.5px solid var(--hairline); border-radius: 8px;
  background: var(--chalk); cursor: pointer;
  display: grid; place-items: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
input[type="checkbox"]::after {
  content: ""; width: 14px; height: 8px;
  border-left: 3px solid transparent; border-bottom: 3px solid transparent;
  transform: rotate(-45deg) translate(1px, -2px);
}
input[type="checkbox"]:hover { border-color: var(--slate-2); }
input[type="checkbox"]:checked { background: var(--jade); border-color: var(--jade); }
input[type="checkbox"]:checked::after { border-color: #fff; }
[data-contrast="high"] input[type="checkbox"] { border-width: 3px; }
[data-contrast="high"] input[type="checkbox"]:checked { background: #FFE300; border-color: #FFE300; }
[data-contrast="high"] input[type="checkbox"]:checked::after { border-color: #000; }
label.switch-row { cursor: pointer; }
label.switch-row:hover { background: var(--chalk-2); }
.switch-row .txt { flex: 1; }
.switch-row .txt b { display: block; font-weight: 700; font-size: 1.04rem; }
.switch-row .txt small { color: var(--slate); font-size: .84rem; }
.switch {
  flex: none; width: 68px; height: 38px; border-radius: 30px; background: var(--hairline);
  border: 1.5px solid var(--hairline); position: relative; transition: background var(--dur) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px;
  border-radius: 50%; background: var(--chalk); box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease);
}
.switch[aria-pressed="true"] { background: var(--petrol); border-color: var(--petrol); }
.switch[aria-pressed="true"]::after { transform: translateX(30px); }
[data-contrast="high"] .switch { border-width: 3px; background: #000; border-color: #fff; }
[data-contrast="high"] .switch::after { background: #fff; }
[data-contrast="high"] .switch[aria-pressed="true"] { background: #FFE300; border-color: #FFE300; }
[data-contrast="high"] .switch[aria-pressed="true"]::after { background: #000; }

/* Stat pair. two numbers that must never collide */
.stat-pair { display: flex; align-items: flex-end; gap: 26px; flex-wrap: wrap; }
.stat-pair > div { min-width: 0; }
.stat-pair .rest { margin-left: auto; text-align: right; }

/* ---------- Display panel ---------- */
.panel {
  /* Above the timer tray. Opening settings while something is cooking used
     to put the tray card straight over the switches. Still below the sheet
     scrim at 260, which must stay on top of everything. */
  position: fixed; right: 18px; top: calc(var(--bar) + 10px); z-index: 250;
  width: min(400px, calc(100vw - 36px));
  background: var(--chalk); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 20px 22px 16px;
  animation: rise 200ms var(--ease) both;
  /* The panel is taller than the screen once every switch is in it, and the
     page behind is locked, so it has to carry its own scroll or the last
     rows are unreachable. */
  max-height: calc(100dvh - var(--bar) - 24px);
  overflow-y: auto; overscroll-behavior: contain;
}
.panel h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.16rem; margin-bottom: 6px; }
.panel > p { color: var(--slate); font-size: .88rem; margin-bottom: 14px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--porcelain);
  padding: 15px 26px; border-radius: 40px; box-shadow: var(--shadow-3);
  font-weight: 700; font-size: 1rem; max-width: 90vw;
  animation: pop 260ms var(--ease) both;
}
[data-contrast="high"] .toast { border: 3px solid #fff; }
@keyframes pop { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- Celebration ---------- */
/* A cheer that lands on top of a photograph has to carry its own
   background, or it is unreadable exactly when it matters. */
.celebrate { position: fixed; inset: 0; z-index: 320; pointer-events: none; display: grid; place-items: center; }
.celebrate b {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.2rem, 7vw, 5rem); color: #fff;
  background: var(--grad-cta); padding: .34em .7em; border-radius: 999px;
  box-shadow: var(--shadow-3);
  animation: cheer 1500ms var(--ease) both; text-align: center;
  max-width: 88vw;
}
[data-contrast="high"] .celebrate b { background: #000; color: #FFE300; border: 4px solid #fff; }
@keyframes cheer {
  0% { transform: scale(.6); opacity: 0 }
  22% { transform: scale(1.06); opacity: 1 }
  72% { transform: scale(1); opacity: 1 }
  100% { transform: scale(1.02); opacity: 0 }
}

/* ---------- Marks: drawn for this product, used only where a photo would lie ---------- */
.mark {
  --mark-size: 34px;
  flex: none; display: grid; place-items: center;
  width: calc(var(--mark-size) * 1.65); height: calc(var(--mark-size) * 1.65);
  border-radius: 50%; background: var(--petrol-wash); color: var(--petrol);
}
.mark svg { width: var(--mark-size); height: var(--mark-size); display: block; }
[data-contrast="high"] .mark { border: 2px solid #fff; background: #000; }

.mark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px; }
.mark-tile {
  display: flex; align-items: center; gap: 16px; text-align: left;
  padding: 18px 20px; border-radius: var(--r-lg);
  border: 1px solid var(--hairline); background: var(--chalk);
  transition: transform 150ms var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  min-height: 96px;
}
.mark-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--petrol); }
.mark-body { min-width: 0; }
.mark-body b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.14rem; line-height: 1.2; }
.mark-body small { color: var(--slate); font-size: .86rem; }
[data-contrast="high"] .mark-tile { border-width: 2px; }

/* ---------- Numbered flow ---------- */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.flow-step { display: flex; gap: 14px; align-items: flex-start; }
.flow-step > b {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--petrol); color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
}
[data-theme="evening"] .flow-step > b, [data-contrast="high"] .flow-step > b { color: #061312; }

/* ---------- Stat tiles ---------- */
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 16px; }
.kpi .card-pad { padding: 18px 20px; }

/* ---------- Bars: one hue for magnitude, person colour only for people ---------- */
.bar-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.bar-label {
  flex: 0 0 40%; max-width: 40%; min-width: 0; display: flex; align-items: center; gap: 8px;
  font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bar-face { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; }
.bar-track { flex: 1; height: 12px; border-radius: 20px; background: var(--hairline-2); overflow: hidden; min-width: 40px; }
.bar-fill { display: block; height: 100%; border-radius: 20px; transition: width 600ms var(--ease); }
.bar-value { flex: none; font-size: .86rem; color: var(--slate); min-width: 62px; text-align: right; }
[data-contrast="high"] .bar-track { border: 2px solid #fff; }

/* ---------- Events ---------- */
.event-pill {
  display: block; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--chalk-2);
  font-size: .86rem; line-height: 1.35;
}
.event-pill b { font-weight: 700; }
/* Every item on a day opens to be changed, her 9 October. */
button.event-pill, button.on-item, .wbp-on button {
  font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%;
  border-top: 0; border-right: 0; border-bottom: 0;
}
button.on-item, .wbp-on button { border-left: 0; background: transparent; padding: 0; }
button.on-item { background: var(--chalk-2); padding: 4px 8px; }
button.event-pill:hover, button.on-item:hover, .wbp-on button:hover { filter: brightness(.96); }
.wbp-on button { display: block; }
.event-pill[data-kind="Eating out"], .event-pill[data-kind="Away"] { background: var(--amber-wash); }
.event-pill[data-kind="Birthday"] { background: var(--violet-wash); }
.event-pill[data-kind="Appointment"], .event-pill[data-kind="Support"] { background: var(--petrol-wash); }
.event-pill .faces img { width: 24px; height: 24px; margin-right: -7px; }

/* ---------- Wizard ---------- */
.wiz-main { flex: 1; overflow: auto; display: flex; justify-content: center; }
.wiz-inner { width: min(880px, 100%); padding: 40px 32px 48px; }
.wiz-hero { border-radius: var(--r-lg); overflow: hidden; margin-bottom: 24px; }
.wiz-hero img { width: 100%; aspect-ratio: 16/7; object-fit: cover; }

/* On a wide screen a set up step reads as a column of picture and a
   column of questions, which fits in one view instead of scrolling
   for no reason. The photo is capped so it does not run the height. */
@media (min-width: 1200px) and (min-height: 720px) {
  .wiz-inner { width: min(1180px, 100%); padding: 36px 40px 40px; }
  .wiz-split { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 40px; align-items: start; }
  .wiz-hero { margin-bottom: 0; position: sticky; top: 0; }
  .wiz-hero img { aspect-ratio: 4/3; max-height: 46vh; }
  .wiz-inner h2 { font-size: clamp(2rem, 2.8vw, 2.8rem); }
}
@media (min-width: 1200px) and (max-height: 860px) {
  .wiz-inner { padding: 24px 40px 28px; }
  .wiz-hero img { max-height: 38vh; }
}

/* ---------- Kids mode: bigger everything ---------- */
.kids { --tap: 68px; }
.kids .tile-body b { font-size: 1.08rem; }
.kids .btn { font-size: 1.06rem; }
.kids .person { padding: 8px 16px 8px 8px; }

/* ---------- Stack helpers ---------- */
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 22px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Two columns means two. Left on auto-fit it became six on a wide
   monitor and every row inside it wrapped on top of itself. */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
/* minmax(0, 1fr), not 1fr. A plain 1fr track refuses to go below the
   min-content width of what is inside it, which is how a long word
   pushes a whole page sideways. */
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* People are cards, not columns of prose, so they take three across
   as soon as there is room. Six of them then read as two rows
   instead of three. */
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (min-width: 1400px) { .people-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .people-grid { grid-template-columns: minmax(0, 1fr); } }

/* The four storage zones are four short lists. On a wide screen they
   are one row, not two. */
.zone-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (min-width: 1500px) { .zone-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .zone-grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1500px) {
  .zone-grid .card > div:first-child { flex-direction: column; }
  .zone-grid .card > div:first-child > div { min-width: 0; }
  .zone-grid .card img { width: 100% !important; height: 120px !important; }
}

/* Who can do what. Fixed columns so the name, the permission and the
   button never trade places, however wide the screen is. */
/* Who is using the tablet, in the top bar, on every screen. */
.who-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 14px 4px 4px; min-height: 46px;
  border: 1.5px solid var(--hairline); border-radius: 40px;
  background: var(--chalk); text-align: left; flex: none;
  transition: border-color var(--dur) var(--ease);
}
.who-chip:hover { border-color: var(--slate-2); }
.who-chip img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.who-chip span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.who-chip b { font-weight: 700; font-size: .92rem; }
.who-chip small { color: var(--slate); font-size: .72rem; }
.who-chip[data-role="child"] { border-color: var(--violet); background: var(--violet-wash); }
.who-chip[data-role="support"] { border-color: var(--petrol); background: var(--petrol-wash); }
[data-contrast="high"] .who-chip { border-width: 2.5px; }
/* 1.42.0, her 9 October note. A child's stars, a bright orange circle in
   the top bar, always in sight. */
.star-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 46px; height: 46px; padding: 0 12px; border-radius: 999px; flex: none;
  border: 0; background: linear-gradient(180deg, #FFA51F, #F07C00); color: #fff;
  box-shadow: 0 3px 10px rgba(240,124,0,.35); cursor: pointer;
}
.star-badge b { font-size: 1.05rem; font-weight: 800; line-height: 1; }
.star-badge .star-mark { color: #FFF4C2; }
.star-badge:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.who-list { display: grid; gap: 8px; }
.who-row {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; min-height: var(--tap);
  border: 1.5px solid var(--hairline); border-radius: var(--r-md); background: var(--chalk);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.who-row:hover { border-color: var(--slate-2); background: var(--chalk-2); }
.who-row.is-me { border-color: var(--petrol); border-width: 2.5px; background: var(--petrol-wash); }
.who-row img { flex: none; }
.who-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.who-txt b { font-weight: 700; font-size: 1.04rem; }
.who-txt small { color: var(--slate); font-size: .84rem; }
.who-txt .who-what { color: var(--slate-2); font-size: .86rem; line-height: 1.35; margin-top: 4px; }

/* Who you are signed in as, and what that means here. Stated once
   at the top rather than discovered by tapping something that
   does nothing. */
.role-note {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; margin-bottom: 20px;
  border-radius: var(--r-lg); background: var(--chalk);
  border: 1px solid var(--hairline);
}
.role-note[data-role="child"] { background: var(--violet-wash); }
.role-note[data-role="support"] { background: var(--petrol-wash); }
/* A change the tablet could not keep. */
.role-note.store-note { border-color: var(--rust); background: var(--rust-wash); }
.role-note span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.role-note b { font-weight: 700; font-size: .98rem; }
.role-note small { color: var(--slate); font-size: .86rem; }
.role-note img { width: 40px; height: 40px; flex: none; }
[data-contrast="high"] .role-note { border-width: 2px; }
[data-simple="on"] .role-note small { font-size: .96rem; }

/* The permission grid. Names down the side, capabilities across
   the top, one switch per cell. Readable as a table on a tablet
   and as stacked cards on a phone. */
.perm-grid { display: grid; gap: 2px; }
.perm-head, .perm-grid-row {
  display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, 92px);
  align-items: center; gap: 10px;
}
.perm-head { padding-bottom: 10px; border-bottom: 2px solid var(--hairline); }
.perm-head span {
  font-size: .74rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--slate); text-align: center;
}
.perm-head span:first-child { text-align: left; }
.perm-grid-row { padding: 10px 0; border-bottom: 1px solid var(--hairline-2); min-height: var(--tap); }
.perm-grid-row:last-child { border-bottom: 0; }
.perm-who-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.perm-who-cell > span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.perm-who-cell b { font-weight: 700; }
.perm-who-cell small { color: var(--slate); font-size: .8rem; }
.perm-check {
  justify-self: center; width: 54px; height: 32px; border-radius: 20px;
  background: var(--hairline); border: 1.5px solid var(--hairline);
  position: relative; transition: background var(--dur) var(--ease);
}
.perm-check::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-1); transition: transform var(--dur) var(--ease);
}
.perm-check[aria-checked="true"] { background: var(--petrol); border-color: var(--petrol); }
.perm-check[aria-checked="true"]::after { transform: translateX(22px); }
[data-contrast="high"] .perm-check { border-width: 3px; }
[data-contrast="high"] .perm-check[aria-checked="true"]::after { background: #000; }
.perm-fixed {
  justify-self: center; font-size: .74rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--slate-2);
}

@media (max-width: 900px) {
  .perm-head { display: none; }
  .perm-grid-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 12px; padding: 14px 0;
  }
  .perm-who-cell { grid-column: 1 / -1; }
  /* Without the header row each switch has to say what it is. */
  .perm-check::before, .perm-fixed::before {
    content: attr(data-label); position: absolute; left: 50%; transform: translateX(-50%);
    top: -17px; font-size: .68rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--slate); white-space: nowrap;
  }
  .perm-check { position: relative; margin-top: 18px; width: 58px; height: 44px; }
  .perm-check::after { top: 6px; left: 4px; width: 32px; height: 32px; }
  .perm-check[aria-checked="true"]::after { transform: translateX(20px); }
  .perm-fixed { position: relative; margin-top: 18px; }
}

/* The version line. Quiet, at the bottom, but always in the same
   place so it can be read out over the phone. */
.version-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  margin-top: 18px; padding: 14px 16px; min-height: var(--tap);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--chalk-2);
  transition: border-color var(--dur) var(--ease);
}
.version-row:hover { border-color: var(--slate-2); }
.version-row > span:first-child { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.version-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.version-row small { color: var(--slate); font-size: .82rem; font-variant-numeric: tabular-nums; }
[data-contrast="high"] .version-row { border-width: 2px; }

.perm-list { display: grid; gap: 2px; }
/* On a wide screen a single full width row leaves the permission
   chip stranded a foot away from the name it belongs to. */
@media (min-width: 1300px) { .perm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 44px; } }
.perm-row {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  padding: 12px 0; border-bottom: 1px solid var(--hairline-2);
  min-height: var(--tap);
}
.perm-row:last-child { border-bottom: 0; }
.perm-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.perm-who b { font-weight: 700; }
.perm-who small { color: var(--slate); font-size: .82rem; }
.perm-what { display: flex; justify-content: flex-end; }
.perm-what .chip { white-space: nowrap; }
@media (max-width: 760px) {
  .perm-row { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 10px; }
  .perm-what { grid-column: 2 / -1; justify-content: flex-start; }
  .perm-what .chip { white-space: normal; }
}
.muted { color: var(--slate); }
.big-num { font-family: var(--font-display); font-weight: 700; font-size: 2.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.empty { padding: 34px 20px; text-align: center; color: var(--slate); border: 2px dashed var(--hairline); border-radius: var(--r-lg); }

/* ---------- Simple mode: fewer things, bigger things ---------- */
[data-simple="on"] { --step: calc(var(--base-step) * 1.16); --tap: 72px; }
[data-simple="on"] .simple-hide { display: none !important; }
[data-simple="on"] .tiles { grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); }
[data-simple="on"] .week { grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); }
/* Her 20 October: still six across in Focus Mode. The week box stops
   growing at 1656px and seven columns of 230 never fitted, so a wide
   screen shows the seven days in one row, as it does with Focus Mode off. */
@media (min-width: 1181px) {
  [data-simple="on"] .week { grid-template-columns: repeat(7, minmax(0,1fr)); }
}
[data-simple="on"] .today { grid-template-columns: 1fr; }
[data-simple="on"] .today-split { grid-template-columns: 1fr; }
/* Her order for Today in Focus Mode, point 26 of her 5 to 9 October notes,
   given 23 October. One column, so the three groups open up and every
   block takes its place: tonight, who is home, my meals, what is on, the
   tasks, next up, warnings, leftovers, last night, use soon. Anything not
   named keeps its place after them. */
[data-simple="on"] .today { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
[data-simple="on"] .today-main, [data-simple="on"] .today-side, [data-simple="on"] .today-split { display: contents; }
[data-simple="on"] .today-main > *, [data-simple="on"] .today-side > *, [data-simple="on"] .today-split > * { order: 50; }
[data-simple="on"] .today .tb-tonight { order: 1; }
[data-simple="on"] .today .tb-who { order: 2; }
[data-simple="on"] .today .tb-meals { order: 3; }
[data-simple="on"] .today [data-fold="on"] { order: 4; }
[data-simple="on"] .today [data-fold="tasks"] { order: 5; }
[data-simple="on"] .today [data-fold="next"] { order: 6; }
[data-simple="on"] .today [data-fold="warn"] { order: 7; }
[data-simple="on"] .today [data-fold="left"] { order: 8; }
[data-simple="on"] .today .tb-last { order: 9; }
[data-simple="on"] .today .tb-soon { order: 10; }
[data-simple="on"] .cook-main { grid-template-columns: 1fr; }
[data-simple="on"] .cook-side { border-left: 0; border-top: 1px solid var(--hairline); }
[data-simple="on"] .lede { font-size: 1.1rem; }

/* ---------- Motion preference ---------- */
[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Enter animation ---------- */
.enter > * { animation: up 420ms var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: 60ms }
.enter > *:nth-child(3) { animation-delay: 110ms }
.enter > *:nth-child(4) { animation-delay: 150ms }
.enter > *:nth-child(5) { animation-delay: 185ms }
@keyframes up { from { transform: translateY(12px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- Responsive: 1024 tablet. still two columns ---------- */
@media (max-width: 1180px) {
  :root { --rail: 118px; }
  .view { padding: 20px; }
  .today { grid-template-columns: minmax(0, 1.5fr) minmax(256px, 1fr); gap: 16px; }
  .today-split { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
  .today-split > section:nth-child(3) { grid-column: 1 / -1; }
  .hero { min-height: 370px; }
  .hero h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
  .week { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .rail-btn { font-size: .95rem; padding-left: 15px; }
}

/* ---------- Responsive: small tablet and phone ---------- */
@media (max-width: 1000px) {
  .today { grid-template-columns: 1fr; }
  .today-split { grid-template-columns: 1fr; }
  .today-split > section:nth-child(3) { grid-column: auto; }
  .cook-main { grid-template-columns: 1fr; }
  .cook-side { border-left: 0; border-top: 1px solid var(--hairline); }
}

@media (max-width: 760px) {
  :root { --bar: 58px; --tap: 54px; }
  /* A chip that does something is a button, so it has to be big
     enough to hit. A chip that only says something does not. */
  button.chip, a.chip { min-height: 46px; padding: 0 16px; font-size: .88rem; }
  body { font-size: 1rem; }
  .app { grid-template-columns: 1fr; }
  .rail {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0;
    height: auto; flex-direction: row; padding: 0;
    border-right: 0; border-top: 1px solid var(--hairline);
    box-shadow: 0 -2px 18px rgba(40,26,8,.10);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .brand { display: none; }
  /* The bottom bar shares its width evenly across every button,
     including Help, which used to be squeezed to 24px. */
  /* Every button in the bottom bar gets the same width, including
     Help, which sits in its own container and used to be squeezed
     down to 24px. The rail is told how many nav items there are so
     the two containers split the width in the right ratio. */
  .rail-foot { border-top: 0; margin: 0; padding: 0; display: flex; flex: 1 1 0; min-width: 0; }
  .rail-list { flex-direction: row; gap: 0; flex: var(--navcount, 7) 1 0; min-width: 0; }
  .rail-list .rail-btn, .rail-foot .rail-btn { flex: 1 1 0; min-width: 0; }
  .rail-btn {
    text-align: center; padding: 9px 1px; font-size: .72rem; min-height: 56px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    letter-spacing: -.03em; overflow: hidden;
  }
  .nav-long { display: none; }
  .nav-short { display: inline; }
  .rail-btn[aria-current="page"]::before { left: 14%; right: 14%; top: 0; bottom: auto; width: auto; height: 4px; border-radius: 0 0 4px 4px; }
  .rail-badge { margin-left: 0; min-width: 20px; padding: 0 6px; font-size: .62rem; vertical-align: 0; line-height: 1.5; }
  .main { padding-bottom: 78px; }
  /* Three controls plus the date will not fit 390px at full size.
     The date gives up its space first, then the buttons shorten.
     Nothing is allowed off the edge. */
  .bar { padding: 0 10px; gap: 6px; overflow: hidden; }
  .bar-date { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .bar .btn-sm { flex: none; }
  .bar-date b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* On a phone the chip is the face alone. Still one tap, still in
     the same place, just without the words. */
  .who-chip { padding: 4px; gap: 0; }
  .who-chip span { display: none; }
  .bar-date small { display: none; }
  .bar .btn-sm { padding: 0 10px; font-size: .78rem; min-height: 42px; }
  .view { padding: 14px; }
  .view-head h1 { font-size: 1.9rem; }
  .view-head .rest { width: 100%; }
  .hero { min-height: 300px; }
  .hero-body { padding: 20px 18px 22px; }
  .hero h2 { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  .hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .hero-actions .btn-lg { min-height: 60px; font-size: 1.06rem; padding: 0 20px; }
  .hero-corner { display: none; }
  .hero-meta [data-phone-cook] { display: inline-flex !important; }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; flex-direction: row; }
  .day-head { border-bottom: 0; border-right: 1px solid var(--hairline-2); flex: none; width: 78px; }
  .day-img { width: 96px; flex: none; aspect-ratio: auto; }
  .day-body { flex: 1; }
  .cook-step { padding: 24px 20px; }
  .cook-bar { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .cook-prog { order: 5; width: 100%; max-width: none; }
  /* The footer used to run off the right edge and cut "Skip the rest"
     in half. Two rows on a phone: the decision, then the way out. */
  .cook-foot { padding: 12px 14px; flex-wrap: wrap; row-gap: 10px; }
  .cook-foot .btn-primary { order: 1; flex: 1 1 100%; }
  .cook-foot .btn-quiet { order: 2; flex: 1 1 auto; }
  .cook-foot .btn-ghost { order: 3; flex: 1 1 auto; margin-left: 0 !important; }
  .sheet { max-height: 92vh; border-radius: var(--r-lg); }
  .sheet-head { padding: 18px 18px 12px; }
  .sheet-body { padding: 0 18px 24px; }
  .sheet-foot { padding: 14px 18px; flex-wrap: wrap; }
  .sheet-foot .btn { flex: 1; min-width: 130px; }
  .scrim { padding: 10px; align-items: flex-end; }
  .btn { padding: 0 18px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(138px,1fr)); }
  .panel { right: 10px; left: 10px; width: auto;
    max-height: calc(100dvh - var(--bar) - var(--tap) - 24px); }
  .presence-row { display: grid; grid-template-columns: 1fr 1fr; }
  .person { padding: 6px 10px 6px 6px; }
  .person img { width: 40px; height: 40px; }
  .aisle-head h3 { font-size: .9rem; }
  .shop-row { padding: 8px 6px; gap: 10px; }
  .shop-row img { width: 44px; height: 44px; }
  /* Just above the bottom nav, not floating in the middle of the
     content it is talking about. */
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  /* Every avatar used as a control gets a thumb sized target. */
  input[type="checkbox"] { width: 44px; height: 44px; }
  input[type="checkbox"]::after { width: 18px; height: 10px; }
  .celebrate b { font-size: 2.4rem; }
  .tray { right: 10px; left: 10px; bottom: 84px; width: auto; }
  .tray-list { max-height: 34vh; }
  /* Clear of the bottom bar on a phone, the same as the tray. */
  .tray-pill { right: 10px; bottom: 84px; }
  .cook .cook-bar .btn-sm { font-size: .8rem; padding: 0 10px; }
  .wiz-inner { padding: 24px 18px 44px; }
  .bar-label { flex-basis: 46%; max-width: 46%; font-size: .86rem; }
  .bar-value { min-width: 54px; font-size: .8rem; }

  /* A month has to stay a month on a phone. seven columns, no
     substitute layout. The photo carries it and the name moves
     into the day itself. */
  .cal-cell { min-height: 78px; padding: 5px 4px 6px; gap: 4px; }
  .cal-name, .cal-ev { display: none; }
  .cal-photo { aspect-ratio: 1/1; }
  .cal-num { font-size: .74rem; justify-content: center; }
  .cal-num i { display: none; }
  .cal-flag { font-size: .5rem; padding: 1px 4px; left: 3px; bottom: 3px; }
  .cal-dow span { padding: 8px 2px; text-align: center; }
  .cal-dow b { font-size: .64rem; letter-spacing: .02em; }
  .cal-jump { width: 100%; margin-left: 0; }
  .cal-jump select { flex: 1; }

  /* Tabs wrap onto a second row on a phone. Scrolling sideways to
     find a tab is a thing people miss; a second row is not. */
  .seg-scroll { overflow: visible; }
  .seg-scroll > .seg { flex-wrap: wrap; flex: 1 1 auto; }
  .seg-scroll > .seg button { flex: 1 1 auto; }
  [data-simple="on"] .cal-cell { min-height: 78px; padding: 5px 4px 6px; }
}

@media (max-width: 420px) {
  .rail-btn { font-size: .64rem; padding: 9px 0; }
  .cal-cell { min-height: 64px; }
}


/* ---------- Wide screens ----------
   A big tablet in landscape or a desktop monitor has the room to show
   a screen in one go. Use the width rather than stretching everything
   into long thin rows and pushing the rest below the fold. Nothing is
   made smaller to achieve it. */
@media (min-width: 1500px) and (min-height: 800px) {
  .view { padding: 24px 32px; }
  .today { grid-template-columns: minmax(0, 1.7fr) minmax(340px, 1fr); gap: 18px; }
  .hero { min-height: 400px; }
  .today-split { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); }
  .cal-cell { min-height: 148px; }
}

/* Very wide and short, which is most external monitors. Keep the hero
   from eating the fold. */
@media (min-width: 1500px) and (max-height: 900px) {
  .hero { min-height: 340px; }
  .week .day { min-height: 288px; }
}

/* ---------- Really wide ----------
   Past 1700px there is room to use the width rather than the height.
   The decision on Today, and the whole week on This week, both land
   inside one screen. The long lists still scroll, because a shopping
   list crammed into one view helps nobody. */
@media (min-width: 1400px) {
  .view { padding: 22px 32px 30px; }
  .today { grid-template-columns: minmax(0, 1.55fr) minmax(380px, 1fr); gap: 18px; }
  .hero { min-height: min(430px, 44vh); }
  .hero-body { padding: 24px 28px 26px; }
  .hero h2 { font-size: clamp(2rem, 3vw, 3rem); }
  .today-wide { --pad: 16px; }
  .card-pad { padding: 18px 20px; }
  .view-head { margin-bottom: 24px; }
  .presence-row { gap: 10px; }
  .week .day { min-height: min(300px, 34vh); }
  .week .day-img { aspect-ratio: 16/10; }
  .day-body { padding: 10px 12px 12px; gap: 6px; }
  .mini-row { padding: 8px 10px; }
  .reminder { padding: 10px 14px; }
  .aisle-head { margin-bottom: 8px; }
  .kids .tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .kitchen-note { margin-bottom: 12px; }
  .tile-img { aspect-ratio: 3/2; }
}

/* ---------- Print ---------- */
@media print {
  .rail, .bar, .hero-actions { display: none; }
  .app { grid-template-columns: 1fr; }
}


/* ============================================================
   TYPE REFINEMENT, Manrope
   Signed off from the side by side comparison, 28 July 2026.
     page headings and section titles   SemiBold 600
     profile names                      SemiBold 600
     meal titles                        Medium 500
     small labels                       Regular 400
     tracking +0.2 to 0.3px, line height +12 percent
   Manrope carries more colour per stroke than Poppins, so the same
   hierarchy needs one weight step less to read at the same distance.
   ============================================================ */

body { line-height: 1.62; letter-spacing: .2px; }

/* page headings and section titles */
.card-head h3, .sheet-head h2, .panel h3, .aisle-head h3,
.cook-bar b, .tray-head b, .bar-date b {
  font-weight: 600;
  letter-spacing: .3px;
}

/* meal titles */
.hero-title, .day-head b, .mark-body b, .option .ob b {
  font-weight: 500;
  letter-spacing: .25px;
  line-height: 1.16;
}

/* profile names */
.person b { font-weight: 600; letter-spacing: .3px; }

/* small labels such as Tonight · Dinner */
.eyebrow { margin-bottom: 9px; }

/* anything bold with no rule of its own */
b, strong { font-weight: 600; }

/* more air, so the lighter weights have room */
.card { padding: 22px; }
.grid-3, .grid-2, .cards { gap: 18px; }
.mini-row, .reminder, .person { margin-bottom: 10px; }


/* ============================================================
   PHONE: overlays get the whole screen
   A sheet that shows a slice of itself in a 300px window is not
   a small sheet, it is a broken one. On a phone every overlay is
   full height, the head and the actions are pinned, and only the
   middle scrolls. Nothing important can hide under the buttons.
   ============================================================ */
@media (max-width: 760px) {
  .scrim { padding: 0; align-items: stretch; }

  .sheet {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;               /* the body scrolls, not the shell */
    animation: riseUp 240ms var(--ease) both;
  }

  .sheet-head {
    flex: none;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--hairline);
    background: var(--chalk);
    padding-top: calc(16px + env(safe-area-inset-top));
  }
  .sheet-head h2 { font-size: 1.4rem; }

  .sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px 18px 24px;
  }

  .sheet-foot {
    flex: none;
    position: static;              /* pinned by flex, not by sticky */
    border-radius: 0;
    padding: 14px 18px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px rgba(40,26,8,.07);
  }
  /* The primary action is full width and first. Anything else sits
     under it rather than beside it, so a long label never squeezes
     the button that matters. */
  .sheet-foot .btn-primary { order: 1; flex: 1 1 100%; }
  .sheet-foot .btn-ghost, .sheet-foot .btn-quiet { order: 2; flex: 1 1 100%; margin-left: 0 !important; }

  /* The close is always reachable, never scrolled away. */
  .sheet-head .x { position: sticky; top: 0; }
}
@keyframes riseUp { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ============================================================
   PHONE: cooking mode, the ingredients panel
   The step and the panel were two nested scrolling boxes, so the
   quantities and the variants were cut in half by whichever box
   ran out first. On a phone the whole thing is one column that
   scrolls once, with room under the last line.
   ============================================================ */
@media (max-width: 1000px) {
  .cook-main { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .cook-step { padding: 26px 20px 22px; justify-content: flex-start; }
  .cook-side {
    overflow: visible;             /* no second scroll container */
    padding: 24px 20px 34px;
  }
  .cook-side .eyebrow { margin-bottom: 12px; }
  .cook-side .qty-row { padding: 11px 0; }
  .cook-side > .row:first-child { margin-bottom: 14px; }
}
@media (max-width: 760px) {
  .cook-step { padding: 22px 18px 20px; }
  .cook-step h2 { font-size: clamp(1.6rem, 6.4vw, 2.1rem); }
  .cook-side { padding: 22px 18px 40px; }
  /* Read these sat hard against the divider. Give the heading row
     and the last line of the list somewhere to breathe. */
  .cook-side > .row:first-child { margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
  .cook-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}


/* ============================================================
   "How much did you actually use" rows
   These had no rule of their own, so the name and the stock line
   ran together as one sentence and the controls fell wherever
   they landed. One grid: tick, what it is, how much.
   ============================================================ */
.use-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline-2);
}
.use-row:last-child { border-bottom: 0; }
.use-row > input[type="checkbox"] { margin: 0; }
.use-row .txt { min-width: 0; }
.use-row .txt b { display: block; font-weight: 600; line-height: 1.3; }
.use-row .txt small { display: block; color: var(--slate); font-size: .84rem; margin-top: 2px; }

@media (max-width: 760px) {
  /* The quantity controls get their own line rather than being
     squeezed next to a name that is already wrapping. */
  .use-row { grid-template-columns: auto minmax(0,1fr); padding: 14px 0; }
  .use-row > .row { grid-column: 1 / -1; justify-content: flex-start; gap: 8px; }
  .use-row .use-amt { width: 84px; }
}

/* ============================================================
   The star mark
   The word "stars" became a drawn star. It sits inline with the
   number it belongs to, takes the colour of its container through
   currentColor, and never wraps away from its number.
   ============================================================ */
.star-count { display: inline-flex; align-items: center; gap: .28em; white-space: nowrap; }
.star-mark { color: var(--star); }
/* On a solid or tinted chip the mark has to read against the fill,
   so it follows the text colour rather than the amber. */
.chip .star-mark,
.tile-flag .star-mark,
.btn .star-mark,
.celebrate .star-mark { color: currentColor; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================
   The match row under Add an item
   Appears the moment the app recognises what you typed, and
   carries the photograph it is about to use.
   ============================================================ */
.match-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; margin: 0 0 16px;
  border: 1px solid var(--hairline-2); border-radius: 12px;
  background: var(--chalk-1, #FBF8F3);
}
.match-row[hidden] { display: none; }
.match-row .txt { flex: 1; min-width: 0; }
.match-row .txt b { display: block; }
.match-row .txt small { color: var(--slate); }

/* ============================================================
   The month as a list

   The photograph month reads from across the kitchen. This one
   is for when you are actually planning and want the words. The
   space the photograph took goes to the meal name and to what
   else is happening that day.
   ============================================================ */
.cal-grid-list .cal-cell { min-height: 132px; align-content: start; }
.cal-cell-list { padding-bottom: 10px; }

.cal-meal {
  display: block; font-weight: 700; line-height: 1.25;
  font-size: .95rem; margin: 2px 0 6px; color: var(--ink);
  overflow-wrap: anywhere;
}
.cal-meal.none { font-weight: 500; color: var(--slate-2); }

.cal-tag {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
  background: var(--chalk-2); color: var(--slate); margin: 0 4px 6px 0;
}
.cal-tag.out { background: var(--amber-wash, #FDF0D9); color: var(--primary-ink); }
.cal-tag.plan { background: var(--petrol-wash); color: var(--petrol); }

.cal-list { display: block; border-top: 1px solid var(--hairline-2); padding-top: 6px; }
.cal-li {
  display: block; font-size: .78rem; line-height: 1.35; color: var(--slate);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* A dot rather than an icon, and a different colour per kind, so an
   appointment and a job are told apart without reading them. */
.cal-li::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--slate-2); }
.cal-li.ev::before { background: var(--violet, #7A5AA8); }
.cal-li.task::before { background: var(--jade, #146A47); }
.cal-li.more { color: var(--slate-2); font-style: italic; }
.cal-li.more::before { display: none; }

@media (max-width: 760px) {
  .cal-grid-list .cal-cell { min-height: 104px; }
  .cal-meal { font-size: .86rem; }
  .cal-li { font-size: .72rem; }
}

/* ============================================================
   The PIN pad
   A tablet on a fridge, often one handed. Big keys, and the dots
   say how far you are without showing the number.
   ============================================================ */
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 6px 0 4px; }
.pin-dot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--hairline); background: transparent;
}
.pin-dot.on { background: var(--petrol); border-color: var(--petrol); }
.pin-msg { min-height: 22px; text-align: center; color: var(--destructive-ink, #C42B2B); font-size: .9rem; font-weight: 600; margin: 4px 0 10px; }

.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-key {
  min-height: 62px; border-radius: var(--r-md); border: 1.5px solid var(--hairline);
  background: var(--chalk); font-size: 1.5rem; font-weight: 700; color: var(--ink);
}
.pin-key:active { background: var(--petrol-wash); }
.pin-key.pin-alt, .pin-key.pin-go { font-size: 1rem; }
.pin-key.pin-go { background: var(--petrol); color: #fff; border-color: var(--petrol); }

/* The carer session banner, on every screen while it is running */
.carer-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: var(--r-md);
  background: var(--violet-wash, #F0EAF8); color: var(--ink);
  margin-bottom: 18px; font-size: .92rem;
}
.carer-bar b { font-weight: 700; }
.carer-bar .rest { margin-left: auto; display: flex; gap: 8px; }
.carer-bar.ending { background: var(--amber-wash, #FDF0D9); }

/* ============================================================
   The week strip on Family Overview
   Seven nights at a glance with a way into the calendar.
   ============================================================ */
.fam-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.fam-day {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 10px; border-radius: var(--r-md); border: 1.5px solid var(--hairline);
  background: var(--chalk); min-height: 132px;
}
.fam-day:hover { background: var(--petrol-wash); }
.fam-day.is-today { border-color: var(--petrol); border-width: 2.5px; }
.fam-dow { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--slate); }
.fam-day img { width: 100%; height: 54px; object-fit: cover; border-radius: 8px; display: block; }
.fam-out, .fam-none {
  display: block; height: 54px; border-radius: 8px; background: var(--chalk-2);
  font-size: .72rem; color: var(--slate); display: flex; align-items: center; justify-content: center;
}
.fam-name { font-size: .8rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.fam-ev { font-size: .7rem; color: var(--violet, #7A5AA8); font-weight: 700; }

/* The second strip. What is on, rather than what is for dinner. */
.fam-on { min-height: 116px; }
.fam-item {
  font-size: .74rem;
  line-height: 1.3;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--chalk-2);
  overflow-wrap: anywhere;
}
.fam-item b { font-variant-numeric: tabular-nums; }
.fam-item.violet { background: var(--violet-wash, var(--chalk-2)); color: var(--violet, #5B3A78); }
.fam-item.amber { background: var(--amber-wash, var(--chalk-2)); color: var(--amber-text, var(--ink)); }
.fam-clear { font-size: .74rem; color: var(--slate-2); }

@media (max-width: 900px) {
  .fam-week { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .fam-week { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Every meal of the day
   Breakfast, lunch and snack, the per day strip and the eaten tick.
   ============================================================ */

/* The note under a meal card saying whose plate is different. It is
   deliberately not muted grey. The whole reason it exists is that it
   was being forgotten, and grey is how a screen says ignore me. */
.meal-note {
  font-size: .78rem;
  line-height: 1.35;
  color: var(--primary-ink);
  font-weight: 650;
}

/* Seven days under a person on the plan screen. A day that carries its
   own meal is filled, the rest are outlines, so a normal week looks
   normal without reading a word. */
.pm-strip {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline-2);
}
.pm-day {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  color: var(--slate);
  background: transparent;
  cursor: pointer;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  transition: background .12s ease, color .12s ease;
}
.pm-day:hover { background: var(--chalk-2); }
.pm-day.on {
  background: var(--petrol-wash);
  border-color: color-mix(in srgb, var(--petrol) 34%, transparent);
  color: var(--petrol);
}
.pm-day:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* A meal row you can tick. Same bones as a reminder row, because it is
   the same gesture and it should not have to be learned twice. */
.ate-row {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--chalk);
  transition: opacity .12s ease;
  overflow: hidden;
}
/* The row opens the recipe. The box ticks it. Two targets, both a
   comfortable size for a thumb on a fridge tablet. */
.ate-open {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  text-align: left;
  cursor: pointer;
  background: transparent;
  transition: background .12s ease;
}
.ate-open:hover { background: var(--chalk-2); }
.ate-open:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.ate-tick {
  flex: none;
  padding: 11px 15px 11px 9px;
  align-self: stretch;
  display: flex;
  align-items: center;
  cursor: pointer;
  background: transparent;
  border-left: 1px solid var(--hairline-2);
  transition: background .12s ease;
}
.ate-tick:hover { background: var(--chalk-2); }
.ate-tick:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.ate-open img {
  width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex: none;
}
.ate-open .ate-blank {
  width: 46px; height: 46px; border-radius: 9px; background: var(--chalk-2); flex: none;
}
.ate-open .txt { flex: 1; min-width: 0; }
.ate-open .txt b { display: block; font-weight: 700; font-size: .98rem; line-height: 1.25; }
.ate-open .txt small { color: var(--slate); font-size: .8rem; }
/* On a phone the meal's name had 74px between its picture and Skip it.
   A little less padding everywhere in the row gives it about 30px back. */
@media (max-width: 560px) {
  .ate-open { padding: 10px; gap: 10px; }
  .ate-open img, .ate-open .ate-blank { width: 40px; height: 40px; }
  .ate-skip { padding: 0 6px; }
  .ate-tick { padding: 10px 10px 10px 6px; }
}
.ate-row.done { opacity: .62; }
.ate-row.done .txt b { text-decoration: line-through; }

/* Skipped is an answer, so it fades the same way an eaten row does,
   but it never draws the green tick. A blank row and a skipped row have
   to look different or the screen cannot say which meals are still
   waiting on somebody. */
.ate-row.skipped { opacity: .62; }
.ate-row.skipped .txt b { text-decoration: line-through; }
.ate-row.skipped .tickbox { border-style: dashed; }
.ate-skip {
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  color: var(--slate);
  padding: 0 10px;
  min-height: var(--tap);
  white-space: nowrap;
}
.ate-skip:hover { color: var(--petrol); text-decoration: underline; text-underline-offset: 3px; }

/* The filled tick. This lived only under .reminder, so an eaten meal
   struck its own name out and left an empty circle beside it, which is
   the one part of the row a person actually looks at. */
.ate-tick:hover .tickbox { border-color: var(--petrol); }
.ate-row.done .tickbox { background: var(--jade); border-color: var(--jade); }
.ate-row.done .tickbox::after { border-color: #fff; }

/* A day that is not the standing meal earns a quiet mark, so the row
   explains itself rather than looking like a mistake. */
.ate-open .just-today {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--primary-ink);
}

@media (max-width: 560px) {
  .pm-day { font-size: .66rem; padding: 6px 7px; }
}


/* ---------- eating notes ----------
   What somebody has been told about how they eat, put in front of the
   cook. Amber rather than red: this is guidance to follow, not an
   allergy that removes the meal. */
.cook-notes { margin-top: 22px; }
.cook-note {
  background: var(--chalk-2);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 10px;
}
.cook-note b { display: block; font-size: .96rem; }
.cook-note small { display: block; margin-bottom: 5px; }
.cook-note p { margin: 0; font-size: .88rem; line-height: 1.45; }


/* One meal, then the next. A row of tiles under a small grey label read
   as one long list of food, so the slot gets a real heading and a rule
   under it. */
.slot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 30px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--hairline);
}
.slot-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  margin: 0;
}
.slot-head small { font-size: .84rem; }

/* ============================================================
   Batch L. Who is home, and the week by person.
   ============================================================ */

/* Who is home. One face each, five to a line on every screen, the name
   and the answer under the face. Her 29: smaller tiles, five to a line. */
.who-home {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 640px;
}
.wh {
  --pc: var(--slate);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 3px; min-width: 0; min-height: var(--tap);
  padding: 8px 4px 7px;
  border-radius: 14px;
  border: 1.5px solid var(--hairline);
  background: var(--chalk);
  font: inherit; color: inherit; text-align: center;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
button.wh { cursor: pointer; }
button.wh:hover { border-color: var(--slate-2); }
button.wh:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.wh img {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none;
  box-shadow: 0 0 0 2px var(--chalk), 0 0 0 4px var(--pc);
  transition: filter var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.wh-name {
  font-family: var(--font-display); font-weight: 700; font-size: .9rem; line-height: 1.15;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wh-word { font-size: .72rem; font-weight: 700; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; color: var(--slate); }
.wh[data-state="home"] { border-color: color-mix(in srgb, var(--jade) 45%, transparent); background: var(--jade-wash); }
.wh[data-state="home"] .wh-word { color: var(--jade); }
.wh[data-state="off"] { border-color: color-mix(in srgb, var(--amber) 50%, transparent); background: var(--amber-wash); }
.wh[data-state="off"] .wh-word { color: var(--amber-text); }
.wh[data-state="away"] img { filter: grayscale(1); opacity: .5; }
.wh[data-state="away"] .wh-word { color: var(--rust); }
.wh[data-state="unknown"] img { filter: grayscale(.75); opacity: .72; }
[data-contrast="high"] .wh { border-width: 3px; }

/* Over the dinner picture. The words stay white and the state shows in
   the ring, the face and the tint, so it reads on any photograph. */
.who-home.on-photo { max-width: 560px; margin: 0 0 16px; gap: 6px; }
.who-home.on-photo .wh {
  background: rgba(8, 16, 15, .5); border-color: rgba(255, 255, 255, .3);
  color: #fff; backdrop-filter: blur(8px); padding: 6px 3px;
}
.who-home.on-photo .wh img { width: 36px; height: 36px; box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 0 0 4px var(--pc); }
.who-home.on-photo .wh-name { font-size: .8rem; }
.who-home.on-photo .wh-word { color: rgba(255, 255, 255, .9); font-size: .66rem; }
.who-home.on-photo .wh[data-state="home"] { background: rgba(8, 60, 50, .62); border-color: rgba(120, 220, 190, .7); }
.who-home.on-photo .wh[data-state="off"] { background: rgba(80, 55, 10, .6); border-color: rgba(255, 200, 110, .7); }
.who-home.on-photo .wh[data-state="away"], .who-home.on-photo .wh[data-state="unknown"] { background: rgba(8, 16, 15, .42); }
[data-contrast="high"] .who-home.on-photo .wh { background: #000; border-color: #fff; }

@media (max-width: 760px) {
  .who-home { gap: 5px; }
  .wh { padding: 6px 2px; border-radius: 12px; }
  .wh img { width: 34px; height: 34px; }
  .wh-name { font-size: .76rem; }
  .wh-word { font-size: .64rem; }
  .who-home.on-photo .wh img { width: 30px; height: 30px; }
}

/* The Unplanned tile on the meals sheet. */
.tile-unplanned .day-empty { font-weight: 700; color: var(--slate); background: var(--chalk-2); }

/* The week by person. Seven days across and one row each. It needs a wide
   window to show all seven, so anything narrower scrolls sideways inside
   this box and never the page, and the names stay put while it moves. */
.wbp-scroll {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  border-radius: var(--r-md);
}
.wbp-scroll:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.wbp {
  display: grid;
  grid-template-columns: 140px repeat(7, minmax(156px, 1fr));
  gap: 6px;
  min-width: 1274px;
}
.wbp-row { display: contents; }
.wbp-head {
  padding: 6px 10px; border-radius: 10px; background: var(--chalk-2);
  display: flex; flex-direction: column; line-height: 1.2;
}
.wbp-head b { font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.wbp-head small { color: var(--slate); font-size: .74rem; }
.wbp-head.is-today { background: var(--petrol-wash); }
.wbp-corner {
  justify-content: center; font-size: .72rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--slate);
  position: sticky; left: 0; z-index: 2;
}
.wbp-name {
  position: sticky; left: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 8px 8px 8px 4px; background: var(--chalk);
  box-shadow: 6px 0 8px -8px rgba(0,0,0,.25);
}
.wbp-name .avatar { width: 38px; height: 38px; }
.wbp-name > span { display: flex; flex-direction: column; min-width: 0; align-items: flex-start; }
.wbp-name b { font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.wbp-name small { color: var(--slate); font-size: .76rem; }
.wbp-usual {
  font: inherit; font-size: .76rem; font-weight: 700; color: var(--petrol);
  background: none; border: 0; padding: 4px 0; min-height: 32px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.wbp-cell {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--hairline); border-radius: 12px; background: var(--chalk); overflow: hidden;
}
.wbp-cell.is-today { border-color: var(--petrol); border-width: 2px; }
.wbp-line {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
  padding: 6px 10px; border: 0; border-bottom: 1px solid var(--hairline-2);
  background: none; font: inherit; color: inherit; text-align: left; min-height: 40px; justify-content: center;
}
button.wbp-line { cursor: pointer; }
button.wbp-line:hover { background: var(--chalk-2); }
button.wbp-line:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.wbp-line:last-child { border-bottom: 0; }
.wbp-slot { font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--slate); }
.wbp-meal { font-size: .82rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.wbp-flag { font-size: .6rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--jade); }
.wbp-line.is-day { background: var(--petrol-wash); }
.wbp-line.is-day .wbp-slot { color: var(--petrol); }
.wbp-line.is-empty .wbp-meal { color: var(--slate-2); font-weight: 500; }
.wbp-line.is-unplanned .wbp-meal { color: var(--slate); font-style: italic; }
.wbp-line.is-out .wbp-meal { color: var(--rust); }
.wbp-dinnerline { background: var(--chalk-2); }
.wbp-on {
  display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; margin-top: auto;
  background: var(--violet-wash); color: var(--violet); font-size: .74rem; font-weight: 600; line-height: 1.25;
}
.wbp-on b { font-variant-numeric: tabular-nums; }
.wbp-night { padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.wbp-night img, .wbp-night .wbp-none { width: 100%; height: 62px; object-fit: cover; display: block; background: var(--chalk-2); }
.wbp-night .wbp-meal { padding: 6px 10px 8px; }

/* What is on, and the tasks, day by day, in the same box so the three
   strips line up as one week. */
.wbd {
  display: grid;
  grid-template-columns: repeat(7, minmax(136px, 1fr));
  gap: 8px;
  min-width: 1008px;
}
.wbd-day {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 120px;
  padding: 10px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--chalk);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.wbd-day:hover { background: var(--petrol-wash); }
.wbd-day:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.wbd-day.is-today { border-color: var(--petrol); border-width: 2px; }
.wbd-dow { display: flex; flex-direction: column; line-height: 1.2; margin-bottom: 2px; }
.wbd-dow b { font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.wbd-dow small { color: var(--slate); font-size: .74rem; }
.wbd-item {
  display: block; padding: 6px 8px; border-radius: 8px; background: var(--chalk-2);
  font-size: .8rem; line-height: 1.3; overflow-wrap: anywhere;
}
.wbd-item b { font-variant-numeric: tabular-nums; }
.wbd-item small { display: block; color: var(--slate); font-size: .72rem; margin-top: 2px; }
.wbd-item.violet { background: var(--violet-wash); color: var(--violet); }
.wbd-item.violet small { color: inherit; opacity: .85; }
.wbd-item.amber { background: var(--amber-wash); color: var(--amber-text); }
.wbd-item.amber small { color: inherit; opacity: .85; }
.wbd-item.task b { font-weight: 600; display: block; }
.wbd-item.task.done { opacity: .6; text-decoration: line-through; }
.wbd-clear, .wbd-more { font-size: .76rem; color: var(--slate-2); }
.wbd-more { font-weight: 700; color: var(--slate); }
[data-contrast="high"] .wbp-cell, [data-contrast="high"] .wbd-day { border-width: 2px; }

/* On a phone the names take less of the width, so a day and a half of
   the week shows beside them. */
@media (max-width: 760px) {
  .wbp { grid-template-columns: 92px repeat(7, minmax(148px, 1fr)); min-width: 1170px; }
  .wbp-name { flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 4px; }
  .wbp-name .avatar { width: 32px; height: 32px; }
  .wbp-name b { font-size: .9rem; }
}

/* ============================================================
   Batch L, the second half. Today's side, every warning, the member
   page and the child page. Drawn for a laptop browser first, 1440 and
   1280 wide, then checked at 1024, 768 and 390.
   ============================================================ */

/* Today. The picture and the leftovers under it on the left, the menus
   that fold on the right, the three way split across the bottom. The
   picture keeps its own height rather than stretching to match a long
   side, which is why the leftovers sit under it. */
.today { align-items: start; }
.today-main, .today-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tonight-notes { padding: 12px 16px; border-radius: 12px; background: var(--chalk-2); }
.tonight-notes > .row:first-child, .tonight-notes > p + .row { margin-top: 0 !important; }
.tonight-notes p + .row { margin-top: 10px !important; }
.today-split { align-items: start; }
@media (min-width: 1181px) {
  html:not([data-simple="on"]) .today-split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); }
}
.fold-extra { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.today-meals { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.today-meals > .card { height: auto; }

/* A menu on the side. The Hide and Show button only exists where there
   is a side, from 1001 wide, and never in Focus Mode, where the screen is
   one column. Narrower, every menu is simply open. */
.side-fold .card-head { align-items: center; flex-wrap: wrap; row-gap: 6px; }
.side-fold .fold-count { white-space: nowrap; }
.side-fold .card-head h3 { flex: 1 1 auto; min-width: 0; }
.fold-toggle {
  display: none; align-items: center; justify-content: center;
  min-height: 36px; min-width: 64px; padding: 0 12px; margin-left: 10px;
  border-radius: 999px; border: 1px solid var(--hairline); background: var(--chalk);
  font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.fold-toggle:hover { background: var(--petrol-wash); }
.fold-toggle:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.side-fold[data-folded="1"] .card-head { margin-bottom: 0; }
@media (min-width: 1001px) {
  html:not([data-simple="on"]) .fold-toggle { display: inline-flex; }
  html:not([data-simple="on"]) .side-fold[data-folded="1"] > .fold-body { display: none; }
}
@media (max-width: 1000px) {
  .side-fold[data-folded="1"] .card-head { margin-bottom: 17px; }
}
/* 1.42.0. In Focus Mode, Next up and Tasks today fold at any width. */
html[data-simple="on"] .side-fold[data-focus="1"] .fold-toggle { display: inline-flex; }
html[data-simple="on"] .side-fold[data-focus="1"][data-folded="1"] > .fold-body { display: none; }
html[data-simple="on"] .side-fold[data-focus="1"][data-folded="1"] .card-head { margin-bottom: 0; }

/* Every warning, drawn the one way. Rust is now, amber is soon. */
.warn-list { display: flex; flex-direction: column; gap: 8px; }
.warn {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 12px; background: var(--amber-wash);
}
.warn[data-level="rust"] { background: var(--rust-wash); }
.warn .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.warn .txt b { line-height: 1.3; overflow-wrap: anywhere; }
.warn .txt small { color: var(--slate); line-height: 1.35; }
.warn .btn { flex: none; }
.warn .avatar { width: 38px; height: 38px; }
.warn-mark {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--chalk); color: var(--rust); font-weight: 800; font-size: 1.1rem;
}
/* An allergy is still the loudest thing in the list: a full rust edge. */
.warn[data-kind="allergy"] { box-shadow: inset 0 0 0 1.5px var(--rust); }
[data-contrast="high"] .warn { border: 2px solid currentColor; }

/* What is on today, a line for each person. */
.today-on { display: flex; flex-direction: column; }
.on-person {
  display: grid; grid-template-columns: 38px minmax(56px, 88px) minmax(0, 1fr);
  gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hairline-2);
}
.on-person:last-child { border-bottom: 0; }
.on-person .avatar, .on-all { width: 38px; height: 38px; }
.on-all { border-radius: 50%; background: var(--petrol-wash); }
.on-name b { font-size: .95rem; overflow-wrap: anywhere; }
.on-what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.on-item { display: block; padding: 4px 8px; border-radius: 8px; background: var(--chalk-2); font-size: .86rem; line-height: 1.3; overflow-wrap: anywhere; }
.on-item b { font-variant-numeric: tabular-nums; }
.on-item.violet { background: var(--violet-wash); color: var(--violet); }
.on-item.amber { background: var(--amber-wash); color: var(--amber-text); }
.on-what .muted { font-size: .86rem; }

/* The meal card, her 27. What is already made sits by the picture. */
.day-leftovers { margin-bottom: 18px; }
.day-leftovers .mini-row { gap: 12px; }

/* The member page, her 32. Tonight as a smaller picture, with who is home
   on it the way Today has it. */
.hero.member-dinner { min-height: 300px; border-radius: var(--r-lg); box-shadow: none; }
.hero.member-dinner .hero-body { padding: 22px 22px 20px; }
.hero.member-dinner h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 8px; }
.hero.member-dinner .hero-actions { display: flex; }
.member-warn .warn-list { gap: 8px; }

/* The child page, her 34 and 35. Three across the top where there is a
   side's worth of room, one under the other where there is not. */
.kid-top {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px; align-items: start; margin-bottom: 20px;
}
.kid-top > .card { min-width: 0; }
.kid-dinner { margin-top: 12px; border-radius: 14px; overflow: hidden; background: var(--chalk-2); }
.kid-dinner img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.kid-dinner-none { display: block; aspect-ratio: 16 / 5; background: var(--petrol-wash); }
.kid-dinner-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.kid-dinner-body b { font-size: 1.35rem; line-height: 1.2; }
.kid-dinner-body small { color: var(--slate); font-size: .95rem; }
.kid-dinner-body .btn { margin-top: 8px; }
@media (min-width: 1001px) and (max-width: 1180px) {
  .kid-top { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .kid-top > .kid-food { grid-row: span 2; }
}
@media (max-width: 1000px) {
  .kid-top { grid-template-columns: 1fr; }
}

/* ============================================================
   1.46.0, the calmer look, 4 November 2026
   She saw each of these as a before and after and said yes to all.
   ============================================================ */

/* Labels that were small spaced capitals read in ordinary letters. */
.tile-flag, .dm-slot, .dm-flag, .cal-flag, .cal-tag, .wbp-slot, .wbp-flag, .wbp-corner,
.ate-open .just-today, .perm-head span, .fam-dow, .cal-dow b, .cal-num i { text-transform: none; letter-spacing: 0; }
.tile-flag { font-size: .78rem; font-weight: 700; }
.dm-slot { font-size: .8rem; font-weight: 700; }
.dm-flag, .cal-flag, .cal-tag, .wbp-slot, .wbp-flag, .cal-num i { font-size: .72rem; }
.aisle-head h3 { text-transform: none; letter-spacing: -.01em; font-size: 1.25rem; }

/* A short grey paragraph reads as one piece, not as separate lines. */
.card small.muted, .card .muted { line-height: 1.45; }

/* Tonight. The plain facts are one line of words, and the food that
   needs using keeps the only pill, so the reason stands out. */
.hero-facts {
  margin: 0 0 12px; color: rgba(255,255,255,.94);
  font-size: 1.08rem; font-weight: 600; text-shadow: 0 1px 8px rgba(0,0,0,.45);
}
.hero-meta .chip.reason {
  background: rgba(255,244,220,.94); color: #5C3300; border-color: transparent;
  backdrop-filter: none; font-size: .9rem; padding: 7px 14px;
}
[data-contrast="high"] .hero-meta .chip.reason { background: #fff; color: #000; border-color: #000; }
.cook-btn {
  align-items: center; min-height: 40px; padding: 0 14px; border-radius: 30px;
  background: rgba(8,16,15,.55); color: #fff; border: 1px solid rgba(255,255,255,.55);
  font: 700 .86rem/1 var(--font-body);
}
.cook-btn u { text-underline-offset: 3px; font-weight: 600; }

/* Yesterday's question. The answers are one shape, one under the other,
   so none looks like the right answer, and Not now is a quiet link. */
.tb-last-q { display: block; font-size: 1.04rem; line-height: 1.3; margin-bottom: 6px; }
.tb-last small.muted { display: block; }
.tb-last .answers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 16px; }
.tb-last .answers .btn { width: 100%; min-height: 48px; justify-content: center; }
.tb-last .answers .btn-ghost { min-height: 40px; color: var(--slate); text-decoration: underline; text-underline-offset: 3px; }

/* This week. Week, Month and List in one row; on a phone Calendar
   joins them there. */
.mode-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 14px; }
.mode-row .seg { margin: 0; }
.cal-link { display: none; }

/* Recipes. Search, then the kind of meal as one row of choices, then the
   extra filters in a quieter row with a word to say what they are. Three
   photographs across on a tablet rather than five small ones. */
.rq-find { margin-bottom: 26px; }
.rq-find input[type="search"] { min-height: 56px; }
.rq-kinds { display: flex; width: 100%; margin-bottom: 12px; }
.rq-kinds .seg-btn { flex: 1 1 0; }
.rq-extras { gap: 8px 5px; }
.rq-lbl { flex: none; color: var(--slate); font-size: .84rem; font-weight: 600; margin-right: 2px; }
.rq-extras .chip { min-height: 40px; padding: 0 10px; font-size: .8rem; }
.rq-extras .chip:not(.chip-petrol) { background: var(--chalk); color: var(--ink-2); border-color: var(--hairline); }
.tiles.rq-tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rq-tiles .tile-img { aspect-ratio: 16 / 10; }

/* The top of every screen. The buttons sit on the heading's line when
   there is room, rather than alone on a row of their own. */
.view-head > div:first-child { flex: 1 1 340px; min-width: 0; }
.view-head .lede { max-width: 46ch; }

/* Help Me and the short date only exist on a phone. */
.bar-help, .bar-date .bar-date-short { display: none; }

@media (min-width: 761px) {
  .rail-list { padding: 0 6px; }
  .rail-btn { border-radius: 12px; padding: 10px 6px 10px 12px; }
  .rail-btn .nav-long { white-space: nowrap; }
}

@media (max-width: 760px) {
  /* The bottom bar: five words that can be read, not nine squeezed.
     Kitchen, Money and The house are at the top of More, and Help Me is
     in the top bar, where it no longer splits over two lines. */
  .rail { padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
  .rail-list { gap: 4px; }
  .rail-foot { display: none; }
  .rail-list .rail-btn[data-phone="more"] { display: none; }
  .rail-btn { border-radius: 14px; flex-direction: row; gap: 6px; }
  .rail[data-phone-count="4"] .rail-btn, .rail[data-phone-count="5"] .rail-btn {
    font-size: .9rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink-2);
    min-height: 52px; padding: 6px 2px;
  }
  .rail[data-phone-count="6"] .rail-btn { font-size: .8rem; font-weight: 600; letter-spacing: -.01em; padding: 6px 1px; }
  .rail-btn[aria-current="page"] { color: var(--primary-ink); }
  .rail-badge { font-size: .7rem; min-width: 22px; line-height: 1.6; }
  .bar-help {
    display: inline-flex; align-items: center; flex: none; min-height: 42px; padding: 0 12px;
    border-radius: 12px; border: 1.5px solid var(--primary); background: var(--chalk);
    color: var(--primary-ink); font: 600 .84rem/1 var(--font-display);
  }
  .bar-help[aria-current="page"] { background: var(--petrol-wash); }
  .bar-date b:first-child { display: none; }
  .bar-date .bar-date-short { display: block; }

  /* Tonight gets shorter, so the next thing on Today shows on the first
     screen. Start cooking leads, Not tonight sits beside it, quieter. */
  .hero { min-height: 0; }
  .hero-body { padding: 18px; }
  .hero h2 { font-size: 2.05rem; line-height: 1.02; margin: 6px 0 8px; }
  .hero-facts { font-size: .98rem; margin-bottom: 10px; }
  .hero-meta { gap: 8px; margin-bottom: 14px; align-items: center; }
  .hero-meta .chip.reason { font-size: .86rem; }
  .who-home.on-photo { margin-bottom: 14px; }
  .hero-actions { grid-template-columns: 1.7fr 1fr; gap: 8px; }
  .hero-actions .btn-lg { min-height: 56px; padding: 0 12px; }
  .hero-actions .btn-lg:only-child { grid-column: 1 / -1; }
  .hero-actions .btn-lg + .btn-lg { background: transparent; border-color: rgba(255,255,255,.4); font-size: .98rem; backdrop-filter: none; }

  /* The top of a screen takes about a third of the first screen, not all
     of it: one sentence under the heading, and the buttons share a row. */
  .view-head { margin-bottom: 14px; gap: 0; }
  .view-head h1 { font-size: 2rem; }
  .view-head .lede { margin-top: 4px; font-size: 1rem; line-height: 1.45; }
  .lede-more { display: none; }
  .view-head .rest { gap: 8px; margin-top: 14px; }
  .view-head .rest > .btn { flex: 1 1 140px; min-height: 50px; padding: 0 10px; }

  .mode-row { margin-bottom: 10px; }
  .mode-row .seg { flex: 1 1 auto; display: flex; }
  .mode-row .seg-btn { flex: 1 1 0; min-height: 46px; padding: 0 6px; font-size: .95rem; }
  .cal-link { display: inline-flex; flex: none; min-height: 46px; padding: 0 14px; font-size: .95rem; }

  /* Earlier, This week and Later read across one row, as a stepper. */
  .weekbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px; margin-bottom: 14px; }
  .weekbar > :nth-child(n+4) { grid-column: 1 / -1; }
  .weekbar .wb-cal { display: none; }
  .weekbar .btn { min-height: 46px; padding: 0 12px; font-size: .95rem; }
  .weekbar [data-action="week-shift"][data-n="-1"]::before { content: "‹ "; }
  .weekbar [data-action="week-shift"][data-n="1"]::after { content: " ›"; }
  .weekbar-now { min-width: 0; }
  .weekbar-now b { font-size: 1.12rem; }
  .weekbar-now small { font-size: .82rem; }

  /* The day card. The day name sat in a 78px column with a line beside
     it, left over from before each person's meals joined the card. Now
     the photo sits beside the dinner and the meals sit underneath in
     pairs. */
  .day { flex-direction: column; }
  .day-open { display: grid; grid-template-columns: 116px minmax(0, 1fr); grid-template-areas: "img head" "img body"; }
  .day-head { grid-area: head; width: auto; border: 0; padding: 12px 14px 0; display: flex; gap: 8px; align-items: baseline; }
  .day-head small { font-size: .86rem; }
  .day-img { grid-area: img; width: 116px; height: 100%; min-height: 116px; aspect-ratio: auto; }
  .day-body { grid-area: body; padding: 4px 14px 14px; }
  .day-mine { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .day-meal { border-bottom: 1px solid var(--hairline-2); padding: 9px 14px; }
  .day-meal:nth-child(odd) { border-right: 1px solid var(--hairline-2); }
  .dm-meal { white-space: normal; font-size: .9rem; }

  .tiles.rq-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  /* Five kinds of meal do not fit one row on a phone; the row wraps, the
     way every other choice row does at this size. */
  .rq-kinds { flex-wrap: wrap; }
  .cal-flag { font-size: .54rem; padding: 1px 3px; }
  .rq-kinds .seg-btn { flex: 1 1 auto; min-height: 44px; }
}

/* Kitchen, Money and The house lead More on a phone only. */
@media (min-width: 761px) { .more-group.phone-only { display: none; } }

/* 1.49.0, Matt's notes of 15 November. A medicine already on the shopping
   list says so in a strip across its warning, in place of the button. */
.on-list { flex-wrap: wrap; }
.on-list-strip {
  flex: 1 1 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 6px; padding: 8px 12px; border-radius: 10px;
  background: var(--jade-wash); color: var(--jade); font-weight: 700;
}
.on-list-tick {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--jade); color: var(--chalk); font-size: .8rem;
}
.on-list-words { flex: 1 1 140px; min-width: 140px; }
.on-list-strip .btn { flex: none; }

/* 1.49.0. Just my day, the switch at the top of the organiser's Today. */
.just-me-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 16px; }
.just-me-note { flex: 1 1 260px; min-width: 140px; margin: 0; color: var(--slate); font-size: .88rem; line-height: 1.4; }

/* 1.49.0. Dinner as a row of a child's meals today. No tick, because it
   is the shared meal, so the right hand side says Tonight. */
.ate-tonight {
  flex: none; align-self: stretch; display: grid; place-items: center; padding: 0 14px;
  font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--primary-ink); border-left: 1px solid var(--hairline-2);
}
.ate-dinner.away { opacity: .62; }

/* 1.49.0. A photo picked on the add someone sheet. */
.photo-pick { align-items: center; flex-wrap: wrap; }
.photo-pick-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; background: var(--chalk-2); }
.on-list-strip .on-list-words { color: var(--jade); font-weight: 700; text-align: left; flex: 1 1 140px; min-width: 140px; }
.on-list-strip .on-list-tick { color: #fff; }
