/* ==========================================================================
   Field Guide: a drop-in theme for Shaken, Stirred & Sautéed (Vivid botanical · warm night)
   The collection as a kitchen herbarium printed in three clear, saturated
   inks, like a modern botanical print. Same layout, type, drawings and
   behaviour as Field Guide (final); only the colour has changed. Every
   recipe is a specimen sheet with its own drawing; each section is a family
   with its own ink and its own plate drawing:

     Baking     Persimmon  #bf440f / dark #f6a466
     Cooking    Holly      #00512f / dark #4fbd88
     Cocktails  Gentian    #0056bd / dark #5f97ea

   Paper is near-white with only a whisper of tint; colour comes from the
   ink, not from tinted backgrounds. The inks differ in lightness as well
   as hue (light: persimmon 46, gentian 38, holly 30 L*; dark: persimmon 74,
   holly 69, gentian 62 L*). After dark the baking ink is lifted so that
   orange and blue, the pair most often side by side, differ clearly in
   lightness (relative luminance .47 / .40 / .31).

   One custom property, --section, carries the family ink. It is set on
   tabs, cards, badges and the whole page (body:has(...)), and every
   coloured part reads it, so a recipe page turns its family colour.

   Per-recipe drawings: 29 single-line icons in ./icons, shown with CSS
   masks keyed on [data-icon]. They sit in each card's spine and large in
   the recipe header. The family plates stay on the tabs and empty state.

   Dark mode is "the herbarium cabinet after dark": a warm charcoal
   board (from Spice cabinet), sheets lifted a step, inks as clear
   saturated mid-tones (never neon, never pastel), drawings 86% ink.

   Flat colour and crisp lines only: no shadows that fake depth, no
   gradients that pretend to be light, no hatching, no grain.

   Type: Fraunces (titles only), Schibsted Grotesk (all reading text),
   IBM Plex Mono (small label fields). All SIL OFL, in ./fonts.
   ========================================================================== */

@font-face {
  font-family: "FGP Fraunces";
  src: url("./fonts/fraunces-latin-full-normal.woff2") format("woff2-variations"),
       url("./fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "FGP Fraunces";
  src: url("./fonts/fraunces-latin-full-italic.woff2") format("woff2-variations"),
       url("./fonts/fraunces-latin-full-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "FGP Schibsted";
  src: url("./fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2-variations"),
       url("./fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "FGP Plex Mono";
  src: url("./fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "FGP Plex Mono";
  src: url("./fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

/* ===== Tokens ===== */
:root {
  /* Paper and ink */
  --bg: #f3f4f1;            /* mounting board: near-white with a whisper of green */
  --surface: #fdfdfc;       /* the specimen sheet */
  --surface-2: #e7e9e5;     /* pressed / sunken */
  --text: #111715;          /* printer's ink, a hair off black */
  --muted: #4b524e;         /* graphite */
  --border: #d4d8d3;        /* hairline rule */
  --rule-strong: #7c837e;   /* control edges, 3:1 on board */
  --accent: #111715;        /* neutral "chosen": plain ink */
  --accent-contrast: #fdfdfc;
  --lime: #cadd4c;          /* specimen tape (fill only, never text) */
  --on-lime: #111715;
  --focus: #111715;
  --scrim: rgba(10, 14, 16, .4);

  /* The three families: ink (text-safe), wash (tint behind ink), paper (page tint),
     fill (solid "chosen" state) and the text that sits on that fill. */
  --baking: #bf440f;    --baking-wash: #fdf4ef;    --baking-paper: #f7f4f2;    --baking-fill: #bf440f;
  --cooking: #00512f;   --cooking-wash: #eef7f2;   --cooking-paper: #f2f5f3;   --cooking-fill: #00512f;
  --cocktails: #0056bd; --cocktails-wash: #f2f5fd; --cocktails-paper: #f3f4f7; --cocktails-fill: #0056bd;
  --on-family: #ffffff;     /* text on a small solid ink stamp (badge, tick, step number) */
  --on-fill: #ffffff;       /* text on the larger "chosen" fill (tab, option, button) */
  /* Inside a family, the sheet and its hairlines take a faint family tint. */
  --baking-sheet: #fffdfc;    --baking-line: #e4d8d1;
  --cooking-sheet: #fcfefd;   --cooking-line: #d1ddd6;
  --cocktails-sheet: #fdfdff; --cocktails-line: #d7dae5;

  /* Neutral defaults, overridden per family below */
  --section: var(--text);
  --section-wash: var(--surface-2);
  --section-paper: var(--bg);
  --section-fill: var(--text);
  --on-section: var(--accent-contrast);
  --on-section-fill: var(--accent-contrast);

  /* Drawings: how much of the family ink a drawing takes (the rest is page ink).
     100% in light mode; 86% after dark, a touch softer. */
  --draw-mix: 100%;
  /* Done lines: a clear strike in the family ink, over readable graphite. */
  --strike: 2px;

  /* Shape */
  --radius: 4px;
  --radius-ctl: 6px;
  --rule: 1.5px;

  /* Type */
  --display: "FGP Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "FGP Schibsted", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--display);
  --mono: "FGP Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --soft: "SOFT" 100, "WONK" 0;

  /* Glyphs (data URIs are allowed by img-src data:) */
  --chk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.4l2.9 2.9 5.9-6.6' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --ico-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='8' cy='9' r='5.6'/%3E%3Cpath d='M8 6v3.2l2 1.3M6.4 1.8h3.2'/%3E%3C/g%3E%3C/svg%3E");
  --ico-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.4l2.9 2.9 5.9-6.6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ===== Dark: the herbarium cabinet after dark =====
   Warm charcoal board (never pure black), sheets lifted one step,
   the three inks as clear, saturated mid-tones (bright, never neon),
   drawings slightly softened. Body text is a warm soft white at 12-14:1,
   not paper-white. Shading stays flat.
   theme.js sets data-theme from the header toggle, or from the system
   setting when nothing is saved. Screen only, so printing stays light. */
@media screen {
  :root[data-theme="dark"] {
    --bg: #15120f;
    --surface: #1d1b17;
    --surface-2: #27231f;
    --text: #e4dfd6;
    --muted: #afa89e;
    --border: #312d29;
    --rule-strong: #6f6963;
    --accent: #e4dfd6;
    --accent-contrast: #15120f;
    --lime: #b9cc55;
    --on-lime: #15120f;
    --focus: #c9da7c;
    --scrim: rgba(8, 6, 4, .62);

    --baking: #f6a466;    --baking-wash: #2f2219;    --baking-paper: #181410;    --baking-fill: #4a2616;
    --cooking: #4fbd88;   --cooking-wash: #1a271f;   --cooking-paper: #121512;   --cooking-fill: #0e3222;
    --cocktails: #5f97ea; --cocktails-wash: #1d2331; --cocktails-paper: #121318; --cocktails-fill: #0d2448;
    --on-family: #15120f;
    --on-fill: #ece6dc;
    --baking-sheet: #221c17;    --baking-line: #45352a;
    --cooking-sheet: #1b201b;   --cooking-line: #2c3b31;
    --cocktails-sheet: #1c1e25; --cocktails-line: #2f3647;

    --draw-mix: 86%;

    --chk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.4l2.9 2.9 5.9-6.6' fill='none' stroke='%2315120f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

/* ===== Families: one switch per section =====
   Tabs, cards, badges, and the whole page when a section is chosen on the
   home page or a recipe of that section is open. */
.tab[data-cat="baking"], .badge.baking, .card:has(.badge.baking), .fam-baking,
body:has(.tab[data-cat="baking"][aria-pressed="true"]),
body:has(.recipe .recipe-toprow > .back[href*="cat=baking"]) {
  --section: var(--baking); --section-wash: var(--baking-wash); --section-paper: var(--baking-paper);
  --section-fill: var(--baking-fill); --on-section: var(--on-family); --on-section-fill: var(--on-fill);
}
.tab[data-cat="cooking"], .badge.cooking, .card:has(.badge.cooking), .fam-cooking,
body:has(.tab[data-cat="cooking"][aria-pressed="true"]),
body:has(.recipe .recipe-toprow > .back[href*="cat=cooking"]) {
  --section: var(--cooking); --section-wash: var(--cooking-wash); --section-paper: var(--cooking-paper);
  --section-fill: var(--cooking-fill); --on-section: var(--on-family); --on-section-fill: var(--on-fill);
}
.tab[data-cat="cocktails"], .badge.cocktails, .card:has(.badge.cocktails), .fam-cocktails,
body:has(.tab[data-cat="cocktails"][aria-pressed="true"]),
body:has(.recipe .recipe-toprow > .back[href*="cat=cocktails"]) {
  --section: var(--cocktails); --section-wash: var(--cocktails-wash); --section-paper: var(--cocktails-paper);
  --section-fill: var(--cocktails-fill); --on-section: var(--on-family); --on-section-fill: var(--on-fill);
}
.tab[data-cat="all"], .fam-all {
  --section: var(--text); --section-wash: var(--surface-2); --section-fill: var(--text);
  --on-section: var(--accent-contrast); --on-section-fill: var(--accent-contrast);
}

/* The page itself: sheet and hairlines pick up the family tint too. */
body:has(.tab[data-cat="baking"][aria-pressed="true"]), body:has(.recipe .recipe-toprow > .back[href*="cat=baking"]), .fam-baking.g-sheet { --surface: var(--baking-sheet); --border: var(--baking-line); }
body:has(.tab[data-cat="cooking"][aria-pressed="true"]), body:has(.recipe .recipe-toprow > .back[href*="cat=cooking"]), .fam-cooking.g-sheet { --surface: var(--cooking-sheet); --border: var(--cooking-line); }
body:has(.tab[data-cat="cocktails"][aria-pressed="true"]), body:has(.recipe .recipe-toprow > .back[href*="cat=cocktails"]), .fam-cocktails.g-sheet { --surface: var(--cocktails-sheet); --border: var(--cocktails-line); }

/* Each family's plate drawing, used as a mask so it takes the family ink.
   (Cards use their recipe's own drawing; the plate is only a fallback.) */
.tab[data-cat="all"]::before, .fam-all .plate { -webkit-mask-image: url("./plate-leaf.svg"); mask-image: url("./plate-leaf.svg"); }
.tab[data-cat="baking"]::before, .card:has(.badge.baking)::after, .fam-baking .plate { -webkit-mask-image: url("./plate-baking.svg"); mask-image: url("./plate-baking.svg"); }
.tab[data-cat="cooking"]::before, .card:has(.badge.cooking)::after, .fam-cooking .plate { -webkit-mask-image: url("./plate-cooking.svg"); mask-image: url("./plate-cooking.svg"); }
.tab[data-cat="cocktails"]::before, .card:has(.badge.cocktails)::after, .fam-cocktails .plate { -webkit-mask-image: url("./plate-cocktails.svg"); mask-image: url("./plate-cocktails.svg"); }

/* ===== Recipe drawings (per-recipe icons) =====
   [data-icon] is set on each card and on the recipe page. Each key names a
   single-line drawing in ./icons; .card-icon and .recipe-icon show it as a
   mask, so it takes the family ink (slightly softened after dark). */
[data-icon="loaf"] { --icon: url("./icons/loaf.svg"); }
[data-icon="donut"] { --icon: url("./icons/donut.svg"); }
[data-icon="tart"] { --icon: url("./icons/tart.svg"); }
[data-icon="bars"] { --icon: url("./icons/bars.svg"); }
[data-icon="cake"] { --icon: url("./icons/cake.svg"); }
[data-icon="ramekin"] { --icon: url("./icons/ramekin.svg"); }
[data-icon="jar"] { --icon: url("./icons/jar.svg"); }
[data-icon="soup"] { --icon: url("./icons/soup.svg"); }
[data-icon="salad"] { --icon: url("./icons/salad.svg"); }
[data-icon="sauce"] { --icon: url("./icons/sauce.svg"); }
[data-icon="rice-bowl"] { --icon: url("./icons/rice-bowl.svg"); }
[data-icon="grill"] { --icon: url("./icons/grill.svg"); }
[data-icon="sheet-pan"] { --icon: url("./icons/sheet-pan.svg"); }
[data-icon="sandwich"] { --icon: url("./icons/sandwich.svg"); }
[data-icon="chicken"] { --icon: url("./icons/chicken.svg"); }
[data-icon="potato"] { --icon: url("./icons/potato.svg"); }
[data-icon="greens"] { --icon: url("./icons/greens.svg"); }
[data-icon="corn"] { --icon: url("./icons/corn.svg"); }
[data-icon="pasta"] { --icon: url("./icons/pasta.svg"); }
[data-icon="garlic"] { --icon: url("./icons/garlic.svg"); }
[data-icon="apple"] { --icon: url("./icons/apple.svg"); }
[data-icon="mug"] { --icon: url("./icons/mug.svg"); }
[data-icon="highball"] { --icon: url("./icons/highball.svg"); }
[data-icon="coupe"] { --icon: url("./icons/coupe.svg"); }
[data-icon="nick-nora"] { --icon: url("./icons/nick-nora.svg"); }
[data-icon="rocks"] { --icon: url("./icons/rocks.svg"); }
[data-icon="martini"] { --icon: url("./icons/martini.svg"); }
[data-icon="tiki-mug"] { --icon: url("./icons/tiki-mug.svg"); }
[data-icon="bottle"] { --icon: url("./icons/bottle.svg"); }

.card-icon, .recipe-icon {
  display: block; flex: none;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  background: color-mix(in srgb, var(--section) var(--draw-mix), var(--text));
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--section-paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease;
}
a { color: var(--section); text-underline-offset: .18em; text-decoration-thickness: 1px; }
h1, h2, h3 {
  font-family: var(--display); font-variation-settings: var(--soft);
  line-height: 1.12; margin: 0; font-weight: 600; letter-spacing: -.01em;
}
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
code { font-family: var(--mono); font-size: .88em; }
::selection { background: var(--lime); color: var(--on-lime); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) calc(64px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* ===== Header ===== */
/* The tricolour rule: the three family inks, flat, end to end. On a
   section page it becomes that one ink. */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--section-paper);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--baking) 0 33.333%, var(--cooking) 33.333% 66.666%, var(--cocktails) 66.666% 100%) 1;
  padding: 10px max(16px, env(safe-area-inset-right)) 9px max(16px, env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top));
}
body:has(.tab:not([data-cat="all"])[aria-pressed="true"]) .site-header,
body:has(.recipe .back) .site-header { border-image: none; border-bottom-color: var(--section); }
.brand {
  display: flex; align-items: center; gap: 11px;
  max-width: 1048px; margin: 0 auto;
  text-decoration: none; color: var(--text);
  min-height: 38px;
  padding-right: 48px; /* room for the theme toggle */
}
.brand-mark { font-size: 1.5rem; flex: none; display: block; width: 27px; height: 32px; }
.brand-mark .lg-sheet { fill: var(--surface); stroke: var(--text); }
.brand-mark .lg-stem { stroke: var(--text); }
.brand-mark .lg-b { fill: var(--baking); }
.brand-mark .lg-c { fill: var(--cooking); }
.brand-mark .lg-k { fill: var(--cocktails); }
.brand-mark .lg-tape { fill: var(--lime); }
.brand-name {
  font-family: var(--display); font-variation-settings: var(--soft);
  font-size: 1.2rem; font-weight: 650; letter-spacing: -.012em; line-height: 1.15;
}
.amp { font-style: italic; font-weight: 500; color: var(--section); padding: 0 .04em; }
/* Light/dark toggle, top right, level with the brand row. */
.theme-toggle {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right));
  display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--rule-strong); border-radius: 50%;
  background: var(--surface); color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease;
}
.theme-toggle:hover { border-color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ===== Home controls ===== */
.controls { padding-top: 18px; }
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-ctl);
  padding: 0 14px;
  min-height: 48px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--section); box-shadow: 0 0 0 1px var(--section); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 1rem; padding: 12px 0;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }

