/* Recepees: "Enamelware". Cool white enamel, a cobalt rim, tomato for the dish, butter for done.
   One family (Archivo) used at three widths: expanded headlines, normal body, condensed table cells. */
:root {
  --bg: #f7f8f4; --card: #ffffff; --cell: #eef1f8; --line: #d9deec;
  --ink: #151a33; --muted: #5b6182;
  --accent: #1e3fd0; --accent-ink: #ffffff;           /* cobalt rim */
  --tomato: #ee3b24; --butter: #ffd43b; --basil: #23845a; --butter-ink: #151a33; --dish-ink: #ffffff;
  --ok: var(--basil); --ok-bg: #e2f2e9; --warn: #c42c17; --warn-bg: #fde6e1;
  --radius: 18px;
  --display: var(--gh-font-heading, 'Archivo', system-ui, sans-serif);
  --sans: var(--gh-font-body, 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif);
  --serif: var(--display); /* old name, still used by a few rules */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-palette]), :root[data-palette="enamel"] { color-scheme: dark; --bg: #12152b; --card: #1a1e3a; --cell: #232850; --line: #2f3566;
    --ink: #f2f0e6; --muted: #a3a8c8;
    --accent: #7d95ff; --accent-ink: #0e1126;
    --tomato: #ff5a3d; --butter: #ffd43b; --basil: #4cc38a;
    --ok-bg: #173a2b; --warn: #ff7a62; --warn-bg: #3d1d1a; }
}
[data-palette="enamel"]:not(:root) { color-scheme: light;
  --bg: #f7f8f4; --card: #ffffff; --cell: #eef1f8; --line: #d9deec;
  --ink: #151a33; --muted: #5b6182;
  --accent: #1e3fd0; --accent-ink: #ffffff;           /* cobalt rim */
  --tomato: #ee3b24; --butter: #ffd43b; --basil: #23845a; --butter-ink: #151a33; --dish-ink: #ffffff;
  --ok: var(--basil); --ok-bg: #e2f2e9; --warn: #c42c17; --warn-bg: #fde6e1; }
/* Pastel: soft butter yellows, honey accent, cocoa ink. Light only. */
:root[data-palette="pastel"], [data-palette="pastel"] { color-scheme: light;
  --bg: #fff7d9; --card: #fffdf2; --cell: #fdf0c4; --line: #efdf9f; --ink: #3a2f1c; --muted: #7a6a48;
  --accent: #f2c53d; --accent-ink: #3a2f1c; --tomato: #f59e86; --dish-ink: #3a2f1c; --butter: #cdecc0; --butter-ink: #24401b; --basil: #4c8a3c;
  --ok: #3f7a30; --ok-bg: #e3f3da; --warn: #b4442b; --warn-bg: #fde3da; }
/* Summer: sea-foam and sun, sunset-orange rim, watermelon for the dish. Light only. */
:root[data-palette="summer"], [data-palette="summer"] { color-scheme: light;
  --bg: #effaf8; --card: #ffffff; --cell: #d9f2ee; --line: #b9e3dd; --ink: #0f3537; --muted: #4a6f71;
  --accent: #e8551f; --accent-ink: #ffffff; --tomato: #e0336b; --dish-ink: #ffffff; --butter: #ffd23f; --butter-ink: #3b2c00; --basil: #0f9a75;
  --ok: #0b7a5c; --ok-bg: #d5f3ea; --warn: #c42c55; --warn-bg: #fde1ea; }
/* Night: deep ink, moonlight violet rim, neon pink dish. Dark only. */
:root[data-palette="night"], [data-palette="night"] { color-scheme: dark;
  --bg: #0b0d17; --card: #141828; --cell: #1c2236; --line: #2a3150; --ink: #e9ecf8; --muted: #9aa3c7;
  --accent: #b79cff; --accent-ink: #0b0d17; --tomato: #ff6f91; --dish-ink: #0b0d17; --butter: #ffe07a; --butter-ink: #231a00; --basil: #5fe0b0;
  --ok: #5fe0b0; --ok-bg: #123528; --warn: #ff8fa3; --warn-bg: #3a1624; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16.5px/1.55 var(--sans); font-stretch: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-stretch: 118%; font-weight: 800; line-height: 1.02; letter-spacing: -.02em; }
h2 small { font: 600 15px var(--sans); color: var(--muted); letter-spacing: 0; }

/* header */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 21px; letter-spacing: -.03em; white-space: nowrap; min-width: 0; }
.brand b { overflow: hidden; text-overflow: ellipsis; font-weight: inherit; }
.brand img { height: 32px; width: auto; }
.logo { font-size: 24px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent); }
.links { display: flex; gap: 2px; margin-left: 10px; }
.links a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.links a:hover { color: var(--ink); background: var(--cell); }
.links a[aria-current] { color: var(--ink); box-shadow: inset 0 -3px var(--accent); border-radius: 0; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top-actions .btn { padding: 7px 14px; font-size: 14px; white-space: nowrap; }
.btn.pro { color: var(--butter-ink); background: var(--butter); border-color: var(--butter); }

.tabbar { display: none; }
@media (max-width: 720px) {
  .top { gap: 10px; padding: 10px 16px; }
  .brand { font-size: 18px; }
  .logo { width: 32px; height: 32px; font-size: 19px; border-radius: 10px; }
  .links { display: none; }
  .lang { padding: 6px 8px; }
  .tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line);
    background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 14px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current] { color: var(--accent); }
  .tabbar a[aria-current] svg { fill: color-mix(in srgb, var(--accent) 18%, transparent); }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .intro { padding: 20px 0 8px; }
  .card { padding: 16px; }
  .wrap { padding-bottom: 32px; }
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 8px 16px 64px; }
.foot { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: 14px; border-top: 2px solid var(--line); }
.foot ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 2px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 12px; padding: 8px 15px; font-weight: 700; font-size: 15px; text-decoration: none; transition: transform .12s, background-color .12s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .55; cursor: default; }
.top-actions .btn.primary { color: var(--accent-ink); }
.pal { position: relative; }
.pal summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); }
.pal summary::-webkit-details-marker { display: none; }
.pal[open] summary, .pal summary:hover { border-color: var(--accent); }
.sw { display: block; width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--accent) 0 50%, var(--tomato) 0 75%, var(--butter) 0); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 12%, transparent); }
.sw.enamel { background: conic-gradient(#1e3fd0 0 50%, #ee3b24 0 75%, #ffd43b 0); }
.sw.pastel { background: conic-gradient(#f2c53d 0 50%, #f59e86 0 75%, #cdecc0 0); }
.sw.summer { background: conic-gradient(#e8551f 0 50%, #e0336b 0 75%, #0f9a75 0); }
.sw.night { background: conic-gradient(#b79cff 0 50%, #ff6f91 0 75%, #141828 0); }
.pal-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; display: grid; gap: 4px; min-width: 170px; padding: 6px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); box-shadow: 0 18px 40px -18px rgba(0,0,0,.4); }
.pal-menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); font-weight: 600; text-align: left; }
.pal-menu button:hover { background: var(--cell); }
.pal-menu button[aria-pressed="true"] { background: var(--cell); box-shadow: inset 3px 0 var(--accent); }
.lang { border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 6px 10px; font-size: 14px; font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 220px; }
.grow input { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
input:not([type=checkbox]):not([type=file]), textarea { width: 100%; border: 2px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 14px; }
input:focus, textarea:focus { border-color: var(--accent); outline: none; }
.row input { width: auto; }

/* library */
.intro { padding: 40px 0 24px; max-width: 900px; }
.intro h1 { font-size: clamp(42px, 8vw, 96px); font-stretch: 125%; font-weight: 900; line-height: .92; letter-spacing: -.035em; margin: 0 0 16px; }
.intro p { color: var(--muted); font-size: 19px; margin: 0 0 22px; max-width: 52ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
.chips a { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 13px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.chips a:hover { border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 10px; font-size: 26px; }
.post-card { display: flex; flex-direction: column; gap: 8px; text-align: left; color: var(--ink); text-decoration: none; margin: 0; transition: border-color .15s; }
.post-card:hover { border-color: var(--accent); }
.post-card img { border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; }
.post-card h3 { margin: 4px 0 0; font-size: 21px; font-stretch: 112%; }
.post-card p { margin: 0; color: var(--muted); font-size: 14.5px; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span, .badge { font-size: 12.5px; font-weight: 600; background: var(--cell); color: var(--muted); border-radius: 8px; padding: 2px 9px; }
.tags .lock { background: var(--butter); color: var(--butter-ink); }
.badge.ok { background: var(--ok-bg); color: var(--ok); align-self: flex-start; }
.badge.warn { background: var(--warn-bg); color: var(--warn); align-self: flex-start; }
.empty { color: var(--muted); text-align: center; padding: 24px; grid-column: 1 / -1; list-style: none; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; color: var(--muted); }

/* post: one left edge, a huge expanded title, a spec sheet beside it */
.recipe-post { padding-top: 12px; }
.back { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.back:hover { color: var(--accent); }
.post-title { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 20px 48px; align-items: end; margin: 18px 0 0; }
.post-title h1 { margin: 0; font-size: clamp(40px, 7.4vw, 104px); font-stretch: 125%; font-weight: 900; line-height: .9; letter-spacing: -.04em; text-wrap: balance; }
.spec { margin: 0; border-top: 4px solid var(--accent); padding-top: 10px; display: grid; gap: 8px; }
.spec div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 8px; align-items: baseline; }
.spec dt { color: var(--muted); font-size: 14px; }
.spec dd { margin: 0; font-weight: 700; font-size: 15px; }
.lede { font-size: clamp(18px, 2vw, 22px); line-height: 1.45; color: var(--muted); max-width: 54ch; margin: 22px 0 0; }
.hero-band { margin: 32px 0 0; }
.hero-band img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); display: block; }
.gh-content { margin-top: 32px; font-size: 18px; line-height: 1.65; }
.gh-content > * { max-width: 68ch; }
.gh-content > .rt-wrap, .gh-content > .kg-width-wide, .gh-content > .kg-width-full, .gh-content > figure { max-width: none; }
.gh-content > p:first-child { margin-top: 0; }
.kg-width-full img { width: 100%; }
@media (max-width: 860px) {
  .post-title { grid-template-columns: 1fr; }
  .spec { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); border-top-width: 3px; }
  .spec div { grid-template-columns: 1fr; gap: 0; }
}

/* recipe table: the enamel tray */
.rt-wrap { margin: 32px 0; font-size: 16px; }
.rt-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.rt-head h2 { margin: 0 0 6px; font-size: clamp(26px, 3.4vw, 38px); }
.rt-head p { margin: 0 0 6px; color: var(--muted); }
.rt-emoji { font-size: 44px; line-height: 1; }
.rt-tray { position: relative; border-radius: var(--tray-r); overflow: hidden; background: var(--card); }
/* the rim is drawn ON TOP of the content, so anti-aliased corner pixels never show the background through a seam */
.rt-tray::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border: var(--tray-b) solid var(--accent); border-radius: inherit; }
.rt-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: var(--accent); color: var(--accent-ink); }
.rt-controls label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.rt-controls input { width: 60px !important; padding: 5px 8px !important; border: 0 !important; border-radius: 9px !important; background: color-mix(in srgb, var(--accent-ink) 16%, transparent) !important; color: inherit; font-weight: 700; }
.rt-controls .btn { border: 0; background: color-mix(in srgb, var(--accent-ink) 14%, transparent); color: inherit; padding: 7px 13px; font-size: 14px; }
.rt-controls .btn:hover { background: color-mix(in srgb, var(--accent-ink) 24%, transparent); }
.rt-controls .btn.primary { background: var(--butter); color: var(--butter-ink); }
.rt-controls .seg { background: color-mix(in srgb, var(--accent-ink) 12%, transparent); border: 0; }
.rt-controls .seg button { color: inherit; opacity: .8; }
.rt-controls .seg button.on { background: var(--accent-ink); color: var(--accent); opacity: 1; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; padding: 3px; background: var(--card); gap: 2px; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 6px 12px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.rt-prep { margin: 0; padding: 10px 16px 10px 34px; color: var(--muted); border-bottom: 2px solid var(--line); background: var(--cell); }
.rt-tray { --tray-r: 22px; --tray-b: 3px; }
/* inner corners = outer radius minus the border, so corner cells follow the tray's curve exactly */
.rt-scroll { overflow-x: auto; }
.rt-tray > :first-child { margin: var(--tray-b) var(--tray-b) 0; } /* keep the controls inside the rim */
.rt-scroll, .rt-prep { margin: 0 var(--tray-b); }
.rt-scroll:last-child { margin-bottom: var(--tray-b); }
.rt { display: grid; min-width: 0; width: max(100%, calc(12rem + var(--cols) * 9.5rem));
  grid-template-columns: minmax(12rem, 1.25fr) repeat(var(--cols), minmax(9.5rem, 1fr)); }
.rt > * { padding: 10px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.rt-h { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--cell); padding-top: 8px; padding-bottom: 8px; }
.rt-ing { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.rt-ing b { font-variant-numeric: tabular-nums; font-weight: 800; }
.rt-ing small { color: var(--muted); }
.rt-ing.miss { box-shadow: inset 4px 0 var(--tomato); }
.rt-ing .buy { color: var(--warn); font-size: 12.5px; font-weight: 700; }
.rt-ing.opt { color: var(--muted); }
.rt-step { --p: 20; border-top: 0; border-left: 0; text-align: left; display: flex; align-items: center; min-width: 0;
  font-stretch: 78%; font-weight: 700; font-size: 15.5px; line-height: 1.2; color: var(--ink);
  background: color-mix(in oklab, var(--accent) calc(var(--p) * 1%), var(--card)); transition: background-color .15s, color .15s; }
.rt-step.deep { color: var(--accent-ink); }
.rt-step.dish { background: var(--tomato); color: var(--dish-ink); font-stretch: 100%; font-weight: 900; font-size: 19px; line-height: 1.1; padding: 16px 18px; }
.rt-step:hover { filter: brightness(1.06) saturate(1.1); }
.rt-step.done { background: var(--butter); color: var(--butter-ink); text-decoration: line-through; text-decoration-thickness: 2px; }
.rt-step.done::before { content: '✓'; margin-right: 6px; text-decoration: none; }
.rt-shop { margin: 14px 0 0; color: var(--warn); }
.rt-shop.ok { color: var(--ok); }
.rt-note { color: var(--muted); margin: 8px 0 0; }
script[type="application/recipe+json"] { display: none; }
@media (max-width: 720px) {
  .rt-tray { --tray-r: 16px; --tray-b: 2px; }
  .rt { grid-template-columns: minmax(10rem, 1.2fr) repeat(var(--cols), minmax(8rem, 1fr)); width: max(100%, calc(10rem + var(--cols) * 8rem)); }
  .rt-step.dish { font-size: 16px; }
}

/* recipe box: every section gets the same breathing room */
#box { display: flex; flex-direction: column; gap: 28px; }
#box > section { margin: 0; }
#box > section > h2 { margin: 0 0 12px; }
#viewer:empty { display: none; }
#viewer .rt-wrap, #viewer.rt-wrap { margin: 0; }
.usage { display: flex; flex-direction: column; gap: 8px; }
.meter { height: 8px; background: var(--cell); border-radius: 9px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.usage small { color: var(--muted); }
.found { margin: 14px 0; padding: 12px; border-radius: 12px; background: var(--cell); display: flex; flex-direction: column; gap: 6px; }
.line { display: flex; gap: 8px; align-items: center; }
.line small { color: var(--muted); }
.stock { list-style: none; padding: 0; margin: 14px 0 0; }
.stock li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.stock small { color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; z-index: 99; max-width: calc(100vw - 32px); }

/* photo drop zone */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 230px; padding: 28px 20px; border-radius: 22px; overflow: hidden; isolation: isolate;
  border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--line));
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%), var(--bg);
  transition: border-color .2s, transform .2s, background-color .2s, box-shadow .2s; }
.drop.sm { min-height: 170px; padding: 20px 16px; margin-bottom: 14px; }
.drop:hover, .drop:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.drop.over { transform: scale(1.015); border-style: solid; border-color: var(--accent); background-color: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.drop-input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-input:disabled { cursor: progress; }
.drop-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: var(--accent-ink);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .25s; }
.drop.sm .drop-icon { width: 52px; height: 52px; border-radius: 16px; }
.drop:hover .drop-icon, .drop.over .drop-icon { transform: translateY(-3px) rotate(-4deg); }
.drop svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.drop h3 { margin: 6px 0 0; font-size: 20px; }
.drop p { margin: 0; color: var(--muted); font-size: 14px; max-width: 32ch; }
.drop-btns { position: relative; z-index: 2; margin-top: 6px; }
.drop .cam { display: none; }
.drop .cam svg { width: 18px; height: 18px; }
@media (pointer: coarse) { .drop .cam { display: inline-flex; } }
.drop.has { padding: 0; border-style: solid; border-color: var(--line); min-height: 280px; }
.drop.sm.has { min-height: 200px; }
.drop.has img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
.drop.has::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(0,0,0,.7), transparent 45%); }
.drop-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; color: #fff; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.drop-x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(6px); }
.drop-count { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-weight: 700; font-size: 13px; }
.drop .scan { display: none; }
.drop.busy .scan { display: block; position: absolute; left: 0; right: 0; z-index: 0; height: 34%; top: -34%;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 50%, transparent) 70%, color-mix(in srgb, var(--accent) 90%, #fff) 100%);
  box-shadow: 0 2px 18px color-mix(in srgb, var(--accent) 80%, transparent); animation: scan 1.8s cubic-bezier(.5,0,.5,1) infinite; }
