/* The Cook's Book — reader. Enamel paper, cobalt stoneware, tomato for time.
   The one loud moment is cooking: the step numeral and the timers. Everything else is set like a quiet book page. */
:root {
  --bg: #f7f6f1;
  --surface: #fffefb;
  --ink: #1b1e24;
  --ink-2: #3a3f49;
  --muted: #646a74;
  --line: #e2e0d8;
  --line-soft: #ecebe4;
  --cobalt: #2340a0;
  --cobalt-ink: #fffefb;
  --cobalt-wash: #e7ebf7;
  --tomato: #c8402a;
  --tomato-ink: #fff;
  --check: #3d7a4f;
  --stone: #ebe8e1;
  --shadow: 0 1px 2px rgba(27, 30, 36, .06), 0 10px 30px -12px rgba(27, 30, 36, .22);
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.6 3.6 7.4-8.2' fill='none' stroke='%23fffefb' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --serif: "Source Serif 4", Georgia, serif;
  --display: "Fraunces", Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Type scale: a major third (1.25) on a 17px reading size. */
  --fs-xs: 12.5px;
  --fs-s: 14px;
  --fs-0: 17px;
  --fs-1: 21px;
  --fs-2: 26.5px;
  --fs-3: 33px;
  --fs-4: 41.5px;
  --fs-title: clamp(41.5px, 11vw, 66px);

  /* Spacing on a 4px grid. */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  --tabs-h: 64px;
  --bar-h: 56px;
  --top: calc(var(--bar-h) + env(safe-area-inset-top));
  --radius-s: 8px;
  --radius-m: 16px;
  --gutter: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161b; --surface: #1c1f26; --ink: #ecebe6; --ink-2: #c9c8c2; --muted: #9aa0aa; --line: #2c3039; --line-soft: #23262e;
    --cobalt: #8fa6ff; --cobalt-ink: #10131c; --cobalt-wash: #232a44; --tomato: #ff7a5c; --tomato-ink: #14161b; --check: #7cc293; --stone: #22252c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .6);
    --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.6 3.6 7.4-8.2' fill='none' stroke='%2310131c' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14161b; --surface: #1c1f26; --ink: #ecebe6; --ink-2: #c9c8c2; --muted: #9aa0aa; --line: #2c3039; --line-soft: #23262e;
  --cobalt: #8fa6ff; --cobalt-ink: #10131c; --cobalt-wash: #232a44; --tomato: #ff7a5c; --tomato-ink: #14161b; --check: #7cc293; --stone: #22252c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .6);
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.6 3.6 7.4-8.2' fill='none' stroke='%2310131c' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-0)/1.6 var(--serif); font-variant-numeric: lining-nums proportional-nums;
  font-optical-sizing: auto; font-kerning: normal; text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
p, li { hanging-punctuation: first allow-end; text-wrap: pretty; }
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.small { font: 400 var(--fs-s)/1.5 var(--ui); }
.loading { padding: 40vh 20px 0; text-align: center; color: var(--muted); font-style: italic; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main:focus { outline: none; }
.num, .q, .tnum { font-variant-numeric: lining-nums tabular-nums; }

/* ---- Top bar & tabs ---- */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  height: var(--top); padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent;
  transition: background-color .25s, border-color .25s;
}
.bar.scrolled { border-bottom-color: var(--line); }
.brand { font: italic 400 19px/1 var(--display); letter-spacing: -0.01em; color: var(--ink); text-decoration: none; transition: opacity .25s; padding: 10px 0; }
.acct { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px 6px 11px; font: 500 var(--fs-s) var(--ui); min-height: 40px; min-width: 44px; transition: border-color .2s, box-shadow .2s; }
.acct:hover { border-color: color-mix(in srgb, var(--muted) 50%, var(--line)); }
.acct .g { width: 18px; height: 18px; flex: none; }
.acct.is-user { position: relative; width: 40px; height: 40px; min-width: 40px; padding: 0; justify-content: center; overflow: hidden; background: var(--cobalt-wash); }
.acct .av { font: 600 15px var(--ui); color: var(--cobalt); }
.acct img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; opacity: 0; transition: opacity .2s; }
.acct img.in { opacity: 1; }
.btn.google { gap: 10px; }
.btn.google .g { width: 20px; height: 20px; background: #fff; border-radius: 50%; padding: 2px; }
/* Home: the bar floats over the cover until the reader scrolls. */
body[data-view="home"] .bar:not(.scrolled) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
body[data-view="home"] .bar:not(.scrolled) .brand { opacity: 0; pointer-events: none; }

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font: 500 11.5px var(--ui); letter-spacing: .01em; transition: color .2s; }
.tabs a::before { content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 2px; margin-left: -14px; border-radius: 0 0 2px 2px; background: var(--cobalt); transform: scaleX(0); transition: transform .3s var(--ease); }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--spring); }
.tabs a:active svg { transform: scale(.9); }
.tabs a[aria-current="page"] { color: var(--cobalt); }
.tabs a[aria-current="page"] svg { stroke-width: 2.1; }
.tabs a:focus-visible { outline-offset: -6px; border-radius: 12px; }
.tabs .badge { position: absolute; top: 7px; left: calc(50% + 5px); background: var(--tomato); color: #fff; border-radius: 999px; font: 600 10.5px/17px var(--ui); min-width: 17px; padding: 0 5px; text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--surface); }
.tabs .badge.bump { animation: bump .45s var(--spring); }
@keyframes bump { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px;
  border-radius: 999px; border: 0; background: var(--cobalt); color: var(--cobalt-ink); font: 600 16px var(--ui); letter-spacing: .005em; text-decoration: none;
  transition: transform .15s var(--ease), background-color .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn small { font: 500 13px var(--ui); color: inherit; opacity: .75; font-variant-numeric: tabular-nums; }
.btn.ghost { background: transparent; color: var(--cobalt); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--cobalt) 70%, transparent); }
.btn.ghost:hover { background: color-mix(in srgb, var(--cobalt-wash) 60%, transparent); }
.btn.small { min-height: 44px; padding: 0 18px; font-size: 14.5px; }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.linkish { border: 0; background: none; padding: 0; color: var(--cobalt); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.icon-btn { width: 48px; min-height: 48px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; flex: none; transition: transform .15s var(--ease), border-color .2s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: fill .2s, stroke .2s; }
.icon-btn[aria-pressed="true"] { border-color: color-mix(in srgb, var(--cobalt) 40%, var(--line)); }
.icon-btn[aria-pressed="true"] svg { fill: var(--cobalt); stroke: var(--cobalt); }
.icon-btn.pop svg { animation: pop .45s var(--spring); }
@keyframes pop { 0% { transform: scale(.7); } 55% { transform: scale(1.22); } 100% { transform: scale(1); } }

/* ---- Photos: fixed ratio boxes, fade in on arrival ---- */
.ph { position: relative; aspect-ratio: 4/5; border-radius: var(--radius-s); overflow: hidden; background: var(--stone); }
.ph img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.015); transition: opacity .5s var(--ease), transform .8s var(--ease); }
.ph img.in { opacity: 1; transform: none; }
.ph.mono { display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--cobalt-wash) 55%, var(--bg)); }
.ph.mono span { font: italic 300 30px/1 var(--display); color: color-mix(in srgb, var(--cobalt) 70%, var(--bg)); }
.ph.land { aspect-ratio: 4/3; }

