/* Self-hosted fonts (SIL Open Font Licence, see /fonts/). font-display: optional, so a page never swaps fonts
   part-way through (no jump); the service worker caches them, so later visits get them straight away. */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: optional; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: optional; src: url("/fonts/barlow-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: optional; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: optional; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* Layout: enamel kitchen-board. Sticky header + tab strip; mobile is one column,
   desktop puts the plan editor and the timeline side by side. Times are set in a
   condensed signage face so they read at arm's length; body text is Barlow, the same
   family at normal width. Times use tabular figures, so digits don't shift as they change.
   Spacing comes from the --sp-* scale: 4-8 px inside a group, 12 px between items,
   --sp-section between page sections (24 px on phones, 32 px on wide layouts).
   Corners: containers --r, the controls inside them --r-sm, small markers --r-xs. */
:root {
  --bg: #f7f7f4;          /* near-white */
  --surface: #ffffff;
  --surface-2: #f1f2ee;
  --ink: #17201b;
  --ink-2: #46524b;
  --muted: #5c675f;
  --line: #e2e5df;
  --line-strong: #848f86;
  --accent: #1d5640;      /* range-cooker green */
  --accent-2: #2b7356;
  --accent-ink: #f3f7f2;
  --heat: #a8761a;        /* brass: temperature, serve line */
  --heat-ink: #7a5309;
  --critical: #c0352b;
  --critical-bg: #fbe9e6;
  --warning: #94600a;
  --on-warning: #ffffff;  /* text on a --warning fill */
  --warning-bg: #fbf0d9;
  --good: #16723f;
  --now: #c0352b;
  --s1: #d0592b; --s2: #2f62c4; --s3: #008f7c; --s4: #b07c00;
  --s5: #b8457a; --s6: #4f8a1f; --s7: #6a4bb0; --s-other: #6f7b88;
  --wait: #8a948c;
  --shadow: 0 1px 0 rgba(23, 32, 27, .06), 0 8px 24px -12px rgba(23, 32, 27, .25);
  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 10px;              /* containers */
  --r-sm: 6px;            /* buttons, inputs and other controls inside containers */
  --r-xs: 4px;            /* small markers */
  --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-24: 24px; --sp-32: 32px; --sp-48: 48px;
  --sp-section: var(--sp-24);
  --hdr-h: 128px;
}
@media (min-width: 760px) { :root { --sp-section: var(--sp-32); } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111713; --surface: #19211c; --surface-2: #212a24; --ink: #e6ede6; --ink-2: #b6c2b8; --muted: #8e9a91;
    --line: #2e3a32; --line-strong: #5b6e61; --accent: #7cc29e; --accent-2: #94d1b1; --accent-ink: #0d1912;
    --heat: #d9a441; --heat-ink: #e8bd6a; --critical: #f07466; --critical-bg: #3a1d1a; --warning: #e0a63a; --on-warning: #1c1300; --warning-bg: #33280f;
    --good: #5cc48a; --now: #f07466;
    --s1: #e07042; --s2: #4f84e6; --s3: #22a596; --s4: #b5850f; --s5: #d0659a; --s6: #6aa63a; --s7: #8f74d9; --s-other: #7d8a98;
    --wait: #6d776f; --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111713; --surface: #19211c; --surface-2: #212a24; --ink: #e6ede6; --ink-2: #b6c2b8; --muted: #8e9a91;
  --line: #2e3a32; --line-strong: #5b6e61; --accent: #7cc29e; --accent-2: #94d1b1; --accent-ink: #0d1912;
  --heat: #d9a441; --heat-ink: #e8bd6a; --critical: #f07466; --critical-bg: #3a1d1a; --warning: #e0a63a; --on-warning: #1c1300; --warning-bg: #33280f;
  --good: #5cc48a; --now: #f07466;
  --s1: #e07042; --s2: #4f84e6; --s3: #22a596; --s4: #b5850f; --s5: #d0659a; --s6: #6aa63a; --s7: #8f74d9; --s-other: #7d8a98;
  --wait: #6d776f; --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body);
  font-size: 17px; line-height: 1.45; margin: 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--heat); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.display { font-family: var(--f-display); font-weight: 600; letter-spacing: .005em; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; }
h2 { font-size: 30px; }
h3 { font-size: 22px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
svg.i { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }

/* ---------- header ---------- */
.hdr { position: relative; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .hdr { position: sticky; top: env(safe-area-inset-top, 0px); } }
.hdr-in { max-width: 1480px; margin: 0 auto; padding: 10px 16px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.hdr-top { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.hdr-top .status { min-width: 0; }
.status .st-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The logo. build.js inlines /favicon.svg here as a data URI, so no request is made. */
.brand-mark {
  width: 34px; height: 34px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2.9 5.3 60 60'%3E%3Cdefs%3E%3Cmask id='roastly-rear' maskUnits='userSpaceOnUse' x='-8' y='-8' width='80' height='80'%3E%3Crect x='-8' y='-8' width='80' height='80' fill='%23fff'/%3E%3Cpath d='M5 45 C5 33.5 15 29 27 29 C38.5 29 47.5 32.5 51.5 39.5 C54.5 45 52 51.5 46 53.5 C40 55.5 33 55.5 26 55.5 C13.5 55.5 5 52.5 5 45 Z' fill='%23000' stroke='%23000' stroke-width='4'/%3E%3Cpath d='M50.29 47.25 L58.07 32.1 A5.7 5.7 0 0 0 48.89 25.55 L37.09 37.81 A8.2 8.2 0 1 0 50.29 47.25 Z' fill='%23000'/%3E%3Cpath d='M53 29.5 L56.8 23.4' fill='none' stroke='%23000' stroke-width='7.2' stroke-linecap='round'/%3E%3Ccircle cx='58.63' cy='23.95' r='4.2' fill='%23000'/%3E%3Ccircle cx='55.49' cy='22' r='4.2' fill='%23000'/%3E%3C/mask%3E%3Cmask id='roastly-body' maskUnits='userSpaceOnUse' x='-8' y='-8' width='80' height='80'%3E%3Crect x='-8' y='-8' width='80' height='80' fill='%23fff'/%3E%3Cpath d='M50.29 47.25 L58.07 32.1 A5.7 5.7 0 0 0 48.89 25.55 L37.09 37.81 A8.2 8.2 0 1 0 50.29 47.25 Z' fill='%23000'/%3E%3Cpath d='M53 29.5 L56.8 23.4' fill='none' stroke='%23000' stroke-width='7.2' stroke-linecap='round'/%3E%3Ccircle cx='58.63' cy='23.95' r='4.2' fill='%23000'/%3E%3Ccircle cx='55.49' cy='22' r='4.2' fill='%23000'/%3E%3C/mask%3E%3C/defs%3E%3Cg%3E%3Cg mask='url(%23roastly-rear)'%3E%3Cpath d='M41.44 40.69 L48.02 25.84 A3.3 3.3 0 0 0 42.42 22.44 L32.28 35.13 A5.4 5.4 0 1 0 41.44 40.69 Z' fill='%23c47524'/%3E%3Cpath d='M45 24.5 L48.3 18.6' fill='none' stroke='%23c47524' stroke-width='3.2' stroke-linecap='round'/%3E%3Ccircle cx='50.16' cy='19.07' r='2.2' fill='%23c47524'/%3E%3Ccircle cx='46.93' cy='17.26' r='2.2' fill='%23c47524'/%3E%3C/g%3E%3Cpath d='M5 45 C5 33.5 15 29 27 29 C38.5 29 47.5 32.5 51.5 39.5 C54.5 45 52 51.5 46 53.5 C40 55.5 33 55.5 26 55.5 C13.5 55.5 5 52.5 5 45 Z' fill='%23c47524' mask='url(%23roastly-body)'/%3E%3Cpath d='M48.52 46.33 L56.29 31.19 A3.7 3.7 0 0 0 50.33 26.93 L38.53 39.2 A6.2 6.2 0 1 0 48.52 46.33 Z' fill='%23c47524'/%3E%3Cpath d='M53 29.5 L56.8 23.4' fill='none' stroke='%23c47524' stroke-width='3.2' stroke-linecap='round'/%3E%3Ccircle cx='58.63' cy='23.95' r='2.2' fill='%23c47524'/%3E%3Ccircle cx='55.49' cy='22' r='2.2' fill='%23c47524'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.brand-name { font-family: var(--f-display); font-weight: 700; font-size: 25px; line-height: 1; white-space: nowrap; }
@media (max-width: 759px) {
  .hdr-in { gap: 4px; padding-top: 8px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-name { font-size: 21px; }
  .status { font-size: 13px; padding: 3px 8px; }
  .planbar-name { font-size: 18px; }
  .planbar-meta { font-size: 14px; }
}
/* The save note. All is well: small plain text in the muted colour. A problem (nothing can be saved, or only
   in this browser in the artifact build) keeps the pill and its coloured dot, so it stands out. */
.status {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted);
  padding: 0; border: 0; background: transparent;
}
.status.status-warn {
  color: var(--ink-2); padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.status[data-mode="account"] .dot { background: var(--good); }
.status[data-mode="browser"] .dot { background: var(--warning); }
.status[data-mode="memory"] .dot { background: var(--critical); }
.status.saving .dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.planbar { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: nowrap; min-width: 0; }
.planbar-name { flex: 0 1 auto; min-width: 0; font-family: var(--f-display); font-weight: 600; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.planbar-meta { flex: none; white-space: nowrap; color: var(--ink-2); font-size: 15px; }
.cook-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--critical); }
.cook-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: none; cursor: pointer; white-space: nowrap;
  min-height: 46px; padding: 0 12px; font-family: var(--f-display); font-size: 19px; font-weight: 600;
  color: var(--muted); border-bottom: 3px solid transparent;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: 11px; font-size: 14px; background: var(--critical); color: var(--surface); font-family: var(--f-body); font-weight: 700; }
.tab-sep { width: 1px; background: var(--line); margin: 12px 6px; flex: none; }

/* ---------- page ---------- */
main { max-width: 1480px; margin: 0 auto; padding-inline: var(--sp-16); padding-block: var(--sp-16) calc(var(--sp-48) + var(--sp-32)); }
.view-head { display: flex; align-items: end; justify-content: space-between; gap: var(--sp-12); flex-wrap: wrap; margin-bottom: var(--sp-section); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-12); }
/* Page sections: the plan editor's groups, the Cook tab's sections */
.sections, #ed-pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-section); min-width: 0; }
.row { display: flex; gap: var(--sp-8); align-items: center; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-16); min-width: 0; }
.panel-tight { padding: var(--sp-12); }
.empty { padding: var(--sp-32) var(--sp-16); text-align: center; color: var(--ink-2); display: grid; gap: var(--sp-12); justify-items: center; }
.split { display: grid; gap: var(--sp-section); }
@media (min-width: 1100px) {
  .split { grid-template-columns: minmax(400px, 460px) minmax(0, 1fr); align-items: start; }
  .split > .tl-pane { position: sticky; top: calc(var(--hdr-h) + 14px); }
}

/* ---------- controls ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 var(--sp-16); border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 700; font-size: 16px; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: var(--critical); border-color: currentColor; }
.btn-confirm { background: var(--critical); border-color: var(--critical); color: var(--surface); }
.btn-sm { min-height: 44px; padding: 0 var(--sp-12); font-size: 15px; }
.btn-big { min-height: 60px; font-size: 20px; padding: 0 var(--sp-24); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 44px; min-width: 44px; padding: 0; }
.seg-ctl { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg-ctl button { appearance: none; border: 0; background: none; min-height: 44px; padding: 0 var(--sp-12); cursor: pointer; font-weight: 700; color: var(--ink-2); }
.seg-ctl button + button { border-left: 1px solid var(--line-strong); }
.seg-ctl button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
label.field { display: grid; gap: var(--sp-4); font-size: 14px; color: var(--ink-2); min-width: 0; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 var(--sp-12); background: var(--surface);
  color: var(--ink); width: 100%; min-width: 0; font-size: 17px;
}
textarea { padding: var(--sp-8) var(--sp-12); min-height: 64px; resize: vertical; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.unit-input { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); min-height: 44px; overflow: hidden; }
.unit-input input { border: 0; min-height: 42px; text-align: right; padding-right: 4px; }
.unit-input span { padding: 0 var(--sp-12) 0 2px; color: var(--muted); font-size: 15px; white-space: nowrap; }
/* Native time fields size themselves to the device's own format (24-hour, or 12-hour with AM/PM) and, on desktop, the clock icon */
input.time-input { width: auto; flex: none; text-align: center; font-family: var(--f-display); font-size: 24px; font-weight: 600; }
input.time-input-sm { font-size: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip-heat { color: var(--heat-ink); border-color: color-mix(in oklab, var(--heat) 45%, transparent); background: color-mix(in oklab, var(--heat) 12%, var(--surface)); }
.chip-crit { color: var(--critical); background: var(--critical-bg); border-color: color-mix(in oklab, var(--critical) 40%, transparent); }
.chip-warn { color: var(--warning); background: var(--warning-bg); border-color: color-mix(in oklab, var(--warning) 40%, transparent); }
.chip-ok { color: var(--good); }
.swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.toggle-ho { min-height: 44px; padding: 0 var(--sp-12); border-radius: var(--r-sm); border: 1px dashed var(--line-strong); background: transparent; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-weight: 700; font-size: 14px; }
.toggle-ho[aria-pressed="true"] { border-style: solid; border-color: var(--ink-2); color: var(--ink); background: var(--surface-2); }

/* ---------- plan editor ---------- */
#plan-summary { gap: var(--sp-8) var(--sp-16); }
.sum-head { display: flex; align-items: baseline; gap: var(--sp-8); white-space: nowrap; font-size: 15px; color: var(--muted); }
.sum-head b { font-family: var(--f-display); font-weight: 700; font-size: 26px; line-height: 1.1; color: var(--ink); }
.plan-meta { display: flex; flex-wrap: wrap; gap: var(--sp-12) var(--sp-16); align-items: end; }
.plan-meta .pm-name { flex: 1 1 100%; }
.plan-meta > .field:not(.pm-name) { flex: 1 1 160px; }
.serve-ctl { display: flex; align-items: center; gap: var(--sp-8); }
/* The dishes are one list: one container, thin dividers between dishes */
.dish-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.dish { min-width: 0; }
.dish + .dish { border-top: 1px solid var(--line); }
/* Dish top row, one grid for both states: arrow (44 px), name, time; problem labels on a second line under the name.
   Collapsed, the whole row is a button. Open, the arrow is its own button and the name is the editable field, in the
   same place: the first line is a 44 px band, and the name text starts 7 px in (the field's border plus padding). */
.dish-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "arrow name time" ". probs probs";
  column-gap: var(--sp-8); align-items: start; width: 100%; min-height: 48px; padding: 2px 12px 2px 2px; color: var(--ink);
}
.dish:first-child > button.dish-row { border-top-left-radius: calc(var(--r) - 1px); border-top-right-radius: calc(var(--r) - 1px); }
.dish:last-child > button.dish-row { border-bottom-left-radius: calc(var(--r) - 1px); border-bottom-right-radius: calc(var(--r) - 1px); }
button.dish-row { appearance: none; border: 0; border-radius: 0; background: transparent; text-align: left; cursor: pointer; }
button.dish-row:hover, .dish-close:hover { background: var(--surface-2); }
.dish-row > svg.i, .dish-close > svg.i { display: block; width: 20px; height: 20px; margin: 12px; color: var(--ink-2); }
.dish-row > svg.i { grid-area: arrow; transform: rotate(-90deg); }
.dish-close { grid-area: arrow; appearance: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer; }
.dish-title { grid-area: name; min-width: 0; padding: 9px 0 9px 7px; overflow-wrap: anywhere; font-family: var(--f-display); font-size: 23px; font-weight: 600; line-height: 26px; }
.dish-when { display: contents; }
.dish-time { grid-area: time; padding-top: 9px; white-space: nowrap; font-size: 15px; line-height: 26px; color: var(--ink-2); }
.dish-time.num { font-family: var(--f-display); font-size: 19px; font-weight: 600; color: var(--ink); }
.dish-probs { grid-area: probs; display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-12); align-items: center; padding: 0 0 var(--sp-8) 7px; }
/* A problem on a collapsed dish: text in its severity colour after a small symbol (decorative; the words carry the meaning) */
.prob { display: inline-flex; align-items: center; gap: var(--sp-4); font-size: 14px; font-weight: 700; line-height: 1.3; }
.prob > svg.i { width: 16px; height: 16px; vertical-align: 0; }
.prob.warn { color: var(--warning); }
.prob.crit { color: var(--critical); }
.dish-row > input.dish-name {
  grid-column: 2 / 4; grid-row: 1; height: 44px; min-height: 44px; padding: 0 6px; border: 1px solid var(--line-strong); background: var(--surface);
  font-family: var(--f-display); font-size: 23px; font-weight: 600;
}
.dish-head { display: flex; padding: var(--sp-4) var(--sp-12) var(--sp-8) 54px; }
.dish-sum { display: flex; gap: var(--sp-4) var(--sp-12); flex-wrap: wrap; align-items: center; padding: 0 var(--sp-12) var(--sp-8) 54px; font-size: 15px; color: var(--ink-2); }
.dish-sum strong { color: var(--ink); font-family: var(--f-display); font-size: 19px; font-weight: 600; }
.nudge { display: flex; gap: var(--sp-8); align-items: center; flex-wrap: wrap; padding: 0 var(--sp-12) var(--sp-12) 54px; }
.phases { border-top: 1px solid var(--line); }
.phase { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: var(--sp-8) var(--sp-12); padding: var(--sp-12); border-bottom: 1px solid var(--line); align-items: center; }
.phase:last-child { border-bottom: 0; }
.ph-time { font-family: var(--f-display); font-size: 17px; font-weight: 600; color: var(--ink-2); line-height: 1.1; }
.ph-time small { display: block; font-family: var(--f-body); font-size: 12px; font-weight: 400; color: var(--muted); }
.ph-main { display: flex; flex-wrap: wrap; gap: var(--sp-8); align-items: center; min-width: 0; }
.ph-main .ph-name { flex: 1 1 140px; }
.ph-main .ph-min { flex: 0 0 96px; }
.ph-main .ph-app { flex: 1 1 140px; }
.ph-main .ph-temp { flex: 0 0 132px; }
.ph-flag { grid-column: 2; font-size: 14px; display: flex; gap: var(--sp-4) var(--sp-8); flex-wrap: wrap; }
.ph-more { grid-column: 1 / -1; display: grid; gap: var(--sp-12); grid-template-columns: 1fr; padding: var(--sp-8) 0 2px; }
@media (min-width: 560px) { .ph-more { grid-template-columns: 1fr 140px; } }
.ph-more .row { grid-column: 1 / -1; }
.add-bar { display: flex; gap: var(--sp-8); flex-wrap: wrap; }
.lock-note { display: flex; gap: var(--sp-12); align-items: center; padding: var(--sp-12) var(--sp-16); border-radius: var(--r); background: var(--warning-bg); color: var(--ink); border: 1px solid color-mix(in oklab, var(--warning) 35%, transparent); }

/* ---------- timeline ---------- */
.tl-pane { display: grid; gap: 12px; min-width: 0; }
.tl-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.tl-scroll {
  overflow: auto; max-height: min(76vh, 900px); border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); position: relative; overscroll-behavior-x: contain;
}
@media (min-width: 1100px) {
  .split > .tl-pane { display: flex; flex-direction: column; gap: 12px; height: calc(100vh - var(--hdr-h) - 18px); }
  .split .tl-scroll { flex: 1 1 auto; min-height: 0; max-height: none; }
  /* The Timeline tab: the chart is the page. The axis strip is pinned under the header and carries the sideways scrollbar;
     the chart body below it never scrolls vertically and hides its own scrollbar (the two are kept in step in app.js). */
  .tl-frame { min-width: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
  .tl-headbox { position: sticky; top: var(--hdr-h); z-index: 8; overflow-x: auto; overflow-y: hidden; background: var(--surface); border-radius: var(--r) var(--r) 0 0; border-bottom: 1px solid var(--line-strong); }
  .tl-headbox .tl-head { position: static; border-bottom: 0; }
  .tl-frame .tl-scroll { border: 0; border-radius: 0 0 var(--r) var(--r); max-height: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .tl-frame .tl-scroll::-webkit-scrollbar { display: none; }
  /* 44 px rows */
  .tl-row > .tl-label { padding-block: 3px; }
  .tl-track > .seg { top: 4px; bottom: 4px; }
  /* The all-clear on the controls row, between the view switch and the zoom buttons */
  .tl-controls > .issue-ok, .tl-controls > .iss-wrap { flex: 1 1 0; min-width: 0; min-height: 44px; }
  .tl-controls > .issue-ok { padding-block: 0; }
  /* the open list spans the chart pane, just below the controls row */
  .tl-controls { position: relative; }
  .tl-controls > .iss-wrap { position: static; }
  .tl-legend-in { position: sticky; left: 0; width: 100%; display: grid; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
  .tl-pane .issue-ok > span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.tl-grid { position: relative; }
.tl-head { position: sticky; top: 0; z-index: 6; display: flex; background: var(--surface); border-bottom: 1px solid var(--line-strong); }
.tl-corner { position: sticky; left: 0; z-index: 7; background: var(--surface); flex: none; border-right: 1px solid var(--line); padding: 8px 10px; font-size: 13px; color: var(--muted); display: flex; align-items: flex-end; }
.tl-axis { position: relative; height: 56px; flex: none; }
.tl-tick { position: absolute; bottom: 0; width: 1px; height: 3px; background: var(--line-strong); }
.tl-tick.q { height: 6px; background: var(--ink-2); }
.tl-tlabel { position: absolute; bottom: 6px; line-height: 1; transform: translateX(-50%); font-family: var(--f-display); font-weight: 600; font-size: 16px; color: var(--ink-2); white-space: nowrap; }
.tl-cmark { position: absolute; top: 20px; height: 14px; border-radius: 3px; background: var(--critical); color: var(--surface); font-size: 11px; font-weight: 700; line-height: 14px; text-align: center; border: 0; padding: 0; cursor: pointer; min-width: 14px; }
.tl-cmark.warn { background: var(--warning); color: var(--on-warning); }
.tl-row { display: flex; border-bottom: 1px solid var(--line); }
.tl-row.band { background: var(--surface-2); }
.tl-label {
  position: sticky; left: 0; z-index: 4; flex: none; background: var(--surface); border-right: 1px solid var(--line);
  padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0;
}
.tl-row.band .tl-label { background: var(--surface-2); }
.tl-label b { font-family: var(--f-display); font-weight: 600; font-size: 17px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-label span { font-size: 12px; color: var(--muted); line-height: 1.2; }
.tl-label .late { color: var(--critical); font-weight: 700; }
.tl-track { position: relative; flex: none; }
.tl-lane { position: relative; }
.tl-lane.over { background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--critical) 14%, transparent) 0 6px, transparent 6px 12px); box-shadow: inset 0 1px 0 var(--critical); }
.tl-lane-tag { position: absolute; right: 4px; top: 2px; font-size: 11px; font-weight: 700; color: var(--critical); }
.seg {
  position: absolute; top: 5px; bottom: 5px; border-radius: 5px; border: 1px solid color-mix(in oklab, var(--c) 70%, var(--ink));
  background: color-mix(in oklab, var(--c) 46%, var(--surface)); color: var(--ink);
  display: flex; align-items: center; gap: 4px; padding: 0 6px; overflow: hidden; cursor: pointer; text-align: left;
  font-size: 13px; line-height: 1.15; appearance: none;
}
.seg.un {
  background:
    repeating-linear-gradient(135deg, color-mix(in oklab, var(--c) 30%, transparent) 0 2px, transparent 2px 7px),
    color-mix(in oklab, var(--c) 14%, var(--surface));
}
.seg .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.seg .t em { font-style: normal; font-weight: 400; }
.seg.conf { outline: 3px solid var(--critical); outline-offset: -1px; z-index: 2; }
.seg.warn { outline: 3px dashed var(--warning); outline-offset: -1px; }
.seg .bang { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--critical); color: var(--surface); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.seg .bang.w { background: var(--warning); color: var(--on-warning); }
.seg.done { opacity: .42; }
.seg.active { box-shadow: 0 0 0 2px var(--ink); }
.seg.hl { animation: hl 1.2s ease-in-out 2; }
@keyframes hl { 50% { transform: translateY(-3px); box-shadow: 0 0 0 4px var(--critical); } }
.seg.wait {
  border: 1px dashed var(--wait); cursor: default;
  background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--wait) 28%, transparent) 0 2px, transparent 2px 6px);
  color: var(--muted); font-weight: 400;
}
.seg.preheat { border-style: dashed; cursor: default; }
.band-seg {
  position: absolute; top: 4px; bottom: 4px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-weight: 600; font-size: 15px; color: var(--ink); overflow: hidden; white-space: nowrap;
  background: color-mix(in oklab, var(--heat) var(--pct), var(--surface)); border: 1px solid color-mix(in oklab, var(--heat) 55%, transparent);
}
.band-seg.pre { justify-content: flex-start; padding: 0 6px; text-overflow: ellipsis; background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--heat) 35%, transparent) 0 2px, transparent 2px 7px); border-style: dashed; font-family: var(--f-body); font-size: 12px; font-weight: 700; }
.band-strip { position: relative; height: 26px; border-bottom: 1px dashed var(--line); }
.tl-vline { position: absolute; top: 0; bottom: 0; width: 0; z-index: 3; pointer-events: none; }
.tl-vline.serve { border-left: 2px solid var(--heat); }
.tl-vline.now { border-left: 2px solid var(--now); }
.ax-tag { font-variant-numeric: tabular-nums; position: absolute; top: 1px; font-size: 12px; font-weight: 700; white-space: nowrap; padding: 1px 6px; border-radius: 4px; line-height: 16px; }
.ax-tag.serve { background: var(--heat); color: #1d1404; }
.ax-tag.now { background: var(--now); color: var(--surface); z-index: 1; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--ink-2); }
.legend .key { display: inline-flex; gap: 6px; align-items: center; }
.key-box { width: 28px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid var(--line-strong); }
.key-ho { background: color-mix(in oklab, var(--ink-2) 46%, var(--surface)); }
.key-un { background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--ink-2) 30%, transparent) 0 2px, transparent 2px 7px), color-mix(in oklab, var(--ink-2) 12%, var(--surface)); }
.key-conf { outline: 3px solid var(--critical); outline-offset: -2px; }
.key-wait { border-style: dashed; background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--wait) 28%, transparent) 0 2px, transparent 2px 6px); }