@keyframes scan { to { top: 100%; } }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drop, .drop-icon { transition: none; } .drop.busy .scan { animation: none; top: 0; height: 100%; opacity: .35; } .dots i { animation: none; opacity: 1; } }
.add-row { margin-top: 4px; }

/* print: just the recipe, a table that fits the page. Style chosen in the print dialog:
   html[data-print="bw"] = black & white with real borders, html[data-print="color"] = the chosen palette, colours kept. */
@media print {
  @page { margin: 12mm; }
  .top, .tabbar, .foot, .rt-controls, .rt-shop, .back, .post-head img, .hero-band, .chips, .toast, .trash-link, dialog, #box > section:not(#viewer), #box > a { display: none !important; }
  * { box-shadow: none !important; text-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body { padding: 0 !important; font-size: 10.5pt; }
  .wrap, .post-head, .gh-content { max-width: none; margin: 0; padding: 0; font-size: 10.5pt; }
  .post-title { display: block; } .post-title h1 { font-size: 26pt; margin: 0 0 6pt; } .spec { border: 0; display: flex; gap: 14pt; } .spec div { display: block; }
  .gh-content > .rt-wrap, .gh-content > .kg-width-wide { width: auto; max-width: none; margin: 12pt 0; transform: none; }
  #box, #viewer, .rt-wrap { display: block; margin: 0; }
  .rt-head h2 { font-size: 18pt; }
  .rt-scroll { overflow: visible; }
  .rt { min-width: 0 !important; width: 100% !important; grid-template-columns: minmax(0, 1.5fr) repeat(var(--cols), minmax(0, 1fr)) !important; break-inside: avoid; }
  .rt > * { min-width: 0 !important; padding: 4pt 6pt; font-size: 10pt; overflow-wrap: anywhere; }
  .rt-step, .rt-step.dish { font-size: 10pt; line-height: 1.25; padding: 4pt 6pt; text-decoration: none !important; font-stretch: 85%; }
  .rt-step.done::before { content: none; }
  .rt-ing .buy { display: none; }
  .rt-ing.miss { box-shadow: none !important; }
  .rt-tray { --tray-r: 10pt; --tray-b: 2pt; }
  html[data-print="bw"] body, html[data-print="bw"] .rt > *, html:not([data-print]) body, html:not([data-print]) .rt > * { background: #fff !important; color: #000 !important; }
  html[data-print="bw"] .rt-tray, html:not([data-print]) .rt-tray { --tray-b: 0px; border-radius: 0; overflow: visible; }
  html[data-print="bw"] .rt-tray::after, html:not([data-print]) .rt-tray::after { display: none; }
  html[data-print="bw"] .rt, html:not([data-print]) .rt { gap: 0; background: none; border-top: .75pt solid #000; border-left: .75pt solid #000; }
  html[data-print="bw"] .rt > *, html:not([data-print]) .rt > * { border-right: .75pt solid #000; border-bottom: .75pt solid #000; }
  html[data-print="bw"] .rt-h, html:not([data-print]) .rt-h { background: #eee !important; font-size: 8pt; }
  html[data-print="bw"] .rt-step, html:not([data-print]) .rt-step { font-weight: 700; }
  html[data-print="bw"] a, html:not([data-print]) a { color: #000 !important; text-decoration: none; }
}

/* print dialog: a large page preview + a column of tiny live pages, one per style */
.print-dlg { width: min(1180px, calc(100vw - 24px)); height: min(860px, calc(100vh - 24px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 26px; background: var(--bg); color: var(--ink); overflow: hidden; }
.print-dlg[open] { display: grid; grid-template-columns: minmax(0, 1fr) 250px; animation: drop-in .2s ease-out; }
.print-dlg::backdrop { background: rgba(8, 10, 20, .7); backdrop-filter: blur(6px); }
.pd-stage { display: grid; place-items: start center; overflow: auto; padding: 32px; background: color-mix(in srgb, var(--ink) 8%, var(--bg)); }
.pd-stage .paper { width: min(640px, 100%); box-shadow: 0 30px 60px -30px rgba(0,0,0,.55); border-radius: 6px; }
.pd-side { display: flex; flex-direction: column; gap: 14px; padding: 22px 18px; border-left: 2px solid var(--line); min-height: 0; }
.pd-styles { display: grid; gap: 14px; overflow-y: auto; padding: 4px; margin: -4px; }
.pd-style { display: grid; gap: 8px; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.pd-style .paper { border-radius: 10px; outline: 2px solid var(--line); outline-offset: 0; transition: outline-color .15s, transform .2s; }
.pd-style:hover .paper { transform: translateY(-2px); }
.pd-style[aria-checked="true"] .paper { outline: 4px solid var(--accent); outline-offset: 3px; }
.pd-style span { font-weight: 800; font-size: 14px; }
.pd-style small { font-weight: 600; color: var(--muted); }
.pd-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: auto; padding-top: 12px; border-top: 2px solid var(--line); }
/* a page: rendered at 760px wide, scaled to fit (--s); A4 proportions */
.paper.landscape { aspect-ratio: 297 / 210; }
.paper { position: relative; aspect-ratio: 210 / 297; overflow: hidden; background: var(--card); color: var(--ink); }
.paper-in { position: absolute; top: 0; left: 0; width: var(--pw, 760px); margin: 0; padding: 44px; transform: scale(var(--s, .3)); transform-origin: 0 0; pointer-events: none; font-size: 16px; }
.paper .rt-head h2 { font-size: 34px; }
.paper .rt { width: 100% !important; grid-template-columns: minmax(0, 1.4fr) repeat(var(--cols), minmax(0, 1fr)) !important; }
.paper .rt > * { min-width: 0 !important; font-size: 13px; padding: 7px 9px; overflow-wrap: anywhere; }
.paper .rt-step.dish { font-size: 15px; padding: 9px; }
.paper .rt-scroll { overflow: visible; }
/* black & white page = what the B&W print looks like */
.paper.bw { background: #fff; color: #000; }
.paper.bw .rt-head p, .paper.bw .meta, .paper.bw .rt-prep, .paper.bw .rt-note { color: #333; }
.paper.bw .rt-tray { --tray-b: 0px; border-radius: 0; background: #fff; }
.paper.bw .rt-tray::after { display: none; }
.paper.bw .rt-prep { background: #fff; border: 0; }
.paper.bw .rt { border-top: 1px solid #000; border-left: 1px solid #000; }
.paper.bw .rt > * { background: #fff !important; color: #000 !important; border-right: 1px solid #000; border-bottom: 1px solid #000; }
.paper.bw .rt-h { background: #eee !important; }
.paper.bw .rt-ing.miss { box-shadow: none; }
.paper.bw .rt-ing .buy { display: none; }
@media (max-width: 760px) {
  .print-dlg { width: 100vw; height: 100dvh; border-radius: 0; }
  .print-dlg[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .pd-stage, .pd-side { min-width: 0; }
  .pd-stage { padding: 16px; }
  .pd-side { border-left: 0; border-top: 2px solid var(--line); padding: 14px; }
  .pd-styles { grid-auto-flow: column; grid-auto-columns: 96px; overflow-x: auto; overflow-y: visible; }
  .pd-style span { font-size: 12px; }
  .pd-style small { display: none; }
}

/* phones: tabs share the width evenly instead of wrapping */
@media (max-width: 720px) {
  .card > .seg { display: flex; width: 100%; }
  .card > .seg button { flex: 1; white-space: nowrap; padding: 8px 6px; font-size: 14px; }
  #convert .row .btn { flex: 1 1 auto; }
}

/* kitchen: section headers */
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; }
#box > section > .sec-head > h2 { margin: 0; }

/* collections as 3D stacks: cards recede in Z; the front card opens, the rest pass through */
.stacks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 44px 28px; margin-top: 8px; }
.cstack { min-width: 0; }
.stack-cards { position: relative; height: 230px; margin-top: 78px; perspective: 700px; perspective-origin: 50% -60%; transform-style: preserve-3d; border-radius: 20px; touch-action: pan-y; }
.scard { --i: 0; position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; text-align: left;
  border: 2px solid var(--line); border-radius: 20px; background: var(--card); color: var(--ink);
  transform: translate3d(0, calc(var(--i) * -26px), calc(var(--i) * -120px)) rotateX(calc(var(--i) * 4deg));
  transform-origin: 50% 0;
  z-index: calc(20 - var(--i)); opacity: calc(1 - var(--i) * .2); filter: brightness(calc(1 - var(--i) * .08)) saturate(calc(1 - var(--i) * .15));
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .45s, filter .45s, border-color .2s;
  pointer-events: none; }
.scard:not([style*="--i:0"]):not([style*="--i: 0"]) { box-shadow: none; }
.scard[style*="--i:0"], .scard[style*="--i: 0"] { pointer-events: auto; cursor: pointer; box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--accent) 60%, transparent); }
.scard[style*="--i:1"], .scard[style*="--i: 1"], .scard[style*="--i:2"], .scard[style*="--i: 2"], .scard[style*="--i:3"], .scard[style*="--i: 3"] { pointer-events: auto; cursor: pointer; }
.scard[data-far] { opacity: 0; pointer-events: none; }
.scard:hover { border-color: var(--accent); }
.scard::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 5px; border-radius: 0 0 6px 6px; background: var(--accent); opacity: .85; }
.scard-emoji { font-size: 46px; line-height: 1; margin-top: 6px; }
.scard-title { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 21px; line-height: 1.05; letter-spacing: -.015em; flex: 1; }
.scard.ghost { border-style: dashed; background: transparent; color: var(--muted); align-items: center; justify-content: center; text-align: center; font-size: 14.5px; }
.scard.ghost::before { display: none; }
.stack-foot { display: grid; gap: 12px; margin-top: 22px; }
.stack-nav { display: flex; gap: 8px; align-items: center; }
.stack-nav .gear { margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; font-weight: 700; color: var(--ink); }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.stack-cards:focus-visible { outline-offset: 6px; }

/* an opened collection: the stack fans out into a grid */
.col-open { margin-top: 30px; padding: 20px; border: 3px solid var(--accent); border-radius: 22px; background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.col-open-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.col-open-head h3 { margin: 0; font-size: 26px; }
.col-open-head small { font: 600 15px var(--sans); color: var(--muted); }
.fan .post-card { animation: fan .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--k) * 45ms); }
.fan .scard-title { flex: 0; }
@keyframes fan { from { opacity: 0; transform: perspective(900px) translate3d(0, -30px, -160px) rotateX(10deg); } }
@media (prefers-reduced-motion: reduce) { .scard { transition: none; } .fan .post-card { animation: none; } }

/* stock shelves grouped by tag */
.shelf { margin-top: 16px; }
.shelf h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 16px; }
.shelf h4 small { color: var(--muted); font-weight: 600; }
.shelf .stock { margin-top: 0; }
.ticon { flex: none; display: inline-block; width: 30px; height: 30px; border-radius: 10px; background: var(--accent);
  -webkit-mask: var(--icon) center / 22px no-repeat; mask: var(--icon) center / 22px no-repeat; }
.ticon.none { -webkit-mask: none; mask: none; background: var(--line); }
.found .line .ticon { width: 20px; height: 20px; -webkit-mask-size: 18px; mask-size: 18px; }

/* the collection picker inside the tray */
.rt-col { border: 0; border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: 14px; background: var(--butter); color: var(--butter-ink); max-width: 220px; }

/* collection headers, grid/list layouts, settings */
.col-title { display: grid; gap: 2px; min-width: 0; }
.col-title h3 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.col-title small { color: var(--muted); font-size: 14px; }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.col-block { margin-top: 40px; }
.col-block-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--line); }
.post-card.mini { padding: 16px; gap: 10px; }
.post-card.mini .scard-emoji { font-size: 34px; margin: 0; }
.post-card.mini .scard-title { font-size: 18px; }
.rlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rlist button { width: 100%; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; padding: 12px 14px; text-align: left;
  border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); }
.rlist button:hover { border-color: var(--accent); }
.rlist .scard-emoji { font-size: 26px; margin: 0; }
.rlist-title { font-weight: 700; font-size: 16px; min-width: 0; }
.rlist small { color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) { .rlist button { grid-template-columns: auto 1fr; } .rlist small, .rlist .badge { grid-column: 2; justify-self: start; } }
.col-settings { margin-top: 36px; padding: 20px; border-radius: 20px; border: 3px solid var(--accent); background: var(--card); display: grid; gap: 16px; max-width: 640px; }
.col-settings-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.col-settings-head h3 { margin: 0; font-size: 22px; }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 6px; }
.field select { width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); }
.field .seg label { padding: 7px 14px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.field .seg label.on { background: var(--accent); color: var(--accent-ink); }
.field .seg input { position: absolute; opacity: 0; pointer-events: none; }
.field .seg label:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.col-settings-foot { padding-top: 12px; border-top: 2px solid var(--line); }
.btn.danger { color: var(--warn); margin-left: auto; }
.link-btn { margin-top: 28px; border: 0; background: none; color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; }
.link-btn:hover { color: var(--accent); }
.col-open { margin-top: 40px; }

/* trash */
.trash-ico { display: inline-block; width: 20px; height: 20px; background: currentColor; flex: none;
  --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14M10 11v6M14 11v6'/%3E%3C/svg%3E");
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.trash-ico.big { width: 56px; height: 56px; color: var(--line); }
.trash-link { display: inline-flex; align-items: center; gap: 8px; align-self: center; padding: 10px 16px; border-radius: 12px; color: var(--muted); font-weight: 600; text-decoration: none; }
.trash-link:hover { color: var(--accent); background: var(--cell); }
.trash-link small { font-weight: 700; background: var(--cell); border-radius: 8px; padding: 0 7px; }
.trash-page { max-width: 900px; }
.trash-head { margin-top: 16px; }
.trash-head h1 { margin: 0; font-size: clamp(34px, 6vw, 64px); font-stretch: 125%; font-weight: 900; letter-spacing: -.03em; }
.trash-head h1 small { font: 700 18px var(--sans); color: var(--muted); letter-spacing: 0; }
.trash-page .note { color: var(--muted); margin: 0 0 24px; }
.trash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.trash-item .row { flex-wrap: nowrap; }
.trash-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); }
.trash-what { display: grid; gap: 2px; min-width: 0; }
.trash-what small { color: var(--muted); }
.trash-empty { display: grid; justify-items: center; gap: 8px; padding: 56px 16px; color: var(--muted); text-align: center; border: 2px dashed var(--line); border-radius: 20px; }
@media (max-width: 600px) { .trash-item { grid-template-columns: auto 1fr; } .trash-item .row { grid-column: 1 / -1; } }
.toast button { margin-left: 10px; border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; padding: 0; }

/* today's pick */
.daily { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 24px; border-radius: 24px;
  border: 3px solid var(--accent); background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--butter) 45%, transparent), transparent 60%), var(--card); }
.daily-emoji { font-size: clamp(64px, 10vw, 104px); line-height: 1; filter: drop-shadow(0 10px 16px rgba(0,0,0,.15)); }
.daily-label { display: inline-block; font-weight: 800; font-size: 13.5px; padding: 3px 10px; border-radius: 999px; background: var(--butter); color: var(--butter-ink); }
.daily h2 { margin: 10px 0 6px; font-size: clamp(26px, 3.6vw, 40px); }
.daily p { margin: 0 0 10px; color: var(--muted); max-width: 60ch; }
.daily small { color: var(--muted); font-weight: 600; }
.daily-actions { margin-top: 14px; }
.claimed { font-weight: 800; color: var(--ok); }
.daily.is-loading, .daily.is-empty { grid-template-columns: 1fr; gap: 8px; border-style: dashed; }
.daily.is-loading .dots i { background: var(--accent); }
@media (max-width: 560px) { .daily { grid-template-columns: 1fr; text-align: left; } }

/* inline "new collection" form + collections overview */
.newcol { display: grid; gap: 12px; max-width: 520px; margin: 0 0 8px; padding: 18px; border-radius: 18px; border: 3px solid var(--accent); background: var(--card); animation: drop-in .2s ease-out; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } }
.overview { margin: 0 0 16px; padding: 18px; border-radius: 20px; border: 3px solid var(--accent); background: var(--card); display: grid; gap: 12px; animation: drop-in .2s ease-out; }
.ov-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ov-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; }
.ov-row.is-hidden b { color: var(--muted); text-decoration: line-through; }
.ov-row small { color: var(--muted); white-space: nowrap; }
.ov-row select { padding: 7px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 600; }
.ov-move { display: flex; gap: 6px; }
.ov-move .icon-btn { width: 34px; height: 34px; font-size: 16px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; }
.switch input { position: absolute; opacity: 0; }
.switch span { flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--card); transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 600px) { .ov-row { grid-template-columns: 1fr auto; } .ov-row small { display: none; } }

