/* Slothei's Kitchen styles.
   1. Tokens: every color, size, space and corner comes from here; components never invent their own.
   2. Base   3. Shared components (cards, pills, icon buttons, sheets)   4. Screens, top to bottom. */

/* ---------- 1. tokens ---------- */
:root {
  color-scheme: light;
  /* color: light */
  --bg: #f6f3ee; --surface: #ffffff; --ink: #2a1d14; --muted: #7a6a5d; --line: #e4ddd3; --done: #b8ada3;
  --toffee: #a5561b; --toffee-soft: #f3e3d3;   /* amounts, stats, the current item */
  --ok: #2f7d4f; --ok-soft: #dcefe3;           /* done, on, equipment */
  --link: #2f6aa0; --link-soft: #dde9f5;       /* links and jumps */
  --alarm: #c2341f;                            /* warnings, timers going off */
  --g-s: #8a4fd0; --g-e: #2a7fc0; --g-a: #2f8f52; --g-b: #5f9a2a; --g-c: #a8860a; --g-d: #c4621a; --g-f: #c2341f; --g-x: #8c1c3a; /* grades; e: Super Easy, x: Backbreaking */
  --scrim: rgba(0, 0, 0, .45);
  /* type */
  --font-display: "Young Serif", Georgia, serif;
  --font-body: "Figtree", -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace; /* timer digits only */
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3.1 6.6 7.2.9-5.3 5 1.4 7.1L12 17.9l-6.4 3.5L7 14.3l-5.3-5 7.2-.9z'/%3E%3C/svg%3E");
  --t-xs: 13px; --t-s: 15px; --t-m: 17px; --t-body: 19px; --t-l: 20px; --t-xl: 24px; --t-xxl: 34px;
  /* space, corners, sizes */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-pill: 999px;
  --tap: 44px;         /* smallest thing a finger has to hit */
  --icon-btn: 36px;    /* round buttons beside an item */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .08);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, .18);
  --gutter: max(var(--s4), env(safe-area-inset-left, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17120e; --surface: #221a14; --ink: #f2e9df; --muted: #a8998b; --line: #3a2e25; --done: #6a5d52;
    --toffee: #e39a5c; --toffee-soft: #3b2718; --ok: #6fcf97; --ok-soft: #1d3326; --link: #7fb6e8; --link-soft: #1b2a38;
    --alarm: #ff7a63;
    --g-s: #c08cff; --g-e: #6cb4f0; --g-a: #5fd38a; --g-b: #a6d65a; --g-c: #f0cc3c; --g-d: #f59a52; --g-f: #ff6b5e; --g-x: #e0607e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17120e; --surface: #221a14; --ink: #f2e9df; --muted: #a8998b; --line: #3a2e25; --done: #6a5d52;
  --toffee: #e39a5c; --toffee-soft: #3b2718; --ok: #6fcf97; --ok-soft: #1d3326; --link: #7fb6e8; --link-soft: #1b2a38;
  --alarm: #ff7a63;
  --g-s: #c08cff; --g-e: #6cb4f0; --g-a: #5fd38a; --g-b: #a6d65a; --g-c: #f0cc3c; --g-d: #f59a52; --g-f: #ff6b5e; --g-x: #e0607e;
}

/* ---------- 2. base ---------- */
* { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--top-h, 0px)); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--t-body); line-height: 1.5; font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
img { max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; } /* (not the browser's Arial) */
button:focus-visible, label:focus-within { outline: 3px solid var(--toffee); outline-offset: 2px; }
.wrap { max-width: 680px; margin: 0 auto; padding-inline: var(--gutter); }
main { padding-block: var(--s3) 140px; }
h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--t-xl); margin: var(--s5) 0 var(--s2);
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
h2:first-child { margin-top: var(--s1); }
h2 small { font-family: var(--font-body); font-size: var(--t-s); color: var(--muted); }
h3 { font-size: var(--t-m); margin: var(--s4) 0 var(--s1); color: var(--muted); }
.lead { margin: var(--s1) 0 0; color: var(--muted); font-size: var(--t-m); }
/* Cooking Time while recording: ● the time so far, and Stop */
.rec-now { display: flex; align-items: center; gap: var(--s3); margin: var(--s3) 0; padding: var(--s3) var(--s4); border: 1px solid var(--line);
  border-radius: var(--r-l); background: var(--surface); }
.rec-now .rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--alarm); animation: pulse-dot 1.6s infinite; flex: none; }
@keyframes pulse-dot { 50% { opacity: .35; } }
.rec-now span { flex: 1; display: flex; flex-direction: column; }
.rec-now b { font-size: var(--t-xl); line-height: 1.2; }
.rec-now small { font-size: var(--t-xs); color: var(--muted); }
.rec-now .chip svg { width: 14px; height: 14px; }
.rec-now .del { border: 1px solid var(--line); background: none; border-radius: var(--r-pill); min-width: 36px; height: 36px; color: var(--muted); }
.rec-now .del.sure { background: var(--alarm); border-color: var(--alarm); color: #fff; padding: 0 var(--s3); }
@keyframes blink { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- 3. shared components ---------- */
/* cards: anything that's a box on the page */
.card, .step, .note, .scale, .feed-card, .timer, .xlink, .peek {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
}
/* pills: chips, sub-tabs, picks */
.chip, .subtabs button, .picks button {
  display: inline-flex; align-items: center; gap: var(--s1); border-radius: var(--r-pill); white-space: nowrap;
}
.chip { height: var(--icon-btn); border: 2px solid var(--toffee); color: var(--toffee); background: transparent; padding: 0 var(--s3); font-weight: 700; font-size: var(--t-m); }
.chip .mono { font-family: var(--font-mono); }
.chip.running { background: var(--toffee); color: var(--surface); } /* (its timer is going) */
/* round icon buttons */
.tool, .help, .hear, .sheet-x {
  flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); padding: 0;
}
.tool svg { width: 20px; height: 20px; }
/* bottom sheets */
/* (sized to what's visible, dom.js --vv-top/--vv-h: with the keyboard up the sheet sits right on it, nothing between) */
.sheet { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100%); z-index: 20; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { position: relative; width: 100%; max-width: 680px; max-height: 85%; overflow-y: auto; background: var(--bg);
  border-radius: 20px 20px 0 0; padding: var(--s5) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom, 0px)); text-align: left; }
