:root {
  --bg: #faf8f5; --fg: #1f1d1a; --muted: #6b665e; --card: #fff; --line: #e6e1d9;
  --accent: #c8102e; --accent-fg: #fff; --done: #2f7d32; --alarm: #d9480f;
  --prep: #2b8a3e; --cook: #e67700; --simmer: #1971c2; --bake: #c92a2a; --preheat: #c92a2a;
  --rest: #6741d9; --assemble: #0c8599; --serve: #5c940d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614; --fg: #ece8e1; --muted: #a39d93; --card: #211f1c; --line: #34312c;
    --accent: #ff5a6e; --accent-fg: #1a0005; --done: #6fbf73; --alarm: #ff8a4c;
    --prep: #69db7c; --cook: #ffa94d; --simmer: #74c0fc; --bake: #ff8787; --preheat: #ff8787;
    --rest: #b197fc; --assemble: #66d9e8; --serve: #a9e34b;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
main { max-width: 680px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
a { color: var(--accent); }
h1 { font-size: 26px; line-height: 1.2; margin: 8px 0 8px; }
h2 { font-size: 19px; margin: 28px 0 8px; }
h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 4px; }
.muted { color: var(--muted); font-size: 15px; }
.crumbs { font-size: 15px; color: var(--muted); }
.crumbs a { color: var(--muted); }

.week h2 a { color: var(--fg); text-decoration: none; }
.dishes { padding-left: 20px; margin: 4px 0 16px; }
.dishes li { margin: 6px 0; }

.dish-card { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0; color: var(--fg); text-decoration: none; }
.dish-card strong { font-size: 19px; }

.summary { font-size: 18px; margin: 4px 0; }
.facts { color: var(--muted); margin: 4px 0 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.button:disabled { opacity: .4; }

.check { list-style: none; padding: 0; margin: 0; }
.check li { border-bottom: 1px solid var(--line); }
.check label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.check li.got span { color: var(--muted); text-decoration: line-through; }
.prep { color: var(--muted); }
.pantry { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; margin-left: 4px; white-space: nowrap; }

.steps { padding-left: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 12px 0 12px 44px; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.steps p { margin: 2px 0; }
.kind { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 14px; border-radius: 999px; padding: 2px 10px; background: var(--line); }
.chip.timer { background: color-mix(in srgb, var(--simmer) 20%, transparent); }
.notes { white-space: pre-line; }
.kind-preheat .kind { color: var(--preheat); } .kind-prep .kind { color: var(--prep); } .kind-cook .kind { color: var(--cook); }
.kind-simmer .kind { color: var(--simmer); } .kind-bake .kind { color: var(--bake); } .kind-rest .kind { color: var(--rest); }
.kind-assemble .kind { color: var(--assemble); } .kind-serve .kind { color: var(--serve); }

/* Cook mode: a full-height screen with the step in the middle, running
   timers above it and big back and next buttons in reach of a thumb. */
body.cook { height: 100dvh; overflow: hidden; }
#app { display: flex; flex-direction: column; height: 100dvh; max-width: 680px; margin: 0 auto; }
.cook-bar { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
.cook-bar strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook-bar .close { font-size: 22px; color: var(--muted); text-decoration: none; width: 32px; }
#count { color: var(--muted); font-variant-numeric: tabular-nums; }
.timers { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px; }
.timers:not(:empty) { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.t { flex: none; display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 6px 6px 6px 12px; background: var(--card); border: 1px solid var(--line); }
.t b { font-variant-numeric: tabular-nums; font-size: 20px; }
.t span { font-size: 14px; color: var(--muted); max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t button { min-width: 40px; min-height: 36px; border-radius: 8px; border: 0; background: var(--line); color: var(--fg); font: inherit; font-size: 14px; font-weight: 600; }
.t.ringing { background: var(--alarm); border-color: var(--alarm); color: #fff; animation: pulse 1s infinite; }
.t.ringing span { color: #fff; }
@keyframes pulse { 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .t.ringing { animation: none; } }
.card-area { flex: 1; overflow-y: auto; padding: 20px 16px; max-width: none; margin: 0; }
.card-area .kind { font-size: 15px; }
.card-area .text { font-size: 24px; line-height: 1.35; margin: 8px 0 16px; }
.card-area ul { padding-left: 20px; margin: 8px 0; }
.card-area li { margin: 4px 0; font-size: 18px; }
.waits { color: var(--muted); margin: 12px 0; }
.hint { color: var(--muted); margin: 12px 0; }
.timer-button { width: 100%; margin: 12px 0 0; min-height: 56px; font-size: 18px; }
.next-up { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.cook-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