/* Sections: one slim row of tabs, each lettered in its family ink. The chosen
   one gets a light wash and an ink underline ("All": the tricolour band). */
.tabs {
  display: flex; gap: 2px; margin-top: 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 46px; padding: 8px 6px 7px;
  border: 0; border-bottom: 3px solid transparent;
  border-radius: var(--radius-ctl) var(--radius-ctl) 0 0;
  background: transparent; color: var(--section);
  font-family: var(--display); font-variation-settings: var(--soft);
  font-weight: 600; font-size: 1.04rem; line-height: 1.1; letter-spacing: -.01em;
  white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease;
}
.tab > span[aria-hidden="true"] { display: none; }
.tab::before {
  content: ""; flex: none; display: none;
  width: 22px; height: 22px;
  background: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.tab .n {
  font-family: var(--mono); font-weight: 500; font-size: .76rem; letter-spacing: .02em;
  color: var(--muted);
}
.tab[aria-pressed="true"] { background-color: var(--section-wash); border-bottom-color: var(--section); }
.tab[aria-pressed="true"] .n { color: var(--section); }
.tab[data-cat="all"][aria-pressed="true"] {
  border-bottom-color: transparent;
  background-image: linear-gradient(90deg, var(--baking) 0 33.333%, var(--cooking) 33.333% 66.666%, var(--cocktails) 66.666% 100%);
  background-position: left bottom; background-size: 100% 3px; background-repeat: no-repeat;
  padding-bottom: 10px; border-bottom-width: 0;
}
@media (max-width: 374px) {
  .tabs { gap: 0; }
  .tab { padding-inline: 4px; font-size: .9rem; gap: 3px; }
  .tab .n { font-size: .68rem; letter-spacing: 0; }
}
@media (min-width: 600px) {
  .tab { flex: 0 0 auto; justify-content: flex-start; padding: 8px 16px 7px 12px; gap: 8px; font-size: 1.2rem; }
  .tab::before { display: block; }
}

/* Filter buttons: one row that scrolls sideways on a phone. */
.filter-host { position: relative; }
.filter-row {
  display: flex; gap: 6px; margin: 14px -16px 0; padding: 2px 16px 4px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-row:empty { display: none; }
@media (min-width: 720px) { .filter-row { flex-wrap: wrap; overflow: visible; margin: 14px 0 0; padding: 0; } }
.filter-btn {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--rule-strong); background: var(--surface);
  border-radius: 999px; padding: 0 13px; min-height: 38px;
  cursor: pointer; font-size: .92rem; font-weight: 500; white-space: nowrap; color: var(--text);
}
.filter-btn .caret { color: var(--muted); font-size: .7rem; }
.filter-btn .n {
  min-width: 1.5em; padding: 0 5px; border-radius: 999px; text-align: center;
  background: var(--section); color: var(--on-section);
  font-family: var(--mono); font-size: .74rem; font-weight: 500; line-height: 1.55;
}
.filter-btn[data-on="true"] { border-color: var(--section); color: var(--section); font-weight: 650; box-shadow: inset 0 0 0 1px var(--section); }
.filter-btn[aria-expanded="true"] { background: var(--section-wash); border-color: var(--section); }

.active-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.active-row:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--rule-strong);
  background: transparent;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: .86rem;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--section); color: var(--section); background: var(--surface); font-weight: 600; }