/* the title and ✕ stay at the top while the sheet scrolls */
.sheet-card > h2:first-of-type { position: sticky; top: calc(-1 * var(--s5)); z-index: 2; background: var(--bg);
  margin: calc(-1 * var(--s5)) calc(-1 * var(--s4)) 0; padding: var(--s5) calc(var(--tap) + var(--s2) + var(--s4)) var(--s2) var(--s4); }
.sheet-x { position: sticky; z-index: 3; float: right; top: calc(var(--s3) - var(--s5)); margin: calc(var(--s3) - var(--s5)) calc(var(--s3) - var(--s4)) 0 0;
  width: 40px; height: 40px; border: 0; background: var(--line); font-size: 18px; }
/* sheet layout: title, subtitle under it, a summary card, small-caps section headings, rows */
.sheet-card h2 { display: block; }
.sheet-card h2 small { display: block; margin-top: 2px; font-size: var(--t-s); }
.sheet-card h3 { margin: var(--s4) 0 var(--s1); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.summary { display: flex; gap: var(--s3); margin: var(--s3) 0; padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.summary div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.summary div + div { border-left: 1px solid var(--line); padding-left: var(--s3); }
.summary b { font-size: var(--t-xl); color: var(--toffee); line-height: 1.2; }
.summary div > span { font-size: var(--t-xs); color: var(--muted); }
/* an Author's time, typed where it shows (timefield.js): its pencil beside it; tapped, a line under it and the gray
   rest of 00h 00m behind */
.tf-wrap { position: relative; display: inline-flex; align-items: center; gap: var(--s2); max-width: 100%; }
.tf { position: relative; z-index: 1; width: 4.6em; max-width: 100%; padding: 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; font: inherit; color: inherit; outline: none; }
/* ⓘ after a name (dom.js infoMark) */
sup.info { display: inline-grid; vertical-align: super; margin-left: 2px; color: var(--muted); cursor: pointer; line-height: 0; }
sup.info svg { width: .8em; height: .8em; }
.tf-edit { display: grid; width: 22px; height: 22px; color: var(--muted); }
.tf-edit svg { width: 100%; height: 100%; }
label.tf-wrap:focus-within { outline: none; } /* (a toffee line under it instead) */
.summary [data-grade] { color: var(--grade); } /* a rating in a summary: its colour */
.tf:focus { border-bottom-color: var(--toffee); border-bottom-style: solid; }
.tf.bad { border-bottom-color: var(--alarm); }
.summary .tf-ghost { position: absolute; inset: 0 auto 0 0; display: flex; align-items: center; font-size: inherit; color: var(--muted); opacity: .6; white-space: pre; pointer-events: none; }
.tf-ghost i { font-style: normal; visibility: hidden; }
.money { color: var(--toffee); font-weight: 700; }
/* tables in sheets (calories, cost) */
table.kcal { width: 100%; border-collapse: collapse; font-size: var(--t-m); }
table.kcal td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kcal td:last-child { text-align: right; font-weight: 700; color: var(--toffee); padding-left: var(--s3); }
table.kcal small { display: block; color: var(--muted); font-size: var(--t-xs); }
table.kcal tr.opt { color: var(--muted); }
/* the toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 8;
  max-width: calc(100% - 2 * var(--s4)); padding: 10px var(--s4); border-radius: var(--r-m); background: var(--ink); color: var(--bg); font-size: var(--t-s); }

/* ---------- 4. screens ---------- */
/* header: a toolbar (Hamagotchi left, icons right), the line above the title, the title, the metrics strip */
header.hero { padding-block: var(--s2) var(--s4); }
/* the top bar stays put while the page scrolls; what sticks under it (.bar, .subtabs) sits below it (--top-h) */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 7; background: var(--bg); padding-block: var(--s3) var(--s2); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.tools { display: flex; gap: var(--s2); }
.tool { width: 40px; height: 40px; color: var(--muted); }
.tool[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.tool.avatar { border-color: var(--toffee); background: var(--toffee-soft); color: var(--toffee); font-weight: 700; font-size: var(--t-m); overflow: hidden; }
.tool.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* the sign-in sheet: one full-width button per way */
.sign-in { display: flex; align-items: center; justify-content: center; gap: var(--s3); min-height: var(--tap); margin: var(--s3) 0;
  border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; }
.sign-in.google { background: #fff; color: #1f1f1f; border-color: #747775; }
.tool.rec svg { width: 16px; height: 16px; }
.tool.rec[aria-pressed="true"] { border-color: var(--alarm); background: transparent; color: var(--alarm); animation: blink 1.6s ease-in-out infinite; }
.eyebrow { font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dates { font-size: var(--t-s); color: var(--muted); margin: calc(-1 * var(--s3)) 0 var(--s3); }
.dates:empty { display: none; }
h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--t-xxl); line-height: 1.1; margin: var(--s1) 0 var(--s4); text-wrap: balance; }
/* header tiles: the rated row (time, difficulty, taste: whose, by the switch above it), then the plain facts (prep time,
   cost, calories, and the recipe's own facts) in a slimmer row of their own */
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.stats:empty { display: none; }
.stats.facts { margin-top: 6px; }
.facts .stat { flex-direction: row; justify-content: center; gap: var(--s2); padding: 6px var(--s2); }
.facts .stat-icon { height: auto; }
/* three facts (Prep Time, Cost, Calories) stand like the tiles above, so none is squeezed */
.facts:has(> :nth-child(3)) .stat { flex-direction: column; gap: 2px; padding: var(--s2) var(--s1); }
.facts:has(> :nth-child(3)) .stat-icon { height: var(--t-m); }
.seg.source { margin: 0 0 var(--s2); }
.seg.source button { flex: auto; white-space: nowrap; padding-inline: var(--s1); } /* "Average Ratings" on one line */
.recipe-card .seg.source button { flex: 1; white-space: normal; line-height: 1.2; } /* (narrower: two lines each) */
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: var(--s2) var(--s1);
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-align: center; }
.stat-icon { font-style: normal; font-size: var(--t-m); line-height: 1; height: var(--t-m); }
.stat-value { font-size: var(--t-m); line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; }
.stat-label { font-size: var(--t-xs); color: var(--muted); line-height: 1.2; }
.stat [data-grade] { color: var(--grade); white-space: nowrap; } /* (100/100 on one line) */
.stat .rate { color: var(--link); font-size: var(--t-s); }

/* sticky tab bar */
.bar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--top-h, 0px)); z-index: 5; background: var(--bg); padding-block: var(--s2) 10px; border-bottom: 1px solid var(--line); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); padding: var(--s1); border-radius: var(--r-m); background: var(--line); }
.tabs button { border: 0; background: transparent; padding: 9px 2px; border-radius: 9px; font-weight: 700; font-size: var(--t-s); color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.count { font-size: var(--t-xs); font-weight: 400; margin-left: var(--s1); opacity: .8; }
/* sub-tabs: pinned under the bar, scroll sideways */
.subtabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--top-h, 0px) + var(--bar-h, 0px)); z-index: 4; background: var(--bg);
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 6px; padding-block: var(--s2); }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: none; border: 2px solid var(--line); background: transparent; padding: 6px var(--s3); font-weight: 700; font-size: var(--t-s); color: var(--muted); }
.subtabs button[aria-selected="true"] { background: var(--toffee); border-color: var(--toffee); color: var(--surface); }

