:root {
  --bg: #f3f6f9;
  --surface: #ffffff;
  --ink: #1b2330;
  --muted: #4a5568;
  --line: #c9d2dc;
  --line-soft: #e1e7ee;
  --accent: #a3192f;
  --accent-ink: #ffffff;
  --accent-soft: #fbe9ec;
  --ok: #1f6b45;
  --warn-bg: #fff3d6;
  --warn-ink: #5c3d00;
  --bad: #b3261e;
  --h-mix: #3d6f9e;
  --h-shape: #7aa6c9;
  --h-dec: #2e8a63;
  --head: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --r: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b222b;
    --ink: #e8edf2;
    --muted: #aab5c3;
    --line: #3a4553;
    --line-soft: #29323d;
    --accent: #ff8a9b;
    --accent-ink: #2a0910;
    --accent-soft: #3a1d24;
    --ok: #7fd6a6;
    --warn-bg: #3b2f12;
    --warn-ink: #ffe3a3;
    --bad: #ff9a92;
    --h-mix: #7fb0dd;
    --h-shape: #4f7ea3;
    --h-dec: #5fc495;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--body); }
a { color: var(--accent); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; letter-spacing: -0.005em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); font-weight: 800; margin: 0 0 8px; }
h2 { font-size: 1.45rem; font-weight: 800; margin: 28px 0 10px; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 18px 0 8px; }
.top { max-width: 1240px; margin: 0 auto; padding: 20px 16px 4px; }
.lede { margin: 0; max-width: 62ch; color: var(--muted); font-size: 1.05rem; }
main { max-width: 1240px; margin: 0 auto; padding: 0 16px 32px; }