.clear {
  border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: .18em;
  cursor: pointer; font-size: .86rem; padding: 3px 4px;
}

/* Option panel: a bottom sheet on phones, a dropdown under its button on wider screens. */
.backdrop { position: fixed; inset: 0; z-index: 20; background: var(--scrim); }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0;
  max-height: 75vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 14px 14px 0 0;
  border-top: 4px solid var(--section);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.sheet[hidden], .backdrop[hidden] { display: none; }
/* Links only for the signed-in owner (assets/common.js shows them). */
[data-signed-in][hidden] { display: none !important; }
.sheet-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
}
.sheet-head h2 { font-size: 1.4rem; color: var(--section); }
.sheet-head .btn { background: var(--section-fill); color: var(--on-section-fill); border-color: var(--section-fill); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 22px; }
.sheet-body h3 {
  font-family: var(--mono); font-variation-settings: normal;
  font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin: 16px 0 8px;
}
.opts { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; }
.sheet-body h3 + .opts { padding-top: 0; }
.opt {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--rule-strong); background: var(--surface);
  border-radius: 999px; padding: 0 13px; min-height: 40px;
  cursor: pointer; font-size: .92rem; color: var(--text);
}
.opt .n { font-family: var(--mono); color: var(--muted); font-size: .76rem; }
.opt[aria-pressed="true"] { background: var(--section-fill); border-color: var(--section); color: var(--on-section-fill); font-weight: 600; }
.opt[aria-pressed="true"] .n { color: inherit; }
/* A chosen option also carries a tick, so the choice never rests on colour alone. */
.opt[aria-pressed="true"]::before {
  content: ""; width: 14px; height: 14px; margin-left: -3px; flex: none;
  background: currentColor;
  -webkit-mask: var(--ico-tick) center / contain no-repeat;
  mask: var(--ico-tick) center / contain no-repeat;
}
.opt:disabled { opacity: .45; cursor: default; border-style: dashed; }
body.sheet-open { overflow: hidden; }
@media (min-width: 720px) {
  .backdrop { background: transparent; }
  .sheet {
    position: absolute; left: 0; right: auto; bottom: auto; top: 100%;
    width: min(420px, 100%); max-height: 60vh;
    padding: 0;
    border: 1px solid var(--section); border-top-width: 4px; border-radius: var(--radius-ctl);
  }
  body.sheet-open { overflow: auto; }
}

.result-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 20px 0 12px; padding-top: 12px; border-top: var(--rule) solid var(--section);
  color: var(--muted);
  font-family: var(--mono); font-size: .76rem; letter-spacing: .07em; text-transform: uppercase;
}
.sort { display: inline-flex; align-items: center; }
.sort select {
  margin-left: 8px; border: 1px solid var(--rule-strong); border-radius: var(--radius-ctl);
  background: var(--surface); color: var(--text); padding: 6px 8px; min-height: 36px;
  font-family: var(--sans); font-size: .9rem; letter-spacing: 0; text-transform: none;
}

/* ===== Cards: specimen sheets with a coloured family spine ===== */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  counter-reset: specimen;
}
.grid > li { counter-increment: specimen; min-width: 0; }
.card {
  position: relative;
  display: grid; grid-template-columns: 60px minmax(0, 1fr); grid-template-rows: auto 1fr;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  overflow: hidden;
  transition: border-color .15s ease;
}
/* The spine: family wash, family rule and the accession number. */
.card::before {
  content: "No. " counter(specimen, decimal-leading-zero) / "";
  grid-column: 1; grid-row: 1 / -1;
  background: var(--section-wash);
  border-left: var(--rule) solid var(--section); /* the spine is turned 180deg, so this is its right edge */
  color: var(--section);
  writing-mode: vertical-rl; transform: rotate(180deg);
  padding: 12px 0; text-align: left;
  display: flex; align-items: center;
  font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
}
/* The family plate at the head of the spine: only a fallback for a card
   that has no drawing of its own yet. */