/* ingredients: sub-tabs + portions pinned; checklist rows */
.ing-top { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--top-h, 0px) + var(--bar-h, 0px)); z-index: 4; background: var(--bg); padding-block: var(--s2); }
.ing-top .subtabs { position: static; padding: 0; margin: 0 0 var(--s2); }
.scale { padding: var(--s2) var(--s3); display: flex; flex-direction: column; gap: 10px; }
.scale-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.scale-label { display: flex; flex-direction: column; min-width: 0; }
.scale-label strong { font-size: var(--t-m); }
.scale-label span { font-size: var(--t-s); color: var(--toffee); font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 40px; height: 40px; border-radius: var(--r-m); border: 2px solid var(--toffee); background: transparent; color: var(--toffee);
  font-size: 26px; font-weight: 700; line-height: 1; display: grid; place-items: center; }
.stepper button:disabled { opacity: .35; }
.stepper input { width: 64px; padding: var(--s1) 0; border: 2px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink);
  text-align: center; font-weight: 700; font-size: var(--t-xl); -moz-appearance: textfield; appearance: textfield; }
.stepper input:focus { outline: none; border-color: var(--toffee); }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#view-ing > .hint { font-size: var(--t-s); color: var(--muted); margin: var(--s1) 0 0; }
.ings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ing { display: flex; gap: var(--s3); align-items: flex-start; padding: 10px var(--s1); border-bottom: 1px solid var(--line); cursor: pointer; }
.ing input { position: absolute; opacity: 0; pointer-events: none; }
.box { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 7px; border: 2px solid var(--muted); display: grid; place-items: center; }
.box svg { width: 16px; height: 16px; opacity: 0; }
.ing .qty { font-weight: 700; color: var(--toffee); white-space: nowrap; }
.ing .what { min-width: 0; }
.ing .opt { font-size: var(--t-s); color: var(--muted); }
/* grocery list: rows under aisle headings; price on the right */
h3.aisle { margin: var(--s4) 0 0; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ok); }
.ing.grocery .what { flex: 1; display: flex; flex-direction: column; }
.ing.grocery .what small { font-size: var(--t-s); color: var(--muted); }
.ing.grocery .what em { font-style: normal; font-weight: 700; font-size: var(--t-s); color: var(--alarm); }
.ing .price { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.ing .price b { color: var(--toffee); }
.ing .price small { font-size: var(--t-xs); color: var(--muted); }
.ing.is-done .price b, .ing.grocery.is-done .what b { color: var(--done); text-decoration: line-through; }
.ing.is-done .box { background: var(--ok); border-color: var(--ok); }
.ing.is-done .box svg { opacity: 1; }
.ing.is-done .what, .ing.is-done .qty { color: var(--done); text-decoration: line-through; }

/* prep and steps: one card per item. Number | text; under the text one row: timer left, round buttons right;
   panels open under that. The current item gets the toffee outline; done items fade and cross out. */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.step { padding: var(--s3) var(--s3) var(--s3) 10px; display: grid; grid-template-columns: var(--icon-btn) minmax(0, 1fr); gap: 0 var(--s3); }
.step.is-current { border-color: var(--toffee); box-shadow: 0 0 0 1px var(--toffee) inset; background: linear-gradient(var(--toffee-soft), var(--toffee-soft)) 0 0 / 4px 100% no-repeat, var(--surface); }
.step.is-done { opacity: .55; }
.step.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 4px var(--link); } }
.step .num { width: var(--icon-btn); height: var(--icon-btn); border-radius: 50%; border: 0; display: grid; place-items: center;
  font-weight: 700; font-size: var(--t-m); background: var(--toffee-soft); color: var(--toffee); }