/* tabs */
.tabs { display: flex; gap: 0; margin: 16px 0 12px; border-bottom: 2px solid var(--line); }
.tabs button { font: 700 1.05rem/1.2 var(--head); background: none; color: var(--muted); border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px; padding: 12px 14px; min-height: 48px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* buttons and fields */
.btn { font: 600 1rem/1.2 var(--body); min-height: 44px; padding: 10px 16px; border-radius: var(--r); border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn:hover { background: var(--line-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { border-color: var(--line); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 8px 12px; font-size: 0.95rem; }
.linkish { background: none; border: 0; padding: 10px 0; min-height: 44px; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; text-align: left; }
.fld { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; font-weight: 600; font-size: 0.95rem; min-width: 0; }
.opt { font-weight: 400; color: var(--muted); }
input:not([type]), input[type="time"], input[inputmode] { font: 16px/1.3 var(--body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); padding: 10px 10px; min-height: 44px; width: 100%; min-width: 0; }
input[type="time"] { font-family: var(--mono); }
input[aria-invalid="true"] { border-color: var(--bad); }
.ferr { color: var(--bad); font-weight: 500; font-size: 0.95rem; }
.ferr:empty { display: none; }
.store-note { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 14px; border-radius: var(--r); margin: 8px 0; }
.banner { background: var(--accent-soft); padding: 12px 16px; border-radius: var(--r); margin: 0 0 12px; }
.banner p { margin: 0 0 10px; }
.banner-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* layout */
.cols { display: grid; gap: 28px; }
@media (min-width: 960px) {
  .cols { grid-template-columns: minmax(380px, 1fr) minmax(0, 1.15fr); align-items: start; }
  .jump { display: none; }
}
.jump { margin: 0 0 4px; font-size: 1.05rem; }
.jump a { display: inline-flex; align-items: center; min-height: 44px; }
.jump span { font-weight: 700; }
.inputs h2:first-child { margin-top: 4px; }

/* recipes */
#recipes { display: grid; gap: 10px; margin-bottom: 12px; }
.rc { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); }
.rc[open] { border-color: var(--ink); }
.rc.has-err { border-color: var(--bad); }
.rc summary { list-style: none; cursor: pointer; padding: 12px 44px 12px 14px; position: relative; min-height: 48px; display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.rc summary::-webkit-details-marker { display: none; }
.rc summary::after { content: ""; position: absolute; right: 16px; top: 20px; width: 9px; height: 9px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg); }
.rc[open] summary::after { transform: rotate(225deg); top: 24px; }
.rc-name { font-weight: 700; overflow-wrap: anywhere; }
.rc-sum { color: var(--muted); font-family: var(--mono); font-size: 0.95rem; }
.rc-sum .bad { color: var(--bad); font-family: var(--body); }
.rc-body { padding: 0 14px 14px; display: grid; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) and (max-width: 1180px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 500; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.rc-body > .btn { justify-self: start; }

/* kitchen */
.kitchen { display: grid; gap: 12px; }
.kitchen h3 { margin: 6px 0 0; }
.row2, .row3 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row3 { grid-template-columns: 1fr; align-items: end; }
.row2 { align-items: end; }
@media (min-width: 560px) { .row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.unit { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.unit legend { font-weight: 600; font-size: 0.95rem; float: left; margin-right: 8px; }
.unit label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; font-weight: 600; }
.unit label:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.unit input { accent-color: var(--accent); width: 18px; height: 18px; }
#ovens { display: grid; gap: 10px; }
.oven { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.oven .btn { grid-column: 1 / -1; justify-self: start; }
#add-oven { justify-self: start; }
.more { margin-top: 28px; border-top: 1.5px solid var(--line); padding-top: 6px; }
.more summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
#kept { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; }
#kept li { border-bottom: 1px solid var(--line-soft); padding-bottom: 10px; }
#kept p { margin: 0 0 6px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.kept-none { color: var(--muted); }
.more-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.confirm { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r); padding: 12px 14px; margin: 10px 0; }
.confirm p { margin: 0 0 10px; }

/* result */
.result { background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 16px; outline: none; }
.headline .done-by { font-family: var(--head); font-size: 1.6rem; font-weight: 800; margin: 0; line-height: 1.2; }
.headline strong { font-family: var(--mono); font-weight: 700; color: var(--accent); white-space: nowrap; }
.headline .dw { font-size: 1.1rem; color: var(--muted); }
.facts { margin: 4px 0 0; color: var(--muted); }
.facts span { white-space: nowrap; }
.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 12px; border-radius: var(--r); margin: 10px 0 0; }
.problems ul { margin: 6px 0 0; padding-left: 20px; }
.chart { margin: 14px 0 4px; min-height: 0; }
.chart svg { display: block; max-width: 100%; font-family: var(--body); }
.chart .tick { font-size: 11px; fill: var(--muted); }
.chart .lab { font-size: 12px; fill: var(--ink); font-weight: 600; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .lane { fill: none; stroke: var(--line); }
.chart .pre { opacity: 0.35; }
.chart .hold { opacity: 0.12; }
.chart .tray { stroke: var(--surface); stroke-width: 0.5; }
.chart .h-mix { fill: var(--h-mix); }
.chart .h-shape { fill: var(--h-shape); }
.chart .h-dec { fill: var(--h-dec); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; font-size: 0.95rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.legend i.pre-key { opacity: 0.35; }
.legend i.h-mix { background: var(--h-mix); }
.legend i.h-shape { background: var(--h-shape); }
.legend i.h-dec { background: var(--h-dec); }
.print-head { display: none; }

/* the checklist */
.steps { list-style: none; padding: 0; margin: 12px 0; }
.step { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.step .when { font-family: var(--mono); font-weight: 700; font-size: 0.95rem; padding-top: 11px; white-space: nowrap; }
.step .when small { display: block; font-family: var(--body); font-weight: 500; color: var(--muted); font-size: 0.9rem; white-space: normal; }
.step .what { min-width: 0; }
.step .txt { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.step p.txt { padding-top: 10px; }
.step .detail { margin: 2px 0 0; color: var(--muted); }
.k-before .when { font-family: var(--body); }
.k-heat .txt, .k-off .txt { color: var(--accent); }
.tick { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding-top: 8px; cursor: pointer; }
.tick input, .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.box { flex: none; width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 4px; background: var(--surface); position: relative; margin-top: -1px; }
input:checked + .box { background: var(--ok); border-color: var(--ok); }
input:checked + .box::after { content: ""; position: absolute; left: 6px; top: 1px; width: 7px; height: 13px; border: solid var(--surface); border-width: 0 3px 3px 0; transform: rotate(45deg); }
input:focus-visible + .box { outline: 3px solid var(--accent); outline-offset: 2px; }
.step.done .txt, .chip:has(input:checked) span:last-child { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px 6px 8px; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; font-family: var(--mono); font-size: 0.95rem; position: relative; }
.chip .box { width: 22px; height: 22px; }
.blank-sheet .step { min-height: 40px; }
.blank-sheet .blank-head { font-weight: 700; min-height: 0; }
.blank-sheet .blank-head .when { padding-top: 0; }
@media screen { .blank-sheet { display: none; } }
.not { color: var(--muted); margin: 8px 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-box { display: flex; gap: 8px; align-items: end; margin-top: 12px; }
.share-box .fld { flex: 1; }

/* bake day */
#bake-view { max-width: 760px; }
#bake-view h2 { margin-top: 8px; outline: none; }
.now { background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 14px 16px; margin: 0 0 12px; }
.now p { margin: 0 0 8px; }
.now .lbl { display: inline-block; min-width: 0; font-weight: 700; margin-right: 6px; }
.now-next { font-size: 1.3rem; font-family: var(--head); }
.now-next strong { font-family: var(--mono); color: var(--accent); }
.now-next .rel { font-family: var(--body); font-size: 1rem; color: var(--muted); }
.now-next .rel.behind { color: var(--bad); font-weight: 600; }
.now-what { font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.now-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.now-list { color: var(--ink); }
.late { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.late > span { font-weight: 600; margin-right: 4px; }
.steps.big .step { grid-template-columns: 5.8em minmax(0, 1fr); padding: 12px 0; }
.steps.big .txt { font-size: 1.08rem; }
.timer-btn { font-size: 0.95rem; }
/* a chip and its Timer stay side by side; the chip wraps after its label. Below 375px the times no longer fit
   beside the Timer, so the Timer goes under its chip. */
.chip-pair { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 6px 8px; max-width: 100%; }
@media (max-width: 374px) { .chip-pair { flex-wrap: wrap; } }
.chip-pair .chip { min-width: 0; flex: 0 1 auto; }
.chip-pair .chip > span:last-child { min-width: 0; }
.chip-pair .timer-btn { flex: none; }
.detail.in-line .timer-btn { margin-left: 6px; vertical-align: middle; }
.timers { display: grid; gap: 8px; margin: 0 0 12px; }
.timer { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); padding: 8px 12px; }
.timer .t-label { font-weight: 600; flex: 1 1 12em; overflow-wrap: anywhere; }
.timer .t-left { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; }
.timer.up { border-color: var(--accent); background: var(--accent-soft); }
.timer.up .t-left { color: var(--accent); font-size: 1.1rem; }
.bake-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* about */
.about { max-width: 70ch; margin-top: 40px; border-top: 2px solid var(--line); }
.about p { margin: 0 0 12px; }
.faq h3 { margin-top: 20px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); background: var(--ink); color: var(--bg); border-radius: var(--r); padding: 10px 10px 10px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; z-index: 20; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.toast .toast-text { flex: 1 1 14em; }
.toast button { min-height: 44px; min-width: 44px; border-radius: var(--r); border: 1.5px solid var(--bg); background: transparent; color: var(--bg); font: 600 1rem var(--body); padding: 0 14px; cursor: pointer; }

/* footer */
.site-footer { border-top: 1.5px solid var(--line); margin-top: 24px; padding: 20px 16px 32px; }
.sb-footer { max-width: 1240px; margin: 0 auto; color: var(--muted); font-size: 0.95rem; }
.sb-footer a { color: var(--ink); }
.sb-more { line-height: 1.9; }
.sb-privacy, .sb-credit { margin: 8px 0 0; }

@media (max-width: 400px) {
  .step, .steps.big .step { grid-template-columns: 4.9em minmax(0, 1fr); gap: 4px 8px; }
  .step .when { font-size: 0.9rem; }
  .oven { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .oven .fld:first-child { grid-column: 1 / -1; }
  .tabs button { padding: 12px 10px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* paper: one kitchen sheet with clock times and boxes to tick */
@media print {
  @page { margin: 12mm 11mm 9mm; }
  @page :first { margin-top: 9mm; }
  :root { --bg: #fff; --surface: #fff; --ink: #000; --muted: #333; --line: #888; --line-soft: #bbb; --accent: #000; --ok: #000; }
  body { background: #fff; color: #000; font-size: 10.5pt; line-height: 1.17; }
  .top .lede, .tabs, .skip, .store-note, .banner, #bake-view, .inputs, .about, .site-footer, .toast, .actions, .share-box, .jump, .problems { display: none !important; }
  .top { padding: 0; }
  .top h1 { display: none; }
  main { padding: 0; max-width: none; }
  #plan-view { display: block !important; }
  .cols { display: block; }
  .result { border: 0; padding: 0; position: static; max-height: none; overflow: visible; }
  .print-head { display: block; margin: 0 0 4pt; }
  .ph-title { font: 800 16pt/1.1 var(--head); margin: 0; }
  #ph-setup { margin: 2pt 0 0; font-size: 10pt; }
  .headline .done-by { font-size: 13pt; }
  .headline strong { color: #000; }
  .facts { font-size: 10pt; color: #000; }
  .warn { border: 1pt solid #000; background: none; color: #000; padding: 4pt 6pt; font-size: 10pt; }
  .chart { margin: 4pt 0 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .chart svg { width: 100% !important; height: auto; }
  .chart .tray, .chart .pre, .chart .hold, .chart .h-mix, .chart .h-shape, .chart .h-dec { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .steps { margin: 4pt 0; }
  .step { grid-template-columns: 6.2em minmax(0, 1fr); padding: 1pt 0; border-top: 0.75pt solid #999; break-inside: avoid; gap: 0 8pt; }
  .step .when { padding-top: 0; font-size: 10pt; }
  .step .when small { font-size: 10pt; color: #000; }
  .step .txt { font-weight: 700; }
  .step p.txt { padding-top: 0; }
  .step .what { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6pt; }
  .step .detail { color: #000; font-size: 10pt; margin: 0; }
  .step .chips { flex-basis: 100%; }
  .headline { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10pt; }
  .tick { min-height: 0; padding-top: 0; gap: 6pt; }
  .box { width: 11pt; height: 11pt; border: 1pt solid #000; border-radius: 1.5pt; margin-top: 0.5pt; }
  input:checked + .box { background: none; border-color: #000; }
  input:checked + .box::after { border-color: #000; left: 3pt; top: 0; width: 3pt; height: 7pt; border-width: 0 1.5pt 1.5pt 0; }
  .step.done .txt, .chip:has(input:checked) span:last-child { text-decoration: none; color: #000; }
  .chips { gap: 2pt 10pt; margin-top: 1pt; }
  .chip { min-height: 0; padding: 0; border: 0; font-size: 10pt; gap: 4pt; }
  .chip .box { width: 10pt; height: 10pt; }
  .timer-btn { display: none; }
  .legend { margin: 2pt 0 0; gap: 2pt 10pt; font-size: 10pt; color: #000; }
  .legend i { width: 9pt; height: 9pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .blank-sheet .step.blank { min-height: 20pt; }
  .is-blank .headline, .is-blank .problems { display: none !important; }
  .not { font-size: 10pt; color: #000; margin: 6pt 0 0; break-before: avoid; }
  .steps > :nth-last-child(-n+6) { break-before: avoid; }
  .chart .tick { font-size: 12.5px; fill: #000; }
  .chart .lab { font-size: 13px; fill: #000; }
}