/* ---------- conflicts ---------- */
.issues { display: grid; gap: 0; }
.issue {
  appearance: none; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; text-align: left;
  padding: var(--sp-12) var(--sp-8); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; cursor: pointer; min-height: 44px; width: 100%;
}
.issue:last-child { border-bottom: 0; }
.issue:hover { background: var(--surface-2); }
.issue .k, .iss-line .k { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-xs); white-space: nowrap; }
.issue.crit .k, .iss-line.crit .k { background: var(--critical); color: var(--surface); }
.issue.warn .k, .iss-line.warn .k { background: var(--warning); color: var(--on-warning); }
/* Clashes and warnings above the chart: one line, and the full list drawn over the chart (it never moves the chart) */
.iss-wrap { position: relative; min-width: 0; }
.iss-line {
  appearance: none; width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px;
}
.iss-line:hover { background: var(--surface-2); }
.iss-line > svg.i { width: 20px; height: 20px; margin-left: -4px; color: var(--ink-2); transform: rotate(-90deg); }
.iss-line[aria-expanded="true"] > svg.i { transform: none; }
.iss-line .t { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iss-line .more { flex: none; font-weight: 700; white-space: nowrap; }
.iss-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; padding: var(--sp-4) var(--sp-8); max-height: 60vh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow);
}
.iss-pop[hidden] { display: none; }
.issue.past { opacity: .55; }
.issue-ok { display: flex; gap: var(--sp-8); align-items: center; color: var(--ink-2); font-size: 15px; padding: var(--sp-8) var(--sp-12); min-height: 44px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); }