.step.is-current .num { background: var(--toffee); color: var(--surface); }
.step.is-done .num { background: var(--ok); color: #fff; }
.step .body { min-width: 0; font-size: var(--t-body); line-height: 1.5; padding-top: 4px; }
.step.is-done .body { text-decoration: line-through; text-decoration-color: var(--done); }
.step .body .ref { font-weight: 700; }
.step .body .amt { color: var(--toffee); font-weight: 700; white-space: nowrap; }
.step .ptitle { display: block; font-size: var(--t-m); color: var(--muted); font-weight: 700; }
.step .tools { grid-column: 2; display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.step .aside { display: flex; gap: 6px; margin-left: auto; }
.help { width: var(--icon-btn); height: var(--icon-btn); border-color: var(--toffee); background: transparent; color: var(--toffee); font-weight: 700; font-size: var(--t-m); }
.help[aria-expanded="true"] { background: var(--toffee); color: var(--surface); }
.help.why { border-color: var(--muted); color: var(--muted); }
.help.why[aria-expanded="true"] { background: var(--muted); color: var(--surface); }
.help.remind { border-color: var(--alarm); color: var(--alarm); font-size: var(--t-body); }
.help.remind[aria-expanded="true"] { background: var(--alarm); color: var(--surface); }
.help.link { border-color: var(--link); color: var(--link); }
.help.link[aria-expanded="true"] { background: var(--link); color: var(--surface); }
.help svg { width: 18px; height: 18px; }
.step .tip { grid-column: 2; margin-top: var(--s2); padding: 10px var(--s3); border-radius: 10px; background: var(--toffee-soft); font-size: var(--t-m); line-height: 1.45; }
.step .tip + .tip { margin-top: 6px; }
.step .tip strong { display: block; margin-bottom: 2px; }
.step .tip ol { margin: var(--s1) 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.step .tip li img { display: block; width: 100%; max-width: 240px; margin: 6px 0 2px; border-radius: var(--r-s); }
.step .tip.whytip { background: transparent; border: 1px dashed var(--muted); }
.step .tip.remindtip { background: transparent; border: 2px solid var(--alarm); }
.step .tip.linktip { background: var(--link-soft); }
.xlink { display: block; width: 100%; text-align: left; margin-top: 6px; padding: var(--s2) 10px; border-radius: 10px; font-size: var(--t-m); line-height: 1.4; }
.xlink b { display: block; color: var(--link); font-size: var(--t-s); }
.mark { display: inline-block; font-size: var(--t-s); font-weight: 700; padding: 1px var(--s2); border-radius: var(--r-pill); white-space: nowrap; vertical-align: 2px; }
.mark.pause { margin-left: 6px; background: var(--line); color: var(--muted); }
.mark.switch { display: table; margin-bottom: var(--s1); background: var(--toffee-soft); color: var(--toffee); }
/* in recipe text */
.iref { cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; font-weight: 700; color: var(--link);
  text-decoration: underline dotted; text-underline-offset: 3px; }
[data-go] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.equip { color: var(--ok); }
.warn { color: var(--alarm); }
/* press-and-hold preview */
.peek { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  width: min(520px, calc(100% - 2 * var(--s4))); padding: 14px var(--s4); border: 2px solid var(--link); box-shadow: var(--shadow-2); font-size: var(--t-m); line-height: 1.45; }
.peek small { display: block; color: var(--muted); font-size: var(--t-xs); }
.peek strong { display: block; }

/* notes */
.notes { display: flex; flex-direction: column; gap: var(--s3); }
.note { padding: 14px var(--s4); }
.note strong { display: block; margin-bottom: 2px; }
.src { font-size: var(--t-s); color: var(--muted); }
.src a { color: var(--toffee); }
.reset { margin-top: var(--s5); border: 2px solid var(--toffee); background: var(--toffee-soft); border-radius: var(--r-pill); padding: 10px var(--s4); font-size: var(--t-m); font-weight: 700; color: var(--toffee); }

/* timers: dock at the bottom */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-top: 1px solid var(--line); }
.dock .wrap { display: flex; gap: var(--s2); overflow-x: auto; }
.timer { flex: none; min-width: min(330px, calc(100vw - 2 * var(--s4))); display: flex; align-items: stretch; gap: 10px; padding: 10px 10px 10px 14px; border: 2px solid var(--toffee); }
.timer .tmain { flex: 1; min-width: 0; }
.timer .l { font-size: var(--t-s); color: var(--muted); line-height: 1.2; }
.timer .l b { color: var(--ink); }
.timer .tstatus { font-weight: 700; color: var(--alarm); font-size: var(--t-m); }
.timer .t { font-family: var(--font-mono); font-weight: 700; font-size: 26px; }
.timer .t small { font-family: var(--font-body); font-size: var(--t-xs); font-weight: 400; color: var(--muted); margin-left: var(--s2); }
.tbar { position: relative; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--line); }
.tbar span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--toffee); }
.tbar i { position: absolute; top: -3px; width: 2px; height: var(--s3); background: var(--ink); }
.timer .tbtns { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.timer .tbtns button { min-width: var(--tap); height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--toffee-soft); font-weight: 700; }
.timer .tbtns button.ok { background: var(--ok); color: var(--surface); }
.timer.checking { border-color: var(--ok); }
.timer.checking .t, .timer.checking .tstatus { color: var(--ok); }
.timer.ringing { border-color: var(--alarm); animation: pulse 1s infinite; }
.timer.ringing .t { color: var(--alarm); }
@keyframes pulse { 50% { background: var(--toffee-soft); } }

/* sheets: rows, sessions, ratings */
ul.sessions, .meals { list-style: none; margin: 0; padding: 0; }
/* admin: the recipe's time */
.set-time { display: flex; align-items: center; gap: var(--s2); font-weight: 700; }
/* Time Spent: Start, End, Total, each a row of typed boxes */
.set-grid { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; gap: var(--s2) var(--s3); margin: var(--s2) 0 var(--s3); }
.set-grid .tl { color: var(--muted); font-size: var(--t-s); font-weight: 700; }
.clock { display: flex; align-items: center; gap: var(--s1); font-weight: 700; }
.clock .tbox, .hm .tbox { width: 2.8em; padding: 0; }
.clock .ampm { margin: 0 0 0 var(--s2); }
.clock .ampm button { padding: var(--s1) var(--s2); }
.tbox.bad { border-color: var(--alarm); }
.tbox { height: 44px; padding: 0 var(--s2); border: 2px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; text-align: center; -webkit-appearance: none; appearance: none; }
.tbox:focus { outline: none; border-color: var(--toffee); }

ul.sessions li { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.sessions li div { flex: 1; display: flex; flex-direction: column; }
ul.sessions li span { color: var(--muted); font-size: var(--t-s); }
ul.sessions .dur { display: inline-flex; align-items: center; gap: var(--s1); border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--link); }
ul.sessions .dur svg { width: 18px; height: 18px; color: var(--muted); }
.hm { display: inline-flex; align-items: center; gap: var(--s2); }
.fine { margin: var(--s2) 0 0; font-size: var(--t-xs); color: var(--muted); }
.save-time { margin-top: var(--s2); }
ul.sessions .del { border: 1px solid var(--line); background: none; border-radius: var(--r-pill); min-width: 36px; height: 36px; color: var(--muted); }
ul.sessions .del.sure { background: var(--alarm); border-color: var(--alarm); color: #fff; padding: 0 var(--s3); }
.picks { display: flex; flex-wrap: wrap; gap: var(--s2); }
.flag-picks { display: flex; flex-wrap: wrap; gap: var(--s2); }
.picks button svg { width: 18px; height: 18px; color: var(--alarm); fill: currentColor; margin-right: var(--s1); }
.picks button { min-width: 52px; justify-content: center; padding: var(--s2) 14px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; }
.picks button[aria-pressed="true"] { background: var(--toffee); border-color: var(--toffee); color: var(--surface); }
.picks button[data-grade] { border-color: var(--grade); color: var(--grade); }
.picks button[data-grade][aria-pressed="true"] { background: var(--grade); color: var(--bg); }
/* Taste: ten stars, filled up to the pick, numbers under them (a recipe's two rows, first and optional second, or the
   Filters sheet's one 'at least' row); Difficulty: the same two rows of picks */
.stars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.stars button { display: flex; flex-direction: column; align-items: center; padding: var(--s1) 0; border: 0; background: none; color: var(--muted); font-size: var(--t-xs); font-weight: 700; }
.stars b { font-size: var(--t-xxl); line-height: 1.1; color: var(--line); }
.stars .on b { color: var(--toffee); }
.stars button[aria-pressed="true"] { color: var(--toffee); }
.two-rows h3 { text-align: left; }
[data-grade="S"] { --grade: var(--g-s); } [data-grade="A"], [data-grade="Easy"] { --grade: var(--g-a); }
[data-grade="Easy-Medium"] { --grade: var(--g-b); } [data-grade="C"], [data-grade="Medium"] { --grade: var(--g-c); }
[data-grade="D"], [data-grade="Medium-Hard"] { --grade: var(--g-d); } [data-grade="F"], [data-grade="Hard"] { --grade: var(--g-f); }
[data-grade="Backbreaking"] { --grade: var(--g-x); } [data-grade="Super Easy"] { --grade: var(--g-e); }
/* a difficulty's word with its points: under them (tiles, sheets), beside them (book cards) */
.word { display: block; font-size: var(--t-xs); font-weight: 700; line-height: 1.2; }
.word-by { margin-left: 4px; font-size: var(--t-xs); font-weight: 700; }
/* a Difficulty sheet's 1–100 scale: green to deep red, each word's points under it, each rating marked above */
.dscale { position: relative; height: 56px; margin: var(--s3) var(--s3) var(--s2); }
.dscale .track { position: absolute; left: 0; right: 0; top: 22px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--g-e), var(--g-a), var(--g-b), var(--g-c), var(--g-d), var(--g-f), var(--g-x)); }
.dscale.taste .track { background: linear-gradient(90deg, var(--g-f), var(--g-d), var(--g-c), var(--g-b), var(--g-a), var(--g-s)); }
.dscale.taste .tick { top: 32px; }
/* a Taste tile's five stars under its face, filled to scale */
.stat-icon:has(.star-row) { height: auto; }
.star-row { display: block; font-size: 11px; line-height: 1; white-space: nowrap; }
/* stars are drawn (Figtree has no ★): a star-shaped window onto a colour, or onto two for a part-filled one */
.star, .star-row b, .stars b { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; background: currentColor;
  -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat; }