.card::after {
  content: "";
  position: absolute; left: 9px; top: 12px; width: 40px; height: 40px;
  background: color-mix(in srgb, var(--section) var(--draw-mix), var(--text));
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.card:has(.card-icon)::after { content: none; }
/* The recipe's own drawing, at the head of the spine. */
.card .card-icon {
  position: absolute; left: 8px; top: 12px;
  width: 42px; height: 42px;
}
.card:focus-visible { outline-offset: 3px; }
.card-img { grid-column: 2; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; display: block; background: var(--surface-2); }
.card-body { grid-column: 2; padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.card-img + .card-body { grid-row: 2; }
.card h2 { font-size: 1.36rem; line-height: 1.12; letter-spacing: -.014em; text-wrap: balance; color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.5; }

/* The specimen label: a small ruled box with Time and Yield fields. */
.card-meta {
  margin-top: auto;
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  border: 1px solid var(--border); border-radius: 2px;
  font-size: .9rem; font-weight: 600; line-height: 1.3; color: var(--text);
}
.card-meta span {
  position: relative; display: block; min-width: 0;
  padding: 21px 10px 7px;
  text-indent: -.26em;
}
.card-meta span + span { border-left: 1px solid var(--border); }
.card-meta span:only-child { grid-column: 1 / -1; }
.card-meta span::first-letter { font-size: 0; }
.card-meta span::before {
  position: absolute; left: 10px; top: 6px;
  text-indent: 0;
  font-family: var(--mono); font-size: .64rem; font-weight: 400; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}
.card-meta span:first-child::before { content: "Time" / ""; }
.card-meta span:last-child:not(:first-child)::before { content: "Yield" / ""; }
.card-meta span:only-child::before { content: "Field notes" / ""; }

/* Badges: a solid family stamp. */
.badge {
  display: inline-block; align-self: flex-start;
  font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  line-height: 1.5;
  padding: 2px 8px 1px; border-radius: 3px;
  background: var(--section); color: var(--on-section);
}
.badge.component { color: var(--muted); background: transparent; box-shadow: inset 0 0 0 1px var(--rule-strong); }
@media screen {
  /* After dark the stamp is a deep fill lettered in the glowing ink. */
  :root[data-theme="dark"] .badge:not(.component) { background: var(--section-fill); color: var(--section); }
  :root[data-theme="dark"] .opt[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--section); }
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Empty: a little still life of specimens. */
.empty { text-align: center; color: var(--muted); padding: 36px 16px 56px; }
.empty .big {
  display: block; width: 180px; height: 60px; margin: 0 auto 16px;
  font-size: 0; color: transparent;
  /* Three specimens, one per family ink: flat hard stops, no blending. */
  background: linear-gradient(90deg, var(--baking) 0 33.4%, var(--cooking) 33.4% 66.6%, var(--cocktails) 66.6% 100%);
  -webkit-mask: url("./spec-cinnamon.svg") left center / 60px 60px no-repeat, url("./spec-chili.svg") center / 60px 60px no-repeat, url("./spec-lemon.svg") right center / 60px 60px no-repeat;
  mask: url("./spec-cinnamon.svg") left center / 60px 60px no-repeat, url("./spec-chili.svg") center / 60px 60px no-repeat, url("./spec-lemon.svg") right center / 60px 60px no-repeat;
}
.empty a { font-weight: 600; }
.empty code { color: var(--text); }

/* ===== Recipe page: the specimen sheet ===== */
.recipe { max-width: 760px; padding-top: 18px; }

/* The plate: the family drawing with one ingredient specimen beside it. */
.recipe::before {
  content: "";
  float: right;
  width: 112px; height: 112px;
  margin: 2px -4px 6px 10px;
  background: color-mix(in srgb, var(--section) var(--draw-mix), var(--text));
  -webkit-mask: url("./plate-leaf.svg") right top / 74% no-repeat;
  mask: url("./plate-leaf.svg") right top / 74% no-repeat;
}
.recipe:has(> .loading)::before, .recipe:has(> .error)::before { content: none; }
/* A recipe with a photo lets the photo be the plate (the family drawing still closes the sheet). */
.recipe:has(> .recipe-hero)::before { content: none; }
.recipe:has(.recipe-toprow > .back[href*="cat=baking"])::before {
  -webkit-mask: url("./plate-baking.svg") right top / 78% no-repeat, url("./spec-cinnamon.svg") left bottom / 48% no-repeat;
  mask: url("./plate-baking.svg") right top / 78% no-repeat, url("./spec-cinnamon.svg") left bottom / 48% no-repeat;
}
.recipe:has(.recipe-toprow > .back[href*="cat=cooking"])::before {
  -webkit-mask: url("./plate-cooking.svg") right top / 78% no-repeat, url("./spec-chili.svg") left bottom / 46% no-repeat;
  mask: url("./plate-cooking.svg") right top / 78% no-repeat, url("./spec-chili.svg") left bottom / 46% no-repeat;
}
.recipe:has(.recipe-toprow > .back[href*="cat=cocktails"])::before {
  -webkit-mask: url("./plate-cocktails.svg") right top / 80% no-repeat, url("./spec-mint.svg") left bottom / 48% no-repeat;
  mask: url("./plate-cocktails.svg") right top / 80% no-repeat, url("./spec-mint.svg") left bottom / 48% no-repeat;
}
/* The recipe's own drawing replaces the generic family plate: large, in the
   family ink, beside the family line and title. */
.recipe:has(> .recipe-icon)::before { content: none; }
.recipe > .recipe-icon {
  float: right;
  width: 104px; height: 104px;
  margin: -2px -2px 8px 14px;
  -webkit-mask: var(--icon) right top / contain no-repeat;
  mask: var(--icon) right top / contain no-repeat;
}

.back {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content; margin-bottom: 16px;
  text-decoration: none; color: var(--section);
  font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase;
  padding: 5px 10px 4px 8px; min-height: 32px;
  border: 1px solid var(--section); border-radius: 999px;
}
.recipe-hero { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 16px; display: block; }
.recipe h1 {
  font-size: clamp(2.25rem, 9vw, 3.4rem); line-height: 1; letter-spacing: -.025em;
  margin-top: 4px; text-wrap: balance; color: var(--section);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.recipe > .badge { margin-bottom: 4px; }
.recipe .lede { color: var(--muted); font-size: 1.1rem; line-height: 1.5; margin: 12px 0 0; max-width: 36em; }

/* Facts: the archival specimen label, edged in the family ink. */
.facts {
  clear: both;
  position: relative;
  display: flex; flex-wrap: wrap;
  gap: 1px; background: var(--border);
  border: var(--rule) solid var(--section); border-radius: 2px;
  margin: 24px 0 18px;
}
.facts::before {
  content: "Specimen label" / "";
  flex: 1 1 100%;
  background: var(--section-wash);
  padding: 9px 12px 8px;
  font-family: var(--mono); font-size: .64rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--section); text-align: center;
  text-wrap: balance;
  border-bottom: 1px solid var(--section);
  margin-bottom: -1px;
}
/* Specimen tape: one short strip of lime holding the label's top edge. */
.facts::after {
  content: "";
  position: absolute; top: -7px; left: 20px;
  width: 50px; height: 13px;
  background: var(--lime);
  transform: rotate(-3deg);
  pointer-events: none;
}
.fact { flex: 1 1 140px; background: var(--surface); padding: 9px 12px 10px; min-width: 0; }
.fact dt {
  font-family: var(--mono); font-size: .64rem; font-weight: 400; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}
.fact dd { margin: 2px 0 0; font-weight: 600; font-size: .98rem; line-height: 1.35; overflow-wrap: anywhere; }

.toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 0 15px; min-height: 40px;
  cursor: pointer; font-size: .92rem; font-weight: 600; line-height: 1.2;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn[hidden] { display: none; }
/* The toolbar labels start with an emoji; hide it and let the words speak. */
.toolbar .btn { display: inline-block; padding: 9px 12px; font-size: .86rem; min-height: 38px; text-indent: -.24em; }
.toolbar .btn[hidden] { display: none; }
.toolbar .btn::first-letter { font-size: 0; }
.btn[aria-pressed="true"] { background: var(--section-fill); color: var(--on-section-fill); border-color: var(--section); }

.section { margin-top: 34px; }
.section > h2 {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 1.7rem; letter-spacing: -.018em;
  padding-bottom: 7px; border-bottom: 2px solid var(--section); margin-bottom: 4px;
}
/* A quiet catalogue caption at the right end of each section rule. */
.section > h2::after {
  font-family: var(--mono); font-size: .66rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--section); font-variation-settings: normal; white-space: nowrap;
}
.section:has(> .ingredients) > h2::after { content: "Specimen list" / ""; }
.section:has(> .steps) > h2::after { content: "Procedure" / ""; }
.section.before > h2::after { content: "Read first" / ""; }
.section:not(.before):has(> .notes) > h2::after { content: "Field notes" / ""; }
.section h3 {
  font-family: var(--mono); font-variation-settings: normal;
  font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin: 22px 0 4px;
}
.section > h2 + h3 { margin-top: 14px; }
.section.before .notes { margin-top: 12px; }
/* Prep first or as written, under the Steps rule (only on recipes where the
   two orders differ). */
.menu-switch.prep-switch { display: flex; justify-content: flex-end; margin: 10px 0 -4px; font-size: .92rem; }
.prep-switch + h3 { margin-top: 10px; }

/* Ingredients: a lettered specimen list, ticked off as they go in. */
.section:has(> .ingredients) { counter-reset: ing; }
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li { counter-increment: ing; }
.ingredients li label {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 2px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.ingredients li label::before {
  content: counter(ing, lower-alpha) "." / "";
  flex: none; width: 1.35em; margin-top: -1px;
  font-family: var(--display); font-style: italic; font-weight: 500; font-size: 1.02rem;
  color: var(--section); text-align: right;
}
.ingredients li:last-child label { border-bottom: 0; }
.ingredients input {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin: 1px 0 0; flex: none;
  border: var(--rule) solid var(--rule-strong); border-radius: 4px;
  background: var(--surface) center / 16px 16px no-repeat;
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease;
}
.ingredients input:checked { background-color: var(--section); border-color: var(--section); background-image: var(--chk); }
.ingredients input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ingredients input + span { min-width: 0; overflow-wrap: anywhere; }
.ingredients input:checked + span {
  color: var(--muted);
  text-decoration: line-through; text-decoration-thickness: var(--strike); text-decoration-color: var(--section);
  text-decoration-skip-ink: none;
}
.ingredients input:checked + span .qty { color: inherit; }
.ingredients li:has(input:checked) label::before { opacity: .55; }

/* Steps: numbered boxes; done = filled family box with a tick, current = family panel tagged "Now". */
.steps { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 13px 14px 13px 58px;
  margin-bottom: 6px;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  border: var(--rule) solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 11px; top: 11px;
  width: 32px; height: 32px; border-radius: 4px;
  display: grid; place-items: center;
  border: var(--rule) solid var(--section);
  background: var(--surface) center / 18px 18px no-repeat;
  color: var(--section);
  font-family: var(--display); font-variation-settings: var(--soft); font-weight: 600; font-size: 1.05rem; line-height: 1;
}
/* Done: the line is struck through in the family ink, over graphite text
   that stays readable (6:1 or better), so you can still glance back at it. */
.steps li.done {
  color: var(--muted);
  text-decoration: line-through; text-decoration-thickness: var(--strike); text-decoration-color: var(--section);
  text-decoration-skip-ink: none;
}
.steps li.done::before { content: ""; background-color: var(--section); background-image: var(--chk); }
.steps li.current { background: var(--section-wash); border-color: var(--section); color: var(--text); }
.steps li.current::before { background: var(--section); color: var(--on-section); }
.steps li.current::after {
  content: "Now" / "";
  position: absolute; top: -9px; right: 12px;
  padding: 1px 7px; border-radius: 3px;
  background: var(--section); color: var(--on-section);
  font-family: var(--mono); font-size: .64rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; line-height: 1.5;
}
.steps li:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.muted { color: var(--muted); }
/* Quantities stay in the reading face (bold, lining figures), not mono:
   they are read mid-stir, so they must be as easy as the words beside them. */
.qty { font-weight: 680; font-variant-numeric: lining-nums; word-spacing: .14em; }
.step-wait, .step-cue { position: relative; display: block; margin-top: 6px; padding-left: 22px; font-size: .92rem; line-height: 1.45; text-indent: -.3em; }
.step-wait::first-letter, .step-cue::first-letter { font-size: 0; }
.step-wait::before, .step-cue::before {
  content: ""; position: absolute; left: 0; top: .2em;
  width: 15px; height: 15px; background: currentColor;
  -webkit-mask: var(--ico-clock) center / contain no-repeat;
  mask: var(--ico-clock) center / contain no-repeat;
}
.step-wait { color: var(--muted); font-weight: 600; }
.step-cue { color: var(--section); font-weight: 600; }
.step-cue::before { -webkit-mask-image: var(--ico-tick); mask-image: var(--ico-tick); }
.steps li.done .step-cue, .steps li.done .step-wait { color: inherit; }

.notes { padding-left: 1.15em; margin: 10px 0 0; }
.notes li { margin-bottom: 7px; padding-left: 2px; }
.notes li::marker { color: var(--section); }

.tag-groups {
  margin: 38px 0 0; display: grid; gap: 10px; font-size: .9rem;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.tag-groups div { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); align-items: baseline; gap: 8px; }
.tag-groups dt {
  color: var(--muted);
  font-family: var(--mono); font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
}
.tag-groups dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-groups a { text-decoration: none; }
.tag-groups .chip { border-color: color-mix(in srgb, var(--section) 55%, var(--rule-strong)); background: var(--surface); }
.source { color: var(--muted); font-size: .92rem; margin-top: 24px; }
.loading, .error { color: var(--muted); padding: 40px 0; }

/* Colophon: the family plate closes the sheet. */
.recipe:has(.back)::after {
  content: "";
  display: block; clear: both;
  width: 34px; height: 34px; margin: 40px auto 0;
  background: color-mix(in srgb, var(--section) var(--draw-mix), var(--text));
  -webkit-mask: url("./plate-leaf.svg") center / contain no-repeat;
  mask: url("./plate-leaf.svg") center / contain no-repeat;
}
.recipe:has(.recipe-toprow > .back[href*="cat=baking"])::after { -webkit-mask-image: url("./plate-baking.svg"); mask-image: url("./plate-baking.svg"); }
.recipe:has(.recipe-toprow > .back[href*="cat=cooking"])::after { -webkit-mask-image: url("./plate-cooking.svg"); mask-image: url("./plate-cooking.svg"); }
.recipe:has(.recipe-toprow > .back[href*="cat=cocktails"])::after { -webkit-mask-image: url("./plate-cocktails.svg"); mask-image: url("./plate-cocktails.svg"); }

@media (max-width: 359px) {
  .recipe::before { width: 88px; height: 88px; }
  .recipe > .recipe-icon { width: 80px; height: 80px; margin-left: 8px; }
  .card { grid-template-columns: 52px minmax(0, 1fr); }
  .card .card-icon { left: 7px; width: 36px; height: 36px; }
  .recipe h1 { font-size: 2rem; }
  .steps li { padding-left: 50px; padding-right: 10px; }
  .steps li::before { left: 7px; }
  .facts::before { letter-spacing: .07em; padding-left: 8px; padding-right: 8px; }
  .section > h2::after { display: none; }
}

/* Desktop: a mounted sheet with the list and the procedure side by side. */
@media (min-width: 960px) {
  .recipe {
    max-width: none; width: min(1080px, 100% - 32px);
    margin-top: 28px; padding: 34px 48px 40px;
    background: var(--surface);
    border: 1px solid var(--border); border-top: 6px solid var(--section); border-radius: var(--radius);
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 40px; align-content: start;
  }
  .recipe > * { grid-column: 1 / -1; }
  .recipe::before {
    float: none; grid-column: 9 / -1; grid-row: 1 / span 3;
    justify-self: end; align-self: start;
    width: 176px; height: 176px; margin: 0;
  }
  .recipe > .recipe-icon {
    float: none; grid-column: 9 / -1; grid-row: 1 / span 3;
    justify-self: end; align-self: start;
    width: 168px; height: 168px; margin: -4px -6px 0 0;
  }
  .recipe > .recipe-toprow, .recipe > h1, .recipe > .lede, .recipe > .badge { grid-column: 1 / 9; }
  .recipe h1 { font-size: 3.6rem; }
  .facts { margin-top: 28px; }
  .fact { background: var(--surface); }
  .recipe > .section:has(> .ingredients) {
    grid-column: 1 / 6; grid-row: span 2; align-self: start;
    position: sticky; top: 76px;
  }
  .recipe > .section:has(> .steps), .recipe > .section:not(.before):has(> .notes) { grid-column: 6 / -1; }
  .recipe::after { grid-column: 1 / -1; }
  .container.recipe { margin-bottom: 64px; }
  body:has(.recipe) .brand { max-width: 1080px; }
}

/* ===== Welcome page =====
   A calm front door: a headline, one search box, the three families as
   large plates, and a way into the full index. Search and the doors hand
   off to recipes.html (?q= / ?cat=), where all the filtering lives. */
.welcome { max-width: 1000px; }
.hero { padding: 36px 0 22px; }
.hero h1 {
  font-size: clamp(2.1rem, 9vw, 3.8rem); line-height: 1.02; letter-spacing: -.022em;
  max-width: 13ch; margin-bottom: 24px;
}
.hero-search { min-height: 54px; margin: 0; }
.hero-search input { font-size: 1.05rem; }

.doors { display: grid; gap: 10px; }
.door {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto;
  align-content: center; align-items: center; column-gap: 12px;
  min-height: 104px; padding: 12px 14px 12px 20px;
  border: var(--rule) solid var(--section); border-radius: var(--radius-ctl);
  background: var(--section-wash); color: var(--section);
  text-decoration: none;
  transition: background-color .15s ease;
}
.door-name, .door-count { grid-column: 1; }
.door-name {
  grid-row: 1; align-self: end;
  font-family: var(--display); font-variation-settings: var(--soft);
  font-weight: 600; font-size: 2.05rem; line-height: 1.05; letter-spacing: -.016em;
}
.door-count {
  grid-row: 2; align-self: start; margin-top: 6px;
  font-family: var(--mono); font-weight: 500; font-size: .8rem; letter-spacing: .03em;
  color: var(--muted); min-height: 1.3em;
}
.door-count:not(:empty)::after { content: "  →"; color: var(--section); }
.door .plate {
  grid-column: 2; grid-row: 1 / span 2;
  width: 72px; height: 72px;
  background: color-mix(in srgb, var(--section) var(--draw-mix), var(--text));
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}

/* "Browse all": the sheet with the tricolour band along its foot, like the All tab. */
.browse-all {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 10px; min-height: 58px; padding: 10px 18px 15px;
  border: var(--rule) solid var(--text); border-radius: var(--radius-ctl);
  background: var(--surface) linear-gradient(90deg, var(--baking) 0 33.333%, var(--cooking) 33.333% 66.666%, var(--cocktails) 66.666% 100%) left bottom / 100% 5px no-repeat;
  color: var(--text); text-decoration: none;
  font-family: var(--display); font-variation-settings: var(--soft);
  font-weight: 600; font-size: 1.2rem; letter-spacing: -.01em;
}
.browse-all .arrow { font-family: var(--sans); font-weight: 500; }

@media (min-width: 720px) {
  .hero { padding: 64px 0 34px; }
  .hero h1 { margin-bottom: 30px; }
  .hero-search { max-width: 640px; }
  .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .door {
    grid-template-columns: 1fr; grid-template-rows: auto auto auto; align-content: start;
    min-height: 0; padding: 24px 24px 22px;
  }
  .door .plate { grid-column: 1; grid-row: 1; width: 104px; height: 104px; margin-bottom: 28px; }
  .door-name { grid-row: 2; font-size: 2.6rem; }
  .door-count { grid-row: 3; }
  .browse-all { margin-top: 14px; min-height: 64px; font-size: 1.35rem; padding-inline: 22px; }
}

/* ===== Hover (pointer devices only, so taps don't leave sticky states) ===== */
@media (hover: hover) {
  .tab:not([aria-pressed="true"]):hover { background-color: var(--section-wash); }
  .filter-btn:hover { border-color: var(--section); }
  .chip:hover { border-color: var(--section); color: var(--section); }
  .clear:hover { color: var(--text); }
  .opt:hover:not(:disabled) { border-color: var(--section); }
  .card:hover { border-color: var(--section); }
  .card:hover h2 { color: var(--section); }
  .btn:not([aria-pressed="true"]):hover { border-color: var(--section); }
  .ingredients label:hover input:not(:checked) { border-color: var(--section); }
  .steps li:not(.current):hover { background: var(--surface); border-color: var(--border); }
  .back:hover { background: var(--section-fill); color: var(--on-section-fill); }
  .door:hover { background: var(--surface); }
  .door:hover .door-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }
  .browse-all:hover { background-color: var(--surface-2); }
  a:hover { text-decoration-thickness: 2px; }
}

/* ===== Cook mode: one step per screen (assets/cook.js) =====
   Replaces the page while it's open. The step is large enough to read at arm's
   length; everything else is quiet. Colour comes from the family ink. */
.cook-start {
  background: var(--section-fill); color: var(--on-section-fill); border-color: var(--section);
  font-size: 1rem; min-height: 46px; padding: 0 22px; margin-bottom: 10px;
}
body.cooking > .site-header, body.cooking > main { display: none; }
.cook {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 100vh; min-height: 100dvh; max-width: 680px; margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  touch-action: pan-y;
}
.cook-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cook-label { font-family: var(--mono); font-size: .74rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cook-close {
  width: 44px; height: 44px; margin-right: -8px; border: 0; border-radius: 50%; background: none;
  font-size: 1.2rem; cursor: pointer; color: var(--text);
}
.cook-bar { display: flex; gap: 3px; }
.cook-bar i { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.cook-bar i.done { background: var(--section); }
.cook-bar i.now { background: var(--section); opacity: .45; }
.cook-body { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-top: 6px; }
.cook-body h2 { font-size: 1.7rem; letter-spacing: -.018em; }
.cook-do { margin: 0; font-size: 1.45rem; line-height: 1.38; font-weight: 500; text-wrap: pretty; }
.cook-ings { list-style: none; margin: 0; padding: 0; }
.cook-ings label {
  display: flex; align-items: baseline; gap: 12px; padding: 9px 2px;
  border-bottom: 1px solid var(--border); font-size: 1.05rem; line-height: 1.4; cursor: pointer;
}
.cook-ings li:last-child label { border-bottom: 0; }
.cook-ings input {
  appearance: none; flex: none; width: 22px; height: 22px; margin: 0; transform: translateY(4px);
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface);
  background-position: center; background-repeat: no-repeat; background-size: 16px; cursor: pointer;
}
.cook-ings input:checked { background-color: var(--section); border-color: var(--section); background-image: var(--chk); }
.cook-ings input:checked + span { color: var(--muted); text-decoration: line-through var(--strike) var(--section); }
.cook-ings b { font-weight: 700; font-variant-numeric: tabular-nums; }
.cook-alt { color: var(--muted); font-size: .88em; }
.cook-wait { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.cook-timer-start { border-color: var(--section); color: var(--section); }
.cook-timers { display: flex; flex-direction: column; gap: 6px; }
.cook-timers:empty { display: none; }
.cook-timer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 10px;
  border: 1.5px solid var(--section); border-radius: var(--radius-ctl); background: var(--section-wash); font-size: .9rem;
}
.cook-timer-time { font-family: var(--mono); font-weight: 500; font-size: 1.1rem; color: var(--section); font-variant-numeric: tabular-nums; }
.cook-timer-what { flex: 1 1 8em; min-width: 0; color: var(--muted); }
.cook-timer-what a { color: inherit; }
.cook-timer-actions { display: flex; gap: 6px; }
.cook-timer .btn { min-height: 36px; padding: 0 12px; font-size: .86rem; }
.cook-timer.paused .cook-timer-time { color: var(--muted); }
.cook-timer.ringing { background: var(--section-fill); color: var(--on-section-fill); }
.cook-timer.ringing .cook-timer-time, .cook-timer.ringing .cook-timer-what { color: var(--on-section-fill); font-weight: 600; }
.cook-wait, .cook-cue { margin: 0; font-size: 1.02rem; font-weight: 600; line-height: 1.45; }
.cook-wait { color: var(--muted); }
.cook-cue { color: var(--section); }
.cook-list { margin: 0; padding-left: 1.2em; font-size: 1.1rem; line-height: 1.5; }
.cook-list li + li { margin-top: 6px; }
.cook-return { align-self: flex-start; }
.cook-upnext {
  display: block; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--border); background: none;
  text-align: left; font-size: .9rem; line-height: 1.45; color: var(--muted); cursor: pointer;
}
.cook-upnext[aria-expanded="false"] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-upnext-label { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; margin-right: 4px; }
.cook-upnext-label::after { content: " ▴" / ""; }
.cook-upnext[aria-expanded="true"] .cook-upnext-label::after { content: " ▾" / ""; }
.cook-nav { display: flex; gap: 10px; }
.cook-nav .btn { flex: 1; min-height: 52px; border-radius: var(--radius-ctl); font-size: 1rem; }
.cook-nav .cook-go { flex: 2.2; background: var(--section-fill); color: var(--on-section-fill); border-color: var(--section); }
.cook-nav .btn:disabled { opacity: .45; cursor: default; }

/* ===== Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ===== Print: a clean specimen sheet on white ===== */
/* ===== The site bar: Recipes · Menu (the site's title goes home) =====
   Under the header, the same at every width. It scrolls away with the page
   (only the header stays), and it's hidden in cook mode and in print. */
.site-nav { display: flex; justify-content: center; gap: clamp(18px, 7vw, 48px); padding: 8px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--border); }
.site-nav a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px;
  color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent;
  font-family: var(--mono); font-size: .85rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"], .site-nav a.nav-active { color: var(--text); font-weight: 700; border-bottom-color: var(--text); }