/* ---------- run sheet ---------- */
.rs { display: grid; }
.rs-group { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: var(--sp-4) var(--sp-16); padding: var(--sp-12) 0; border-bottom: 1px solid var(--line); }
.rs-time { font-variant-numeric: tabular-nums; font-family: var(--f-display); font-weight: 700; font-size: 26px; line-height: 1; padding-top: 6px; }
.rs-items { display: grid; gap: var(--sp-4); min-width: 0; }
.rs-item { display: flex; gap: var(--sp-8); align-items: center; min-height: 44px; min-width: 0; }
.rs-item .txt { flex: 1 1 auto; min-width: 0; }
.rs-item .meta { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-top: 2px; }
.rs-group.past { opacity: .5; }
.rs-group.next .rs-time { color: var(--critical); }
.tickbox { appearance: none; width: 30px; height: 30px; border: 2px solid var(--line-strong); border-radius: var(--r-sm); flex: none; cursor: pointer; display: grid; place-items: center; background: var(--surface); margin: 7px; }
.tickbox:checked { background: var(--accent); border-color: var(--accent); }
.tickbox:checked::after { content: ""; width: 9px; height: 15px; border: solid var(--accent-ink); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }
.rs-item.ticked .txt { text-decoration: line-through; color: var(--muted); }
.ho-mark { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; font-weight: 700; color: var(--ink); background: color-mix(in oklab, var(--warning) 20%, var(--surface)); border: 1px solid color-mix(in oklab, var(--warning) 50%, transparent); padding: 2px 8px; border-radius: 999px; }

