/* World: the colour code of a professional kitchen's cutting boards. White and ink carry the
   page; the board colours are the only saturated ones and each means a family of food.
   Layout: a top bar, one settings strip, then on a desk the plan in two columns
   (timeline and steps; brigade and notes beside them), one column on a phone. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --panel: #f5f3ef;
  --fg: #1b1d1f;
  --muted: #5e6266;
  --line: #e7e4de;
  --accent: #1b1d1f;
  --warn: #b3261e;
  --oven: #ece8e1;
  --on-oven: #1b1d1f;
  /* the boards: fill, ink on it, edge (only the white board needs one on a white page) */
  --b-meat: #d32f2f;    --b-meat-ink: #ffffff;    --b-meat-edge: transparent;
  --b-poultry: #f2c12e; --b-poultry-ink: #1b1d1f; --b-poultry-edge: transparent;
  --b-fish: #1f6fd1;    --b-fish-ink: #ffffff;    --b-fish-edge: transparent;
  --b-veg: #237a3d;     --b-veg-ink: #ffffff;     --b-veg-edge: transparent;
  --b-pastry: #f4f1ea;  --b-pastry-ink: #1b1d1f;  --b-pastry-edge: #9b9790;
  --b-none: #dcd8d0;    --b-none-ink: #1b1d1f;    --b-none-edge: transparent;
  /* one colour per recipe (cards and menu) and per cook */
  --cook-a: #1b1d1f; --cook-b: #1b1d1f; --cook-c: #1b1d1f; --cook-d: #1b1d1f;
  --c-green: #2e7d46;
  --c-red: #b23a2b;
  --c-amber: #8a5a00;
  --c-blue: #2c5f8a;
  --font-display: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --label-w: 96px;
  --gutter: 32px;
  color-scheme: light;
}
/* Dark: the viewer's system choice, unless they picked a theme with the switch in the top bar
   (static/kitchen/js/theme.js sets data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141516; --surface: #1c1d1f; --panel: #242528; --fg: #f1f0ec; --muted: #a6a9ad; --line: #34363a;
    --accent: #f1f0ec; --warn: #ff8a80; --oven: #34322e; --on-oven: #f1f0ec;
    --b-meat: #ef5350; --b-meat-ink: #2a0b09; --b-poultry: #f2c12e; --b-fish: #5c9cf0; --b-fish-ink: #0e1a2c; --b-veg: #43b968; --b-veg-ink: #0b2014;
    --b-pastry: #e9e4da; --b-pastry-edge: transparent; --b-none: #4a4b4f; --b-none-ink: #f1f0ec;
    --cook-a: #f1f0ec; --cook-b: #f1f0ec; --cook-c: #f1f0ec; --cook-d: #f1f0ec;
    --c-green: #6cc488; --c-red: #f0917f; --c-amber: #f0c46a; --c-blue: #8fc1ea;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141516; --surface: #1c1d1f; --panel: #242528; --fg: #f1f0ec; --muted: #a6a9ad; --line: #34363a;
  --accent: #f1f0ec; --warn: #ff8a80; --oven: #34322e; --on-oven: #f1f0ec;
  --b-meat: #ef5350; --b-meat-ink: #2a0b09; --b-poultry: #f2c12e; --b-fish: #5c9cf0; --b-fish-ink: #0e1a2c; --b-veg: #43b968; --b-veg-ink: #0b2014;
  --b-pastry: #e9e4da; --b-pastry-edge: transparent; --b-none: #4a4b4f; --b-none-ink: #f1f0ec;
  --cook-a: #f1f0ec; --cook-b: #f1f0ec; --cook-c: #f1f0ec; --cook-d: #f1f0ec;
  --c-green: #6cc488; --c-red: #f0917f; --c-amber: #f0c46a; --c-blue: #8fc1ea;
  color-scheme: dark;
}

* { box-sizing: border-box; }
.icon { display: inline-block; flex: none; vertical-align: -0.15em; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 28px var(--gutter) 64px; }
/* once the plan is up, the settings strip sits right under the top bar */
.wrap:has(> #picker[hidden]) { padding-top: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; margin: 0; text-wrap: balance; }
p, li { text-wrap: pretty; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.015em; }
h2 { font-size: 1.5rem; margin-bottom: 12px; letter-spacing: -0.01em; }
.step h3 { font-size: 1.2rem; }
a { color: var(--fg); text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::placeholder { color: var(--muted); opacity: 1; }
::selection { background: var(--b-poultry); color: var(--b-poultry-ink); }
/* Read by screen readers, not drawn: a page's title where the top bar already says it. */
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; padding: 10px 14px; border-radius: 10px; background: var(--fg); color: var(--bg); font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Top bar: logo, the two modes as one switch, the account at the far end */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.brand { display: flex; align-items: center; padding: 10px 0; }
.brand img { display: block; height: 26px; width: auto; }
/* the logo is drawn in ink; on a dark page it turns to cream */
:root[data-theme="dark"] .brand img { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: invert(1); } }
.theme-toggle { width: 40px; justify-content: center; padding: 0 !important; }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.topbar nav { flex: 1; display: flex; align-items: center; gap: 12px; }
.modes { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--panel); }
.modes a { display: flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 9px; font-weight: 600; color: var(--muted); text-decoration: none; }
.modes a:hover { color: var(--fg); }
.modes a[aria-current="page"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
.topbar .account { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar .account a, .topbar .account button { display: flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; font-size: .92rem; font-weight: 600; color: var(--fg); text-decoration: none; cursor: pointer; }
.topbar .account a:hover, .topbar .account button:hover { border-color: var(--fg); }
.topbar .account .who { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .9rem; }
.topbar .account form { margin: 0; }

/* Signing in and up */
.auth { max-width: 440px; margin: 24px auto 0; padding: 28px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.auth h1 { font-size: 1.7rem; margin-bottom: 18px; }
.auth p { margin: 0 0 14px; }
.auth .field { display: grid; gap: 6px; margin-bottom: 16px; }
.auth label { font-weight: 600; }
.auth input[type="email"], .auth input[type="password"] { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.auth input[aria-invalid="true"] { border-color: var(--warn); }
.auth .help { font-size: .88rem; color: var(--muted); }
.auth .errorlist, .auth .alert { list-style: none; margin: 0; padding: 0; color: var(--warn); font-size: .92rem; font-weight: 600; }
.auth .alert { margin-bottom: 16px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--surface)); border-radius: 8px; background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.auth .check { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth .check input { width: 20px; height: 20px; accent-color: var(--fg); }
.auth .check label { font-weight: 400; }
.auth button.primary { width: 100%; }
.auth .links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 18px; font-size: .92rem; }
/* The field a person never sees (accounts/honeypot.py). */
.auth-trap { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; }

.gate { max-width: 62ch; margin: 0 0 40px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.gate p { margin: 0 0 12px; }
.gate .links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 600; }
.recipes + h2, section + section > h2 { margin-top: 40px; }

/* Recipes: import form and list */
.import { margin-bottom: 40px; }
.import label { display: block; font-weight: 600; margin-bottom: 6px; }
.import-row { display: flex; flex-wrap: wrap; gap: 10px; }
.import-row input { flex: 1 1 280px; max-width: 620px; min-height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); }
.import-row input:disabled { color: var(--muted); }
.import .hint { max-width: 62ch; margin: 10px 0 0; font-size: .92rem; color: var(--muted); }
.import-status { margin: 12px 0 0; min-height: 1.6em; font-weight: 600; }
.import-status[data-kind="error"] { color: var(--warn); }
.import-status[data-kind="busy"]::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .5em; border: 2px solid var(--line); border-top-color: var(--fg); border-radius: 50%; animation: spin 0.9s linear infinite; vertical-align: -0.05em; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .import-status[data-kind="busy"]::before { animation: none; } }
.recipes { list-style: none; margin: 0; padding: 0; }
.recipes .card { cursor: pointer; }
.recipes .card:hover { border-color: var(--fg); }
.recipes .card:has(.cook-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the title's link covers the card; the source link and « Supprimer » stay above it */
.cook-link { color: inherit; text-decoration: none; }
.cook-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cook-link:focus-visible { outline: none; }
.recipes .card .src, .recipes .card button { position: relative; z-index: 1; }
.recipes .card .txt { grid-template-rows: none; }
button.link.danger { justify-self: start; color: var(--warn); }

/* Recipe picker */
.search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 16px; }
.search label { font-weight: 600; }
.search input { flex: 1 1 260px; max-width: 460px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); font: inherit; }
.card[hidden], .search[hidden], .setup[hidden] { display: none; }
#no-match { margin-top: 0; }
button.link { justify-self: start; padding: 4px 0; border: 0; background: none; color: var(--fg); font: inherit; font-size: .9rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button.link[hidden], #picker[hidden] { display: none; }
.go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 36px; }
.go[hidden] { display: none; }
.go span { color: var(--muted); }
button.primary { min-height: 48px; padding: 0 24px; border: 0; border-radius: 12px; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 1rem; cursor: pointer; }
button.primary:hover { background: color-mix(in srgb, var(--fg) 82%, var(--bg)); }
button.primary:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; }
.card input { position: absolute; opacity: 0; pointer-events: none; }
.card .pic { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.nopic { display: grid !important; place-items: center; background: color-mix(in srgb, var(--rc) 14%, var(--surface)); color: var(--rc); font-family: var(--font-display); font-weight: 800; font-size: 3rem; line-height: 1; }
.card .txt { padding: 14px 16px 16px; display: grid; gap: 6px; align-content: start; }
.card h3 { font-size: 1.05rem; }
.card .by { font-size: .88rem; color: var(--muted); }
.card .facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; }
.card .src { display: inline-block; padding: 0 5px; margin-left: 2px; font-weight: 700; font-style: normal; text-decoration: none; border-radius: 4px; }
.card .src:hover { background: var(--panel); }
.card .tick { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-weight: 700; color: transparent; }
.card:has(input:checked) { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.card:has(input:checked) .tick { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A guest's page (a scanned QR code): the meal as it is, nothing to change it with */
.post-mode #picker, .post-mode .setup, .post-mode #go, .post-mode #tab-brigade, .post-mode #panel-brigade { display: none !important; }
.post-mode .wrap { padding-top: 0; }
.guest-note { font-weight: 600; color: var(--muted); }

/* Settings: one strip under the top bar */
.setup { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 0 calc(var(--gutter) * -1) 0; padding: 12px var(--gutter); border-bottom: 1px solid var(--line); }
#picker:not([hidden]) + .setup { margin-top: 28px; border-top: 1px solid var(--line); }
.field { display: flex; align-items: center; gap: 10px; }
.label { font-size: .92rem; color: var(--muted); font-weight: 500; }
.stepper { display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 12px; }
.stepper button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; font-size: 1.1rem; cursor: pointer; }
.stepper button:hover { background: var(--panel); }
.stepper output { font-weight: 700; min-width: 1.6ch; text-align: center; }
.stepper span { padding-right: 6px; font-weight: 600; }
.setup .menu { flex: 1 1 360px; flex-wrap: wrap; }
.tray { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tray .none { color: var(--muted); }
.thumb { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.thumb .pic { display: block; width: 32px; height: 32px; font-size: .95rem; object-fit: cover; border-radius: 9px; }
.thumb .tick { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--fg); color: var(--bg); font-size: .62rem; font-weight: 700; }
.thumb .tick .icon { width: 12px; height: 12px; }
.thumb .tick .icon + .icon, .thumb:hover .tick .icon:first-child, .thumb:focus-visible .tick .icon:first-child { display: none; }
.thumb:hover .tick .icon + .icon, .thumb:focus-visible .tick .icon + .icon { display: block; }
.thumb:hover { border-color: var(--fg); }
.thumb .name { font-size: .92rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
#edit-menu { padding: 0 14px; min-height: 40px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
#edit-menu:hover { border-color: var(--fg); }

/* Tabs, with the meal's hours at the far end */
.tabbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin: 0 0 24px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 8px; }
.tab { font-weight: 600; font-size: .98rem; padding: 14px 4px 12px; margin: 0 12px -1px 0; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.summary { display: flex; flex-wrap: wrap; gap: 4px 24px; padding-bottom: 10px; }
.summary div { display: flex; align-items: baseline; gap: 8px; }
.summary span { font-size: .92rem; color: var(--muted); }
.summary b { font-size: 1.25rem; font-weight: 800; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 16px; }

/* The brigade tab: one card per person, the notes beside them */
.brigade-panel { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.brigade-panel .posts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
@media (max-width: 900px) { .brigade-panel { grid-template-columns: minmax(0, 1fr); } }
.insights { list-style: none; margin: 0; padding: 16px 18px; display: grid; gap: 12px; background: var(--panel); border-radius: 16px; font-size: .92rem; }
.insights li { display: grid; gap: 2px; }
.insights .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.insights .warn .k, .insights .warn span { color: var(--warn); }

/* Brigade: one card per person in the kitchen */
.brigade h2 { margin-bottom: 2px; }
.brigade .note { margin: 0 0 10px; font-size: .85rem; }
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.post { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.post-text { min-width: 0; }
.post p { margin: 0; }
.post-who { display: flex; align-items: center; gap: 8px; }
.post-who b { font-size: 1.12rem; }
.badge { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: .8rem; font-weight: 800; }
.post:not([data-cook="0"]) .badge { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--fg); }
.post-dishes { font-size: .9rem; color: var(--muted); margin-top: 4px; }
.post-boards { display: flex; align-items: center; gap: 6px; margin-top: 8px !important; font-size: .82rem; color: var(--muted); }
.post-boards span:first-child { margin-right: 2px; }
.post ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: .88rem; color: var(--muted); }
.post-qr { flex: none; display: block; width: 88px; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #fff; }
.post-qr img { display: block; width: 100%; height: auto; }

/* Timeline: bars in the colour of their board */
.g-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; margin-bottom: 12px; }
.g-title { font-size: 1.5rem; margin: 0; }
#zoom-title { margin: 0 0 12px; font-size: .95rem; color: var(--muted); font-weight: 600; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .board { width: 22px; height: 14px; border-radius: 4px; margin: 0; }
.legend .board::before { inset: 3px 8px 3px 3px; border-radius: 2px; }
.legend .board::after { right: 3px; width: 4px; height: 4px; }
.legend i.passive { width: 20px; height: 13px; border-radius: 4px; border: 1.5px dashed var(--muted); }
.gantt-scroll { overflow-x: auto; margin-bottom: 28px; padding: 6px 2px 26px 0; }
.gantt { display: grid; gap: 6px; min-width: var(--min-w); position: relative; }
.g-row { display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); gap: 10px; align-items: center; }
.g-name { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.g-name small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.g-track { position: relative; height: 34px; }
.g-lines { position: absolute; top: 24px; bottom: 0; left: calc(var(--label-w) + 10px); right: 0; pointer-events: none; }
.g-lines i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.seg { position: absolute; top: 0; bottom: 0; left: calc(var(--s) * 100%); width: max(3px, calc(var(--w) * 100% - 3px)); padding: 0 8px; border: 0; border-radius: 8px; background: var(--board, var(--b-none)); color: var(--board-ink, var(--fg)); box-shadow: inset 0 0 0 1.5px var(--board-edge, transparent); font-size: .76rem; font-weight: 600; line-height: 34px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.seg.passive { background: color-mix(in srgb, var(--board, var(--b-none)) 22%, var(--surface)); color: var(--fg); box-shadow: none; border: 1.5px dashed color-mix(in srgb, var(--board, var(--b-none)) 80%, var(--fg)); line-height: 31px; }
.seg.preheat { display: flex; align-items: center; gap: 3px; background: repeating-linear-gradient(-65deg, var(--surface) 0 5px, var(--line) 5px 7px); color: var(--fg); border: 1px dashed var(--muted); cursor: default; }
.seg .icon { width: 12px; height: 12px; }
.seg.narrow { padding: 0; font-size: 0; }
.seg.done { opacity: .35; }
.g-brush { position: absolute; top: 20px; bottom: -4px; left: calc(var(--label-w) + 10px); right: 0; pointer-events: none; }
.overview:not(.zoom-open) .g-brush { display: none; }
.zoom-toggle { margin: -18px 0 8px; }
#zoom-part { margin-bottom: 8px; }
/* the time of the step being followed */
.g-now { position: absolute; top: 22px; bottom: -4px; left: calc(var(--label-w) + 10px + (100% - var(--label-w) - 10px) * var(--s, 0)); width: 2px; margin-left: -1px; background: var(--fg); pointer-events: none; z-index: 2; }
.g-now b { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); padding: 1px 7px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.g-win { position: absolute; top: 0; bottom: 0; box-sizing: border-box; pointer-events: auto; cursor: grab; touch-action: none;
  border: 2px solid var(--fg); border-radius: 10px; background: color-mix(in srgb, var(--fg) 5%, transparent); }
.g-win.dragging { cursor: grabbing; }
.g-win:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.g-win i { position: absolute; top: 0; bottom: 0; width: 14px; cursor: ew-resize; }
.g-win i::after { content: ""; position: absolute; top: 50%; left: 50%; width: 4px; height: 22px; border-radius: 2px; background: var(--fg); transform: translate(-50%, -50%); }
.g-win i[data-h="l"] { left: -8px; }
.g-win i[data-h="r"] { right: -8px; }
.g-cuts { position: absolute; top: 22px; bottom: -2px; left: calc(var(--label-w) + 10px); right: 0; pointer-events: none; }
/* hatching leans 25deg from the vertical; blocks cut by it are bevelled along the same slope */
.g-cut { position: absolute; top: 0; bottom: 0; pointer-events: auto;
  background: repeating-linear-gradient(-65deg, transparent 0 5px, var(--line) 5px 6px); }
.seg.bevel-r, .seg.bevel-l { --bev: calc(34px * 0.4663); border-radius: 8px; }
.seg.bevel-r { width: calc(var(--w) * 100% + var(--bev) / 2); clip-path: polygon(0 0, 100% 0, calc(100% - var(--bev)) 100%, 0 100%); padding-right: var(--bev); }
.seg.bevel-l { margin-left: calc(var(--bev) / -2); width: calc(var(--w) * 100% - 3px + var(--bev) / 2); clip-path: polygon(var(--bev) 0, 100% 0, 100% 100%, 0 100%); padding-left: calc(var(--bev) + 4px); }
/* oven shared by two dishes: two shelves */
.g-track.split { height: 62px; }
.g-track.split .seg { bottom: 32px; line-height: 28px; --bev: calc(30px * 0.4663); }
.g-track.split .seg.low { top: 32px; bottom: 0; }
.g-track.tall { height: 50px; }
.g-track.tall .seg { bottom: 14px; }
.g-track.tall .seg.under { top: 40px; bottom: 0; padding: 0; font-size: 0; line-height: 0; border-radius: 3px; }
.g-axis { position: relative; height: 18px; font-size: .75rem; color: var(--muted); }
.g-axis-row { margin-bottom: 2px; }
.g-axis span { position: absolute; left: calc(var(--s) * 100%); transform: translateX(-50%); white-space: nowrap; }

/* Steps: each row opens with the board to take */
.steps-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 8px 0 12px; }
.steps-head h2 { margin: 0; }
.steps-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 0 auto; font-size: .9rem; color: var(--muted); }
.steps-count b { color: var(--fg); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { min-height: 38px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .92rem; font-weight: 600; }
.filters button:hover { border-color: var(--fg); }
.filters button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
#steps-help { margin: 12px 0 0; }
.agenda { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 64px 48px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 14px 12px; border-bottom: 1px solid var(--line); background: none; cursor: pointer; scroll-margin-block: 96px; transition: opacity .15s; }
.step:hover { background: color-mix(in srgb, var(--panel) 60%, transparent); }
.step:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 12px; }
.when { display: grid; align-content: start; }
.when b { font-size: 1.1rem; font-weight: 700; line-height: 1.25; }
.when span { font-size: .8rem; color: var(--muted); }
.board { position: relative; display: block; width: 46px; height: 30px; margin-top: 1px; border-radius: 9px; background: var(--board); box-shadow: inset 0 0 0 1.5px var(--board-edge); }
/* the hole a board hangs by */
.board::after { content: ""; position: absolute; top: 50%; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1px var(--board-edge); transform: translateY(-50%); }
/* and the groove that keeps the juice on it */
.board::before { content: ""; position: absolute; inset: 4px 18px 4px 4px; border-radius: 5px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--board-ink) 22%, transparent); }
.board.mini { display: inline-block; width: 24px; height: 16px; border-radius: 5px; margin: 0; vertical-align: middle; }
.board.mini::before { inset: 3px 9px 3px 3px; border-radius: 3px; }
.board.mini::after { right: 3px; width: 4px; height: 4px; }
.tag { display: grid; place-items: center; width: 46px; height: 30px; margin-top: 1px; border-radius: 9px; font-size: .78rem; font-weight: 600; text-align: center; line-height: 1.1; border: 1.5px dashed var(--line); color: var(--muted); }
.tag.oven { border: 0; background: var(--oven); color: var(--on-oven); }
.tag.rest { border-color: var(--muted); }
.what { min-width: 0; }
.what .head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 22px; font-size: .78rem; font-weight: 600; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.chip.who { border-color: var(--fg); }
.chip.alone { border-style: dashed; color: var(--muted); }
.chip.rec { border-color: transparent; background: var(--panel); color: var(--muted); }
.chip.oven { border-color: transparent; background: var(--oven); color: var(--on-oven); }
.step p { margin: 4px 0 0; font-size: .95rem; }
.step .ings { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: .86rem; }
.step .ings li { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
.step .ings b { font-weight: 700; }
.until { display: none; }
.act { display: flex; align-items: center; gap: 14px; align-self: center; }
.done-btn { display: none; align-self: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--fg); color: var(--bg); font-weight: 700; cursor: pointer; white-space: nowrap; }
.done-btn:hover { background: color-mix(in srgb, var(--fg) 82%, var(--bg)); }
/* the step being followed: large, ink-framed, with its button */
.step.selected { grid-template-columns: 104px 64px minmax(0, 1fr) auto; margin: 10px 0; padding: 22px 20px; border: 2px solid var(--fg); border-radius: 16px; background: var(--surface); }
.step.selected .when b { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.step.selected h3 { font-size: 1.55rem; }
.step.selected .done-btn { display: inline-flex; align-items: center; }
.step.selected .until { display: block; }
.step.selected .until { font-size: .85rem; color: var(--muted); }
.step.selected .board, .step.selected .tag { width: 62px; height: 40px; border-radius: 11px; }
.step.selected .board::after { width: 9px; height: 9px; right: 9px; }
.step.selected .board::before { inset: 5px 24px 5px 5px; border-radius: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .step.selected { animation: follow .32s cubic-bezier(.16, 1, .3, 1); }
  @keyframes follow { from { background: var(--panel); transform: translateY(6px); } }
}
.step.selected:focus-visible { outline-offset: 3px; }
/* steps above it are done */
/* done: greyed in words, struck through; the colour marks fade, the text stays readable */
.step.done:not(.selected) { color: var(--muted); }
.step.done:not(.selected) h3 { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.step.done:not(.selected) .board, .step.done:not(.selected) .chip { opacity: .45; }
.step.done:not(.selected) .when span { color: inherit; }
.step.done:not(.selected) { padding-block: 8px; align-items: center; }
.step.done:not(.selected):not(.event) p, .step.done:not(.selected) .ings, .step.done:not(.selected) .when span, .step.done:not(.selected) .chip.rec { display: none; }
.step.event.done p { font-weight: 500; text-decoration: line-through; }
.step.done:not(.selected) .board, .step.done:not(.selected) .tag { height: 22px; margin: 0; }
.step.done:not(.selected) .board::before, .step.done:not(.selected) .board::after { content: none; }
.step.done:not(.selected) h3 { font-size: 1rem; font-weight: 600; }
.step.passive h3 { font-weight: 600; }
.step.event { grid-template-columns: 64px minmax(0, 1fr); align-items: center; padding: 10px 12px; background: var(--panel); }
.step.event p { margin: 0; font-weight: 600; }
.note { font-size: .88rem; color: var(--muted); margin-top: 14px; }

/* Glossary terms */
button.g { all: unset; cursor: help; text-decoration: underline dotted var(--accent) 2px; text-underline-offset: 4px; }
button.g:hover, button.g[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 3px; }
button.g:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bubble { position: absolute; z-index: 20; width: min(320px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 34px 12px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font-size: .95rem; line-height: 1.45; }
.bubble strong { display: block; font-family: var(--font-display); margin-bottom: 4px; }
.bubble .close { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.bubble .close:hover { background: var(--panel); color: var(--fg); }

/* Shopping list */
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.list-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.aisle { margin-top: 22px; }
.aisle h3 { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.item input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.item label { cursor: pointer; }
.item .qty { font-weight: 600; font-variant-numeric: tabular-nums; }
.item .detail { color: var(--muted); }
.item.done .name { text-decoration: line-through; color: var(--muted); }
.item .swap { display: block; font-size: .9rem; color: var(--muted); margin-top: 2px; }
.item .for { margin-left: 6px; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: .92rem; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--fg); border-color: var(--fg); color: var(--bg); font-weight: 600; }
.hint { font-size: .88rem; color: var(--muted); }


@media (max-width: 640px) {
  :root { --label-w: 62px; --gutter: 16px; }
  .step { grid-template-columns: 52px 44px minmax(0, 1fr); gap: 10px; padding: 12px 8px; }
  .step .board, .step .tag { width: 44px; height: 28px; }
  .step .tag { font-size: .72rem; }
  .step .board::before { inset: 3px 15px 3px 3px; }
  .step.selected .board, .step.selected .tag { width: 52px; height: 34px; }
  .act { grid-column: 1 / -1; flex-wrap: wrap; }
  .done-btn { grid-column: 1 / -1; justify-self: start; }
  .step.selected { grid-template-columns: 76px 52px minmax(0, 1fr); padding: 16px 12px; }
  .step.selected .when b { font-size: 1.5rem; }
  .g-name small { display: none; }
  .summary b { font-size: 1.1rem; }
  .topbar .account .who { display: none; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