.star-row b { background: linear-gradient(90deg, var(--grade, var(--line)) var(--f), var(--line) var(--f)); }
svg.g { vertical-align: -0.125em; }
.dscale .tick { position: absolute; top: 34px; transform: translateX(-50%); font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
.dscale .mk { position: absolute; top: 2px; transform: translateX(-50%); font-size: var(--t-xs); font-weight: 800; color: var(--ink); white-space: nowrap; }
.dscale .mk::after { content: ""; display: block; width: 2px; height: 12px; margin: 2px auto 0; background: var(--ink); }
.dscale .l { transform: none; } .dscale .r { transform: translateX(-100%); }
.dscale .mk.l::after { margin-left: 0; } .dscale .mk.r::after { margin-right: 0; }
.picks button small { margin-left: 6px; font-size: var(--t-xs); font-weight: 600; opacity: .85; } /* a difficulty's points */

/* Hamagotchi: sits at the left of the toolbar, art beside its fullness meter */
.pet-mini { flex: none; display: flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; height: 40px; border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.pet-art { display: inline-block; line-height: 0; animation: bob 1.2s steps(2) infinite; }
.pet-art.pet-hungry { animation-duration: 2.4s; }
.pet-art.pet-egg { animation: wobble 2s steps(2) infinite; }
.pet-art.big { display: block; width: fit-content; margin: var(--s2) auto; }
@keyframes bob { 50% { transform: translateY(-2px); } }
@keyframes wobble { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.meter { display: block; width: 44px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ok); }
.sheet-card .meter { width: 160px; height: 10px; margin: 0 auto var(--s2); border-radius: 5px; }
.pet-name { display: block; margin: 0 auto; width: 70%; text-align: center; font-family: var(--font-display); font-size: 28px; border: 0; border-bottom: 2px dashed var(--line); background: transparent; color: var(--ink); }
.pet-status { margin: var(--s2) 0; color: var(--muted); text-align: center; }
.meals li { display: flex; justify-content: space-between; gap: var(--s3); padding: 10px var(--s1); border-bottom: 1px solid var(--line); }
.meals small { color: var(--muted); }
.feed-card { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: 14px; padding: 14px var(--s4); border: 2px dashed var(--toffee); }
.feed-card.done { border-style: solid; border-color: var(--ok); }
.feed-card p { margin: 0; flex: 1; min-width: 0; font-weight: 700; }
.feed-card .food { font-size: 34px; line-height: 1; }
.feed-card .food-img { width: 1.3em; height: 1.3em; }
.feed-card.eating .food { animation: eat 2.4s steps(4) forwards; }
@keyframes eat { to { transform: scale(0); opacity: 0; } }
.feed-card .done-btn { margin-left: auto; padding: 10px 26px; font-size: 18px; background: var(--toffee); color: var(--surface); }
.food-img { width: 1em; height: 1em; image-rendering: pixelated; vertical-align: -0.12em; }

/* a save the server hasn't got yet (data.js): a dot on your photo */
#account { position: relative; }
[data-unsent] #account::after { content: ""; position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--toffee); border: 2px solid var(--bg); }
/* Settings' time zone */
.zone { display: flex; align-items: center; gap: var(--s3); margin: var(--s3) 0; color: var(--muted); font-size: var(--t-s); font-weight: 700; }
label.zone:focus-within { outline: none; }
.zone select:focus { outline: none; border-color: var(--toffee); }
.zone select { width: auto; min-width: 0; height: 40px; padding: 0 var(--s2); border: 2px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-m); font-weight: 400; }
/* the account sheet's Sign out */
.sign-out { display: inline-flex; margin-top: var(--s2); text-decoration: none; }
/* Settings: its title with Sign Out beside it (clear of the ✕) */
.set-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-right: 52px; }
.set-head .sign-out { margin-top: 0; flex: none; }
/* the grocery list's store, and the store sheet */
.store-pick { display: block; margin: var(--s2) 0; border: 0; background: none; padding: 0; text-align: left; font-size: var(--t-s); color: var(--muted); }
button.store-pick { color: var(--link); }
.zip { display: flex; gap: var(--s2); }
.zip input { flex: 1; min-width: 0; }
ul.stores { list-style: none; margin: var(--s3) 0 0; padding: 0; }
ul.stores button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: var(--s3) 0; font-size: var(--t-m); color: var(--ink); }