/* ---- Home: the cover ---- */
.cover {
  /* A band of the photograph's own stone is drawn above it, so the title gets the calm space it needs. */
  --band: calc(var(--top) + 30px);
  position: relative; margin-top: calc(-1 * var(--top)); padding-top: var(--band); width: 100%; overflow: hidden; isolation: isolate;
  background: linear-gradient(to right, #ebe7e2 0%, #e4e0d9 12%, #ddd8d0 25%, #d4cec6 37%, #cac3bb 50%, #c1b9b2 62%, #b7afa6 75%, #aea69c 87%, #a7a099 100%);
}
.cover-art {
  width: 100%; aspect-ratio: 20/23; object-fit: cover; object-position: 50% 0; opacity: 0; transition: opacity .7s var(--ease);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 72px); mask-image: linear-gradient(to bottom, transparent 0, #000 72px);
}
.cover-art.in { opacity: 1; }
.cover::after { content: ""; position: absolute; inset: auto 0 0 0; height: 20%; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }
/* The title is set into the calm stone at the top of the photograph, in ink, in both themes: it is printed on the cover. */
.cover h1 {
  position: absolute; z-index: 1; left: var(--gutter); right: var(--gutter); top: calc(var(--top) + 2px);
  color: #1b1e24; font-size: clamp(58px, 16.5vw, 128px); font-weight: 300; line-height: .9; letter-spacing: -0.045em;
  font-variation-settings: "opsz" 144; text-wrap: nowrap;
}
.cover h1 span { display: block; }
.cover h1 span + span { padding-left: .52em; font-style: italic; letter-spacing: -0.03em; }
/* Returning readers: a shorter cover, so their kitchen is on the first screen. */
.home.returning .cover-art { aspect-ratio: 20/13; object-position: 50% 32%; }
.home.returning .cover h1 { font-size: clamp(50px, 13.5vw, 128px); }
.cover-text { padding: 0 var(--gutter); max-width: 720px; margin: -6px auto 0; position: relative; }
.lede { font: italic 300 clamp(21px, 5.4vw, 26.5px)/1.3 var(--display); margin: 0 0 var(--s3); max-width: 28ch; letter-spacing: -0.005em; }
.tally { font: 400 var(--fs-s)/1.5 var(--ui); color: var(--muted); margin: 0 0 var(--s5); max-width: 42ch; font-variant-numeric: tabular-nums; }
.buy { display: grid; gap: var(--s3); margin: 0; }
.pdf-pair { display: grid; gap: 10px; }
.buy > small { font: 400 13.5px/1.45 var(--ui); color: var(--muted); }
.owned { font: 500 15px var(--ui); color: var(--check); display: flex; align-items: center; gap: 8px; margin: 0; }

/* ---- Home: my kitchen ---- */
.kitchen { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s5) 0 var(--s6); }
.kitchen:empty { display: none; }
.k-tile { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: var(--s3); padding: var(--s3) var(--s4); min-height: 76px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; transition: border-color .2s, transform .15s var(--ease); }
.k-tile:hover { border-color: var(--line); }
.k-tile:active { transform: scale(.985); }
.k-tile .k-n { grid-row: span 3; font: 300 var(--fs-4)/1 var(--display); color: var(--cobalt); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.03em; font-variation-settings: "opsz" 144; }
.k-tile .k-l { font: 500 var(--fs-s)/1.3 var(--ui); }
.k-tile .k-s { font: 400 var(--fs-xs)/1.4 var(--ui); color: var(--muted); }
.k-tile .k-faces { display: flex; margin-top: 4px; }
.k-tile .k-faces .ph { width: 22px; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.k-tile .k-faces .ph + .ph { margin-left: -6px; }
.k-tile .k-faces .ph.mono span { font-size: 12px; }
.k-cook { grid-column: 1 / -1; grid-template-columns: 76px 1fr; column-gap: var(--s4); padding: var(--s3); }
.k-cook .ph { width: 76px; aspect-ratio: 1; border-radius: 10px; grid-row: span 3; }
.k-cook .k-s { color: var(--cobalt); font-weight: 500; }
.k-cook .k-t { font: 400 var(--fs-1)/1.15 var(--display); letter-spacing: -0.01em; }
.k-cook .k-l { font-weight: 400; color: var(--muted); font-size: 13px; }
.k-bar { display: block; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; max-width: 220px; }
.k-bar i { display: block; height: 100%; background: var(--cobalt); border-radius: 3px; }

/* ---- Home: rows of photographs ---- */
.row { margin-top: var(--s7); }
.row-head { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px var(--s4); }
.row-head h2 { font-size: var(--fs-3); font-weight: 350; letter-spacing: -0.02em; }
.row-head p { grid-column: 1 / -1; grid-row: 2; margin: 2px 0 0; font: 400 var(--fs-s)/1.45 var(--ui); color: var(--muted); }
.row-head a { font: 500 var(--fs-s) var(--ui); text-decoration: none; white-space: nowrap; padding: 10px 0; }
.row-head a:hover { text-decoration: underline; }
.shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: 43%; gap: var(--s4); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); margin: var(--s4) calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) 6px;
  scrollbar-width: none;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf.small { grid-auto-columns: 33%; gap: var(--s3); }