.nav-count:empty { display: none; }
.nav-count { min-width: 20px; padding: 2px 6px; border-radius: 10px; background: var(--lime); color: var(--on-lime); font-size: .72rem; letter-spacing: 0; text-align: center; }
body.cooking > .site-nav { display: none; }

/* The footer: a quiet "Sign in" / "Sign out" at the bottom of every page. */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px;
  margin-top: 40px; padding: 14px max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; text-align: center;
}
.site-footer a, .site-footer .link-button {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px;
  font: inherit; font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.site-footer a:hover, .site-footer .link-button:hover { color: var(--text); }
.site-footer .footer-status { flex-basis: 100%; margin: 0; }
.site-footer .footer-status:empty { display: none; }
body.cooking > .site-footer { display: none; }

/* The back link and the way to your menu share one row; "+ Add to menu" sits
   beside Start. */
.recipe-toprow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.recipe-toprow .back { margin: 0; }
.recipe-edit { font-family: var(--mono); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media print { .recipe-edit { display: none; } }
.menu-link {
  display: inline-flex; align-items: center; min-height: 32px; padding: 5px 10px 4px;
  font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text); text-decoration: none; border: 1px solid var(--rule-strong); border-radius: 999px; white-space: nowrap;
}
.start-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.start-row .cook-start { margin: 0; }
.menu-on { min-height: 46px; padding: 0 18px; font-weight: 600; border-color: var(--section); color: var(--section); }
.menu-on[aria-haspopup] { background: var(--section-wash); }
.start-row .menu-pop { min-width: 220px; }
/* Your menu while choosing recipes: a panel beside them on a wide screen, a
   "Your menu ▾" button over them on a phone (hidden while the menu is empty). */
.menu-peek { position: relative; }
.menu-peek-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.menu-peek-toggle {
  display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; padding: 0 14px; margin-bottom: 10px;
  border: 1.5px solid var(--text); border-radius: var(--radius-ctl); background: var(--surface); color: var(--text); cursor: pointer;
  font: 500 .8rem var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.menu-peek.empty .menu-peek-toggle { display: none; }
.menu-peek-body { display: grid; gap: 10px; margin-bottom: 14px; padding: 14px; border: 1.5px solid var(--text); border-radius: var(--radius); background: var(--surface); }
.menu-peek-body[hidden] { display: none; }
.menu-peek-body p { margin: 0; font-size: .9rem; }
.menu-peek-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.menu-peek-list li { display: grid; grid-template-columns: auto minmax(12px, 1fr) auto; align-items: baseline; gap: 6px; }
.menu-peek-list a { font-family: var(--display); font-weight: 600; color: var(--section); text-decoration: none; }
.menu-peek-list a:hover { text-decoration: underline; }
.menu-peek-go { font-weight: 600; color: var(--text); }
@media (min-width: 960px) {
  .container.has-peek { display: grid; grid-template-columns: minmax(0, 1fr) 280px; column-gap: 28px; row-gap: 14px; align-items: start; }
  .has-peek > * { grid-column: 1; }
  .has-peek > .menu-peek-host { grid-column: 2; grid-row: 1 / span 20; position: sticky; top: 76px; }
  .menu-page.has-peek { max-width: 1040px; }
  .menu-page.has-peek > #menu-body { min-width: 0; }
  .menu-peek { padding-top: 14px; }
  .menu-peek::before { content: ""; position: absolute; top: 5px; left: 20px; z-index: 1; width: 56px; height: 15px; background: var(--lime); transform: rotate(-3deg); }
  .menu-peek-head { position: static; width: auto; height: auto; clip: auto; overflow: visible; margin: 0 0 -1px; padding: 14px 14px 0; border: 1.5px solid var(--text); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface);
    font: 500 .72rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; }
  .menu-peek-toggle { display: none; }
  .menu-peek-body, .menu-peek-body[hidden] { display: grid; border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
}
@media (max-width: 959px) { .menu-page .menu-peek-host { display: none; } }
/* A card on your menu gets a strip of lime tape across its corner. */
.grid > li { position: relative; }
.menu-tape { position: absolute; z-index: 1; top: -6px; right: 14px; transform: rotate(3deg); background: var(--lime); color: var(--on-lime); font: 500 .68rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; padding: 6px 9px; pointer-events: none; }
.welcome .menu-link { margin: 14px auto 0; }
.welcome .add-link { margin-top: 10px; }

/* ===== Your menu (menu.html) =====
   The recipes you're cooking together. Empty, it invites a search; with
   dishes it's a menu card: courses in italics, each dish in its family ink
   with a dotted leader to its time, nested recipes indented under their dish. */
.menu-page { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; padding-bottom: 48px; max-width: 680px; }
.menu-page .back { margin: 0; }
.menu-page .search[hidden] { display: none; }
#menu-body { display: flex; flex-direction: column; gap: 16px; }
#menu-body > p { margin: 0; }
.menu-toprow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow { margin: 0; font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.menu-title { font-family: var(--display); font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.05; margin: 6px 0 10px; letter-spacing: -.02em; text-wrap: balance; }
.menu-browse { font-weight: 600; color: var(--text); }
.menu-how { margin: 0; padding: 14px 14px 14px 34px; border: 1.5px dashed var(--border); border-radius: var(--radius); color: var(--muted); display: grid; gap: 6px; }
.menu-how b { color: var(--text); }
.menu-tabs { margin: 0; }
.menu-results { list-style: none; margin: 0; padding: 0; display: grid; }
.menu-results li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.menu-results .card-icon { width: 32px; height: 32px; }
.menu-result { display: grid; gap: 2px; color: var(--text); text-decoration: none; min-width: 0; }
.menu-result span { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-add { min-height: 40px; padding: 0 14px; font-size: .9rem; border-color: var(--section); color: var(--section); }
.menu-added { color: var(--section); font-weight: 600; font-size: .9rem; padding: 0 6px; }

.menu-card { position: relative; padding: 26px 20px 20px; border: 1.5px solid var(--text); border-radius: var(--radius); background: var(--surface); text-align: center; }
.menu-card::before { content: ""; position: absolute; top: -9px; left: 28px; width: 70px; height: 18px; background: var(--lime); transform: rotate(-3deg); }
.menu-head { margin: 0; font: 500 .74rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.menu-course { margin: 18px 0 8px; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 1.35rem; }
.menu-course small { font: 500 .72rem var(--mono); font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-left: 6px; }
.menu-list, .menu-nest { list-style: none; margin: 0; padding: 0; text-align: left; display: grid; gap: 12px; }
.menu-list > li, .menu-nest > li { display: grid; grid-template-columns: auto minmax(12px, 1fr) auto; align-items: baseline; gap: 4px 6px; }
.menu-nest { grid-column: 1 / -1; margin: 4px 0 0 14px; padding-left: 12px; border-left: 2px solid var(--border); gap: 8px; }
.menu-anchor { position: relative; min-width: 0; }
.menu-dish { all: unset; cursor: pointer; font-family: var(--display); font-size: 1.12rem; font-weight: 600; color: var(--section); }
.menu-dish::after { content: " ▾" / ""; font-size: .75em; color: var(--muted); }
.menu-dish:focus-visible, .menu-choice:focus-visible { outline: 2px solid var(--section); outline-offset: 2px; border-radius: 2px; }
.menu-name { font-family: var(--display); font-size: .98rem; font-weight: 600; color: var(--section); }
.menu-dots { border-bottom: 2px dotted var(--rule-strong); transform: translateY(-4px); }
.menu-time { font: 500 .85rem var(--mono); color: var(--muted); white-space: nowrap; }
.menu-with { grid-column: 1 / -1; padding-left: 12px; color: var(--muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.menu-choice { border: 0; border-bottom: 1.5px solid var(--rule-strong); background: none; font: inherit; font-weight: 600; color: var(--text); padding: 0 2px; cursor: pointer; }
.menu-pop { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; display: grid; min-width: 210px; background: var(--surface); border: 1.5px solid var(--text); border-radius: var(--radius-ctl); box-shadow: 0 8px 22px rgba(0, 0, 0, .16); overflow: hidden; text-align: left; }
.menu-pop > * { border: 0; background: none; text-align: left; padding: 12px 14px; font: inherit; font-size: .95rem; color: var(--text); text-decoration: none; cursor: pointer; }
.menu-pop > * + * { border-top: 1px solid var(--border); }
.menu-pop > :focus-visible { outline: 2px solid var(--text); outline-offset: -3px; }
.menu-pop .menu-danger { color: var(--baking); font-weight: 600; }
.menu-seg { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.menu-seg label { position: relative; }
.menu-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.menu-seg span { display: inline-block; border: 1.5px solid var(--rule-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .82rem; padding: 4px 11px; }
.menu-seg input:checked + span { background: var(--text); color: var(--bg); font-weight: 600; border-color: var(--text); }
.menu-seg input:focus-visible + span { outline: 2px solid var(--section); outline-offset: 2px; }
.menu-seg-stack { flex-direction: column; align-items: stretch; }
.menu-seg-stack span { display: block; border-radius: var(--radius-ctl); padding: 10px 14px; font-size: .92rem; }
.menu-slot { display: block; padding: 12px; border: 1.5px dashed var(--rule-strong); border-radius: var(--radius); color: var(--muted); text-decoration: none; font-weight: 600; margin-top: 16px; }
.menu-foot { display: grid; gap: 4px; margin-top: 16px; font-size: .92rem; }
.menu-switch { font-weight: 600; color: var(--text); display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
.menu-switch input { width: 40px; height: 22px; accent-color: var(--text); }
.menu-warn { text-align: left; margin: 14px 0 0; padding: 10px 12px; border-left: 4px solid var(--baking); background: var(--baking-wash); color: var(--text); border-radius: 4px; font-size: .92rem; }
.menu-error { display: grid; gap: 8px; padding: 16px; border: 1.5px solid var(--baking); border-radius: var(--radius); background: var(--surface); }
.menu-error h2 { margin: 0; font-size: 1.2rem; }
.menu-error p { margin: 0; }
.menu-ahead { display: grid; gap: 8px; padding: 16px; border: 1.5px dashed var(--rule-strong); border-radius: var(--radius); }
.menu-ahead h2 { margin: 0; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 1.25rem; }
.menu-ahead p { margin: 0; color: var(--muted); }
.menu-ahead .btn { justify-self: start; border-color: var(--text); font-weight: 600; min-height: 44px; }
.menu-done { color: var(--text) !important; font-weight: 600; }
.menu-asks { display: grid; gap: 14px; padding: 16px; border: 1.5px solid var(--text); border-radius: var(--radius); background: var(--surface); }
.menu-asks h2 { margin: 0; font-size: 1.15rem; }
.menu-asks > p { margin: 0; font-size: .9rem; }
.menu-ask { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.menu-ask p { margin: 0; }
.menu-ask blockquote { margin: 0; padding-left: 10px; border-left: 3px solid var(--section); color: var(--muted); font-style: italic; }
.menu-ask label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.menu-ask input[type="text"] { width: 5em; font: inherit; padding: 6px 8px; border: 1.5px solid var(--rule-strong); border-radius: var(--radius-ctl); background: var(--bg); color: var(--text); }
.menu-ask .btn { justify-self: start; min-height: 38px; }
.menu-start { width: 100%; justify-content: center; margin: 0; min-height: 52px; font-size: 1.05rem; }

/* Cooking your menu: today's cook screen, plus a chip naming each step's
   dish, the wait screen's ring, and the plate-up step. */
.menu-chip { display: inline-block; margin-right: 8px; padding: 3px 7px; border-radius: 3px; background: var(--section-fill); color: var(--on-section-fill); font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; }
.menu-cook .cook-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.menu-gather { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.menu-gather h3 { margin: 0 0 4px; font-size: 1.1rem; color: var(--section); }
.menu-plate { list-style: none; margin: 0; padding: 0; }
.menu-plate li { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 1.2rem; font-family: var(--display); font-weight: 600; color: var(--section); }
.menu-behind { margin: 0; font-size: .92rem; color: var(--muted); }
.menu-behind b { color: var(--text); }
.menu-land { margin: 0; padding: 10px 12px; border: 1.5px solid var(--section); border-radius: var(--radius-ctl); background: var(--section-wash); display: grid; gap: 2px; font-size: .95rem; }
.menu-land b { font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--section); }
.menu-range { display: block; font-weight: 400; font-size: .92rem; margin-top: 2px; }
.menu-due { display: inline-block; padding: 1px 6px; border-radius: 3px; background: var(--lime); color: var(--on-lime); font: 500 .66rem var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.menu-notes { border-bottom: 1px solid var(--border); padding: 10px 0; }
.menu-notes summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; }
.menu-notes .cook-list { margin-top: 8px; }
.menu-waitbody { align-items: center; text-align: center; justify-content: center; }
.menu-wait-text { font-size: 1.3rem; }
.menu-waitbody > .muted { margin: 0; }
.menu-ring { position: relative; width: min(200px, 50vw, 28vh); aspect-ratio: 1; max-width: 100%; }
.menu-waitbody .menu-land { align-self: stretch; text-align: left; }
.menu-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.menu-ring circle { fill: none; stroke-width: 8; }
.menu-ring-track { stroke: var(--border); }
.menu-ring-left { stroke: var(--section); stroke-linecap: round; }
.menu-ring.up .menu-ring-track { stroke: var(--section); }
.menu-ring.up .menu-ring-left { display: none; }
.menu-ring > span { position: absolute; inset: 0; display: grid; place-content: center; }
.menu-ring b { font: 500 3rem/1 var(--mono); color: var(--section); font-variant-numeric: tabular-nums; }
.menu-ring small { font-family: var(--mono); color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .menu-ring.running .menu-ring-left { transition: stroke-dashoffset 1s linear; }
  .menu-ring.ringing { animation: menu-pulse 1s ease-in-out infinite; }
}
@keyframes menu-pulse { 50% { transform: scale(1.05); } }
.menu-wait-actions { display: flex; gap: 10px; justify-content: center; }
.menu-wait-actions .btn { min-height: 46px; padding: 0 20px; font-weight: 600; }
.menu-stop { min-height: 56px !important; min-width: 200px; font-size: 1.15rem; background: var(--section-fill); color: var(--on-section-fill); border-color: var(--section); }

@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --text: #000; --muted: #333;
    --border: #bbb; --rule-strong: #666; --accent: #000; --lime: #fff;
    --baking: #000; --cooking: #000; --cocktails: #000;
    --baking-wash: #fff; --cooking-wash: #fff; --cocktails-wash: #fff;
    --baking-paper: #fff; --cooking-paper: #fff; --cocktails-paper: #fff;
  }
  @page { margin: 14mm 14mm 16mm; }
  .site-header, .site-nav, .site-footer, .back, .menu-link, .menu-peek, .start-row .menu-anchor, .prep-switch, .toolbar, .tag-groups, .sheet, .backdrop { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.45; }
  .container { padding: 0; max-width: none; }
  .recipe { padding: 0; margin: 0; max-width: none; display: block; border: 0; background: #fff; }
  .recipe::before, .recipe > .recipe-icon { float: right; width: 72px; height: 72px; background: #000; margin: 0 0 6px 12px; }
  .card-icon { background: #000; }
  .recipe:has(.back)::after { width: 22px; height: 22px; margin-top: 18px; background: #000; }
  .recipe h1 { font-size: 26pt; color: #000; }
  .recipe h1::before { color: #333; }
  .facts::after { display: none; }
  .facts, .fact, .facts::before { background: #fff; color: #000; }
  .facts { border-color: #000; break-inside: avoid; }
  .section > h2 { border-color: #000; break-after: avoid; }
  .section > h2::after { color: #333; }
  .ingredients li label { padding: 5px 2px; break-inside: avoid; }
  .ingredients input { width: 14px; height: 14px; border: 1px solid #000; background: #fff !important; }
  .ingredients input:checked + span, .steps li.done { text-decoration: none; }
  .ingredients li:has(input:checked) label::before { opacity: 1; }
  .steps li { padding: 6px 0 6px 40px; border: 0; background: none; break-inside: avoid; }
  .steps li::before { left: 0; top: 5px; width: 26px; height: 26px; border-color: #000; color: #000; font-size: .86rem; letter-spacing: -.04em; }
  .steps li.current::after { display: none; }
  .steps li.done, .ingredients input:checked + span { color: #000; }
  .steps li.done::before, .steps li.current::before { content: counter(step); background: #fff; border-color: #000; color: #000; }
  .step-cue, .step-wait { color: #000; }
  a { color: #000; text-decoration: none; }
}

/* ---- Recipe intake (intake.html): paste a recipe, answer, check, copy ---- */
.intake h1 { margin-top: 18px; }
.intake-read { display: grid; gap: 14px; margin-top: 12px; }
.intake-read > .btn { justify-self: start; }
.intake-field { display: grid; gap: 5px; font-weight: 600; font-size: .95rem; }
.intake-field.inline { display: inline-grid; margin: 6px 10px 6px 0; }
.intake-field input, .intake-field textarea, .intake-field select, .intake-guess select {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: var(--radius-ctl); padding: 8px 10px; min-height: 40px; max-width: 100%;
}
.intake-field textarea { width: 100%; line-height: 1.45; }
.intake-field input:focus-visible, .intake-field textarea:focus-visible, .intake-field select:focus-visible, .intake-guess select:focus-visible,
.intake-part:focus-visible, .intake input[type="radio"]:focus-visible, .intake input[type="checkbox"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.intake-choice, .intake-ask { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0; display: grid; gap: 6px; }
.intake-choice legend, .intake-ask legend { font-weight: 600; padding: 0 4px; }
.intake-ask { margin-top: 12px; background: var(--surface); }
.intake-ask.answered { border-color: var(--section, var(--rule-strong)); }
.intake-ask .btn { justify-self: start; display: inline-flex; margin-right: 8px; }
.intake-option { display: flex; gap: 8px; align-items: baseline; }
.intake-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.intake-primary:disabled { opacity: .5; cursor: not-allowed; }
.intake-problem { color: var(--baking); font-weight: 600; margin: 4px 0; }
.intake-done { color: var(--cooking); font-weight: 600; margin: 2px 0 0; }
.intake-preview { border-top: 0; }
.intake-title { margin-top: 10px; font-size: 2rem; }
.intake-part {
  font: inherit; color: inherit; text-align: left; background: none; border: 0; padding: 2px 0; cursor: pointer;
  text-decoration: underline dotted var(--muted); text-underline-offset: 4px;
}
.intake-ingredients { list-style: none; margin: 0 0 10px; padding: 0; }
.intake-ingredients > li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.intake-steps > li { cursor: default; }
.intake-guess { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 0; font-size: .92rem; color: var(--muted); }
.intake-guess .btn { min-height: 34px; padding: 0 12px; font-size: .86rem; }
.intake-flag { margin: 6px 0 0; font-size: .92rem; color: var(--baking); }
.intake-edit { display: grid; gap: 10px; padding: 10px 0; }
.intake-row { display: flex; gap: 8px; flex-wrap: wrap; }
.intake-holds { margin-top: 18px; }
.intake-holds select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.intake-field { min-width: 0; }
/* A recipe website's address and "Choose a PDF" (assets/intake-import.mjs) */
.intake-from { display: grid; gap: 8px; }
.intake-from .btn { justify-self: start; }
.intake-from .intake-hint { margin: 0; font-size: .9rem; }
.intake-file { position: relative; cursor: pointer; }
.intake-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.intake-file:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
#import-status:empty { display: none; }
.intake-preview .source { margin-top: 6px; }
.intake-finish code, .intake-checks code { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }

/* ---- Recipe editor (edit.html): the recipe as it will look, edited in place ---- */
.edit { max-width: 760px; padding-top: 18px; padding-bottom: 48px; }
.edit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.edit-kicker { margin: 0; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); flex: 1 1 auto; }
.edit-kicker code { text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.edit-status { flex: 1 1 100%; margin: 0; font-size: .92rem; color: var(--muted); }
.edit-status:empty { display: none; }
.edit-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.edit-primary:disabled { opacity: .5; cursor: not-allowed; }
.edit-note, .edit-problems, .edit-todo { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); }
.edit-note h2, .edit-problems h2, .edit-todo h2 { font-size: 1.15rem; margin: 0 0 6px; }
.edit-problems { border-color: var(--baking); }
.edit-problems ul, .edit-todo ul { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 8px; }
.edit-todo li .edit-row { margin-top: 6px; }
.edit-card { margin-top: 20px; }
.edit-card .grid { margin: 0; }
.edit-preview { margin-top: 20px; padding-top: 0; }
.edit-part {
  font: inherit; color: inherit; text-align: left; background: none; border: 0; padding: 2px 0; margin: 0; cursor: pointer;
  text-decoration: underline dotted var(--muted); text-underline-offset: 4px; letter-spacing: inherit; line-height: inherit;
}
.edit-preview h1 .edit-part, .edit-preview h3 .edit-part { text-decoration-thickness: 2px; }
.edit-part:focus-visible, .edit input:focus-visible, .edit textarea:focus-visible, .edit select:focus-visible, .edit summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.edit-preview ol.steps > li { cursor: default; }
.edit-preview ul.ingredients > li { padding: 6px 0; }
.edit-add-line { margin: 10px 0 0; }
.edit-error { margin: 6px 0 0; font-size: .92rem; font-weight: 600; color: var(--baking); }
/* Saving and deleting: why a save didn't happen, Delete, and its confirmation. */
.edit-save-error { flex: 1 1 100%; font-size: .95rem; color: var(--baking); font-weight: 600; }
.edit-save-error:empty { display: none; }
.edit-save-error p { margin: 0 0 4px; }
.edit-save-error ul { margin: 4px 0; padding-left: 1.2em; font-weight: 400; color: var(--text); }
.edit-save-error a, .edit-status a { color: inherit; font-weight: 600; }
.edit-delete { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--border); }
.edit-delete .muted { margin: 8px 0 0; }
.edit-danger { color: var(--baking); border-color: var(--baking); }
.edit-danger:disabled { opacity: .55; cursor: not-allowed; }
.edit-dialog { max-width: min(460px, calc(100vw - 32px)); padding: 18px 20px; color: var(--text); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius); }
.edit-dialog::backdrop { background: var(--scrim); }
.edit-dialog h2 { font-size: 1.3rem; margin: 0 0 8px; }
.edit-dialog-body { display: grid; gap: 12px; }
.edit-dialog-body p { margin: 0; }
.edit-dialog input:focus-visible, .edit-dialog button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.edit-form { display: grid; gap: 10px; padding: 10px 12px; margin: 6px 0; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); }
.edit-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.edit-fields > .edit-field { flex: 1 1 140px; }
.edit-field { display: grid; gap: 5px; font-weight: 600; font-size: .95rem; min-width: 0; }
.edit-field.inline { display: inline-grid; margin: 4px 0 4px 26px; }
.edit-field input, .edit-field textarea, .edit-field select {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: var(--radius-ctl); padding: 8px 10px; min-height: 40px; max-width: 100%; width: 100%;
}
.edit-field textarea { line-height: 1.45; }
.edit-row { display: flex; flex-wrap: wrap; gap: 8px; }
.edit-adds { margin-top: 12px; }
.edit-adds .edit-form { flex: 1 1 100%; }
.edit-check { display: flex; gap: 8px; align-items: baseline; font-size: .95rem; }
.edit-details { margin-top: 28px; border-top: var(--rule) solid var(--section); padding-top: 10px; }
.edit-details > summary { cursor: pointer; font-family: var(--display, inherit); font-size: 1.5rem; font-weight: 600; padding: 6px 0; }
.edit-details-body { display: grid; gap: 16px; margin-top: 8px; }
.edit-set { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
.edit-set > legend { font-weight: 700; padding: 0 4px; }
.edit-tags, .edit-ing, .edit-step { border: 0; border-top: 1px solid var(--border); padding: 10px 0 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.edit-tags > legend, .edit-ing > legend, .edit-step > legend { font-weight: 600; padding: 0; float: left; width: 100%; margin-bottom: 4px; }
.edit-subhead { margin: 4px 0 0; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.edit-chips { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.edit-uses { display: grid; gap: 4px; }