/* segmented control (a row of tabs in a pill) */
.seg { display: flex; gap: var(--s1); padding: var(--s1); border-radius: var(--r-m); background: var(--line); margin: 0 0 var(--s3); }
.seg button { flex: 1; border: 0; background: transparent; padding: var(--s2); border-radius: var(--r-s); font-weight: 700; font-size: var(--t-s); color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.sheet-card h4 { margin: var(--s3) 0 var(--s1); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- recipe book (index.html) ---------- */
.toolbar-left { display: flex; align-items: center; gap: var(--s2); }
.back { display: grid; place-items: center; color: var(--link); }
.book-hero h1 { margin-bottom: var(--s3); }
.search input { width: 100%; height: var(--tap); padding: 0 var(--s4); border: 2px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-m); }
.search input:focus { outline: none; border-color: var(--toffee); }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: var(--s3); padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: transparent; border-radius: var(--r-pill); padding: 6px var(--s3); font-weight: 700; font-size: var(--t-s); color: var(--muted); white-space: nowrap; }
.pill[aria-pressed="true"] { background: var(--toffee); border-color: var(--toffee); color: var(--surface); }
/* what's filtered now: a bubble each, ✕ clears it; Clear all clears every one */
.active { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.pill.bubble { border-color: var(--toffee); background: var(--toffee-soft); color: var(--ink); }
.pill.bubble i { font-style: normal; color: var(--toffee); margin-left: 2px; }
.pill.bubble [data-grade] { color: var(--grade); }
.pill.clear { border-color: var(--line); color: var(--muted); }
.ing-find { margin-bottom: var(--s2); }
/* the ingredients search finds: one row each, with how many recipes use it; picked ones filled */
.ing-list { display: flex; flex-direction: column; }
.ing-list button { display: flex; justify-content: space-between; padding: var(--s2) var(--s3); border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; }
.ing-list button[aria-pressed="true"] { color: var(--toffee); font-weight: 700; }
.ing-list button[aria-pressed="true"]::before { content: "✓"; margin-right: var(--s2); }
.ing-list button[aria-pressed="true"] small { margin-left: auto; }
.ing-list small { color: var(--muted); font-weight: 400; }
.cards { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.recipe-card { position: relative; overflow: hidden; transition: transform .12s ease, filter .12s ease; }
/* pressed: while a finger is on it (not on a button inside), and while its recipe opens */
.recipe-card:has(> a:active):not(:has(button:active)), .recipe-card.opening { transform: scale(.97); filter: brightness(.94); }
.recipe-card > a { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.rc-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg); }
span.rc-photo { aspect-ratio: 3 / 1; border-bottom: 1px dashed var(--line); } /* an admin's empty spot */
.rc-camera { position: absolute; top: var(--s2); right: var(--s2); }
.crumb-link { border: 1px solid var(--line); border-radius: var(--r-pill); background: none; padding: 1px var(--s2); font: inherit; letter-spacing: inherit;
  text-transform: inherit; color: inherit; transition: transform .1s; }
.crumb-link:active { transform: scale(.92); background: var(--toffee-soft); }
.eyebrow .draft { color: var(--toffee); font-weight: 700; }
.crumb-link[aria-pressed="true"] { border-color: var(--toffee); background: var(--toffee-soft); color: var(--ink); }
/* the filter a card's tag just set: its bubble pops */
.pill.bubble.new { animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } }
.rc-dates { font-size: var(--t-xs); color: var(--muted); }
.recipe-card > .share { position: absolute; bottom: var(--s3); right: var(--s3); }
.recipe-card > .fav { position: absolute; bottom: var(--s3); right: calc(var(--s3) + var(--tap) + var(--s2)); }
.fav[aria-pressed="true"] { color: var(--alarm); }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.share-row { display: flex; gap: var(--s2); }
.crumb-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.recipe-photo { position: relative; overflow: hidden; border-radius: var(--r-l); margin-bottom: var(--s3); }
.recipe-photo span.rc-photo { border: 1px dashed var(--line); border-radius: var(--r-l); }
.rc-body { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s4); }
.rc-title { font-family: var(--font-display); font-size: var(--t-xl); line-height: 1.15; }
/* time, difficulty, taste: a plain line, not buttons */
/* a card's ratings: a row each (time, difficulty, taste), a column each (Author, Average, You) */
.rc-table { display: grid; grid-template-columns: auto repeat(var(--cols), 1fr); gap: var(--s1) var(--s2); align-items: center; margin-top: var(--s1); }
.rc-table .h { text-align: center; font-size: var(--t-xs); font-weight: 700; color: var(--muted); line-height: 1.2; }
.rc-table .h small { display: block; font-weight: 400; }
.rc-table .m { display: grid; place-items: center; font-size: var(--t-m); }
.rc-table .v { text-align: center; font-size: var(--t-s); font-weight: 700; white-space: nowrap; }
.rc-table [data-grade] { color: var(--grade); }
.recipe-card:has(> .share, > .fav) .rc-body { padding-bottom: calc(var(--tap) + var(--s4)); } /* (the heart and share get their own room under it) */
.rc-rated { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-top: var(--s1); font-size: var(--t-s); font-weight: 700; }
.rc-rated > span { white-space: nowrap; } /* (a whole one wraps to the next line, never cut off) */
.rc-rated i { font-style: normal; margin-right: var(--s1); }
.rc-rated [data-grade] { color: var(--grade); }
.rc-rated .star-row { display: inline-block; font-size: 1.05em; }
.photo-actions { display: flex; gap: var(--s2); }
.photo-actions .remove { border-color: var(--alarm); color: var(--alarm); }
.uses { font-size: var(--t-s); color: var(--ok); font-weight: 700; margin-top: var(--s1); }
/* a card's plain facts under its rated line: "$1.94 per portion · ⚡ 447 cal" */
.card-facts { display: block; font-size: var(--t-s); color: var(--muted); }
.card-facts span:first-child { color: var(--ink); }
.empty { color: var(--muted); padding: var(--s5) 0; text-align: center; }
/* the Filters sheet's ranges, two to a row: a heading, one box (min – max; red, and saying so, when min is over max) */
.range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s3); }
.range { min-width: 0; }
.range h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.range-err { margin: var(--s1) 0 0; font-size: var(--t-xs); color: var(--alarm); }
.range-box { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 44px; border: 2px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.range-box:focus-within { border-color: var(--toffee); }
.range-box.bad { border-color: var(--alarm); }
.range-box .end { display: flex; align-items: center; min-width: 0; height: 100%; padding: 0 var(--s1) 0 var(--s2); }
.range-box .dash { color: var(--muted); padding: 0 2px; }
.range-box .pre { font-style: normal; font-weight: 800; margin-right: 3px; flex: none; }
.range-box input { flex: 1; width: 100%; min-width: 0; height: 100%; border: 0; padding: 0; background: none; color: var(--ink); font: inherit; font-size: var(--t-m); outline: none; }
.range-box input::placeholder { color: var(--muted); opacity: .6; }
/* a time end: what's typed, and behind it the gray rest of 0h 00m */
.hm-end { position: relative; flex: 1; display: flex; min-width: 0; height: 100%; }
.hm-end input { position: relative; z-index: 1; }
.ghost { position: absolute; inset: 0; display: flex; align-items: center; font-size: var(--t-m); color: var(--muted); opacity: .6; white-space: pre; pointer-events: none; }
.ghost i { font-style: normal; visibility: hidden; }
.stars .half b { background: linear-gradient(90deg, var(--toffee) 50%, var(--line) 50%); }
.sheet-card h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
/* a sheet's ✓ (in place of ✕: Filters, Cooking Time, Prep Time) */
.sheet-x.sheet-ok { background: var(--toffee); color: var(--surface); display: grid; place-items: center; }
/* Sort: its sheet, a heading per group, one row per order (its icon first), the picked one ✓ */
.sort-list { list-style: none; margin: 0; padding: 0; }
.sort-list span { display: flex; align-items: center; }
.sort-list i { width: 1.7em; font-style: normal; flex: none; }
.sort-list i .bars { width: 1.4em; height: .9em; vertical-align: -1px; }
.sort-list li + li { border-top: 1px solid var(--line); }
.sort-list button { width: 100%; min-height: var(--tap); display: flex; align-items: center; justify-content: space-between; border: 0; background: none;
  padding: 0 var(--s1); font: inherit; font-size: var(--t-m); color: var(--ink); text-align: left; }
.sort-list [aria-pressed="true"] { color: var(--toffee); font-weight: 700; }
.sort-list svg { width: 22px; height: 22px; stroke: var(--toffee); }
.sheet-card .seg.source { margin-top: var(--s4); }

.zip input, .ing-find { width: 100%; min-width: 0; height: 40px; padding: 0 var(--s2); border: 2px solid var(--line); border-radius: var(--r-m);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-m); }