/* ingredient explorer */
.btn.explore { border-color: var(--butter); background: var(--butter); color: var(--butter-ink); }
.explorer { width: min(1100px, calc(100vw - 24px)); height: min(860px, calc(100vh - 24px)); max-width: none; max-height: none; padding: 0; border: 3px solid var(--accent); border-radius: 24px; background: var(--bg); color: var(--ink); overflow: hidden; }
.explorer[open] { display: flex; flex-direction: column; animation: drop-in .2s ease-out; }
.explorer::backdrop { background: rgba(10, 12, 25, .55); backdrop-filter: blur(4px); }
.ex-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 0; }
.ex-head h2 { margin: 0; font-size: clamp(24px, 3.4vw, 36px); }
.ex-hint { margin: 6px 20px 10px; color: var(--muted); }
.ex-count { font-weight: 700; color: var(--ink); margin-left: 8px; }
.ex-search { margin: 0 20px; width: calc(100% - 40px) !important; font-size: 16px; }
.ex-cats { display: flex; gap: 8px; padding: 12px 20px; overflow-x: auto; scrollbar-width: thin; flex: none; }
.ex-cats button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border: 2px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
.ex-cats button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ex-cats .ticon { width: 22px; height: 22px; border-radius: 7px; -webkit-mask-size: 16px; mask-size: 16px; background: currentColor; }
.ex-body { flex: 1; overflow-y: auto; padding: 4px 20px 28px; }
.ex-body h3 { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-size: 18px; }
.ex-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ex-tile { position: relative; }
.ex-add { width: 100%; aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 6px; padding: 10px 8px; border: 2px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); transition: transform .12s, border-color .12s, background-color .12s; }
.ex-add:hover { border-color: var(--accent); transform: translateY(-2px); }
.ex-add:active { transform: scale(.96); }
.ex-emoji { font-size: 38px; line-height: 1; }
.ex-emoji .ticon { width: 40px; height: 40px; -webkit-mask-size: 28px; mask-size: 28px; }
.ex-name { font-weight: 700; font-size: 13.5px; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.ex-tile.has .ex-add { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.ex-qty { position: absolute; top: 6px; right: 6px; pointer-events: none; min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; text-align: center; }
.ex-qty small { font-weight: 600; font-size: 10.5px; }
.ex-minus { position: absolute; top: 6px; left: 6px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-weight: 800; line-height: 1; }
.ex-minus:hover { border-color: var(--warn); color: var(--warn); }
.ex-tile.pop .ex-add { animation: pop .3s ease-out; }
@keyframes pop { 40% { transform: scale(1.08); } }
@media (max-width: 600px) { .explorer { width: 100vw; height: 100dvh; border-radius: 0; border: 0; } .ex-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); } .ex-emoji { font-size: 32px; } }
@media (prefers-reduced-motion: reduce) { .ex-tile.pop .ex-add, .newcol, .overview, .explorer[open] { animation: none; } }