/* ---------- cook mode ---------- */
.cook-top { display: grid; gap: var(--sp-12); align-items: center; }
@media (min-width: 760px) { .cook-top { grid-template-columns: auto 1fr auto; } }
.clock { font-family: var(--f-display); font-weight: 700; font-size: clamp(64px, 13vw, 112px); line-height: .9; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.clock small { font-size: .42em; color: var(--muted); font-weight: 600; }
.to-serve { font-family: var(--f-display); font-size: 26px; font-weight: 600; line-height: 1.15; }
.to-serve b { font-size: 34px; }
.rehearsal-bar {
  display: flex; gap: var(--sp-8); flex-wrap: wrap; align-items: center; justify-content: space-between; padding: var(--sp-12) var(--sp-16); border-radius: var(--r);
  background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--heat) 22%, var(--surface)) 0 14px, color-mix(in oklab, var(--heat) 10%, var(--surface)) 14px 28px);
  border: 2px solid var(--heat);
}
.rehearsal-bar .lbl { font-family: var(--f-display); font-weight: 700; font-size: 24px; }
.cook-grid { display: grid; gap: var(--sp-section); }
@media (min-width: 980px) { .cook-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }
/* What's cooking now: one list, a divider between steps */
.now-list { padding-block: 0; }
.now-card { display: grid; gap: var(--sp-8); padding: var(--sp-16) 0; border-bottom: 1px solid var(--line); position: relative; }
.now-card:last-child { border-bottom: 0; }
.now-card .nc-head { display: flex; justify-content: space-between; gap: var(--sp-12); align-items: baseline; flex-wrap: wrap; }
.now-card .nc-dish { font-family: var(--f-display); font-weight: 700; font-size: 26px; line-height: 1.05; }
.now-card .nc-left { font-family: var(--f-display); font-weight: 700; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.now-card .nc-sub { color: var(--ink-2); font-size: 16px; display: flex; gap: var(--sp-8); flex-wrap: wrap; align-items: center; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c, var(--accent)); }
.delay-row { display: flex; gap: var(--sp-8); flex-wrap: wrap; align-items: center; }
.next-list { display: grid; gap: 0; }
.next-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: var(--sp-12); align-items: center; padding: var(--sp-12) 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.next-item .at { font-variant-numeric: tabular-nums; font-family: var(--f-display); font-weight: 700; font-size: 22px; }
.next-item .cd { font-family: var(--f-display); font-weight: 600; font-size: 20px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.next-item.soon .cd { color: var(--critical); }
.banner { display: grid; gap: var(--sp-8); padding: var(--sp-12) var(--sp-16); border-radius: var(--r); border: 2px solid var(--critical); background: var(--critical-bg); }
.banner.info { border-color: var(--line-strong); background: var(--surface); }
.banner ul { margin: 0; padding-left: var(--sp-24); }
.late-panel { border: 2px solid var(--critical); }
/* The alert: a card on the page background, a red band per due time, one line per action with its tickbox.
   It grows to fit and scrolls only when it is taller than the screen. */
.flash { position: fixed; inset: 0; z-index: 90; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-16); background: var(--bg); color: var(--ink); }
.fl-card { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.fl-time { font-variant-numeric: tabular-nums; background: var(--critical); color: var(--surface); font-family: var(--f-display); font-weight: 700; font-size: 72px; line-height: 1; padding: var(--sp-8) var(--sp-16); }
.fl-list { padding: 0 var(--sp-16); }
.fl-line { display: flex; align-items: center; gap: var(--sp-12); min-height: 56px; padding: var(--sp-12) 0; border-bottom: 1px solid var(--line); font-size: clamp(24px, 4.6vw, 40px); line-height: 1.2; cursor: pointer; }
.fl-line:last-child { border-bottom: 0; }
.fl-line .act-txt { flex: 1 1 auto; }
.fl-line.ticked .act-txt { text-decoration: line-through; color: var(--muted); }
.fl-foot { display: grid; justify-items: center; padding: var(--sp-16); border-top: 1px solid var(--line); }
/* An action line (alert, Next, Still to do): bold dish name, what to do, appliance label in the appliance's colour. */
.act-line { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--sp-4); align-items: start; min-width: 0; }
.act-line > :not(.act-txt) { justify-self: start; }
.act-txt { min-width: 0; }
.act-app { display: inline-flex; align-items: center; margin-left: var(--sp-8); padding: 2px 10px; border: 2px solid var(--c); border-radius: 999px; background: color-mix(in oklab, var(--c) 12%, var(--surface)); font-size: 20px; font-weight: 700; line-height: 1.3; white-space: nowrap; vertical-align: middle; }
.next-item .act-app { font-size: 14px; padding: 1px 8px; }
.todo-item { cursor: pointer; }
label.rs-item { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .status.saving .dot, .cook-badge::before { animation: none; } .seg.hl { animation: none; outline: 4px solid var(--critical); } }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(10, 16, 12, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--surface); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0;
  padding: var(--sp-16) var(--sp-16) calc(var(--sp-16) + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow); display: grid; gap: var(--sp-16); align-content: start;
}
@media (min-width: 760px) { .scrim { align-items: center; } .sheet { border-radius: 16px; max-height: 86vh; padding: var(--sp-24); } }
.sheet-head { display: flex; justify-content: space-between; gap: var(--sp-12); align-items: start; }
.pick-list { display: grid; gap: var(--sp-4); }
.pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-12); align-items: center; padding: var(--sp-8) var(--sp-4); border-bottom: 1px solid var(--line); }
.pick b { font-family: var(--f-display); font-size: 20px; font-weight: 600; }
.pick .sub { font-size: 14px; color: var(--muted); }
.cat-h { font-family: var(--f-display); font-size: 18px; font-weight: 700; color: var(--ink-2); padding-top: var(--sp-12); }
.calc-out { display: grid; gap: var(--sp-4); }
.calc-line { display: grid; grid-template-columns: 1fr auto auto; gap: var(--sp-12); padding: var(--sp-8) 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.calc-line b { font-family: var(--f-display); font-size: 20px; font-weight: 600; }
.note { font-size: 14px; color: var(--ink-2); padding: var(--sp-8) var(--sp-12); border-radius: var(--r-sm); background: var(--surface-2); }

/* ---------- library / kitchen ---------- */
.lib-list { display: grid; gap: 0; }
.lib-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); padding: var(--sp-12) 0; border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .lib-item { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.lib-item b { font-family: var(--f-display); font-size: 21px; font-weight: 600; }
.lib-item .sub { font-size: 14px; color: var(--ink-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.meat { border-collapse: collapse; min-width: 880px; width: 100%; font-size: 15px; }
table.meat th, table.meat td { padding: var(--sp-4) var(--sp-8); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.meat th { white-space: nowrap; font-size: 13px; color: var(--ink-2); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
table.meat td input { width: 74px; min-height: 40px; text-align: right; }
table.meat td.cut { font-weight: 700; }
.app-card { display: grid; gap: var(--sp-12); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.stepper { display: inline-flex; align-items: center; gap: var(--sp-8); }
.stepper output { font-family: var(--f-display); font-size: 28px; font-weight: 700; min-width: 64px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 95; background: var(--ink); color: var(--surface); padding: var(--sp-12) var(--sp-16); border-radius: var(--r); box-shadow: var(--shadow); max-width: calc(100% - 32px); font-size: 15px; }
.cols-2 { display: grid; gap: var(--sp-section); }
@media (min-width: 900px) { .cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

/* ================= Roastly website additions ================= */
html { scroll-padding-top: var(--sp-16); }
body { min-height: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
a.tab { display: inline-flex; align-items: center; text-decoration: none; }
a.btn { text-decoration: none; }
.calc .btn, .cta-band .btn { white-space: normal; text-align: center; min-height: 48px; padding-block: var(--sp-8); }
a.btn-primary, a.btn-primary:hover { color: var(--accent-ink); }
a.brand { color: var(--ink); text-decoration: none; min-height: 44px; }
.lib-item .sub.src { color: var(--muted); font-size: 13px; margin-top: 2px; }
details.sources { font-size: 14px; color: var(--ink-2); }
details.sources summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
details.sources ul { margin: 0; padding-left: var(--sp-24); display: grid; gap: var(--sp-8); }

/* App page: intro band and static footer */
.intro { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.intro-off #intro { display: none; } /* set before first paint by head.js, then kept in step by the app */
.intro-in { max-width: 1480px; margin: 0 auto; padding-inline: var(--sp-16); padding-block: var(--sp-12); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-8) var(--sp-16); align-items: start; }
.intro h1 { font-size: clamp(26px, 4vw, 34px); }
.intro p { color: var(--ink-2); max-width: 70ch; }
/* "Guides:" and the three guide links as one line of text, " · " between them, wrapping like a sentence where it
   doesn't fit. Each link's tap area is 28 px tall: links inside a line of text meet WCAG 2.5.8 (at least 24 px). */
.intro .intro-links { font-size: 15px; line-height: 28px; color: var(--ink-2); max-width: none; }
.intro .intro-links a { display: inline-block; line-height: 28px; white-space: nowrap; }

/* Shared static header for guide pages */
.site-hdr { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-hdr-in { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 10px; display: flex; gap: 10px 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.site-nav { display: flex; gap: 2px 4px; flex-wrap: wrap; align-items: center; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-family: var(--f-display); font-weight: 600; font-size: 18px; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.site-nav a.btn { color: var(--accent-ink); border-bottom: 0; margin-left: 6px; font-family: var(--f-body); font-size: 16px; font-weight: 700; }

/* Guide pages */
.guide { max-width: 1120px; margin: 0 auto; padding-inline: var(--sp-16); padding-block: var(--sp-32) var(--sp-48); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-section); }
.guide-head { display: grid; gap: var(--sp-12); max-width: 760px; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; gap: var(--sp-8); flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); }
.guide h1 { font-size: clamp(38px, 7vw, 62px); line-height: .98; letter-spacing: -.005em; }
.lede { font-size: 20px; line-height: 1.5; color: var(--ink-2); max-width: 64ch; }
.updated { font-size: 14px; color: var(--muted); }
.prose { max-width: 68ch; display: grid; gap: var(--sp-16); }
.prose h2 { font-size: 32px; margin-top: var(--sp-16); }
.prose h3 { margin-top: var(--sp-8); }
.prose ul, .prose ol { margin: 0; padding-left: var(--sp-24); display: grid; gap: var(--sp-8); }
.prose p, .prose li { line-height: 1.6; }
.wide { max-width: 100%; display: grid; gap: var(--sp-12); min-width: 0; }
.wide h2 { font-size: 32px; }
.cta-band { display: flex; gap: var(--sp-12) var(--sp-16); flex-wrap: wrap; align-items: center; padding: var(--sp-16); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.cta-band p { flex: 1 1 260px; color: var(--ink-2); }
.callout { padding: var(--sp-12) var(--sp-16); border-radius: var(--r); background: var(--warning-bg); border: 1px solid color-mix(in oklab, var(--warning) 35%, transparent); }
.callout b { color: var(--ink); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: 16px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: var(--sp-8) var(--sp-12); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data thead th { font-size: 14px; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
table.data tbody th { font-weight: 700; }
table.data tr:last-child td, table.data tr:last-child th { border-bottom: 0; }
table.data .t { font-variant-numeric: tabular-nums; font-family: var(--f-display); font-weight: 700; font-size: 20px; white-space: nowrap; }
.src-list { font-size: 15px; color: var(--ink-2); display: grid; gap: var(--sp-8); padding-left: var(--sp-24); margin: 0; }

/* Static timetable (run sheet) */
.timetable { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.timetable > li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: var(--sp-4) var(--sp-16); padding: var(--sp-12) var(--sp-16); border-bottom: 1px solid var(--line); }
.timetable > li:last-child { border-bottom: 0; }
.timetable time { font-variant-numeric: tabular-nums; font-family: var(--f-display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.timetable ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); }
.timetable .act { display: flex; gap: var(--sp-8); flex-wrap: wrap; align-items: baseline; }
.timetable .serve-row time, .timetable .serve-row .act { color: var(--heat-ink); }

/* Static Gantt (generated at build time) */
.gantt { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.gantt-in { min-width: 640px; display: grid; grid-template-columns: 150px minmax(0, 1fr); }
.g-axis { position: relative; height: 30px; border-bottom: 1px solid var(--line-strong); }
.g-axis span { font-variant-numeric: tabular-nums; position: absolute; bottom: 6px; transform: translateX(-50%); font-family: var(--f-display); font-weight: 600; font-size: 15px; color: var(--ink-2); }
.g-label { padding: 6px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--f-display); font-weight: 600; font-size: 16px; line-height: 1.1; display: flex; align-items: center; }
.g-track { position: relative; border-bottom: 1px solid var(--line); min-height: 40px;
  background-image: repeating-linear-gradient(90deg, color-mix(in oklab, var(--line) 80%, transparent) 0 1px, transparent 1px var(--g15, 60px)); }
.g-bar { position: absolute; top: 6px; bottom: 6px; border-radius: 4px; border: 1px solid color-mix(in oklab, var(--c) 70%, var(--ink)); background: color-mix(in oklab, var(--c) 46%, var(--surface)); font-size: 12px; font-weight: 700; padding: 0 5px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
.g-bar.un { background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--c) 30%, transparent) 0 2px, transparent 2px 7px), color-mix(in oklab, var(--c) 14%, var(--surface)); }
.g-bar.wait { border-style: dashed; border-color: var(--wait); background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--wait) 28%, transparent) 0 2px, transparent 2px 6px); color: var(--muted); font-weight: 400; }
.g-serve { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--heat); }

@media (max-width: 639px) {
  .gantt-in { min-width: 0; grid-template-columns: 92px minmax(0, 1fr); }
  .g-label { font-size: 13px; padding: 4px 6px; }
  .g-axis span { font-size: 12px; }
  .g-bar { font-size: 0; padding: 0; }
}

/* Turkey calculator */
.calc { display: grid; gap: var(--sp-16); padding: var(--sp-16); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.calc-form { display: flex; flex-wrap: wrap; gap: var(--sp-12) var(--sp-16); align-items: end; }
.calc-form .field { flex: 1 1 140px; min-width: 0; max-width: 240px; }
.calc-form .field .unit-input, .calc-form .field .time-input { width: 100% !important; }
.calc-result { display: grid; gap: var(--sp-12); grid-template-columns: repeat(auto-fit, minmax(min(100%, 136px), 1fr)); }
.calc { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.calc-form .unit-input input { min-width: 0; }
.calc-result > div { padding: var(--sp-12); border-radius: var(--r-sm); background: var(--surface-2); display: grid; gap: 2px; }
.calc-result .k { font-size: 14px; color: var(--ink-2); }
.calc-result .v { font-family: var(--f-display); font-weight: 700; font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.calc-result .v small { font-size: 18px; font-weight: 600; color: var(--ink-2); }

/* Shared footer */
.site-ftr { border-top: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.site-ftr-in { max-width: 1120px; margin: 0 auto; padding-inline: var(--sp-16); padding-block: var(--sp-32) var(--sp-48); display: grid; gap: var(--sp-24); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-ftr h2 { font-size: 22px; color: var(--ink); margin-bottom: var(--sp-8); }
.site-ftr ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.site-ftr ul a { display: inline-flex; min-height: 36px; align-items: center; }
.site-ftr p { font-size: 15px; max-width: 46ch; }
.app-page .site-ftr-in { max-width: 1480px; }
/* Tip links (Ko-fi) sit inside a line of text: each is 28 px tall, meeting WCAG 2.5.8 (at least 24 px) */
.tip-link { display: inline-block; line-height: 28px; }
/* the link and its full stop stay on one line */
.tip-end { white-space: nowrap; }
.tip-line { margin-top: var(--sp-8); }
.app-page #main { min-height: 100vh; }

/* About page: the "Count my visits" switch (a checkbox with role="switch"; the whole row is the tap target) */
.count-ctl { display: grid; gap: var(--sp-4); margin-top: var(--sp-4); }
.switch-row { display: inline-flex; align-items: center; gap: var(--sp-12); min-height: 44px; cursor: pointer; font-weight: 700; justify-self: start; }
input.switch { appearance: none; width: 52px; height: 32px; margin: 0; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; cursor: pointer; transition: background .15s; }
input.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); transition: transform .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(20px); }
input.switch:disabled { opacity: .55; cursor: not-allowed; }
.switch-row:has(input:disabled) { cursor: not-allowed; }
input.switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::after { transition: none; } }

/* Share sheets: the link field and the iPhone and iPad hint */
.share-field { width: 100%; }
.ios-hint { display: grid; gap: var(--sp-8); justify-items: start; padding: var(--sp-12); border: 1px solid var(--line); border-radius: var(--r-sm); }
.ios-hint p, .ios-hint .field { margin: 0; width: 100%; }

/* The printed run sheet (#print-root, drawn by app.js). On screen it is hidden; printed from the planner, from any
   tab, it is the only thing on the page: black on white in either theme, A4 portrait, body text 12 pt, every row with
   its own time, no row split across pages, and the address in the table footer, which repeats on each page. */
#print-root { display: none; }
@media print {
  @page { size: A4 portrait; margin: 15mm 15mm 20mm; }
  html:has(#print-root), html:has(#print-root) body { background: #fff !important; color: #000 !important; color-scheme: light; }
  body:has(> #print-root) > *:not(#print-root) { display: none !important; }
  #print-root { display: block; color: #000; background: #fff; font-family: var(--f-body); font-size: 12pt; line-height: 1.2; print-color-adjust: economy; -webkit-print-color-adjust: economy; }
  #print-root h1 { font-family: var(--f-display); font-weight: 700; font-size: 20pt; line-height: 1.1; margin: 0; color: #000; }
  #print-root .pr-when { margin: 2pt 0 8pt; }
  .pr-table { width: 100%; border-collapse: collapse; }
  .pr-table th, .pr-table td { text-align: left; vertical-align: top; padding: 2pt 4pt; border-bottom: 0.5pt solid #000; color: #000; background: #fff; }
  .pr-table th { font-weight: 700; }
  .pr-table .pr-t { width: 15mm; white-space: nowrap; }
  .pr-table td.pr-t { font-weight: 700; font-size: 13pt; font-variant-numeric: tabular-nums; }
  .pr-table .pr-a { width: 28mm; }
  .pr-table .pr-serve td { font-weight: 700; }
  .pr-table tr { break-inside: avoid; page-break-inside: avoid; }
  .pr-table tfoot td { border-bottom: 0; padding-top: 6pt; }
  .pr-table a { color: #000; text-decoration: none; }
}