.shelf.menus { grid-auto-columns: 74%; }
.card { display: flex; flex-direction: column; scroll-snap-align: start; color: var(--ink); text-decoration: none; min-width: 0; }
.card .ph { transition: transform .3s var(--ease); }
.card:active .ph { transform: scale(.98); }
.card .t { font: 400 18px/1.2 var(--display); margin-top: 10px; letter-spacing: -0.005em; text-wrap: balance; }
.shelf.small .card .t { font-size: 15.5px; }
.card .m { font: 400 var(--fs-xs)/1.4 var(--ui); color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.card:hover .t { color: var(--cobalt); }
.shelf.menus .card .t { font-size: var(--fs-1); }

/* ---- Home: contents ---- */
.contents { margin-top: var(--s8); }
.contents-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); padding-bottom: var(--s1); border-bottom: 1.5px solid var(--ink); }
.contents-head h2 { font-size: var(--fs-4); font-weight: 300; letter-spacing: -0.03em; font-variation-settings: "opsz" 144; }
.contents-head a { font: 500 var(--fs-s) var(--ui); text-decoration: none; padding: 10px 0; white-space: nowrap; }
.contents-head a:hover { text-decoration: underline; }
.part-title { font: italic 300 var(--fs-1) var(--display); color: var(--muted); margin: var(--s6) 0 var(--s1); }
.chapters { list-style: none; margin: 0; padding: 0; }
.chapters a { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: var(--s4); padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 68px; }
.chapters .ph.thumb { width: 48px; border-radius: 6px; }
.chapters .ph.mono span { font-size: 22px; }
.chapters .t { font: 400 clamp(22px, 5.8vw, 26.5px)/1.1 var(--display); letter-spacing: -0.01em; transition: color .2s; }
.chapters .n { font: 400 var(--fs-xs) var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.chapters a:hover .t { color: var(--cobalt); }
footer.legal { margin: var(--s8) 0 var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); font: 400 13px/1.6 var(--ui); color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 20px; }
footer.legal a { color: var(--muted); }
footer.legal span { margin-left: auto; font-style: italic; font-family: var(--display); }