.sort-ctl { display: grid; justify-items: end; gap: 4px; }
.sort-ctl small { color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .sort-ctl { justify-items: start; } }

/* "How to read this" link on every recipe table */
.rt-howto { margin-left: 8px; font-weight: 700; white-space: nowrap; }
@media print { .rt-howto { display: none; } }

/* ---------- How to read a recipe: the animated player ---------- */
.howto-title { font-size: clamp(40px, 7vw, 96px); font-stretch: 125%; font-weight: 900; line-height: .92; letter-spacing: -.035em; margin: 14px 0 0; }
.ht-player { margin: 32px 0 40px; border: 3px solid var(--accent); border-radius: 26px; overflow: hidden; background: var(--card); outline: none; }
.ht-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 0; align-items: stretch; }
.ht-art { display: grid; place-items: center; padding: 22px; color: var(--ink); background: var(--bg); border-right: 2px solid var(--line); }
.ht-svg { width: 100%; max-width: 460px; height: auto; overflow: visible; }
.ht-table { padding: 22px; min-width: 0; }
.ht-table .rt-wrap, .ht-table { margin: 0; }
.ht-table .rt-head h2 { font-size: 24px; }
.ht-table .rt-emoji { font-size: 34px; }
.ht-table .rt-step { pointer-events: none; }
.ht-table .rt > * { transition: opacity .35s, outline-color .35s, background-color .35s; }
.ht-table .rt.dim > *:not(.hl):not(.rt-h) { opacity: .28; }
/* outline (not an inset shadow): it covers the 1px grid line, so neighbouring highlights join with no gap */
.ht-table .rt .hl { outline: 3px solid var(--accent); outline-offset: -2px; position: relative; z-index: 1; }
.ht-table .rt-step.dish.hl { outline-color: var(--ink); }
.ht-caption { margin: 0; padding: 16px 22px; min-height: 3.6em; font-size: clamp(16px, 1.8vw, 20px); line-height: 1.4; font-weight: 600; border-top: 2px solid var(--line); background: var(--card); }
.ht-player.no-cc .ht-caption { visibility: hidden; min-height: 0; padding: 0; border: 0; }
.ht-bar { padding: 10px 16px 14px; background: var(--accent); color: var(--accent-ink); }
.ht-seek { position: relative; height: 22px; display: grid; align-items: center; }
.ht-range { -webkit-appearance: none; appearance: none; width: 100% !important; height: 6px; padding: 0 !important; border: 0 !important; border-radius: 999px !important; margin: 0;
  background: linear-gradient(to right, var(--accent-ink) var(--p, 0%), color-mix(in srgb, var(--accent-ink) 28%, transparent) 0) !important; cursor: pointer; }