/* settings: your tier; the admin's users list (email, tier) */
.users .user { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: var(--t-s); }
.users .user span:first-child { overflow-wrap: anywhere; }
.users .user span:last-child { flex: none; color: var(--muted); }

/* the book's footer (© · Privacy · Terms) and those pages */
.foot { display: flex; flex-direction: column; align-items: center; gap: var(--s2); margin-top: var(--s6); padding-block: var(--s4); border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--muted); }
.foot span { display: flex; gap: var(--s2); }
.foot a, .foot button { padding: 6px var(--s3); border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--muted); text-decoration: none; font-weight: 600; }
.foot button { background: none; font: inherit; font-weight: 600; }
/* the inbox: a dot on the tray while something's unread; the sheet's notices, the unread ones marked */
.tool.unread { position: relative; color: var(--toffee); border-color: var(--toffee); }
.tool.unread::after { content: ""; position: absolute; top: var(--s1); right: var(--s1); width: var(--s3); height: var(--s3); border-radius: 50%; background: var(--alarm); }
.inbox { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.inbox li { display: flex; gap: var(--s3); padding: var(--s3) 0 var(--s3) var(--s3); border-top: 1px solid var(--line); }
.inbox li.new { box-shadow: inset var(--s1) 0 0 var(--toffee); }
.inbox .k { font-size: var(--t-l); }
.inbox p { margin: var(--s1) 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox a { font-weight: 700; }
.inbox small { color: var(--muted); font-size: var(--t-xs); }
.fb-text, .rv-text { display: block; width: 100%; margin: var(--s3) 0; padding: var(--s2); border: 2px solid var(--line); border-radius: var(--r-m);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-m); resize: vertical; }
.fb-text:focus, .rv-text:focus { outline: none; border-color: var(--toffee); }
/* reviews: the link under the header's tiles, your own box, then everyone's */
.reviews-link { display: block; margin: var(--s2) 0 0; padding: var(--s1) 0; border: 0; background: none; color: var(--link); font: inherit; font-size: var(--t-m); font-weight: 700; }
.rv-do { display: flex; gap: var(--s2); }
.rv-list { list-style: none; margin: var(--s4) 0 0; padding: 0; }
.rv { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.rv.hidden-rv { opacity: .6; }
.rv-head { color: var(--muted); font-size: var(--t-s); }
.rv-head b { color: var(--ink); }
.rv p, .rv-reply { margin: var(--s1) 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rv-reply { margin-left: var(--s4); padding-left: var(--s3); border-left: var(--s1) solid var(--toffee-soft); }
.rv-foot { display: flex; align-items: center; justify-content: space-between; }
.rv-foot small { color: var(--muted); font-size: var(--t-xs); }
.rv-foot button { min-width: var(--tap); min-height: var(--tap); border: 0; background: none; font-size: var(--t-l); }
.rv-mine .rv-reply { margin: var(--s3) 0 0; }
.legal { padding-block: var(--s4) var(--s6); }
.legal h2 { margin: var(--s5) 0 var(--s1); }
.legal p, .legal li { line-height: 1.5; }
.legal ul { padding-left: var(--s4); }

/* Difficulty's coloured bars (categories.js), sized like the emoji beside it */
svg.bars { width: 1.7em; height: 1em; vertical-align: -0.12em; } /* seven bars */

/* the recipe editor (editor.html, Authors); the book's + card opens it */
.new-card a { display: grid; place-items: center; height: 72px; color: var(--muted); border: 2px dashed var(--line); border-radius: inherit; }
.new-card { border: 0; background: none; box-shadow: none; }
.new-card svg { width: 28px; height: 28px; }
.editor input, .editor select, .editor textarea { width: 100%; min-width: 0; padding: var(--s2); border: 2px solid var(--line); border-radius: var(--r-m);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-m); }
.editor input, .editor select { height: var(--tap); }
.editor :is(input, select, textarea):focus { outline: none; border-color: var(--toffee); }
.editor .bad { border-color: var(--alarm); }
.editor textarea { resize: vertical; line-height: 1.4; }
.ed-field { display: block; margin: var(--s3) 0; font-weight: 700; font-size: var(--t-s); }
.ed-field input { margin-top: var(--s1); font-weight: 400; }
.ed-row { display: grid; grid-template-columns: 1fr 1fr 5.5em; gap: var(--s2); margin-bottom: var(--s3); }
.ed-row.ed-two { grid-template-columns: 1fr 1fr; }
.ed-field select { margin-top: var(--s1); }
.ed-special, .chip.toggle, #versions, .ed-state button { min-height: var(--tap); }
.ed-special, .chip.toggle { margin-bottom: var(--s3); border-color: var(--line); color: var(--muted); }
.mail, .plans { margin-top: var(--s3); }
/* ads (ads.js): their own box, apart from the cards */
.ad { list-style: none; margin: var(--s4) 0; min-height: var(--tap); }
.plans { display: flex; flex-wrap: wrap; gap: var(--s2); }
.ed-special[aria-pressed="true"], .chip.toggle[aria-pressed="true"] { border-color: var(--toffee); background: var(--toffee-soft); color: var(--toffee); }
.ed-row .ed-field { margin: 0; }
.ed-paste { display: grid; gap: var(--s2); justify-items: start; margin-bottom: var(--s4); }
.ed-group { margin: var(--s3) 0 var(--s4); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.ed-head { display: flex; gap: var(--s2); align-items: center; }
.ed-ings { list-style: none; margin: var(--s2) 0; padding: 0; }
.editor .i-line { border-style: dashed; }
.ed-ing { display: grid; grid-template-columns: 5em 6.5em 1fr auto; grid-template-areas: "name name name x" "amt unit flag shop"; gap: var(--s1);
  align-items: center; padding-bottom: var(--s2); margin-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.ed-ing .i-flag { grid-area: flag; }
.ed-ing .i-shop { grid-area: shop; justify-self: start; width: var(--tap); height: var(--tap); border: 1px dashed var(--line); border-radius: 50%; background: none; filter: grayscale(1); opacity: .6; }
.ed-ing .i-shop.on { border: 2px solid var(--ok); filter: none; opacity: 1; }
.ed-ing .i-name { grid-area: name; } .ed-ing .i-amt { grid-area: amt; } .ed-ing .i-unit { grid-area: unit; } .ed-ing .x { grid-area: x; }
.ed-items { list-style: none; margin: var(--s2) 0; padding: 0; counter-reset: ed; }
.ed-item { margin-bottom: var(--s3); padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); display: grid; gap: var(--s2); }
.ed-item > .ed-head::before { counter-increment: ed; content: counter(ed); min-width: 1.4em; font-weight: 700; color: var(--toffee); }
.ed-item .s-timer { width: 6.5em; flex: none; }
.ed-preview { margin: 0; color: var(--muted); font-size: var(--t-s); }
.ed-preview:empty, .ed-chips:empty { display: none; }
.ed-chips { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; }
.ed-chip { flex: none; min-height: var(--tap); padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--bg); color: var(--ink); font: inherit; font-size: var(--t-s); }
.ed-chip[data-timer] { border-color: var(--toffee); color: var(--toffee); font-weight: 700; }
.editor .x { flex: none; width: var(--icon-btn); height: var(--icon-btn); border: 0; border-radius: 50%; background: none; color: var(--muted); }
.ed-state { margin-bottom: var(--s3); }
.ed-tabs { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; box-shadow: 0 0 0 var(--s2) var(--bg); }
.ed-tabs button { padding-inline: 2px; white-space: nowrap; }
.ed-problems { list-style: none; margin: var(--s4) 0 0; padding: var(--s3); border: 2px solid var(--alarm); border-radius: var(--r-l); color: var(--alarm); font-weight: 600; }
.ed-problems li + li { margin-top: var(--s1); }
.ed-problems .warn-only { color: var(--ink); font-weight: 400; }
.ed-problems:not(:has(li:not(.warn-only))) { border-color: var(--toffee); } /* only warnings */
.ps-q { width: 100%; height: var(--tap); padding: 0 var(--s2); border: 2px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-m); }
.ed-versions, .ps-list { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.ps-list button { display: grid; gap: 2px; width: 100%; min-height: var(--tap); padding: var(--s2) 0; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--ink); font: inherit; text-align: left; }
.ps-list button:disabled { opacity: .45; }
.ps-list small { color: var(--muted); font-size: var(--t-xs); }
.ed-versions button { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: var(--tap); padding: var(--s2) 0;
  border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-weight: 700; text-align: left; }
.ed-versions small { color: var(--muted); font-weight: 400; font-size: var(--t-xs); }
.ed-actions { display: flex; gap: var(--s3); margin-top: var(--s6); position: sticky; bottom: 0; z-index: 5; background: var(--bg);
  border-top: 1px solid var(--line); padding: var(--s3) 0 calc(var(--s3) + env(safe-area-inset-bottom, 0px)); } /* (Save always in reach) */
.chip.save { background: var(--toffee); color: var(--surface); }
.chip.remove { border-color: var(--alarm); color: var(--alarm); }
.chip.remove.sure { background: var(--alarm); border-color: var(--alarm); color: #fff; }
/* the editor's item extras: ⋯ (title, timer name, tag or template, pan depth, ? 📖 ! panels), typing tools, pans, notes */
.ed-more-btn { flex: none; width: var(--tap); height: var(--tap); border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--muted); font-weight: 800; }
.ed-more-btn[aria-expanded="true"] { border-color: var(--toffee); color: var(--toffee); }
.ed-more { display: grid; gap: var(--s2); padding-top: var(--s2); border-top: 1px dashed var(--line); }
.ed-more .ed-row { margin: 0; }
.ed-panel { display: grid; grid-template-columns: 2em 1fr; gap: var(--s1) var(--s2); align-items: start; }
.ed-panel-k { grid-row: span 2; display: grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; background: var(--toffee-soft); color: var(--toffee); }
.ed-panel[data-panel="remind"] .ed-panel-k { background: var(--alarm); color: #fff; }
.ed-panel > .chip { justify-self: start; }
.ed-notes, .ed-pans, .ed-pairs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.ed-note, .ed-pair { display: grid; gap: var(--s1); }
.n-own { display: grid; gap: var(--s1); }
.ed-panrow { display: grid; grid-template-columns: 1fr 5.5em auto; gap: var(--s2); align-items: center; }
.ed-pairs + .chip, .ed-pans + .chip { margin-top: var(--s2); }
.ed-tools { display: flex; gap: var(--s1); flex-wrap: wrap; }
.ed-tool { min-width: var(--tap); height: 36px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--bg); color: var(--ink); }
.ed-links { list-style: none; margin: 0; padding: 0; }
.ed-links button { display: block; width: 100%; padding: var(--s2) 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: var(--t-m); }
.ed-links small { display: block; color: var(--muted); font-size: var(--t-xs); }
.ps-food { width: 100%; height: var(--tap); margin-bottom: var(--s2); padding: 0 var(--s2); border: 2px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink); font-size: var(--t-m); }