/* ---- Lists of recipes ---- */
.chap-head { padding: var(--s6) 0 var(--s2); }
.chap-head .where, .recipe-head .where { font: 500 13px var(--ui); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; letter-spacing: .01em; }
.chap-head h1 { font-size: var(--fs-title); font-weight: 300; letter-spacing: -0.035em; margin-top: var(--s2); font-variation-settings: "opsz" 144; }
.chap-head p { margin: var(--s4) 0 0; }
.chap-head .intro { color: var(--ink-2); max-width: 62ch; }
.chap-head .intro.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { border: 0; background: none; padding: 10px 0; min-height: 44px; font: 500 14.5px var(--ui); color: var(--cobalt); }
.rlist { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.rlist li { border-bottom: 1px solid var(--line); }
.rlist a { display: grid; grid-template-columns: 72px 1fr; gap: var(--s4); align-items: center; padding: var(--s3) 0; color: var(--ink); text-decoration: none; min-height: 64px; }
.rlist a.prose-row { grid-template-columns: 1fr; }
.rlist .ph.thumb { width: 72px; border-radius: var(--radius-s); }
.rlist .t { font: 400 var(--fs-1)/1.2 var(--display); letter-spacing: -0.008em; transition: color .2s; }
.rlist .s { font: italic 400 15px/1.35 var(--serif); color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rlist .m { font: 400 var(--fs-xs)/1.4 var(--ui); color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.rlist .m:empty { display: none; }
.rlist a:hover .t { color: var(--cobalt); }
.tag-free { color: var(--check); font-weight: 600; }

/* ---- Search & filter chips ---- */
.search-box { position: sticky; top: var(--top); z-index: 10; background: var(--bg); padding: var(--s4) 0 var(--s2); }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.search-box input { width: 100%; height: 52px; padding: 0 20px 0 48px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 400 17px var(--ui); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.search-box input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.search-box input:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--cobalt) 14%, transparent); }
.chips { display: flex; gap: var(--s2); overflow-x: auto; padding: 10px var(--gutter) 2px; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.in-chapter { margin-top: var(--s4); }
.chip { flex: none; min-height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 15px; font: 500 14px var(--ui); color: var(--ink); transition: background-color .2s, color .2s, border-color .2s; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.count { font: 400 var(--fs-s) var(--ui); color: var(--muted); margin: var(--s3) 0 0; min-height: 1.5em; font-variant-numeric: tabular-nums; }

/* ---- Empty states ---- */
.empty { padding: var(--s7) 0; text-align: center; color: var(--muted); }
.empty .glyph { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto var(--s4); border-radius: 50%; background: var(--cobalt-wash); }
.empty .glyph svg { width: 32px; height: 32px; fill: none; stroke: var(--cobalt); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty h2 { color: var(--ink); font-size: var(--fs-2); margin-bottom: var(--s2); }
.empty p { max-width: 34ch; margin: 0 auto var(--s5); font-size: 16px; line-height: 1.5; }
.empty .btn { margin-top: 0; }

/* ---- Recipe & menu head ---- */
.recipe { padding-bottom: 120px; }
.hero-photo .ph.hero { aspect-ratio: 4/3; max-height: 52svh; width: 100%; border-radius: 0; }
.hero-photo .ph.hero img { object-position: 50% 55%; }
/* Phones: the page is laid on the photograph like a sheet of paper. */
.page-head.has-photo .recipe-head { position: relative; margin-top: -22px; background: var(--bg); border-radius: 22px 22px 0 0; padding-top: var(--s5); }
.recipe-head { padding-top: var(--s5); }
.recipe-head .where a { color: var(--cobalt); text-decoration: none; }
.recipe-head .where a:hover { text-decoration: underline; }
.recipe-head h1 { font-size: var(--fs-title); font-weight: 350; letter-spacing: -0.035em; line-height: 1.02; margin: var(--s2) 0 var(--s3); font-variation-settings: "opsz" 144; }
.recipe-head .sub { font: italic 300 var(--fs-1)/1.35 var(--display); color: var(--muted); margin: 0 0 var(--s3); text-wrap: pretty; max-width: 34ch; }
.recipe-head .intro { margin: var(--s4) 0 0; color: var(--ink-2); max-width: 62ch; }
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3) 0; margin: var(--s5) 0 0; padding: var(--s3) 0; border-block: 1px solid var(--line); }
.meta > div { min-width: 0; padding: 0 var(--s3); border-left: 1px solid var(--line-soft); }
.meta > div:first-child, .meta > .makes + div { border-left: 0; padding-left: 0; }
.meta > .makes { grid-column: 1 / -1; padding: 0 0 var(--s3); border-bottom: 1px solid var(--line-soft); }
.meta dt { font: 400 var(--fs-xs) var(--ui); color: var(--muted); }
.meta dd { margin: 3px 0 0; font: 400 var(--fs-1)/1.15 var(--display); letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums; }
.meta .makes dd { font-size: 18px; }
.diff { display: inline-flex; align-items: flex-end; gap: 2px; margin-left: 4px; vertical-align: -1px; }
.diff i { width: 4px; height: 12px; border-radius: 2px; background: var(--line); }
.diff i:nth-child(1) { height: 6px; } .diff i:nth-child(2) { height: 9px; }
.diff i.on { background: var(--cobalt); }

/* Sticky switch between the two halves of a recipe (phones). One indicator slides between them. */
.jump {
  position: sticky; top: var(--top); z-index: 15; display: grid; grid-template-columns: 1fr 1fr; margin-top: var(--s5);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.jump button { height: 50px; border: 0; background: none; font: 600 15px var(--ui); color: var(--muted); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: color .2s; }
.jump button[aria-current="true"] { color: var(--ink); }
.jump::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 50%; height: 2px; background: var(--cobalt); transform: scaleX(.56); transition: transform .35s var(--ease); }
.jump.at-method::after { transform: translateX(100%) scaleX(.56); }
.jump .prog { font: 500 12px var(--ui); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; transition: background-color .25s, color .25s, border-color .25s; }
.jump .prog.some { background: var(--cobalt-wash); color: var(--cobalt); border-color: transparent; }
@media screen and (max-width: 959px) { #ingredients > .sec-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } #ingredients .controls { margin-top: var(--s5); } }
#ingredients, #method { scroll-margin-top: calc(var(--top) + 58px); }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: var(--s4) 0 var(--s2); font: 400 var(--fs-s) var(--ui); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--cobalt); border-radius: 999px; transition: background-color .15s; }
.stepper button:active { background: var(--cobalt-wash); }
.stepper output { min-width: 92px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper output.tick { animation: nudge .3s var(--ease); }
@keyframes nudge { 0% { opacity: .3; transform: translateY(3px); } 100% { opacity: 1; transform: none; } }
.seg { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 3px; }
.seg::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--cobalt-wash); transition: transform .3s var(--ease); }
.seg.us::before { transform: translateX(100%); }
.seg button { position: relative; border: 0; background: none; padding: 0 14px; height: 38px; font: 500 14px var(--ui); color: var(--muted); transition: color .2s; }
.seg button[aria-pressed="true"] { color: var(--cobalt); }

.sec-title { font: 400 var(--fs-2) var(--display); letter-spacing: -0.015em; margin: var(--s6) 0 var(--s2); display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.prog-text { font: 400 13px var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; display: inline-flex; gap: 10px; align-items: baseline; }
.prog-text .linkish { font-size: 13px; color: var(--muted); }

/* Ingredients: quantities hang in their own column, like a set page. */
.grp { display: flex; align-items: center; gap: var(--s3); font: italic 400 var(--fs-0) var(--display); color: var(--cobalt); margin: var(--s5) 0 var(--s1); }
.grp::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ingr { --qw: 72px; list-style: none; margin: 0; padding: 0; }
.ingr li { border-bottom: 1px solid var(--line-soft); font-size: 16.5px; line-height: 1.42; }
.ingr li:last-child { border-bottom: 0; }
.ingr label { display: grid; grid-template-columns: 34px 1fr; padding: 11px 0; min-height: 48px; cursor: pointer; }
.ingr input {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 50%; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--muted) 50%, var(--line)); background: var(--surface) center / 18px no-repeat;
  transition: background-color .2s, border-color .2s, transform .3s var(--spring);
}
.ingr input:checked { background-color: var(--cobalt); background-image: var(--tick); border-color: var(--cobalt); transform: scale(1); animation: pop .4s var(--spring); }
.ingr .txt { display: block; padding-left: var(--qw); text-indent: calc(-1 * var(--qw)); }
.ingr .txt.no-q { text-indent: 0; }
.ingr .q { display: inline-block; min-width: var(--qw); padding-right: .5em; text-indent: 0; font: 600 15.5px var(--serif); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.ingr.us-mode { --qw: 100px; }
.ingr .it {
  background: linear-gradient(currentColor, currentColor) 0 58% / 0 1px no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-size .35s var(--ease), color .25s;
}
.ingr li.done .txt { color: var(--muted); }
.ingr li.done .it { background-size: 100% 1px; }
.us { color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-style: italic; }
.scale-note { font: 400 13px/1.5 var(--ui); color: var(--muted); margin: var(--s3) 0 0; padding: 10px 14px; border-radius: 10px; background: var(--cobalt-wash); }

/* Method */
.progress { height: 3px; border-radius: 3px; background: var(--line); margin: var(--s1) 0 var(--s2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--cobalt); border-radius: 3px; transition: width .5s var(--ease); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { position: relative; display: grid; grid-template-columns: 44px 1fr; align-items: baseline; gap: var(--s2); padding: 18px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: color .3s; }
.steps li:last-child { border-bottom: 0; }
.steps li > div { max-width: 62ch; line-height: 1.62; }
.steps .n { position: relative; font: 300 34px/.9 var(--display); color: var(--cobalt); font-variant-numeric: lining-nums; font-variation-settings: "opsz" 144; letter-spacing: -0.03em; transition: color .3s; }
.steps .n::after {
  content: ""; position: absolute; left: 0; top: calc(100% + 6px); width: 18px; height: 18px; border-radius: 50%;
  background: var(--cobalt) var(--tick) center / 14px no-repeat; transform: scale(0); transition: transform .35s var(--spring);
}
.steps li.done { color: var(--muted); }
.steps li.done .n { color: color-mix(in srgb, var(--muted) 45%, transparent); }
.steps li.done .n::after { transform: scale(1); }
.steps li.next::before { content: ""; position: absolute; left: -12px; top: 20px; bottom: 20px; width: 3px; border-radius: 3px; background: var(--cobalt); animation: grow .4s var(--ease); }
@keyframes grow { from { transform: scaleY(0); } }
.timer-chip { display: inline-flex; align-items: center; gap: 7px; margin-top: var(--s3); min-height: 40px; border: 1.5px solid color-mix(in srgb, var(--tomato) 80%, transparent); color: var(--tomato); background: none; border-radius: 999px; padding: 0 15px 0 12px; font: 600 14px var(--ui); font-variant-numeric: tabular-nums; transition: background-color .2s, color .2s, transform .15s var(--ease); }
.timer-chip:active { transform: scale(.96); }
.timer-chip.running { background: var(--tomato); color: var(--tomato-ink); border-color: var(--tomato); }
.timer-chip svg, .dock svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.steps .timer-chip { display: flex; width: max-content; }

.why { margin: var(--s6) 0 0; padding: var(--s5) var(--s5) var(--s5); background: var(--cobalt-wash); border-radius: var(--radius-m); }
.why h3, .aside h3 { font: italic 400 var(--fs-1) var(--display); margin: 0 0 var(--s2); color: var(--cobalt); }
.why p { margin: 0; }
.aside { margin: var(--s6) 0 0; }
.aside ul { margin: 0; padding: 0; list-style: none; }
.aside li { position: relative; margin: 0; padding: var(--s2) 0 var(--s2) var(--s5); border-bottom: 1px solid var(--line-soft); }
.aside li:last-child { border-bottom: 0; }
.aside li::before { content: ""; position: absolute; left: 4px; top: 1.15em; width: 7px; height: 1.5px; background: var(--cobalt); }
.small-print { margin: var(--s6) 0 0; font: 400 var(--fs-s)/1.6 var(--ui); color: var(--muted); }
.small-print p { margin: 0 0 var(--s2); }
.small-print b { color: var(--ink); font-weight: 600; }
.xref { font-style: italic; }
.related { margin-top: var(--s2); }
.related .sec-title { margin-top: var(--s7); }

.actions {
  position: fixed; z-index: 25; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  display: flex; gap: var(--s2); justify-content: center; padding: var(--s5) var(--s4) 10px;
  background: linear-gradient(to top, var(--bg) 62%, color-mix(in srgb, var(--bg) 0%, transparent));
  pointer-events: none;
}
.actions > * { pointer-events: auto; }
.actions .btn { flex: 1; max-width: 240px; min-height: 48px; padding: 0 14px; }
.actions .btn.done-state { background: var(--check); color: #fff; box-shadow: none; }
.actions .icon-btn { width: 48px; }

/* ---- Locked (paywall on) ---- */
.locked { margin: var(--s5) 0; padding: var(--s5) 22px; border: 1px solid color-mix(in srgb, var(--cobalt) 45%, var(--line)); border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.locked h2 { font-size: var(--fs-2); margin-bottom: var(--s2); letter-spacing: -0.015em; }
.locked p { margin: 0 0 var(--s4); }
.locked .btn { width: 100%; }
.teaser { position: relative; max-height: 220px; overflow: hidden; filter: blur(4px); opacity: .7; user-select: none; pointer-events: none; margin-top: 4px; }
.teaser::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 0%, var(--bg) 92%); }
.teaser + .locked { margin-top: -40px; position: relative; }
.wrap > .ph.hero { margin: 18px calc(-1 * var(--gutter)) 0; border-radius: 0; }

/* ---- Shopping list ---- */
.list-summary { font: 400 var(--fs-s) var(--ui); color: var(--muted); margin: var(--s3) 0 0; font-variant-numeric: tabular-nums; }
.list-summary + .progress { margin-top: var(--s2); }
.list-group { margin-top: var(--s6); }
.list-group h2 { display: grid; grid-template-columns: 40px 1fr auto; gap: var(--s3); align-items: center; font-size: var(--fs-1); margin: 0 0 var(--s1); }
.list-group h2 .ph { width: 40px; aspect-ratio: 1; border-radius: 8px; }
.list-group h2 .ph.mono span { font-size: 18px; }
.list-group h2 a { color: inherit; text-decoration: none; }
.list-group h2 a:hover { color: var(--cobalt); }
.list-group h2 .muted { font: 400 var(--fs-xs) var(--ui); font-variant-numeric: tabular-nums; }
.list-group .ingr .txt { padding-left: 0; text-indent: 0; }
.list-tools { display: flex; gap: 10px; margin: var(--s6) 0; }

/* ---- Menu ---- */
.courses { list-style: none; margin: 0; padding: 0; }
.course { padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); }
.course-link { display: grid; grid-template-columns: 64px 1fr; gap: var(--s4); align-items: center; color: var(--ink); text-decoration: none; }
.course-link .ph.thumb { width: 64px; border-radius: var(--radius-s); }
.course-link .c { display: block; font: italic 400 15px var(--display); color: var(--muted); }
.course-link .ct { display: block; font: 400 var(--fs-1)/1.15 var(--display); margin-top: 2px; transition: color .2s; }
.course-link .x { display: block; font: 500 13px var(--ui); color: var(--cobalt); margin-top: 3px; }
.course-link:hover .ct { color: var(--cobalt); }
.course .cn { margin: var(--s2) 0 0 80px; font-size: 15.5px; line-height: 1.5; color: var(--muted); }
.ahead { padding: var(--s5); border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
.ahead li::before { background: var(--muted); }
.plan-hint { font: 400 13.5px/1.5 var(--ui); color: var(--muted); margin: 0 0 var(--s3); }
.plan-day { font: italic 400 var(--fs-1) var(--display); color: var(--cobalt); margin: var(--s5) 0 var(--s3); }
.plan { list-style: none; margin: 0; padding: 0; }
.plan li { display: grid; grid-template-columns: 96px 1fr; cursor: pointer; }
.plan .when { display: flex; flex-direction: column; align-items: flex-end; text-align: right; padding: 0 18px 0 0; font: 400 12.5px/1.3 var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.plan .when b { font: 400 17px/1.2 var(--display); color: var(--ink); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.plan .what { position: relative; border-left: 1.5px solid var(--line); padding: 0 0 22px 20px; font-size: 16px; line-height: 1.5; transition: color .25s; }
.plan .what::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg) center / 10px no-repeat; border: 1.5px solid var(--cobalt); transition: background-color .25s, border-color .25s, transform .3s var(--spring); }
.plan li:last-child .what { border-left-color: transparent; }
.plan li.serve .what { font-weight: 600; }
.plan li.serve .what::before { background-color: var(--cobalt); }
.plan li.serve .when b { color: var(--cobalt); }
.plan li.done .what { color: var(--muted); }
.plan li.done .what::before { background-color: var(--cobalt); background-image: var(--tick); border-color: var(--cobalt); transform: scale(1.25); }

/* ---- Prose ---- */
.prose { font-size: 17.5px; padding-bottom: var(--s8); }
.prose > p, .prose > ul, .prose > ol { max-width: 66ch; }
.prose h2 { font-size: var(--fs-2); margin: var(--s6) 0 var(--s3); letter-spacing: -0.015em; }
.prose h3 { font-size: var(--fs-1); margin: var(--s5) 0 var(--s2); }
.prose table { width: 100%; border-collapse: collapse; font: 400 var(--fs-s)/1.45 var(--ui); margin: var(--s4) 0; display: block; overflow-x: auto; font-variant-numeric: tabular-nums; }
.prose th { text-align: left; border-bottom: 1.5px solid var(--ink); padding: 6px 12px 6px 0; }
.prose td { border-bottom: 1px solid var(--line); padding: 6px 12px 6px 0; vertical-align: top; }
.next-page { display: block; margin: var(--s7) 0 0; padding: var(--s5) 0; border-top: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; font: 400 var(--fs-2)/1.15 var(--display); letter-spacing: -0.015em; }
.next-page span { display: block; font: 400 13px var(--ui); color: var(--muted); margin-bottom: 6px; letter-spacing: 0; }
.next-page:hover { color: var(--cobalt); }

/* ---- Skeleton while a page loads ---- */
.sk { position: relative; overflow: hidden; background: var(--line-soft); border-radius: 6px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-photo { aspect-ratio: 4/3; max-height: 52svh; border-radius: 0; }
.skel .wrap { position: relative; margin-top: -22px; background: var(--bg); border-radius: 22px 22px 0 0; padding-top: var(--s5); }
.sk-line { height: 13px; margin: 18px 0 0; }
.sk-title { height: 44px; margin: 14px 0 0; width: 88%; border-radius: 8px; }

/* ---- Cook mode: the loud moment ---- */
.cook {
  position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; grid-template-rows: auto auto 1fr auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  animation: cook-in .38s var(--ease);
}
.cook.out { animation: cook-out .22s ease-in forwards; }
@keyframes cook-in { from { opacity: 0; transform: translateY(28px); } }
@keyframes cook-out { to { opacity: 0; transform: translateY(18px); } }
.cook header { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 6px 8px 0 var(--gutter); }
.cook header .ct { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 400 17px var(--display); color: var(--muted); }
.cook header button { border: 0; background: none; font: 600 16px var(--ui); color: var(--cobalt); min-height: 44px; padding: 0 14px; border-radius: 999px; }
.cook .bars { display: flex; gap: 4px; padding: 0 var(--s4); }
.cook .bars button { flex: 1; height: 24px; border: 0; padding: 0; background: none; position: relative; }
.cook .bars button::after { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 4px; border-radius: 2px; background: var(--line); transition: background-color .3s; }
.cook .bars button.past::after { background: color-mix(in srgb, var(--cobalt) 45%, var(--line)); }
.cook .bars button.on::after { background: var(--cobalt); }
.cook .stage { overflow-y: auto; padding: var(--s3) var(--s5) var(--s5); display: flex; flex-direction: column; justify-content: safe center; max-width: 760px; width: 100%; margin: 0 auto; }
.cook .stage > * { animation: step-in .36s var(--ease) both; }
.cook .stage > .txt { animation-delay: .04s; }
.cook .stage > .need { animation-delay: .08s; }
.cook[data-dir="back"] .stage > * { animation-name: step-back; }
.cook[data-dir="none"] .stage > * { animation: none; }
@keyframes step-in { from { opacity: 0; transform: translateX(26px); } }
@keyframes step-back { from { opacity: 0; transform: translateX(-26px); } }
.cook .pos { display: flex; align-items: flex-end; gap: var(--s3); }
.cook .num { font: 300 clamp(96px, 28vw, 176px)/.8 var(--display); color: var(--cobalt); letter-spacing: -0.05em; font-variation-settings: "opsz" 144; margin-left: -.04em; }
.cook .of { font: 400 15px var(--ui); color: var(--muted); padding-bottom: 6px; font-variant-numeric: tabular-nums; }
.cook .txt { font: 400 clamp(23px, 5.8vw, 34px)/1.4 var(--serif); max-width: 30ch; margin-top: var(--s5); text-wrap: pretty; hanging-punctuation: first allow-end; }
.cook .txt a { text-decoration-thickness: 1.5px; }
.cook .timer-chip.big { font-size: 16px; min-height: 52px; padding: 0 20px 0 16px; margin: 0 0 4px auto; align-self: flex-end; border-width: 2px; }
.cook .stage.long .num { font-size: clamp(72px, 19vw, 128px); }
.cook .stage.long .txt { font-size: clamp(20px, 5vw, 29px); }
.cook .timer-chip.big svg { width: 20px; height: 20px; }
.cook .need { margin-top: var(--s6); max-width: 34rem; padding: var(--s4) var(--s4) var(--s2); border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line-soft); }
.cook .need h3 { font: italic 400 var(--fs-0) var(--display); color: var(--cobalt); margin: 0 0 var(--s1); letter-spacing: 0; }
.cook .need ul { list-style: none; margin: 0; padding: 0; }
.cook .need li { display: grid; grid-template-columns: 4em 1fr; gap: var(--s2); font: 400 17px/1.4 var(--serif); padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.cook .need li:last-child { border-bottom: 0; }
.cook .need li b { font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.cook .need li.no-q { grid-template-columns: 1fr; padding-left: calc(4em + var(--s2)); }
.cook nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--s3); padding: var(--s3) 18px 18px; max-width: 760px; width: 100%; margin: 0 auto; }
.cook nav .btn { min-height: 68px; font-size: 18px; }
.cook .swipe-hint { grid-column: 1 / -1; text-align: center; font: 400 12.5px var(--ui); color: var(--muted); margin: -4px 0 0; }
body[data-view="r"] .dock { top: calc(var(--top) + 62px); }
body:has(.cook) .dock { top: auto; bottom: calc(env(safe-area-inset-bottom) + 108px); }
.dock button[hidden] { display: none; }
body:has(.cook) { overflow: hidden; }

/* ---- Timers dock: a tomato ring that empties as time runs ---- */
.dock { position: fixed; z-index: 70; top: calc(var(--top) + 10px); right: max(12px, env(safe-area-inset-right)); display: grid; gap: var(--s2); justify-items: end; }
.dock button {
  --p: 1; display: flex; gap: 10px; align-items: center; min-height: 48px; border: 0; border-radius: 999px; padding: 0 16px 0 6px;
  background: var(--tomato); color: var(--tomato-ink); font: 600 16px var(--ui); font-variant-numeric: tabular-nums; letter-spacing: .01em;
  box-shadow: 0 8px 22px -6px color-mix(in srgb, var(--tomato) 60%, transparent); animation: dock-in .4s var(--spring);
}
.dock .ring { position: relative; width: 36px; height: 36px; border-radius: 50%; background: conic-gradient(var(--tomato-ink) calc(var(--p) * 360deg), color-mix(in srgb, var(--tomato-ink) 28%, transparent) 0); display: grid; place-items: center; }
.dock .ring::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--tomato); }
.dock .ring svg { position: relative; width: 16px; height: 16px; }
.dock .lbl { display: grid; text-align: left; line-height: 1.1; }
.dock .lbl small { font: 500 11px var(--ui); opacity: .85; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock button.ring-on { animation: ring .6s ease-in-out infinite alternate; }
@keyframes ring { to { transform: scale(1.05); box-shadow: 0 0 0 10px color-mix(in srgb, var(--tomato) 18%, transparent); } }
@keyframes dock-in { from { opacity: 0; transform: translateY(-10px) scale(.9); } }

/* ---- Sheet & toast ---- */
.sheet[hidden] { display: none; }
.sheet { position: fixed; inset: 0; z-index: 80; background: rgba(10, 12, 18, .42); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet > div { position: relative; width: 100%; max-width: 520px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 30px 22px calc(26px + env(safe-area-inset-bottom)); animation: sheet-up .32s var(--ease); }
.sheet > div::before { content: ""; position: absolute; top: 10px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 640px) { .sheet { align-items: center; } .sheet > div { border-radius: 22px; } .sheet > div::before { display: none; } }
.sheet h2 { font-size: var(--fs-3); font-weight: 350; letter-spacing: -0.02em; margin-bottom: 10px; }
.sheet p { margin: 0 0 var(--s4); }
.sheet .btn { width: 100%; margin-top: var(--s2); }
.sheet .pdf-pair { gap: 0; }
.sheet .fine { font: 400 13px/1.5 var(--ui); color: var(--muted); margin-top: 14px; }
.sheet .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.sheet .big-time { font: 300 var(--fs-4)/1 var(--display); color: var(--tomato); font-variant-numeric: lining-nums tabular-nums; margin: 0 0 var(--s2); }
.sheet .about { display: block; margin-top: var(--s4); text-align: center; font: 500 var(--fs-s) var(--ui); }
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 84px); transform: translate(-50%, 16px) scale(.96); opacity: 0;
  display: flex; align-items: center; gap: var(--s3); background: var(--ink); color: var(--bg); padding: 0 8px 0 18px; min-height: 44px; border-radius: 999px;
  font: 500 14.5px var(--ui); transition: opacity .2s, transform .3s var(--spring); pointer-events: none; white-space: nowrap; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
  max-width: calc(100vw - 32px);
}
.toast:not(:has(a)) { padding-right: 18px; }
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.toast a { color: color-mix(in srgb, var(--cobalt) 40%, var(--bg)); font-weight: 600; text-decoration: none; padding: 10px 12px; border-radius: 999px; }
.toast a:hover { background: color-mix(in srgb, var(--bg) 10%, transparent); }

/* ---- Tablet and up ---- */
@media (min-width: 640px) {
  .shelf { grid-auto-columns: 30%; }
  .shelf.small { grid-auto-columns: 22%; }
  .shelf.menus { grid-auto-columns: 46%; }
  .pdf-pair { grid-template-columns: auto auto; justify-content: start; }
  .kitchen { grid-template-columns: 2fr 1fr 1fr; }
  .k-cook { grid-column: auto; }
}

/* ---- Desktop: left rail, the cover becomes a book on the table ---- */
@media (min-width: 960px) {
  :root { --gutter: 32px; }
  body { padding-bottom: 0; }
  .tabs { inset: 0 auto 0 0; width: 84px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 72px; align-content: center; border-top: 0; border-right: 1px solid var(--line); padding: 0; background: var(--surface); }
  .tabs a::before { top: 50%; left: -1px; width: 2px; height: 28px; margin: -14px 0 0; border-radius: 0 2px 2px 0; transform: scaleY(0); }
  .tabs a[aria-current="page"]::before { transform: scaleY(1); }
  .tabs .badge { top: 8px; }
  .bar, main { margin-left: 84px; }
  .wrap.wide { max-width: 1120px; }

  .home-top { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 480px); justify-content: space-between; align-items: end; gap: 56px; max-width: 1120px; margin: 8px auto 0; padding: 0 var(--gutter); }
  .cover { --band: 64px; margin-top: 0; border-radius: 4px; box-shadow: 0 1px 0 var(--line), 0 34px 60px -34px rgba(27, 30, 36, .45); }
  .cover::after { display: none; }
  .cover h1 { top: 34px; left: 8%; right: 8%; font-size: 92px; }
  .home.returning .cover-art { aspect-ratio: 20/19; }
  .home.returning .cover h1 { font-size: 84px; }
  .cover-text { margin: 0; padding: 0 0 12px; }
  .lede { font-size: var(--fs-3); }
  .pdf-pair { grid-template-columns: 1fr; }
  .kitchen { grid-template-columns: 1fr 1fr; }
  .k-cook { grid-column: 1 / -1; }
  .row { margin-top: var(--s8); }
  .row-head p { grid-column: 1; }
  .shelf { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; margin: var(--s5) 0 0; padding: 0; gap: 28px 20px; }
  .shelf.small { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .shelf.menus { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card:hover .ph img.in { transform: scale(1.03); }
  .contents .chapters { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .contents { max-width: none; }

  .page-head.has-photo { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 64px; align-items: center; max-width: 1120px; margin: 0 auto; padding: var(--s6) var(--gutter) 0; }
  .page-head.has-photo .hero-photo { order: 2; }
  .page-head.has-photo .recipe-head { padding: 0; margin: 0; max-width: none; border-radius: 0; background: none; }
  .hero-photo .ph.hero { border-radius: 4px; max-height: 72vh; box-shadow: 0 1px 0 var(--line), 0 34px 60px -34px rgba(27, 30, 36, .45); }
  .page-head:not(.has-photo) .recipe-head { max-width: 1120px; }
  .menu-page .page-head:not(.has-photo) .recipe-head { max-width: 720px; }
  .meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .jump { display: none; }
  .recipe-grid { display: grid; grid-template-columns: 360px 1fr; gap: 64px; align-items: start; margin-top: var(--s3); }
  .recipe-grid .ingr-col { position: sticky; top: calc(var(--top) + 12px); max-height: calc(100vh - var(--top) - 24px); overflow-y: auto; padding-bottom: 20px; scrollbar-width: thin; }
  .related .shelf.small { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .actions { left: auto; right: 28px; bottom: 28px; padding: 8px; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
  .actions .btn { flex: none; white-space: nowrap; padding: 0 26px; }
  .toast { bottom: 100px; }
  .hero-photo .ph.hero { aspect-ratio: 4/5; }
  .sk-photo { max-width: 1120px; margin: 28px auto 0; aspect-ratio: 16/7; border-radius: 6px; }
  .skel .wrap { margin-top: 0; }
  .wrap > .ph.hero { margin: 18px 0 0; border-radius: 6px; aspect-ratio: 16/10; max-height: 60vh; }
  .cook .stage { padding-top: var(--s6); }
}

@media (hover: hover) {
  .btn:not(.ghost):hover { background: color-mix(in srgb, var(--cobalt) 88%, var(--ink)); }
}

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

/* ---- Print: one recipe to a page, no chrome ---- */
@media print {
  @page { margin: 1.4cm; }
  .bar, .tabs, .actions, .controls, .dock, .jump, .related, .progress, .timer-chip, .teaser, .locked, .toast, .sheet, .ingr input, .plan-hint, footer.legal, .prog-text { display: none !important; }
  body { padding: 0; font-size: 9.5pt; line-height: 1.4; background: #fff; color: #000; }
  .ingr li { font-size: 9.5pt; }
  .aside li { padding: 2pt 0 2pt 12pt; border: 0; }
  .why, .aside, .small-print { margin-top: 10pt; font-size: 9pt; }
  main { margin: 0 !important; }
  a { color: inherit; text-decoration: none; }
  .wrap, .wrap.wide { max-width: none; padding: 0; }
  .recipe { padding: 0; break-after: page; }
  .page-head.has-photo { display: grid; grid-template-columns: 1fr 5.2cm; gap: .8cm; align-items: start; padding: 0; }
  .page-head.has-photo .hero-photo { order: 2; }
  .page-head.has-photo .recipe-head { margin: 0; background: none; }
  .hero-photo .ph.hero { max-height: 6.5cm; border-radius: 4px; box-shadow: none; }
  .ph img { opacity: 1 !important; transform: none !important; }
  .recipe-head { padding: 0; }
  .recipe-head h1 { font-size: 26pt; margin: 2pt 0 4pt; }
  .recipe-head .sub { font-size: 12pt; }
  .meta { margin-top: 8pt; padding: 5pt 0; border-color: #bbb; }
  .meta dd { font-size: 11pt; }
  .recipe-grid { display: grid; grid-template-columns: 6cm 1fr; gap: .9cm; }
  .recipe-grid .ingr-col { position: static; max-height: none; overflow: visible; }
  .sec-title { font-size: 15pt; margin: 12pt 0 4pt; }
  .ingr label { grid-template-columns: 1fr; padding: 3pt 0; min-height: 0; }
  .ingr li.done .txt { color: #000; } .ingr .it { background: none !important; }
  .ingr li, .steps li { border-color: #ddd; break-inside: avoid; }
  .steps li { padding: 5pt 0; grid-template-columns: 22pt 1fr; }
  .steps li.next::before, .steps .n::after { display: none; }
  .steps li.done { color: #000; }
  .steps .n { font-size: 16pt; color: #000; }
  .why { background: none; border: 1px solid #ccc; padding: 8pt 10pt; break-inside: avoid; }
  .why h3, .aside h3, .grp { color: #000; }
  .plan .what::before { border-color: #000; }
}