.ht-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-ink); border: 0; }
.ht-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent-ink); border: 0; }
.ht-chapters { position: absolute; inset: 0; pointer-events: none; }
.ht-chapters i { position: absolute; top: 50%; width: 3px; height: 12px; margin-top: -6px; border-radius: 2px; background: var(--accent); opacity: .9; }
.ht-chapters i:first-child { display: none; }
.ht-controls { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ht-btn { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--accent-ink) 14%, transparent); color: inherit; font-weight: 800; font-size: 14px; }
.ht-btn:hover { background: color-mix(in srgb, var(--accent-ink) 26%, transparent); }
.ht-btn:disabled { opacity: .4; cursor: not-allowed; }
.ht-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ht-play { min-width: 52px; height: 48px; background: var(--accent-ink); color: var(--accent); }
.ht-play svg { fill: currentColor; stroke: none; width: 22px; height: 22px; }
.ht-play:hover { background: var(--accent-ink); filter: brightness(.95); }
.i-pause, .playing .i-play { display: none; } .playing .i-pause { display: block; }
.i-off, [aria-pressed="false"] > .i-on { display: none; } [aria-pressed="false"] > .i-off { display: block; }
.ht-text[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }
.ht-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; margin-left: 6px; white-space: nowrap; }
.ht-spacer { flex: 1; }
@media (max-width: 860px) {
  .ht-stage { grid-template-columns: 1fr; }
  .ht-art { border-right: 0; border-bottom: 2px solid var(--line); padding: 14px; }
  .ht-svg { max-width: 340px; }
  .ht-table { padding: 14px; }
  .ht-controls { flex-wrap: wrap; }
}

