/* 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 three tabs: the plan (timeline, then steps),
   the brigade (cards beside the notes) and the shopping list. */
:root {
  /* Each token is written once, as light-dark(light, dark); the scheme picks the side.
     Dark is 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>). */
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #141516);
  --surface: light-dark(#ffffff, #1c1d1f);
  --panel: light-dark(#f5f3ef, #242528);
  --sync: light-dark(#dcd8d0, #4a4b4f); /* the points of sync: panel and label alike */
  --fg: light-dark(#1b1d1f, #f1f0ec);
  --muted: light-dark(#5e6266, #a6a9ad);
  --line: light-dark(#e7e4de, #34363a);
  --accent: var(--fg);
  --warn: light-dark(#b3261e, #ff8a80);
  --oven: light-dark(#ece8e1, #34322e);
  --on-oven: var(--fg);
  /* the boards: fill, ink on it, edge (only the white board needs one on a white page) */
  --b-meat: light-dark(#d32f2f, #ef5350);    --b-meat-ink: light-dark(#ffffff, #2a0b09); --b-meat-edge: transparent;
  --b-poultry: #f2c12e;                      --b-poultry-ink: #1b1d1f;                   --b-poultry-edge: transparent;
  --b-fish: light-dark(#1f6fd1, #5c9cf0);    --b-fish-ink: light-dark(#ffffff, #0e1a2c); --b-fish-edge: transparent;
  --b-veg: light-dark(#237a3d, #43b968);     --b-veg-ink: light-dark(#ffffff, #0b2014);  --b-veg-edge: transparent;
  --b-pastry: light-dark(#f4f1ea, #e9e4da);  --b-pastry-ink: #1b1d1f;                    --b-pastry-edge: light-dark(#9b9790, transparent);
  /* the post-it notes stuck on steps: paler than the yellow board, so never read as one */
  --postit: light-dark(#fff4b0, #4a4327); --postit-ink: light-dark(#3a3312, #f5edc6); --postit-edge: light-dark(#e8d982, #625831);
  --b-none: light-dark(#dcd8d0, #4a4b4f);    --b-none-ink: var(--fg);                    --b-none-edge: transparent;
  /* one colour per recipe, for its card and menu thumbnail only */
  --c-green: light-dark(#2e7d46, #6cc488);
  --c-red: light-dark(#b23a2b, #f0917f);
  --c-amber: light-dark(#8a5a00, #f0c46a);
  --c-blue: light-dark(#2c5f8a, #8fc1ea);
  /* the dish marks: the slate's chalk colours, a shade deeper so they hold on a light chip */
  --mk-red: light-dark(#e2725f, #f0917f);
  --mk-blue: light-dark(#5b9bd5, #8fc1ea);
  --mk-amber: light-dark(#e0a72e, #f0c46a);
  --mk-green: light-dark(#4fae6a, #6cc488);
  /* the day's slate: slate, its wooden frame, white chalk */
  --slate: light-dark(#2d3230, #272c2a);
  --slate-deep: light-dark(#232826, #1e2221);
  --slate-lit: light-dark(#373d3a, #313734);
  --wood: light-dark(#b58a5a, #7c5c3c);
  --wood-edge: light-dark(#8f6640, #5a4129);
  --chalk: #f1eee6;
  --chalk-dim: #b9bcb5;
  --chalk-line: rgba(241, 238, 230, .28);
  --font-chalk: "Caveat", "Segoe Print", cursive;
  /* the carte's cover: leather, its gold tooling and stitch, the cream slip of its search */
  --leather: light-dark(#5b2c22, #4a231c);
  --leather-ink: light-dark(#e3c486, #d9bb80);
  --stitch: rgba(232, 200, 150, .55);
  --slip: light-dark(#f6efe2, #e9dfcc);
  --slip-ink: #2a1a12;
  --slip-line: light-dark(#e2d6c0, #cdbfa4);
  --font-display: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --label-w: 96px;
  --gutter: 32px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { 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; }
/* the carte's cover, or once the plan is up the slate, hangs right under the top bar */
.wrap:has(> #picker) { 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: 12px; 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.icon-only { 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; justify-content: center; min-height: 40px; padding: 0 16px; white-space: nowrap; 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 { position: relative; display: flex; align-items: center; gap: 12px; margin-left: auto; }
div.account a, div.account button { display: flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; font-size: .92rem; font-weight: 600; color: var(--fg); text-decoration: none; cursor: pointer; }
div.account a:hover, div.account button:hover { border-color: var(--fg); }
/* the account menu: the initial in an ink disc; open, a panel under it */
.account summary { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; list-style: none; }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover, .account[open] summary { border-color: var(--fg); }
.account summary .initial { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--fg); color: var(--bg); font-weight: 700; font-size: .92rem; }
.account summary .icon { width: 14px; height: 14px; color: var(--muted); }
.account[open] summary .icon { rotate: 180deg; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 25; display: grid; min-width: 240px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.account-menu form { margin: 0; }
.account-menu a, .account-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--fg); font: inherit; font-size: .95rem; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--panel); }
.account-menu .who { flex-direction: column; align-items: flex-start; gap: 0; margin-bottom: 4px; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.account-menu .who span { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .85rem; font-weight: 500; }
.account-menu .who[aria-current] b { text-decoration: underline; text-underline-offset: 3px; }

/* 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"], .auth input[type="number"] { 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 .notice { margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: .92rem; font-weight: 600; }
.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-files { margin-top: 24px; }
.import-row input[type="file"] { padding: 9px 14px; font-size: .92rem; }
.import-row input[type="file"]::file-selector-button { min-height: 32px; margin-right: 12px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; }
.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 .eta { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.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 */
/* The carte: a band of leather across the sheet, as the cover of a restaurant's menu, with
   « À la carte » tooled in gold and the search on a cream slip. The cards under it stay white,
   like its pages. It leaves with the dishes once the plan is up (DESIGN.md, « La carte »). */
.carte {
  --fg: var(--slip-ink); --line: var(--slip-line); --surface: var(--slip); --muted: #6b5847; --accent: var(--leather-ink);
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 36px; margin: 0 calc(var(--gutter) * -1) 28px; padding: 20px calc(var(--gutter) + 6px);
  color: var(--slip);
  background-color: var(--leather);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.32' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeDiffuseLighting lighting-color='%23fff' surfaceScale='1.6'%3E%3CfeDistantLight azimuth='225' elevation='55'/%3E%3C/feDiffuseLighting%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.55'/%3E%3C/svg%3E"),
    radial-gradient(130% 180% at 50% -10%, rgba(255, 200, 160, .18), rgba(0, 0, 0, .25) 75%);
  background-blend-mode: soft-light, normal;
  box-shadow: inset 0 1px 0 rgba(255, 220, 190, .18), inset 0 -2px 6px rgba(0, 0, 0, .35);
}
.carte::after { content: ""; position: absolute; inset: 7px; border: 1.5px dashed var(--stitch); border-radius: 4px; pointer-events: none; }
.carte h2 { margin: 0; color: var(--leather-ink); font-size: .95rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; text-shadow: 0 -1px 0 rgba(0, 0, 0, .5); }
.carte .search { flex: 1 1 420px; margin: 0; }
.carte .search label { color: var(--slip); font-weight: 600; }
.carte .search input { border-color: transparent; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15); }
.carte .search input::placeholder { color: #6b5847; }
.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; }
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; }
/* No photo: one of the site's engravings (the worktop's masks, scripts/worktop.py), chosen by
   the kind of dish (kitchen/recipes.py, art_of) and inked in the recipe's colour. */
.nopic { position: relative; overflow: hidden; background: color-mix(in srgb, var(--rc) 10%, var(--surface)); }
.nopic::before { content: ""; position: absolute; inset: 0; background: var(--rc); opacity: .75; mask: var(--art) center 38% / 115% auto no-repeat; }
.nopic[data-art="planche"] { --art: url("../img/worktop/planche.ff268917e5d0.webp"); }
.nopic[data-art="legumes"] { --art: url("../img/worktop/legumes.8417326f6946.webp"); }
.nopic[data-art="patisserie"] { --art: url("../img/worktop/patisserie.f48cef74530a.webp"); }
.nopic[data-art="brigade"] { --art: url("../img/worktop/brigade.bf604b74f117.webp"); }
.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-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; vertical-align: middle; padding: 0 4px; margin-left: 2px; font-weight: 700; font-style: normal; text-decoration: none; border-radius: 8px; }
.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 .carte, .post-mode #picker, .post-mode .setup, .post-mode #go, .post-mode #tab-brigade, .post-mode #panel-brigade { display: none !important; }
/* Past the day's slate, the top bar becomes it (app.js, hangSlate): a slim slate of the same
   width, without the wooden frame, the logo drawn on it in chalk, then the dishes and the hour. The
   mode switch leaves; the account stays at the far end, in chalk. Same height as the bar. */
.slate-menu { display: none; }
.slate-up .topbar-in { position: relative; padding: 0 calc(var(--gutter) + 24px); }
.slate-up .topbar-in::before {
  content: ""; position: absolute; inset: 4px var(--gutter); z-index: -1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 3px 8px rgba(30, 25, 20, .22);
}
.slate-up .modes { display: none; }
:root body.slate-up .brand img { filter: invert(1) url(#chalk-logo); }
.slate-up .slate-menu {
  --mk-red: #f0917f; --mk-blue: #8fc1ea; --mk-amber: #f0c46a; --mk-green: #6cc488; --accent: var(--chalk);
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 20px; margin-left: 8px; color: var(--chalk); text-decoration: none;
}
.slate-dishes { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 700 1.7rem/1.3 var(--font-chalk); letter-spacing: .01em; }
.slate-dishes .mark { width: 13px; height: 13px; margin-right: 8px; vertical-align: -.02em; filter: url(#chalk); }
.slate-dishes i { margin: 0 12px; font-style: normal; color: var(--chalk-dim); }
.slate-hour { flex: none; white-space: nowrap; color: var(--chalk-dim); font-size: .92rem; font-weight: 500; }
.slate-hour b { margin-left: 4px; color: var(--chalk); font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; vertical-align: -.08em; }
.slate-up .account summary, .slate-up div.account {
  --fg: var(--chalk); --bg: var(--slate); --muted: var(--chalk-dim); --line: var(--chalk-line); --surface: transparent; --accent: var(--chalk);
}
@media (prefers-reduced-motion: no-preference) {
  .slate-up .topbar-in::before, .slate-up .slate-menu { animation: slate-in .22s ease-out; }
  @keyframes slate-in { from { opacity: 0; } }
}
.post-mode .wrap { padding-top: 0; }
.guest-note { font-weight: 600; color: var(--muted); }

/* Settings: the day's slate, hung under the top bar. The dishes are written on it in white
   chalk, each underlined in the chalk of its board, with the hour of the meal large on the
   right and the two counts under it. It is the one object on the sheet that is not white and
   ink (DESIGN.md, « L'ardoise du jour »). Inside it the page tokens are redefined to chalk, so
   the steppers keep their usual shapes. */
.setup {
  --fg: var(--chalk); --muted: var(--chalk-dim); --line: var(--chalk-line); --surface: transparent; --panel: rgba(241, 238, 230, .1); --accent: var(--chalk);
  --mk-red: #f0917f; --mk-blue: #8fc1ea; --mk-amber: #f0c46a; --mk-green: #6cc488;
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; margin: 0 0 8px; padding: 20px 30px 22px; color: var(--chalk);
  border: 10px solid var(--wood); border-radius: 12px; outline: 1px solid var(--wood-edge);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), inset 0 2px 8px rgba(0, 0, 0, .3), 0 6px 16px rgba(60, 40, 20, .2);
}
/* the slate's ground, shared with the top bar once it has become the slate */
.setup, .slate-up .topbar-in::before {
  background-color: var(--slate);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(120% 140% at 30% 0%, var(--slate-lit), var(--slate) 45%, var(--slate-deep));
}
.setup { scroll-margin-top: 72px; }
.setup .defs { position: absolute; }
.setup + #picker { margin-top: 28px; }
/* before the plan, « Générer le plan de travail » sits on the slate under the counts, in chalk */
.setup .go { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 14px; margin: 0; }
.setup .go[hidden] { display: none; }
.setup .go span { color: var(--chalk-dim); font-size: .92rem; }
.setup .go span:empty { display: none; }
.setup button.primary { background: var(--chalk); color: var(--slate); }
.setup button.primary:hover { background: #fff; }
.setup button.primary:disabled { background: transparent; color: var(--chalk-dim); box-shadow: inset 0 0 0 1.5px var(--chalk-line); }
.setup .table-at { margin-bottom: auto; }
.setup h2 { margin: 0 0 6px; font: 700 1.9rem/1 var(--font-chalk); letter-spacing: .01em; color: var(--chalk); }
.setup .tray { list-style: none; margin: 0; padding: 0; display: grid; justify-items: start; gap: 2px; }
.setup .tray li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.setup .tray .none { color: var(--chalk-dim); padding: 4px 0; }
.setup .tray .course h3 { margin: 16px 0 2px; font: 700 1.6rem/1 var(--font-chalk); color: var(--chalk); }
.setup .tray small { font-size: .85rem; font-weight: 500; color: var(--chalk-dim); }
.dish { display: inline-flex; align-items: center; gap: 10px; color: var(--chalk); font: 700 1.6rem/1.2 var(--font-chalk); letter-spacing: .01em; padding: 3px 0; }
.dish .mark { width: 15px; height: 15px; filter: url(#chalk); }
/* a dish's mark: its shape in its colour, before its name */
.mark { flex: none; width: 12px; height: 12px; }
.chip .mark { margin-right: 6px; }
.rub { display: grid; place-items: center; min-width: 44px; min-height: 44px; margin: -12px -10px -12px -14px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--chalk-dim); cursor: pointer; align-self: center; }
.rub .icon { width: 14px; height: 14px; }
.rub:hover { color: var(--chalk); background: rgba(241, 238, 230, .08); }
.chalk-link { display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin: 6px 0 0 -6px; padding: 6px; border: 0; border-radius: 8px; background: none; color: var(--chalk-dim); font: inherit; font-weight: 500; cursor: pointer; }
.chalk-link:hover { color: var(--chalk); }
.setup .menu { display: grid; align-content: start; }
.setup .side { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; gap: 18px; padding-left: 32px; border-left: 1.5px dashed var(--chalk-line); }
.table-at { margin: 0; text-align: right; }
.table-at span { display: block; color: var(--chalk-dim); font-weight: 500; }
.table-at b { display: block; font-size: 3.2rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.setup .counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 20px; }
.setup .label { color: var(--chalk-dim); font-size: 1rem; }
.setup .stepper { border-width: 1.5px; border-radius: 999px; }
.setup .stepper button { border-radius: 50%; }
.setup .stepper output { font-size: 1.1rem; }
.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; background: var(--surface); }
.stepper button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; cursor: pointer; }
.stepper button:hover { background: var(--panel); }
.stepper output { font-weight: 700; min-width: 1.6ch; text-align: center; }

/* 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 { 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: .88rem; }
.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: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.post-text { min-width: 0; }
.post p { margin: 0; }
.post-who { display: flex; flex-wrap: wrap; 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: 10px !important; }
.post-role { font-size: .85rem; color: var(--muted); margin-top: 4px !important; }
.post-boards { display: flex; align-items: center; gap: 6px; margin-top: 14px !important; font-size: .88rem; color: var(--muted); }
.post-boards span:first-child { margin-right: 2px; }
.post ul { list-style: none; margin: 14px 0 0; padding: 0; font-size: .88rem; color: var(--muted); display: grid; gap: 6px; }
.post { transition: border-color .3s, box-shadow .3s; }
/* a phone has opened this post's code: the card takes the ink frame (no board colour, no hue) */
.post.joined { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.post-joined { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--bg); background: var(--fg); }
.post-joined[hidden] { display: none; }
.post-joined::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.post.just-joined { animation: post-joined 1.4s ease-out; }
.post.just-joined .post-joined { animation: pill-in .32s cubic-bezier(.16, 1, .3, 1); }
@keyframes post-joined { 0% { box-shadow: inset 0 0 0 1px var(--fg), 0 0 0 0 color-mix(in srgb, var(--fg) 30%, transparent); } 100% { box-shadow: inset 0 0 0 1px var(--fg), 0 0 0 14px transparent; } }
@keyframes pill-in { from { transform: scale(.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .post.just-joined, .post.just-joined .post-joined { animation: none; } }
.post-qr { flex: none; display: block; width: clamp(112px, 34vw, 148px); 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: .88rem; 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; }
.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: .88rem; font-weight: 600; white-space: nowrap; }
/* a cook's row: a grey figure and the post's name */
.g-cook { display: inline-flex; align-items: center; gap: 5px; white-space: normal; line-height: 1.15; }
.g-cook .icon { flex: none; color: var(--muted); }
.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 { background: color-mix(in srgb, var(--board, var(--b-none)) 28%, var(--surface)); color: var(--fg); }
.seg.passive.done { background: color-mix(in srgb, var(--board, var(--b-none)) 8%, var(--surface)); border-color: color-mix(in srgb, var(--board, var(--b-none)) 35%, var(--surface)); color: var(--muted); }
.seg.preheat.done { border-color: var(--line); color: var(--muted); }
.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: 12px; 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: 24px; 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: -12px; }
.g-win i[data-h="r"] { right: -12px; }
.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); }
/* a meeting point of the brigade: a dashed line across the rows, a diamond on top */
.g-syncs { position: absolute; top: 22px; bottom: -4px; left: calc(var(--label-w) + 10px); right: 0; pointer-events: none; z-index: 1; }
.g-sync { position: absolute; top: 0; bottom: 0; width: 0; margin-left: -1px; border-left: 2px dashed var(--fg); pointer-events: auto; }
/* the merge road sign, in light grey: a diamond panel, the two lanes joining drawn upright inside */
.sync-sign { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 4px; background: var(--sync); color: var(--fg); transform: rotate(45deg); flex: none; }
.sync-sign .icon { width: 15px; height: 15px; transform: rotate(-45deg); stroke-width: 2; }
/* on the same level as the label of the time being followed (.g-now b) */
.g-sync .sync-sign { position: absolute; bottom: -23px; left: -10.5px; }
.legend .sync-sign { margin: 0 3px; }
.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); }
/* the step a meeting point opens: a rule across, where the brigade comes back together */
.step.sync { position: relative; border-top: 2px dashed var(--fg); }
.sync-tag { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 10px; border-radius: 999px; background: var(--sync); color: var(--fg); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.sync-tag .icon { width: 13px; height: 13px; stroke-width: 2; }
.step.selected .sync-tag { top: -2px; }
.chip.oven { border-color: transparent; background: var(--oven); color: var(--on-oven); }
.step p { max-width: 75ch; 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: .88rem; }
.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)); }
.note-btn { display: none; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.note-btn:hover { border-color: var(--fg); }
.step.selected:not(.has-note) .note-btn { display: inline-flex; }
.step.selected .act { flex-direction: column; align-items: stretch; gap: 8px; }
/* Post-it notes: a square of yellow paper, a little askew, stuck under the step */
.note-slot:empty { display: none; }
.postit { display: block; max-width: 44ch; margin: 12px 0 2px; padding: 10px 14px 12px; border: 0; border-radius: 2px 2px 12px 2px; background: var(--postit); color: var(--postit-ink); font: inherit; font-size: .92rem; line-height: 1.4; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 0 var(--postit-edge), 0 6px 12px -8px rgba(0, 0, 0, .45); transform: rotate(-.8deg); cursor: pointer; }
button.postit:hover { transform: none; }
button.postit:focus-visible { outline: 2px solid var(--postit-ink); outline-offset: 2px; }
.postit.editing { max-width: 52ch; white-space: normal; transform: none; cursor: auto; }
.postit.editing:focus-within { outline: 2px solid var(--postit-ink); outline-offset: 2px; }
.postit textarea { display: block; width: 100%; min-height: 4.5em; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; resize: vertical; outline: none; }
.postit textarea::placeholder { color: color-mix(in srgb, var(--postit-ink) 55%, transparent); }
.postit-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.postit-tools .hint { color: color-mix(in srgb, var(--postit-ink) 70%, transparent); font-size: .8rem; }
@media (prefers-reduced-motion: no-preference) {
  button.postit { transition: transform .15s; }
}
/* 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: .88rem; 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); } }
}
/* the followed step's ink frame already shows where the keyboard is: no second ring */
.step.selected:focus-visible { outline: none; }
/* steps above it are done */
/* done: greyed in words, struck through; the colour marks fade, the text stays readable */
/* every step but the one being followed folds to one line: its time, its board, its title */
.step:not(.selected) { padding-block: 8px; align-items: center; }
.step:not(.selected):not(.event) p, .step:not(.selected) .ings, .step:not(.selected) .when span, .step:not(.selected) .meta { display: none; }
.step:not(.selected) .board, .step:not(.selected) .tag { height: 22px; margin: 0; }
.step:not(.selected) .board::before, .step:not(.selected) .board::after { content: none; }
.step:not(.selected) h3 { font-size: 1rem; font-weight: 600; }
.step:not(.selected) .postit { margin-top: 4px; padding: 4px 10px; font-size: .82rem; }
/* folded, a row names its dish in a pill at the far end (when the menu has more than one) */
.row-dish { display: none; }
.step:not(.selected) .row-dish { display: inline-flex; }
.step:not(.selected) .act { align-self: center; }
.step.event .row-dish { justify-self: end; background: var(--surface); }
/* done, it is also muted and struck through */
.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 { opacity: .45; }
.step.done:not(.selected) .sync-tag { color: var(--muted); }
.step.done:not(.selected) .when span { color: inherit; }
.step.passive h3 { font-weight: 600; }
/* a duration in a step's text: its first number starts a countdown (static/kitchen/js/timers.js) */
button.timer { padding: 0 2px; margin: 0 -2px; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: pointer; }
button.timer:hover, button.timer[aria-pressed="true"] { background: var(--panel); text-decoration-style: solid; }
.countdown { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a rung timer blinks five times, then stays in the warning colour until it is pressed */
.countdown.rung { color: var(--warn); animation: rung 1s steps(2, start) 5; }
@keyframes rung { to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .countdown.rung { animation: none; } }
.step.event { grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; padding: 10px 12px; background: var(--panel); }
.step.event p { margin: 0; font-weight: 600; }
/* a followed oven event keeps the followed step's wide time column, so its large time clears the tag */
.step.event.selected { grid-template-columns: 104px minmax(0, 1fr) auto; padding: 22px 20px; }
.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: 12px; 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: .92rem; 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 .act { flex-direction: row; align-items: center; }
  .step.selected { grid-template-columns: 76px 52px minmax(0, 1fr); padding: 16px 12px; }
  .step.selected .when b { font-size: 1.5rem; }
  .step.event.selected { grid-template-columns: 76px minmax(0, 1fr) auto; padding: 16px 12px; }
  /* folded, the dish's pill stays on the row's line */
  .step:not(.selected):not(.event) { grid-template-columns: 52px 44px minmax(0, 1fr) auto; }
  .step:not(.selected) .act { grid-column: auto; }
  .g-name small { display: none; }
  /* narrow label column: the figure above the name */
  .g-cook { flex-direction: column; align-items: flex-start; gap: 1px; font-size: .75rem; }
  .summary b { font-size: 1.1rem; }
  /* top bar on two rows: logo and account, then the two modes across the full width */
  .topbar-in { gap: 8px 12px; padding-bottom: 8px; }
  .topbar nav { display: contents; }
  .topbar .account { gap: 8px; }
  div.account a, div.account button { padding: 0 12px; }
  .modes, .guest-note { order: 1; flex: 1 1 100%; }
  .modes a { flex: 1; }
  /* become the slate, the bar keeps its two rows and its height: logo and account, then the dishes */
  .slate-up .topbar-in { gap: 4px 12px; padding: 8px calc(var(--gutter) + 14px) 16px; }
  .slate-up .slate-menu { order: 1; flex: 1 1 100%; min-height: 36px; margin-left: 0; gap: 12px; }
  .slate-dishes { font-size: 1.45rem; }
  .slate-hour span { display: none; }
  .setup { scroll-margin-top: 124px; }
  /* the slate: the dishes, then under a chalk line the hour and the two counts */
  .setup { grid-template-columns: minmax(0, 1fr); padding: 16px 18px 18px; border-width: 8px; }
  .setup .side { align-items: flex-start; padding: 14px 0 0; border-left: 0; border-top: 1.5px dashed var(--chalk-line); }
  .table-at { text-align: left; }
  .table-at span { display: inline; }
  .table-at b { display: inline; font-size: 2.2rem; margin-left: 6px; }
  .setup .counts, .setup .go { justify-content: flex-start; }
  .dish { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* The worktop: on a screen wide enough to leave margins, the page is a white sheet laid on a
   cream worktop. */
@media (min-width: 1600px) {
  :root { --counter: light-dark(#efe7da, #1d1a16); }
  body { background: var(--counter); }
  .wrap { min-height: calc(100vh - 64px); background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
  /* the slate is wider than the sheet: it hangs 6px over each edge, onto the worktop, and what
     is written on it lines up with the logo; become the slate, the top bar does the same */
  .setup { margin-inline: calc(-1 * var(--gutter) - 6px); padding-inline: 28px; }
  .slate-up .topbar-in { padding: 0 var(--gutter); }
  .slate-up .topbar-in::before { inset-inline: -6px; }
}