/* line art: shapes draw themselves in when a scene starts (each shape's real length is measured in JS as --len) */
.ht-svg .prop { opacity: 0; transition: opacity .3s; }
.ht-svg .prop.on { opacity: 1; }
.ht-svg .drawn :is(path, ellipse, circle, rect, line, polyline, polygon) { stroke-dasharray: var(--len); animation: ht-draw 1.1s cubic-bezier(.6, 0, .3, 1) both; }
.ht-svg .counter { opacity: .5; }
@keyframes ht-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }

/* arm poses (set by the storyboard); motion only while playing */
.ht-svg .arm { transition: transform .8s cubic-bezier(.3, .7, .2, 1); }
#arm-l { transform-origin: -20px 340px; } #arm-r { transform-origin: 420px 340px; }
[data-pose="idle"] #arm-l { transform: rotate(-16deg) translate(-20px, 40px); }
[data-pose="idle"] #arm-r { transform: rotate(16deg) translate(20px, 40px); }
[data-pose="gather"] #arm-l { transform: rotate(-6deg); } [data-pose="gather"] #arm-r { transform: rotate(6deg); }
.moving[data-pose="gather"] #arm-l { animation: ht-reach 2.4s ease-in-out infinite; }
.moving[data-pose="gather"] #arm-r { animation: ht-reach 2.4s ease-in-out infinite reverse; }
.moving[data-pose="gather"] .prop.on { animation: ht-bob 2.4s ease-in-out infinite; }
.moving[data-pose="gather"] #sugar, .moving[data-pose="gather"] #egg { animation-delay: -.6s; }
.moving[data-pose="gather"] #milk, .moving[data-pose="gather"] #butter { animation-delay: -1.2s; }
[data-pose="whisk"] #arm-r { transform: translate(-120px, -20px) rotate(-8deg); } [data-pose="whisk"] #arm-l { transform: rotate(-4deg) translate(0, 10px); }
.moving[data-pose="whisk"] #arm-r, .moving[data-pose="whisk"] #whisk .spin { animation: ht-whisk .5s linear infinite; }
#whisk .spin { transform-origin: 145px 205px; }
[data-pose="crack"] #arm-r { transform: translate(-30px, -10px); } [data-pose="crack"] #arm-l { transform: translate(110px, -16px) rotate(4deg); }
.moving[data-pose="crack"] #arm-r { animation: ht-tap .9s ease-in-out infinite; }
.moving[data-pose="crack"] #egg { animation: ht-tap .9s ease-in-out infinite; }
[data-pose="pour"] #arm-l { transform: translate(140px, -30px) rotate(8deg); } [data-pose="pour"] #arm-r { transform: rotate(10deg) translate(10px, 30px); }
#bowl-b .tilt { transform-origin: 266px 262px; transition: transform .9s; }
[data-pose="pour"] #bowl-b .tilt { transform: translate(-40px, -46px) rotate(-38deg); }
.moving[data-pose="pour"] #bowl-b .tilt { animation: ht-pour 2.6s ease-in-out infinite; }
[data-pose="flip"] #arm-r { transform: translate(-60px, 30px) rotate(-4deg); } [data-pose="flip"] #arm-l { transform: rotate(-14deg) translate(-10px, 30px); }
.moving[data-pose="flip"] #arm-r { animation: ht-flip 1.6s cubic-bezier(.5, 0, .5, 1) infinite; }
#pancake .toss { transform-origin: 198px 248px; }
.moving[data-pose="flip"] #pancake .toss { animation: ht-toss 1.6s cubic-bezier(.5, 0, .5, 1) infinite; }
[data-pose="serve"] #arm-l { transform: translate(60px, 20px) rotate(-2deg); } [data-pose="serve"] #arm-r { transform: translate(-60px, 20px) rotate(2deg); }
.moving[data-pose="serve"] #plate { animation: ht-bob 2s ease-in-out infinite; }
@keyframes ht-reach { 50% { transform: rotate(4deg) translate(0, -10px); } }
@keyframes ht-bob { 50% { transform: translateY(-6px); } }
@keyframes ht-whisk { 0% { translate: 0 0; } 25% { translate: 8px 4px; } 50% { translate: 0 8px; } 75% { translate: -8px 4px; } }
@keyframes ht-tap { 50% { translate: 0 10px; } }
@keyframes ht-pour { 50% { transform: translate(-46px, -52px) rotate(-52deg); } }
@keyframes ht-flip { 40% { translate: 0 -26px; } }
@keyframes ht-toss { 40% { transform: translateY(-70px) scaleY(-1); } 80% { transform: translateY(0) scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .ht-svg *, .ht-svg .drawn * { animation: none !important; transition: none !important; } }
/* the player's table always fits its panel */
.ht-table .rt-scroll { overflow: visible; }
.ht-table .rt { width: 100% !important; grid-template-columns: minmax(0, 1.35fr) repeat(var(--cols), minmax(0, 1fr)) !important; }
.ht-table .rt > * { min-width: 0 !important; font-size: 13.5px; padding: 8px 10px; overflow-wrap: anywhere; }
.ht-table .rt-step.dish { font-size: 15px; padding: 10px; }

/* print dialog: orientation + text alignment */
.pd-opts { display: grid; gap: 10px; padding-top: 12px; border-top: 2px solid var(--line); }
.pd-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pd-opt > span { font-weight: 700; font-size: 14px; }
.pd-seg { display: inline-flex; gap: 2px; padding: 3px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); }
.pd-seg button { display: grid; place-items: center; width: 38px; height: 32px; border: 0; border-radius: 9px; background: none; color: var(--muted); }
.pd-seg button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pd-seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.pd-stage .paper.landscape { width: min(860px, 100%); }
@media (max-width: 760px) { .pd-opts { grid-template-columns: 1fr 1fr; } .pd-opt { flex-direction: column; align-items: flex-start; gap: 4px; } }

/* text alignment (title, description, prep notes, tips; never the table): preview pages and the real print */
.paper[data-align="center"] :is(.rt-head, .rt-prep, .rt-note), .paper[data-align="center"] .rt-head > div { text-align: center; }
.paper[data-align="center"] .rt-head { flex-direction: column; align-items: center; }
.paper[data-align="center"] .rt-prep { list-style-position: inside; padding-left: 16px; }
.paper[data-align="justify"] :is(.rt-head p, .rt-note, .rt-prep li) { text-align: justify; hyphens: auto; }
@media print {
  html[data-print-align="center"] :is(.rt-head, .rt-prep, .rt-note, .post-head, .lede, .gh-content > p), html[data-print-align="center"] .rt-head > div { text-align: center; }
  html[data-print-align="center"] .rt-head { flex-direction: column; align-items: center; }
  html[data-print-align="center"] .spec { justify-content: center; }
  html[data-print-align="center"] :is(.lede, .gh-content > p) { margin-left: auto; margin-right: auto; }
  html[data-print-align="center"] .rt-prep { list-style-position: inside; }
  html[data-print-align="justify"] :is(.rt-head p, .rt-note, .rt-prep li, .lede, .gh-content > p) { text-align: justify; hyphens: auto; }
}
/* the player's table: square corners so the square highlight outlines line up with its edges */
.ht-table .rt-tray { border-radius: 0; }

/* no grid line where a cell meets the tray's rim (the rim is the line) */
.rt > .edge-r { border-right: 0; }
.rt > .edge-b { border-bottom: 0; }
@media print { html[data-print="bw"] .rt > .edge-r, html:not([data-print]) .rt > .edge-r { border-right: .75pt solid #000; } html[data-print="bw"] .rt > .edge-b, html:not([data-print]) .rt > .edge-b { border-bottom: .75pt solid #000; } }
.paper.bw .rt > .edge-r { border-right: 1px solid #000; } .paper.bw .rt > .edge-b { border-bottom: 1px solid #000; }

/* ---------- editable amounts (pencil on hover) + "not enough" ---------- */
.rt-amt, .qty-n { display: inline-flex; align-items: center; gap: 4px; padding: 1px 4px; margin: -1px -4px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: text; }
.rt-amt:hover, .rt-amt:focus-visible, .qty-n:hover, .qty-n:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pen { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .12s; }
.rt-amt:hover .pen, .rt-amt:focus-visible .pen, .qty-n:hover .pen, .qty-n:focus-visible .pen { opacity: .8; }
.rt-amt-in, .qty-in { width: 76px !important; padding: 3px 6px !important; border-radius: 8px !important; font-weight: 800; font-variant-numeric: tabular-nums; }
.qty-n { margin: 0; }
.rt-ing.low { box-shadow: inset 4px 0 var(--butter); }
.rt-ing.low .buy { color: var(--warn); }
.ht-table .rt-amt { pointer-events: none; }
@media print { .pen { display: none; } .rt-amt { padding: 0; margin: 0; } }

/* ---------- timers ("time table" under a recipe) ---------- */
.rt-step { position: relative; overflow: hidden; }
.rt-timers { margin-top: 18px; padding: 16px; border: 2px solid var(--line); border-radius: 18px; background: var(--card); }
.rt-timers-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rt-timers-head h3 { margin: 0; font-size: 20px; }
.rt-timer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tm-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; transition: border-color .2s, background-color .2s; }
.tm-row[data-state="run"] { border-color: var(--accent); }
.tm-row[data-state="pause"] { border-style: dashed; border-color: var(--accent); }
.tm-row[data-state="ring"] { border-color: var(--tomato); background: color-mix(in srgb, var(--tomato) 12%, var(--card)); }
.tm-what { display: grid; min-width: 0; }
.tm-what b { overflow-wrap: anywhere; }
.tm-what small { color: var(--muted); }
.tm-time { font-variant-numeric: tabular-nums; font-weight: 900; font-size: 24px; font-stretch: 110%; min-width: 4.5ch; text-align: right; }
.tm-row[data-state="run"] .tm-time { color: var(--accent); }
.tm-btns { display: flex; gap: 6px; align-items: center; }
.tm-btns .btn { padding: 7px 12px; font-size: 14px; }
@media (max-width: 640px) { .tm-row { grid-template-columns: 52px 1fr auto; } .tm-btns { grid-column: 1 / -1; justify-content: flex-end; } .tm-time { font-size: 20px; } }

/* the four looks; --p = elapsed fraction (0 → 1) */
.tm-vis { display: inline-grid; place-items: center; width: 60px; height: 60px; flex: none; color: var(--ink); }
.tm-vis.sm { width: 22px; height: 22px; }
.tm-countdown { height: 12px; align-self: center; border-radius: 999px; background: var(--cell); overflow: hidden; place-items: stretch; }
.tm-countdown .tm-bar { display: block; height: 100%; width: calc((1 - var(--p, 0)) * 100%); background: var(--accent); border-radius: inherit; transition: width .25s linear; }
.tm-countdown.sm { height: 6px; width: 26px; }
.tm-clock { position: relative; border-radius: 50%; border: 3px solid var(--ink);
  background: conic-gradient(from calc(var(--p, 0) * 360deg), var(--accent) 0 calc((1 - var(--p, 0)) * 360deg), var(--cell) 0); }
.tm-clock.sm { border-width: 2px; }
.tm-hand { position: absolute; left: 50%; top: 50%; width: 3px; height: 46%; margin-left: -1.5px; border-radius: 2px; background: var(--ink); transform-origin: 50% 0; transform: rotate(calc(180deg + var(--p, 0) * 360deg)); }
.tm-grid { grid-template-columns: repeat(6, 1fr); gap: 3px; place-items: stretch; }
.tm-grid i { border-radius: 3px; background: var(--accent); transition: opacity .4s, transform .4s; }
.tm-grid.sm { grid-template-columns: repeat(4, 1fr); gap: 1.5px; }
.tm-grid.sm i { border-radius: 1px; }
.tm-grid i.gone { opacity: .12; transform: scale(.55); }
.tm-tree svg { width: 100%; height: 100%; overflow: visible; }
.tm-trunk { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.tm-trunk { stroke-dasharray: 1; stroke-dashoffset: calc(1 - min(1, var(--p, 0) * 5)); transition: stroke-dashoffset .4s; }
.tm-tree .lf { fill: var(--basil); transform-box: fill-box; transform-origin: center bottom; opacity: 0; transform: scale(0); transition: transform .9s cubic-bezier(.3, 1.6, .5, 1), opacity .5s; }
.tm-tree .lf.on { opacity: 1; transform: scale(1); }

/* inside the step cell: a small live badge; optional black-out cover that melts away as time runs down (--tp) */
.tm-badge { position: absolute; top: 6px; right: 6px; z-index: 4; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 5px; border-radius: 999px;
  background: var(--card); color: var(--ink); font: 800 12px/1 var(--sans); font-stretch: 100%; text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.18); font-variant-numeric: tabular-nums; }
.tm-cover { position: absolute; inset: -2px; z-index: 3; pointer-events: none; background: #0b0c10;
  transform: translateY(calc(var(--tp, 0) * 102%)); transition: transform .25s linear;
  -webkit-mask: radial-gradient(9px 9px at 50% 0, transparent 98%, #000) 0 0 / 18px 14px repeat-x, linear-gradient(#000, #000) 0 13px / 100% 100% no-repeat;
          mask: radial-gradient(9px 9px at 50% 0, transparent 98%, #000) 0 0 / 18px 14px repeat-x, linear-gradient(#000, #000) 0 13px / 100% 100% no-repeat;
  animation: tm-melt 2.4s ease-in-out infinite alternate; }
@keyframes tm-melt { to { -webkit-mask-position: 9px 0, 0 13px; mask-position: 9px 0, 0 13px; } }

/* timer settings */
.tm-prefs { position: relative; }
.tm-prefs summary { list-style: none; cursor: pointer; }
.tm-prefs summary::-webkit-details-marker { display: none; }
.tm-prefs[open] summary { border-color: var(--accent); color: var(--accent); }
.tm-prefs-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(330px, calc(100vw - 32px)); display: grid; gap: 12px; padding: 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 20px 40px -20px rgba(0,0,0,.45); }
.tm-prefs-panel fieldset { border: 0; margin: 0; padding: 0; }
.tm-prefs-panel legend { font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.tm-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tm-styles label { cursor: pointer; }
.tm-styles input { position: absolute; opacity: 0; }
.tm-styles span { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border: 2px solid var(--line); border-radius: 12px; font-size: 12px; font-weight: 700; text-align: center; }
.tm-styles input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tm-styles input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.tm-styles .tm-vis.sm { width: 28px; height: 28px; --p: .35; }
.tm-styles .tm-countdown.sm { width: 34px; height: 8px; }

/* time's up: the whole screen */
.tm-alert { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--tomato); color: var(--dish-ink); }
.tm-alert[open] { display: grid; place-items: center; animation: tm-flash 1.4s ease-in-out infinite; }
.tm-alert::backdrop { background: var(--tomato); }
.tm-alert-in { width: min(680px, 100%); padding: 24px 16px; text-align: center; }
.tm-alert-bell { display: inline-block; font-size: clamp(72px, 14vw, 128px); line-height: 1; animation: tm-shake .5s ease-in-out infinite; }
.tm-alert h2 { margin: 8px 0 26px; font-size: clamp(48px, 11vw, 128px); font-stretch: 125%; font-weight: 900; letter-spacing: -.04em; line-height: .9; color: inherit; }
.tm-alert ul { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; text-align: left; }
.tm-alert li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,.16); }
.tm-alert li small { display: block; opacity: .8; font-weight: 600; }
.tm-alert li b { font-size: 19px; }
.tm-alert .btn { font-size: 17px; padding: 11px 18px; border-color: currentColor; background: transparent; color: inherit; }
.tm-alert .btn.primary { background: var(--dish-ink); color: var(--tomato); border-color: var(--dish-ink); }
.tm-alert .tm-all { width: 100%; justify-content: center; padding: 14px; font-size: 19px; }
@keyframes tm-flash { 50% { background: color-mix(in srgb, var(--tomato) 82%, #000); } }
@keyframes tm-shake { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .tm-alert[open], .tm-alert-bell, .tm-cover { animation: none; } .tm-tree .lf { transition: none; } }
@media print { .rt-timers, .tm-badge, .tm-cover, .tm-alert { display: none !important; } }

/* "to buy" / "not enough": a discreet dot that barely breathes; the notice is in a tooltip */
.rt-ing.miss, .rt-ing.low { box-shadow: none; }
.rt-dot { flex: none; position: relative; width: 16px; height: 16px; margin: 0 0 0 2px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: help; vertical-align: middle; }
.rt-dot::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--tomato); animation: rt-breathe 2.8s ease-in-out var(--rt-phase, 0ms) infinite; }
.rt-dot.low::before { background: #e5a000; }
.rt-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@keyframes rt-breathe { 50% { transform: scale(.78); opacity: .72; } }
.rt-tip { position: fixed; z-index: 1000; max-width: min(260px, calc(100vw - 16px)); padding: 7px 11px; border-radius: 10px; background: var(--ink); color: var(--bg); font: 600 13px/1.35 var(--sans); pointer-events: none; box-shadow: 0 8px 20px -8px rgba(0,0,0,.4); }
.rt-tip::after { content: ''; position: absolute; left: 50%; margin-left: -5px; border: 5px solid transparent; }
.rt-tip[data-side="top"]::after { top: 100%; border-top-color: var(--ink); }
.rt-tip[data-side="bottom"]::after { bottom: 100%; border-bottom-color: var(--ink); }
.rt-controls .rt-clock { width: 36px; height: 34px; padding: 0; border: 0; }
.rt-controls .rt-clock svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rt-controls .rt-clock[aria-pressed="true"] { background: var(--accent-ink); color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .rt-dot::before { animation: none; } }
@media print { .rt-dot, .rt-tip { display: none !important; } }

/* "Stop preparing …?": everything behind it goes opaque */
.rt-confirm { width: min(560px, calc(100vw - 32px)); padding: 0; border: 3px solid var(--accent); border-radius: 24px; background: var(--card); color: var(--ink); }
.rt-confirm::backdrop { background: color-mix(in srgb, var(--bg) 94%, var(--ink)); }
.rt-confirm[open] { animation: drop-in .2s ease-out; }
.rt-confirm form { display: grid; gap: 14px; padding: 24px; }
.rt-confirm h2 { margin: 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.05; }
.rt-confirm p { margin: 0; color: var(--muted); }
.rt-confirm-why { padding: 12px 14px; border-radius: 14px; background: var(--cell); }
.rt-confirm-why ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-weight: 600; }
.rt-confirm .row { justify-content: flex-end; }
.btn.danger-solid { background: var(--tomato); border-color: var(--tomato); color: var(--dish-ink); }
.tm-ground { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; opacity: .35; }

/* "Cooking now": picture-in-picture for the recipe in progress */
.rt-pip { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(320px, calc(100vw - 32px)); border: 3px solid var(--accent); border-radius: 20px; background: var(--card); color: var(--ink);
  box-shadow: 0 24px 50px -20px rgba(0,0,0,.45); overflow: hidden; animation: pip-in .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pip-in { from { opacity: 0; transform: translateY(20px) scale(.92); } }
.pip-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
.pip-head:focus-visible { outline: 3px solid var(--butter); outline-offset: -3px; }
.pip-emoji { font-size: 28px; line-height: 1; }
.pip-name { display: grid; min-width: 0; flex: 1; text-align: left; }
.pip-name small { font-size: 11.5px; font-weight: 700; opacity: .85; }
.pip-name b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pip-mini-time .tm-time { font: 900 16px var(--sans); font-variant-numeric: tabular-nums; }
.pip-chev { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.rt-pip.min .pip-chev { transform: rotate(180deg); }
.pip-body { display: grid; gap: 8px; padding: 12px; }
.rt-pip.min .pip-body { display: none; }
.pip-progress { height: 8px; border-radius: 999px; background: var(--cell); overflow: hidden; }
.pip-progress i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s; }
.pip-count { color: var(--muted); font-weight: 600; }
.pip-timers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pip-tm { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: var(--cell); }
.pip-tm[data-state="ring"] { background: color-mix(in srgb, var(--tomato) 18%, var(--card)); }
.pip-step { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pip-tm .tm-time { font-size: 16px; min-width: 0; }
.pip-tm .btn { padding: 4px 10px; font-size: 12.5px; }
.pip-open { justify-content: center; }
@media (max-width: 720px) { .rt-pip { bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; width: min(300px, calc(100vw - 24px)); } }
@media (prefers-reduced-motion: reduce) { .rt-pip { animation: none; } }
@media print { .rt-pip { display: none !important; } }
