/* Bulk Buy · Shopping List — styles
   Split out of index.html; font urls stay relative to this folder. */

/* ═══════════════════════════════════════════════════════════════════
   SELF-HOSTED FONTS · Fraunces variable + Atkinson Hyperlegible.
   Files in ./fonts/. The unicode-range declarations let the browser
   fetch only the subsets actually used on the page.
   • Fraunces opsz: variable axis covers all weights 100–900 + opsz
   • Atkinson: separate static files per weight
   ø (U+00F8) sits inside the basic 'latin' subset (U+0000–00FF).
═══════════════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/fraunces-latin-opsz-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: 'Fraunces';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/fraunces-latin-opsz-italic.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: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/fraunces-latin-ext-opsz-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/fraunces-latin-ext-opsz-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('./fonts/atkinson-hyperlegible-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: 'Atkinson Hyperlegible';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url('./fonts/atkinson-hyperlegible-latin-400-italic.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: 'Atkinson Hyperlegible';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('./fonts/atkinson-hyperlegible-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: 'Atkinson Hyperlegible';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('./fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url('./fonts/atkinson-hyperlegible-latin-ext-400-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('./fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
:root {
  --bg: #faf6ee;
  --surface: #ffffff;
  --surface-warm: #f5efe0;
  --ink: #1a1612;
  --ink-soft: #3d362c;
  --muted: #837964;
  --line: #e6dcc4;
  --line-strong: #cbbf9f;
  --accent: #b03a2e;
  --accent-soft: rgba(176, 58, 46, 0.08);
  --accent-glow: rgba(176, 58, 46, 0.18);
  --ok: #5a7a3a;
  --warn: #c87f1e;
  --shadow: 0 1px 0 rgba(0,0,0,0.04), 0 4px 18px rgba(60,40,10,0.05);
  --radius: 14px;
  --tap: 56px;
  /* Delete and reset ONLY. A cooler, deeper red than --accent, so the
     primary and the destructive button can't be mistaken mid-service. */
  --danger: #a3143f;
  --danger-soft: rgba(163, 20, 63, 0.09);

  /* ── Tokens (brief 6, stage 1). Values in one place; later stages edit
     these, not selectors. Stage 1 changes nothing on screen except the
     quantity colour and the destructive red. ── */

  /* Spacing: one scale. */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px;

  /* Two families. */
  --font-display: 'Fraunces', Georgia, serif;                 /* brand, section heads, sheet titles */
  --font-ui: 'Atkinson Hyperlegible', system-ui, sans-serif;  /* everything else */

  /* Type roles, at today's values. The brief's targets (brand 28, section
     head 19, item 16/500) are a stage 2 decision: change them here. */
  --type-brand: 28px;   --type-brand-lh: 1.1;
  --type-section: 19px; --type-section-lh: 1.2;
  /* 500: Atkinson Hyperlegible ships 400 and 700 only, so the browser
     draws 500 with the 400 face. The token says what was asked for. */
  --type-item: 16px;   --type-item-lh: 1.35;  --type-item-weight: 500;
  --type-note: 13px;   --type-note-lh: 1.3;
  --type-meta: 11px;   --type-meta-tracking: 0.06em;  --type-meta-weight: 600;

  /* Colour roles. */
  --text: var(--ink);
  --text-muted: var(--muted);
  --surface-2: var(--surface-warm);
  --border: var(--line);

  /* Strands (brief 8 A): which programme an event is. Not accents — kept
     clear of --accent and --danger in hue. Each fill has its own text
     colour, because a pill's text sits on the fill, not on the page:
     one global text colour leaves the yellow one unreadable. */
  --strand-kino: #2f5596;      --strand-kino-fg: #ffffff;
  --strand-kavarna: #e8b931;   --strand-kavarna-fg: #1a1612;
  --strand-soukroma: #2e7d73;  --strand-soukroma-fg: #ffffff;
  --strand-nabidka: #7a4b8f;   --strand-nabidka-fg: #ffffff;   /* brief 15: the daily menu, plum */
  /* All-day bands (addendum 3): a paler fill, and a text colour paired
     to THAT fill — the page's ink on pale yellow was barely readable. */
  --strand-kino-band: #d3def3;      --strand-kino-band-fg: #1c3564;
  --strand-kavarna-band: #f3d36b;   --strand-kavarna-band-fg: #3a2a00;
  --strand-soukroma-band: #c6e6e0;  --strand-soukroma-band-fg: #16443d;
  --strand-nabidka-band: #e6d8ee;   --strand-nabidka-band-fg: #3d2150;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16130e;
    --surface: #1f1c16;
    --surface-warm: #25221b;
    --ink: #f0e9d6;
    --ink-soft: #d4cab2;
    --muted: #968d76;
    --line: #2d2820;
    --line-strong: #3a3429;
    --accent: #d8634f;
    --accent-soft: rgba(216, 99, 79, 0.12);
    --accent-glow: rgba(216, 99, 79, 0.28);
    --ok: #8eaa5e;
    --warn: #d99a44;
    --shadow: 0 1px 0 rgba(0,0,0,0.3), 0 6px 22px rgba(0,0,0,0.35);
    --danger: #ef5b86;
    --danger-soft: rgba(239, 91, 134, 0.14);
    --strand-kino: #8fb0ec;      --strand-kino-fg: #16130e;
    --strand-kavarna: #e8c350;   --strand-kavarna-fg: #16130e;
    --strand-soukroma: #6cc3b6;  --strand-soukroma-fg: #16130e;
    --strand-nabidka: #c9a6dc;   --strand-nabidka-fg: #16130e;
    --strand-kino-band: #34497a;      --strand-kino-band-fg: #e3ecfd;
    --strand-kavarna-band: #6b5314;   --strand-kavarna-band-fg: #fbecbd;
    --strand-soukroma-band: #23564f;  --strand-soukroma-band-fg: #d5f4ef;
    --strand-nabidka-band: #4a2f5c;   --strand-nabidka-band-fg: #f1e3fa;
  }
}
:root[data-theme="dark"] {
  --bg: #16130e;
  --surface: #1f1c16;
  --surface-warm: #25221b;
  --ink: #f0e9d6;
  --ink-soft: #d4cab2;
  --muted: #968d76;
  --line: #2d2820;
  --line-strong: #3a3429;
  --accent: #d8634f;
  --accent-soft: rgba(216, 99, 79, 0.12);
  --accent-glow: rgba(216, 99, 79, 0.28);
  --ok: #8eaa5e;
  --warn: #d99a44;
  --shadow: 0 1px 0 rgba(0,0,0,0.3), 0 6px 22px rgba(0,0,0,0.35);
  --danger: #ef5b86;
  --danger-soft: rgba(239, 91, 134, 0.14);
  --strand-kino: #8fb0ec;      --strand-kino-fg: #16130e;
  --strand-kavarna: #e8c350;   --strand-kavarna-fg: #16130e;
  --strand-soukroma: #6cc3b6;  --strand-soukroma-fg: #16130e;
  --strand-nabidka: #c9a6dc;   --strand-nabidka-fg: #16130e;
  --strand-kino-band: #34497a;    --strand-kino-band-fg: #e3ecfd;
  --strand-kavarna-band: #6b5314;   --strand-kavarna-band-fg: #fbecbd;
  --strand-soukroma-band: #23564f;  --strand-soukroma-band-fg: #d5f4ef;
  --strand-nabidka-band: #4a2f5c;   --strand-nabidka-band-fg: #f1e3fa;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 0%, var(--accent-soft) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, var(--accent-soft) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--s4) 120px;
}

/* Anything scrolled to (a jump, a focused field) stops below the sticky
   header, measured into --header-h by app.js on every resize. */
html { scroll-padding-top: calc(var(--header-h, 0px) + var(--s2)); }

/* ═══════════════ HEADER ═══════════════ */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -16px;
  padding: max(env(safe-area-inset-top), var(--s3)) var(--s4) var(--s3);
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}
.title-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.theme-toggle {
  background: transparent;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  position: relative;
  top: 2px;
}
.theme-toggle:active { transform: scale(0.9); }
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }
.theme-icon {
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
  display: block;
}
.theme-toggle:active .theme-icon { transform: rotate(30deg); }
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--type-brand);
  line-height: var(--type-brand-lh);
  letter-spacing: -0.02em;
  margin: 0;
}
h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 currentColor;
}
.status.connected .dot { background: var(--ok); animation: pulse 2.4s ease-out infinite; }
.status.connecting .dot { background: var(--warn); animation: blink 1s ease-in-out infinite; }
.status.offline .dot { background: var(--muted); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--ok); opacity: 1; }
  70% { box-shadow: 0 0 0 8px transparent; opacity: 0.6; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}
@keyframes blink { 50% { opacity: 0.3; } }

.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--s2);
  font-size: 13px;
  color: var(--muted);
}
.progress-track {
  flex: 1;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 var(--s3);
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(.2,.8,.2,1);
}
.count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ═══════════════ SECTIONS ═══════════════ */
/* --s5 above a section's heading, --s2 below it, then the rows. */
section.section {
  margin: var(--s5) 0 0;
}
.section-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 0 0 var(--s2);
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: var(--type-section);
  line-height: var(--type-section-lh);
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text);
}
.section-emoji {
  font-style: normal;
  margin-right: var(--s1);
  font-size: 0.9em;
  filter: saturate(0.9);
}
.section-count {
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════ ITEMS ═══════════════
   One line with no note, two with one, never three:

     ☐  20 slice  Ham — home cooked           −  +   ⋮
        Croque Monsieur

   The whole row is the tick target; the stepper and ⋮ are data-noclick.
   The stepper is there only when the item has a quantity. Rows are split
   by a hairline, not a gap. */
.item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 56px;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  transition: background-color 0.18s ease;
  touch-action: pan-y;
  overflow: hidden;
  cursor: pointer;
}
.item:last-child { border-bottom: none; }
.item:active { background: var(--surface-2); }
@media (hover: hover) {
  .item:hover { background: var(--surface-2); }
}

.checkbox {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-left: var(--s1);
  border: 2px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  position: relative;
  transition: all 0.18s ease;
}
.checkbox::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 12 l5 5 11-12'/></svg>");
  background-size: 16px;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.2s cubic-bezier(.34,1.56,.64,1);
}
.item.checked .checkbox {
  background: var(--accent);
  border-color: var(--accent);
}
.item.checked .checkbox::after {
  opacity: 1;
  transform: scale(1);
}

.item-body {
  flex: 1;
  min-width: 0;
}
/* Two lines at most, with an ellipsis — one when a note takes line two.
   A long name never pushes the stepper out of the row. */
.item-text {
  font-size: var(--type-item);
  font-weight: var(--type-item-weight);
  color: var(--text);
  line-height: var(--type-item-lh);
  overflow-wrap: anywhere;
  text-decoration: line-through 2px transparent;
  text-underline-offset: 2px;
  transition: color 0.3s ease, text-decoration-color 0.32s ease;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.item.has-note .item-text { -webkit-line-clamp: 1; line-clamp: 1; }
.item.checked .item-text {
  color: var(--text-muted);
  text-decoration-color: currentColor;
}
/* Quantities are emphasised by weight, not colour: the accent is kept for
   things that are actionable. */
.item-text .qty-display {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}
.item.checked .qty-display { color: var(--text-muted); }
.item-text .unit-display {
  color: var(--ink-soft);
  font-weight: 400;
}
.item.checked .unit-display { color: var(--text-muted); }

.item-note {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--type-note);
  line-height: var(--type-note-lh);
  font-style: italic;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qty-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.qty-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--s2);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, transform 0.1s ease;
  padding: 0;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-ui);
}
.qty-btn:active { transform: scale(0.94); background: var(--accent-soft); }

.item-action {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-right: 2px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.item-action:active, .item-action:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Drag states (SortableJS classes) */
.item--ghost { opacity: 0.35; background: var(--accent-soft); }
.item--chosen { background: var(--surface-warm); }
.item--drag {
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  border-radius: var(--radius);
  border-bottom: 1px solid transparent !important;
}

/* Remote update flash */
@keyframes remote-flash {
  0% { background: var(--accent-glow); }
  100% { background: transparent; }
}
.item.remote-update { animation: remote-flash 1.2s ease-out; }

/* ═══════════════ ROOM SWITCHER ═══════════════ */
.room-bar {
  display: flex;
  gap: var(--s2);
  align-items: center;
  margin-top: 14px;
  padding: 10px var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
}

.room-bar { position: relative; }   /* add this property to the existing rule */

.room-dd-toggle {
  flex-shrink: 0; width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.room-dd-toggle:hover, .room-dd-toggle:active { background: var(--accent-soft); color: var(--accent); }
.room-dd-toggle svg { display: block; transition: transform .2s ease; }
.room-dd-toggle.open svg { transform: rotate(180deg); }

.room-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 6px; max-height: 280px; overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.06);
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top;
  transition: opacity .15s ease, transform .15s cubic-bezier(.2,.8,.2,1); pointer-events: none;
}
.room-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.room-menu-item { display: flex; align-items: center; gap: 6px; border-radius: 8px; }
.room-menu-item:hover { background: var(--accent-soft); }
.room-menu-pick {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 10px var(--s3); border: none; background: transparent; cursor: pointer; text-align: left;
  font: inherit; font-family: var(--font-ui); font-size: 15px; color: var(--ink);
  border-radius: 8px;
}
.room-menu-item.current .rm-name { font-weight: 700; color: var(--accent); }
.rm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-meta {
  flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--muted); background: var(--surface-warm);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px;
}
.rm-meta--missing { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.rm-current-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.room-bar-label {
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: var(--type-meta-weight);
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
}
.room-current {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-family: var(--font-ui);
  color: var(--ink);
  padding: var(--s1) 0;
  min-width: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.room-current:hover, .room-current[aria-expanded="true"] { color: var(--accent); }
/* "+ New list…": the only way a list is made (brief 18). */
.room-menu-new {
  width: 100%; display: block; text-align: left;
  padding: 10px var(--s3); border: none; background: transparent; cursor: pointer;
  font: inherit; font-family: var(--font-ui); font-size: 15px; color: var(--accent); font-weight: 600;
  border-radius: 8px;
}
.room-menu-new:hover { background: var(--accent-soft); }
.room-new-form { display: flex; gap: var(--s2); padding: var(--s1) var(--s2) var(--s2); }
.room-new-form input {
  flex: 1; min-width: 0; font: inherit; font-family: var(--font-ui); font-size: 15px;
  padding: var(--s2); border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.room-new-form button { font: inherit; font-family: var(--font-ui); font-weight: 600; }
/* The room on screen is not a list on the server (brief 18). */
.room-missing {
  margin-top: var(--s2); padding: 10px var(--s3);
  background: var(--danger-soft); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: var(--type-meta); color: var(--ink);
}
.room-missing[hidden] { display: none; }
.room-missing-actions { display: flex; gap: var(--s2); margin-top: var(--s2); flex-wrap: wrap; }
#send-room, #send-room-new { width: 100%; }
#send-room-new { margin-top: var(--s2); }
#send-room-new[hidden] { display: none; }
.cloud-status {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.cloud-status.synced { color: var(--ok); }
.cloud-status.error  { color: var(--warn); }
.cloud-status.saving { color: var(--text-muted); }

/* ═══════════════ SWIPE GESTURES ═══════════════ */
.item.swiping {
  transition: none !important;
}
.item.swiping > .checkbox,
.item.swiping > .item-body,
.item.swiping > .qty-controls,
.item.swiping > .item-action {
  transform: translateX(var(--swipe-x, 0px));
  transition: none;
  position: relative;
  z-index: 2;
}
.item.swipe-snapping > .checkbox,
.item.swipe-snapping > .item-body,
.item.swipe-snapping > .qty-controls,
.item.swipe-snapping > .item-action {
  transform: translateX(0);
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
  position: relative;
  z-index: 2;
}
.item.swipe-removing > .checkbox,
.item.swipe-removing > .item-body,
.item.swipe-removing > .qty-controls,
.item.swipe-removing > .item-action {
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
  position: relative;
  z-index: 2;
}
.item.swipe-removing {
  transition: max-height 0.25s ease 0.1s, padding 0.25s ease 0.1s, border 0.25s ease 0.1s, opacity 0.2s ease;
  overflow: hidden;
}
.item .swipe-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.item .swipe-bg--check {
  left: 0;
  right: 0;
  background: var(--ok);
  justify-content: flex-start;
  padding-left: 22px;
}
.item .swipe-bg--delete {
  left: 0;
  right: 0;
  background: var(--accent);
  justify-content: flex-end;
  padding-right: 22px;
}
.item.swiping .swipe-bg--active {
  opacity: 1;
}
.swipe-bg .swipe-icon {
  font-size: 20px;
  transition: transform 0.15s ease;
}
.item.swipe-threshold .swipe-bg .swipe-icon {
  transform: scale(1.3);
}

/* ═══════════════ CONTEXT MENU ═══════════════ */
.ctx-menu {
  position: fixed;
  z-index: 55;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.08);
  padding: 6px 0;
  min-width: 180px;
  opacity: 0;
  transform: scale(0.92);
  transform-origin: top left;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.ctx-menu.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--s3) 18px;
  font: inherit;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease;
}
.ctx-menu-item:hover,
.ctx-menu-item:active {
  background: var(--accent-soft);
}
.ctx-menu-item.danger { color: var(--danger); }
.ctx-menu-item .ctx-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.ctx-menu-sep {
  height: 1px;
  background: var(--line);
  margin: var(--s1) 0;
}

/* ═══════════════ EMPTY STATE ═══════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px var(--s5) 40px;
  gap: var(--s3);
}
.empty-state .empty-icon {
  font-size: 56px;
  filter: saturate(0.6) opacity(0.7);
  margin-bottom: var(--s2);
}
.empty-state h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 24px;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.empty-state p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
  max-width: 260px;
  line-height: 1.5;
}

@media (max-width: 380px) {
  body { font-size: 16px; }
  h1 { font-size: 26px; }
  .section-head h2 { font-size: 20px; }
  .item-text { font-size: 16px; }
}

/* ═══════════════ FAB ═══════════════ */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--s5) + env(safe-area-inset-bottom));
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 6px 22px rgba(176, 58, 46, 0.35), 0 1px 0 rgba(255,255,255,0.15) inset;
  cursor: pointer;
  z-index: 11;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1), background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: var(--s1);
}
.fab:active { transform: scale(0.92); }
@media (hover: hover) {
  .fab:hover { background: #c8453a; }
}

/* ═══════════════ MODAL / SHEET ═══════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 4, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.modal-backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 51;
  background: var(--bg);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: var(--s2) var(--s4) calc(20px + env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
  max-height: 88dvh;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
}
.sheet.show { transform: translateY(0); }
.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--line-strong);
  border-radius: 2px;
  margin: 0 auto 14px;
}
.sheet h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  margin: 6px 0 14px;
  letter-spacing: -0.01em;
}

.field { margin-bottom: 10px; }
.field label {
  display: block;
  font-size: var(--type-meta);
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
  font-weight: var(--type-meta-weight);
  color: var(--muted);
  margin-bottom: var(--s1);
}
.field input[type="text"],
.field textarea,
.field input[type="number"],
.field input[type="date"],
.field input[type="time"],
.field select {
  font: inherit;
  font-family: var(--font-ui);
  font-size: 16px;
  padding: var(--s3) 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 96px; line-height: 1.4; }

.field-row { display: flex; gap: var(--s2); }
.field-row > .field { flex: 1; margin-bottom: 0; }
.field-row > .field.qty-field { flex: 0 0 auto; max-width: 200px; }

.qty-input-group { display: flex; align-items: stretch; }
.qty-input-group input {
  border-radius: 0;
  text-align: center;
  -moz-appearance: textfield;
  flex: 1;
  min-width: 60px;
  padding-left: var(--s1);
  padding-right: var(--s1);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.qty-input-group input::-webkit-outer-spin-button,
.qty-input-group input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.qty-input-group .qty-btn-big {
  width: 44px;
  height: auto;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
}
.qty-input-group .qty-btn-big:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
  border-right: none;
}
.qty-input-group .qty-btn-big:last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  border-left: none;
}
.qty-input-group .qty-btn-big:active { background: var(--accent-soft); }

.sheet-actions {
  display: flex;
  gap: var(--s2);
  margin-top: 18px;
  flex-wrap: wrap;
}
.sheet-actions button {
  flex: 1;
  min-width: 90px;
  min-height: 50px;
  padding: var(--s3) 18px;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.sheet-actions button:active { transform: scale(0.97); }
.sheet-actions .primary { background: var(--accent); color: #fff; }
.sheet-actions .ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
}
.sheet-actions .destructive,
.editor-actions .destructive {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.sheet-actions .destructive:active,
.editor-actions .destructive:active { background: var(--danger); color: #fff; }
/* The editor's buttons keep the browser's 2px border; a 1px danger outline
   is 2px shorter, so a pixel of padding each side keeps its height and
   nothing below it moves. */
.editor-actions .destructive { padding-top: 14px; padding-bottom: 14px; }
/* The event sheet (brief 8 F): one column, in order of how often. */
.event-actions { flex-direction: column; flex-wrap: nowrap; }
.event-actions > button { flex: 0 0 auto; width: 100%; }
.event-actions-pair { display: flex; gap: var(--s2); }
.event-actions-pair > button { flex: 1 1 0; }
.event-actions-pair:not(:has(> button:not([hidden]))) { display: none; }
.sheet-actions .text-only {
  min-height: 44px; padding: var(--s2); background: transparent; border: none;
  color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px;
}
/* After a gap and a line: its own row, at the bottom, in --danger. */
.event-actions .event-delete-row { position: relative; margin-top: var(--s6); }
.event-actions .event-delete-row::before {
  content: ""; position: absolute; left: 0; right: 0; top: calc(-1 * var(--s4) - 1px);
  border-top: 1px solid var(--line);
}
.hidden { display: none !important; }

.sheet-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sheet-section h4 {
  font-family: var(--font-ui);
  font-size: var(--type-meta);
  font-weight: var(--type-meta-weight);
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s2);
}
.removed-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
}
.removed-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--s1);
  border-bottom: 1px solid var(--line);
}
.removed-list li:last-child { border-bottom: none; }
.removed-list .removed-text {
  flex: 1;
  font-size: 15px;
  color: var(--muted);
  text-decoration: line-through 1px var(--muted);
  word-break: break-word;
}
.removed-list .restore {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px var(--s3);
  font: inherit;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}
.removed-list .restore:active { background: var(--surface-warm); }
.removed-empty {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  padding: 6px var(--s1);
  font-family: var(--font-display);
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.item.just-added { animation: slide-in 0.35s ease both; }

/* ═══════════════ AUTOCOMPLETE SUGGESTIONS ═══════════════ */
.field.has-suggestions { position: relative; }
.suggestions {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: none;
}
.suggestions.open { display: block; }
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: background 0.1s ease;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover,
.suggestion-item.active {
  background: var(--accent-soft);
}
.suggestion-item .sg-text { flex: 1; min-width: 0; }
.suggestion-item .sg-text mark {
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}
.suggestion-item .sg-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════════════ ABOUT SHEET + QR ═══════════════ */
.about-toggle { color: var(--muted); }
.about-toggle svg { display: block; }
.about-block { margin-bottom: 14px; }

/* The QR card keeps its own colours in every theme. Phone cameras are
   unreliable on inverted codes, so dark mode must not reach in here. */
.qr-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}
.qr-card svg { display: block; width: 100%; height: auto; max-width: 340px; }
.about-hint {
  margin: var(--s2) 2px 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.about-meta {
  margin-top: 14px;
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Pairing: a six-character code, big enough to read across a counter. */
.pair-actions { display: flex; gap: var(--s2); }
.pair-btn {
  flex: 1;
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.pair-btn:disabled { opacity: 0.55; cursor: default; }
.pair-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.pair-enter { margin-top: 10px; }
.pair-show {
  margin-top: 10px;
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.pair-show.is-chef { border-color: var(--accent); }
.pair-level {
  margin: 0;
  text-align: center;
  font-size: var(--type-meta);
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
  font-weight: var(--type-meta-weight);
  color: var(--muted);
}
.pair-show.is-chef .pair-level { color: var(--accent); }
.pair-code {
  margin: var(--s1) 0 10px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: pre;
}
.pair-countdown {
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.field input.pair-input {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
}
.field input.pair-input::placeholder { color: var(--line-strong); letter-spacing: 0.2em; }
.pair-msg.error { color: var(--accent); }
.link-btn {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

/* Paired devices: one row per phone, revoke on the right. */
.device-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.device-list:empty { display: none; }
.device-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px var(--s3); border-bottom: 1px solid var(--line);
}
.device-row:last-child { border-bottom: none; }
.device-main { flex: 1; min-width: 0; }
.device-name { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.device-self {
  margin-left: 6px; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700; color: var(--ok);
}
.device-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.device-revoke {
  flex: 0 0 auto; padding: 7px 11px; border-radius: 9px;
  border: 1px solid var(--danger); background: transparent; color: var(--danger);
  font-family: var(--font-ui); font-size: 13px; font-weight: 700; cursor: pointer;
}
.device-revoke:active { background: var(--danger); color: #fff; }

/* ═══════════════ FILTER BOX — one look everywhere ═══════════════ */
.filter-box {
  position: sticky;
  top: var(--header-h, 0px);
  z-index: 6;
  display: flex; align-items: center; gap: var(--s2);
  margin: 0 0 10px;
  padding: 0 6px 0 var(--s3);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px -8px rgba(0,0,0,0.25);
}
.filter-box:focus-within { border-color: var(--accent); }
/* In a sheet it pins to the sheet's own top, not under the page header. */
.sheet .filter-box { top: 0; }
.filter-icon { color: var(--muted); font-size: 17px; line-height: 1; flex-shrink: 0; }
.filter-input {
  flex: 1; min-width: 0;
  border: none; background: transparent; outline: none;
  padding: 11px 0;
  font-family: var(--font-ui);
  font-size: 16px;                       /* 16px or iOS zooms the page on focus */
  color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.filter-input::-webkit-search-cancel-button,
.filter-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.filter-input::placeholder { color: var(--muted); }
.filter-count {
  flex-shrink: 0; font-size: 12.5px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.filter-count:empty { display: none; }
.filter-clear {
  flex-shrink: 0; width: 34px; height: 34px; padding: 0;
  border: none; border-radius: 50%;
  background: var(--surface-warm); color: var(--ink-soft);
  font-size: 13px; cursor: pointer;
}
.filter-clear:active { background: var(--accent-soft); color: var(--accent); }
/* Rows and headings the filter leaves out. Separate from "Hide checked",
   which sets display on the row itself, so the two combine. */
.filter-miss { display: none !important; }

/* Fullscreen: the reliable way to scan one screen off another. */
.qr-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #ffffff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
  cursor: zoom-out;
}
.qr-fullscreen.show { display: flex; }
.qr-fullscreen-inner { width: min(96vw, 88vh, 560px); }
.qr-fullscreen-inner svg { display: block; width: 100%; height: auto; }
.qr-fullscreen-inner .pair-code { color: #111111; font-size: 48px; margin: 18px 0 0; }
.qr-fullscreen-hint {
  margin: 0;
  font-size: 13px;
  color: #6b6b6b;
  font-family: var(--font-ui);
}

/* ═══════════════ MENUS ═══════════════ */
/* Several rules below set `display`, which would otherwise win against
   the browser's own [hidden] rule and leave hidden things on screen. */
[hidden] { display: none !important; }

.view-tabs {
  display: flex;
  gap: var(--s1);
  margin-top: var(--s3);
  padding: 3px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.view-tab {
  flex: 1;
  padding: 7px 10px;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.view-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Menus replace the list entirely; the list's chrome goes with it. */
body.view-menus .subhead,
body.view-menus .room-bar,
body.view-menus .room-missing,
body.view-menus #list,
body.view-menus #list-filter,
body.view-menus .fab,
body.view-calendar .subhead,
body.view-calendar .room-bar,
body.view-calendar .room-missing,
body.view-calendar #list,
body.view-calendar #list-filter,
body.view-calendar .fab { display: none; }
body:not(.view-menus) #menus-view { display: none; }
body:not(.view-calendar) #calendar-view { display: none; }
#menus-view { padding-bottom: 40px; }

.menus-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
}
.menus-head h2 {
  flex: 1; min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-back, .menu-primary {
  flex-shrink: 0;
  padding: 7px var(--s3);
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-family: var(--font-ui);
  font-size: 13px; font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.menu-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.menu-primary[disabled] { opacity: .45; cursor: default; }
.menus-status { margin: 0 0 10px; font-size: 13px; color: var(--muted); }

.menu-row {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  margin-bottom: var(--s2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.menu-row:active { background: var(--surface-warm); }
.menu-row-main { flex: 1; min-width: 0; }
.menu-row-name {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-row-meta { margin-top: 3px; font-size: 12px; color: var(--muted); }
.menu-row-dup, .menu-row-print {
  flex-shrink: 0; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); background: transparent; border-radius: 9px;
  color: var(--muted); font-size: 15px; cursor: pointer;
}
.menus-empty { padding: 26px var(--s4); text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ── editor ── */
/* Level 1 — the outline: courses, and one line per dish. */
.course {
  margin: 14px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.course-head {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s2) 10px;
  background: var(--surface-warm);
  border-bottom: 1px solid var(--line);
}
.course-grip, .dish-grip { flex-shrink: 0; color: var(--line-strong); cursor: grab; font-size: 15px; padding: 0 2px; touch-action: none; }
.course-name {
  flex: 1; min-width: 0;
  border: none; border-bottom: 1px solid transparent; background: transparent;
  font-family: var(--font-ui); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  padding: var(--s1) 2px;
}
.course-name::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
.course-name:focus { outline: none; border-bottom-color: var(--accent); color: var(--ink); }
.course-del {
  flex-shrink: 0; width: 28px; height: 28px; padding: 0;
  border: none; background: transparent; color: var(--muted);
  font-size: 15px; cursor: pointer; border-radius: 7px;
}
.course-del:active { background: var(--danger-soft); color: var(--danger); }
.course-dishes { min-height: 4px; }
.dish-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px var(--s3);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.dish-row:active { background: var(--surface-warm); }
.dish-row-main { flex: 1; min-width: 0; }
.dish-row-title {
  font-family: var(--font-display); font-size: 16.5px; font-weight: 500;
  color: var(--ink); line-height: 1.3;
}
.dish-row-title.is-empty { color: var(--muted); font-style: italic; }
.dish-row-preps { margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.dish-row-portions {
  flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
/* Brief 15: the card's fields, quiet in the kitchen's view. */
.dish-row-price { flex-shrink: 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.course-card {
  display: block; width: 100%; box-sizing: border-box;
  border: none; border-bottom: 1px dashed var(--line); background: transparent;
  font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-soft);
  padding: 6px var(--s3);
}
.service-date-field .field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: var(--s1); }
#dish-price.invalid { border-color: var(--accent); }
#dish-description, #dish-description-en { width: 100%; box-sizing: border-box; font: inherit; }
.dish-row-go { flex-shrink: 0; color: var(--line-strong); font-size: 20px; line-height: 1; }
.course-add-dish, .course-copy-from {
  display: block; width: 100%; padding: 10px var(--s3);
  border: none; background: transparent; text-align: left;
  font-family: var(--font-ui); font-size: 13px; font-weight: 700;
  color: var(--muted); cursor: pointer;
}
.prep-list-btn {
  display: block; width: 100%; margin-top: 10px; padding: var(--s3) 14px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); text-align: left;
  font-family: var(--font-ui); font-size: 14px; font-weight: 700; cursor: pointer;
}

/* Level 2 — a dish: a tick-list of preps. */
.ed-heading {
  margin: 18px 2px 2px; color: var(--muted);
  font-size: var(--type-meta);
  font-weight: var(--type-meta-weight);
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
}
.ed-hint { margin: 2px 2px var(--s2); font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.prep-ticks {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.prep-ticks:empty { display: none; }
/* Brief 15 addendum: a category heading among the preps (copy sheet, dish picker). */
.prep-cat-head {
  margin: 0; padding: var(--s2) var(--s3) var(--s1);
  font-size: var(--type-meta); letter-spacing: var(--type-meta-tracking); font-weight: var(--type-meta-weight);
  text-transform: uppercase; color: var(--muted); list-style: none;
}
.prep-ticks .prep-cat-head { background: var(--surface-warm); border-bottom: 1px solid var(--line); }
#copy-pick-preps .prep-cat-head { padding-left: 0; margin-top: var(--s3); }
.prep-tick { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.prep-tick:last-child { border-bottom: none; }
.prep-tick-main {
  flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: var(--s3);
  padding: var(--s3); cursor: pointer;
}
.prep-tick-main input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.prep-tick-text { display: flex; flex-direction: column; min-width: 0; }
.prep-tick-name { font-weight: 700; color: var(--ink); font-size: 15px; }
.prep-tick:not(.is-on) .prep-tick-main .prep-tick-name { color: var(--ink-soft); font-weight: 400; }
.prep-tick-sub { margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.prep-open {
  flex-shrink: 0; width: 48px; border: none; border-left: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 22px; cursor: pointer;
}
.prep-open:active { background: var(--surface-warm); }
.prep-row { align-items: center; gap: 10px; padding: var(--s3); cursor: pointer; }
.prep-row .prep-tick-text { flex: 1; }
.prep-empty { padding: 14px var(--s3); color: var(--muted); font-size: 13.5px; }

/* Level 3 — a prep: one row per ingredient. */
.prep-used { margin: -4px 2px var(--s3); font-size: 13px; color: var(--ink-soft); }
.prep-used.is-unused { color: var(--warn); }
.line-head, .line-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 70px 36px;
  gap: 5px; align-items: center;
}
.line-head {
  padding: 0 var(--s2) var(--s1); color: var(--muted);
  font-size: var(--type-meta);
  font-weight: var(--type-meta-weight);
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
}
.line-head span { white-space: nowrap; }
/* Brief 22: in a dated menu, beside the amounts as written, what this menu
   needs — the number weighed. Not in the repertoire: nothing is cooked
   from a library. */
.line-head-menu, .line-menu { display: none; }
#level-prep.has-scaled .line-head, #level-prep.has-scaled .line-row { grid-template-columns: minmax(0, 1fr) 48px 52px 72px 36px; }
#level-prep.has-scaled .line-head-menu { display: block; white-space: normal; text-align: right; line-height: 1.2; color: var(--accent); }
#level-prep.has-scaled .line-menu {
  display: block; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14.5px;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.line-head span:nth-child(2) { text-align: right; padding-right: var(--s1); }
/* The section column is its emoji; its header would not fit, and the
   emoji says what it is. */
#prep-lines {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
#prep-lines:empty { display: none; }
.line { padding: 6px var(--s2); border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: none; }
.line.open { background: var(--surface-warm); }
.line-row input, .line-section-wrap {
  min-width: 0; box-sizing: border-box;
  border: 1px solid transparent; background: transparent; border-radius: 7px;
  padding: 6px var(--s1);
  font-family: var(--font-ui); font-size: 14.5px; color: var(--ink);
}
.line-row input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
/* A disabled field swallows the tap, so on a read-only phone the row
   would never open to show its note. Let taps fall through to the row. */
.line-row input:disabled, .line-row select:disabled { pointer-events: none; }
.line.open .line-row input:not(:disabled) { border-color: var(--line); background: var(--bg); }
.line-qty { text-align: right; font-variant-numeric: tabular-nums; }
.line-qty::-webkit-outer-spin-button, .line-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.line-qty { -moz-appearance: textfield; }
.line-section-wrap { position: relative; display: flex; align-items: center; justify-content: center; height: 32px; padding: 0; }
.line-section-face { font-size: 17px; pointer-events: none; }
.line-section {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 16px;
}
.scales-toggle {
  display: inline-flex; align-items: center; gap: 7px; margin-top: var(--s2);
  font-size: 13px; color: var(--ink-soft); cursor: pointer; user-select: none;
}
.scales-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
/* In a fixed prep nothing scales, so the exception has nothing to except. */
#level-prep.basis-fixed .scales-toggle { display: none; }

/* How a prep's quantities are written: one of three, said in words. */
.basis-choice {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden;
}
.basis-choice button {
  padding: 10px var(--s1); border: none; border-left: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-soft);
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.basis-choice button:first-child { border-left: none; }
.basis-choice button.on { background: var(--accent); color: #fff; }
.basis-choice button:disabled { cursor: default; }
.basis-choice button:disabled:not(.on) { opacity: 0.6; }
.serves-line { margin-top: 10px; }
.serves-line input[type="number"] { width: 90px; }
.basis-says { margin: var(--s2) 2px 0; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.basis-says.is-warning { color: var(--warn); font-weight: 700; }
.rescale-offer {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: var(--s2); padding: 9px 11px;
  background: var(--accent-soft); border-radius: 10px;
  font-size: 13px; color: var(--ink-soft);
}
.rescale-offer span { flex: 1; min-width: 160px; }
.rescale-btn {
  padding: 7px var(--s3); border-radius: 8px; border: 1px solid var(--accent);
  background: var(--surface); color: var(--accent);
  font-family: var(--font-ui); font-size: 13px; font-weight: 700; cursor: pointer;
}
.line-more { display: none; padding: 6px 0 var(--s1); }
.line.open .line-more { display: block; }
.line-note {
  display: block; width: 100%; box-sizing: border-box;
  border: 1px solid var(--line); background: var(--bg); border-radius: 8px;
  padding: 7px var(--s2);
  font-family: var(--font-ui); font-size: 14px; color: var(--ink);
}
.line-note:focus { outline: none; border-color: var(--accent); }
.line-note:disabled:placeholder-shown { display: none; }
.line-scale { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.line-scale:empty { display: none; }
.line-del {
  margin-top: var(--s2); padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.line-del:active { background: var(--danger-soft); color: var(--danger); }

/* Save follows the user: pinned to the bottom, only when there is
   something to save. */
.save-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; gap: var(--s3);
  padding: 10px var(--s4) calc(10px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line-strong);
  box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
}
.save-bar[hidden] { display: none; }
#save-count { flex: 1; font-size: 14px; font-weight: 700; color: var(--ink); }
.save-bar .menu-primary { padding: 10px 22px; font-size: 15px; }
body.has-save-bar #menus-view { padding-bottom: 90px; }

.field-row > .field.covers-field { margin-bottom: 10px; }
.covers-line { display: flex; align-items: center; gap: var(--s2); }
.covers-line input[type="number"] { width: 90px; flex: 0 0 auto; }
.covers-line span { color: var(--muted); }
.menu-add-line, .menu-add-dish {
  display: block; width: 100%;
  margin-top: var(--s2); padding: 9px;
  border: 1px dashed var(--line-strong);
  background: transparent; border-radius: 10px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 700;
  color: var(--muted); cursor: pointer;
}
.menu-add-dish { margin-top: 14px; }
.editor-actions { display: flex; flex-direction: column; gap: var(--s2); margin-top: 20px; }
.editor-actions button { padding: 13px; border-radius: 12px; font-family: var(--font-ui); font-size: 15px; font-weight: 700; cursor: pointer; }
.menu-meta { margin: var(--s3) 2px 0; font-size: 11.5px; color: var(--muted); }
.menu-readonly {
  margin: 0 0 var(--s3); padding: 10px var(--s3);
  background: var(--surface-warm); border: 1px solid var(--line);
  border-radius: 10px; font-size: 13px; color: var(--muted);
}

/* ── conflict ── */
.conflict {
  margin-bottom: 14px; padding: var(--s3) 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius);
}
.conflict p { margin: 0 0 var(--s1); font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; }
.conflict-who { font-weight: 700; color: var(--accent); }
.conflict-note { color: var(--muted) !important; }
.conflict-actions { display: flex; gap: var(--s2); margin-top: 10px; }
.conflict-actions button { flex: 1; padding: 9px; border-radius: 9px; font-family: var(--font-ui); font-size: 13px; font-weight: 700; cursor: pointer; }

/* ── someone else saved, heard live: quiet, one line ── */
.menu-stale { margin: 0 0 var(--s3); font-size: 13px; color: var(--muted); }
/* Wherever the cook is in the menu — a prep scrolled to its last step — the
   line stays in view, just under the sticky header. */
.menu-stale:not([hidden]) {
  position: sticky; top: var(--header-h, 0px); z-index: 9;
  padding: var(--s2) var(--s3); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink);
}
.menu-stale-reload {
  background: none; border: none; padding: 0;
  color: var(--accent); font: inherit; font-weight: 700;
  text-decoration: underline; cursor: pointer;
}

/* ── send sheet ── */
.send-warning {
  margin-bottom: var(--s3); padding: 11px 13px;
  background: var(--accent-soft); border: 1px solid var(--accent-glow);
  border-radius: 10px; font-size: 13px; line-height: 1.45; color: var(--ink-soft);
}
.send-preview {
  list-style: none; padding: 0; margin: var(--s2) 0 0;
  max-height: 210px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px;
}
.send-preview li {
  display: flex; gap: var(--s2); align-items: baseline;
  padding: 7px 10px; font-size: 14px; color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.send-preview li:last-child { border-bottom: none; }
.send-preview .sp-qty { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.send-preview .sp-sec { margin-left: auto; font-size: 11px; color: var(--muted); }
.chef-key-btn { width: 100%; padding: 11px; border-radius: 10px; font-size: 14px; }

/* ═══════════════ CALENDAR ═══════════════ */
#calendar-view { padding-bottom: 40px; }
.cal-pull {
  margin: 0; height: 0; overflow: hidden;
  text-align: center; font-size: 12.5px; color: var(--muted);
  transition: height .15s ease;
}
.cal-pull.pulling { height: 26px; }

/* The grid is a jump target, collapsed by default. Nobody reads titles
   out of it: a day with events gets a dot, and a tap scrolls the list. */
.cal-jump {
  margin: 0 0 var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
}
.cal-jump summary {
  padding: 11px var(--s1);
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  cursor: pointer;
}
.cal-month-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 0 6px;
  font-weight: 700; color: var(--ink);
}
.cal-nav {
  width: 36px; height: 32px;
  border: 1px solid var(--line); border-radius: 9px;
  background: transparent; color: var(--ink); font-size: 18px; cursor: pointer;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  padding-bottom: 10px;
}
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: var(--s1) 0; }
.cal-day {
  position: relative;
  height: 38px;
  border: none; border-radius: 9px;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.cal-day:active { background: var(--surface-warm); }
.cal-day.today { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 700; }
.cal-day.has-events::after {
  content: ""; position: absolute; left: 50%; bottom: 5px;
  width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: var(--accent);
}

/* Land a jumped-to day just below the header, whose real height app.js
   measures into --header-h, not under it. */
.agenda-day { margin: 0 0 14px; scroll-margin-top: calc(var(--header-h, 0px) + var(--s3)); }
/* Not uppercased: Czech dates are lowercase ("pátek 2. října"), and the
   locale's own formatting is what goes on screen. */
.agenda-day-head {
  margin: 0 2px 6px;
  font-size: 13.5px; font-weight: 700;
  color: var(--muted);
}
.agenda-day.is-today .agenda-day-head { color: var(--accent); }
.agenda-day.flash { animation: cal-flash 1.2s ease; }
@keyframes cal-flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.event-row {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) 14px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.event-row:active { background: var(--surface-warm); }
.event-time {
  flex: 0 0 auto; min-width: 48px;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink);
}
.event-time.all-day { font-size: 12px; color: var(--muted); padding-top: 1px; }
.event-main { flex: 1; min-width: 0; }
.event-title { font-size: 15.5px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.event-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
/* A filled dot and a word, never an icon alone. */
.event-customers {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 5px;
  padding: 2px var(--s2) 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px; font-weight: 700;
}
.event-customers::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
/* On, but nothing to show: a hollow dot, and the words say why. */
.event-customers.not-shown { background: transparent; border: 1px dashed var(--warn); color: var(--warn); }
.event-customers.not-shown::before { background: transparent; border: 1.5px solid var(--warn); width: 5px; height: 5px; }
#cal-earlier { margin-top: 6px; }
#agenda-earlier { margin-top: var(--s3); opacity: .8; }

.event-more {
  margin: var(--s1) 0 var(--s3);
  border-top: 1px solid var(--line);
  padding-top: var(--s2);
}
.event-more summary {
  padding: 6px 0 10px;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  cursor: pointer;
}
.event-share {
  padding: var(--s3) 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.event-share-toggle {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; color: var(--ink);
  cursor: pointer;
}
.event-share-toggle input { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 auto; }
.event-share .about-hint { margin: 6px 0 0; }
.event-share .field { margin: var(--s3) 0 0; }
/* The native date and time pickers draw their own icons; tell them the
   theme, or they stay black on the dark background. */
.field input[type="date"], .field input[type="time"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .field input[type="date"],
  :root:not([data-theme="light"]) .field input[type="time"] { color-scheme: dark; }
}
:root[data-theme="dark"] .field input[type="date"],
:root[data-theme="dark"] .field input[type="time"] { color-scheme: dark; }

/* ── customer links (chefs) ── */
.link-list { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.link-row {
  display: flex; align-items: center; gap: var(--s2);
  padding: 11px var(--s3); margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.link-main { flex: 1; min-width: 0; }
.link-label { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.link-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.link-copy, .link-revoke {
  flex: 0 0 auto; padding: 7px 10px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: transparent;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.link-revoke { color: var(--danger); border-color: var(--danger); }
.links-empty { padding: 14px var(--s1); color: var(--muted); font-size: 14px; }
.link-new { margin-top: 14px; }
.link-new-row { display: flex; gap: var(--s2); }
.link-new-row input { flex: 1; min-width: 0; }
.link-new-row .menu-primary { padding: 0 14px; }
#calendar-view .menus-head .menu-back { padding: 7px 10px; }
.event-detail-label { margin-top: var(--s3); }
.what-missing { color: var(--warn); font-weight: 700; }
.links-unshown { margin-top: 10px; padding: var(--s2) var(--s3); border: 1px dashed var(--warn); border-radius: var(--radius); }
.links-unshown .about-hint { margin: 0 0 var(--s1); color: var(--warn); font-weight: 700; }
.links-unshown ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink); }
.links-unshown li { padding: 3px 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); }

/* ── language toggle (About, next to the version) ── */
.about-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lang-toggle select {
  font: inherit; font-size: 13px; padding: 5px var(--s2);
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--ink);
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── calendar views ── */
.cal-views {
  display: inline-flex; gap: 3px; padding: 3px; margin: 0 0 10px;
  background: var(--surface-warm); border: 1px solid var(--line); border-radius: 999px;
}
.cal-view {
  padding: 6px 14px; border: none; border-radius: 999px; background: transparent;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.cal-view.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
/* ── the month grid (brief 8 C, and the addendum) ── */
/* The Calendar in Month breaks out of the app's column — the one view
   that earns the width. Never narrower than the column (a phone keeps
   its own), never wider than 1600px or the window less a gutter. */
#calendar-view.is-wide {
  --wide: max(100%, min(1600px, 100vw - 48px));
  width: var(--wide);
  margin-left: calc((100% - var(--wide)) / 2);
}
/* The header stays in the column, but while the calendar is wider its
   background spans the window, so a scrolled grid goes under it, not past it. */
body.view-calendar.cal-wide header {
  background: var(--bg);
  box-shadow: 0 0 0 100vmax var(--bg);
  clip-path: inset(0 -100vmax);
}
.cal-month-nav {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  margin: 0 0 10px;
}
/* In Month, one row: the month's name, the views, the programme filter,
   then ‹ Today › and full screen at the end. It wraps rather than
   overflow when the window is narrow. */
#calendar-view.is-wide .cal-bar {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s4); row-gap: var(--s2);
  margin: 0 0 10px;
}
#calendar-view.is-wide .cal-bar > * { margin: 0; }
#calendar-view.is-wide .cal-month-nav { display: contents; }
#calendar-view.is-wide .cal-month-title { order: -1; margin-right: var(--s2); }
#calendar-view.is-wide .cal-month-btns { margin-left: auto; }
#calendar-view.is-wide { padding-bottom: 0; }
/* The list's room for the add button is not needed under a calendar that fits the window. */
body.view-calendar.cal-wide .app { padding-bottom: 0; }
/* Full screen: only the calendar renders, so it brings its own page. */
#calendar-view:fullscreen {
  width: 100%; margin: 0; padding: var(--s4) var(--s5);
  background: var(--bg); color: var(--ink); overflow-y: auto;
}
#calendar-view::backdrop { background: var(--bg); }
.cal-month-title {
  margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--ink);
}
.cal-month-title::first-letter { text-transform: uppercase; }
.cal-month-btns { display: flex; align-items: center; gap: 6px; }
.cal-month-today {
  padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer;
}
/* Addendum 2: the month fits the window. Its height is the viewport less
   the chrome above it (--cal-chrome, measured by app.js), with a floor
   of 6 × 96px; dvh, so a phone's browser bars don't push it off. Six
   rows, always, sharing that height equally: nothing reflows between
   months, and a column can be read down. */
#month-view {
  height: calc(100dvh - var(--cal-chrome, 260px));
  min-height: 576px;
}
.month-grid {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
}
.mg-dow {
  padding: var(--s2) 10px; font-size: var(--type-meta); letter-spacing: var(--type-meta-tracking);
  font-weight: var(--type-meta-weight); text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--surface-warm);
}
.mg-cell {
  position: relative; min-width: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--s1) 6px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.mg-cell:nth-child(7n + 7) { border-right: none; }
.mg-cell.is-out { background: var(--surface-warm); }
.mg-cell.is-out > :not(.mg-add) { opacity: 0.45; }
.mg-num {
  align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px;
  border: none; border-radius: 999px; background: transparent;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; cursor: pointer; line-height: 26px; text-align: center;
}
/* Today: the accent, as the agenda and week mark it. */
.mg-cell.is-today .mg-num { background: var(--accent); color: var(--surface); }
.mg-ev, .mg-band {
  display: block; width: 100%; min-width: 0; margin: 0;
  padding: 2px 6px; border: none; border-radius: 6px;
  font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.35; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.mg-ev { background: var(--strand); color: var(--strand-fg); }
.mg-time { font-weight: 700; font-variant-numeric: tabular-nums; }
/* All day: a tint across the whole cell, not a pill. */
.mg-band {
  width: auto; margin: 0 -6px; border-radius: 0;
  background: var(--strand-band); color: var(--strand-band-fg);
  border-left: 3px solid var(--strand);
}
.mg-more {
  align-self: flex-start; padding: 0 6px; border: none; background: none;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer;
}
/* Pointer devices only: out of the flow, so it never takes room. */
.mg-add {
  position: absolute; top: var(--s1); right: var(--s1);
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: var(--accent); color: var(--surface); font: inherit; font-size: 17px; font-weight: 700; line-height: 1;
  cursor: pointer; display: none;
}
@media (hover: hover) {
  .mg-cell:hover .mg-add, .mg-add:focus-visible { display: block; }
  .mg-cell:hover { background: var(--accent-soft); }
}
#day-sheet-list { margin: var(--s2) 0; }

/* ── the week, full size (brief 8 D) ── */
/* The stacked week is still drawn underneath — for print and the phone —
   and only hidden from the screen here. */
@media screen { #calendar-view.week-wide #agenda { display: none; } }
#calendar-view.week-wide .cal-week-nav { margin-left: auto; gap: var(--s2); }
#calendar-view.week-wide .cal-week-range { flex: 0 0 auto; min-width: 16ch; }
#calendar-view.week-wide .cal-this-week { margin: 0; }
/* The time grid (addendum 4): the days across, the hours down. Addendum 5:
   a fixed-height column — the window less what sits above it — with ONE
   scroller, the hours. overflow: hidden on the column is what makes it
   one scrollbar rather than the page's and the grid's both. */
#calendar-view.week-wide #week-view {
  height: calc(100dvh - var(--cal-chrome, 260px)); min-height: 360px;
  display: flex; flex-direction: column; overflow: hidden;
}
.tg {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
/* Days and the all-day band never scroll. They reserve the scrollbar's
   width as the hours do, so every column lines up with its heading. */
.tg-days, .tg-allday-row {
  flex: none; display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr));
  overflow-y: hidden; scrollbar-gutter: stable;
}
.tg-time { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior: contain; }
.tg-corner { background: var(--surface-warm); border-bottom: 1px solid var(--line); }
.wk-head {
  display: flex; align-items: baseline; gap: 6px; padding: var(--s2) 10px;
  border: none; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface-warm);
  font: inherit; color: var(--muted); cursor: pointer; text-align: left; min-width: 0;
}
.wk-dow { font-size: var(--type-meta); letter-spacing: var(--type-meta-tracking); font-weight: var(--type-meta-weight); text-transform: uppercase; }
.wk-num { font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
/* Today: the accent, as everywhere else. */
.wk-head.is-today { box-shadow: inset 0 -3px 0 var(--accent); }
.wk-head.is-today .wk-num, .wk-head.is-today .wk-dow { color: var(--accent); }
/* All day: its own region above the hours, bands spanning their days. */
.tg-allday-row .tg-allday-label {
  padding: 6px var(--s1); font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: right; line-height: 1.2;
  border-bottom: 2px solid var(--line-strong);
}
.tg-allday {
  grid-column: 2 / -1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-flow: row dense;
  gap: 3px 0; padding: 3px 0; min-height: 30px; border-bottom: 2px solid var(--line-strong);
}
.wk-band {
  display: block; min-width: 0; margin: 0 3px; padding: 3px var(--s2);
  border: none; border-left: 3px solid var(--strand); border-radius: 0;
  background: var(--strand-band); color: var(--strand-band-fg);
  font: inherit; font-size: 12.5px; font-weight: 700; text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tg-body { position: relative; display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); }
/* The hour gutter scrolls with the hours and survives a sideways scroll. */
.tg-hours { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.tg-hour {
  position: absolute; right: 6px; transform: translateY(-50%);
  font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums;
}
.tg-hour:first-child { transform: none; }
.tg-hour:last-child { transform: translateY(-100%); }
/* A line every hour, drawn by the column itself. */
.wk-col {
  position: relative; min-width: 0; cursor: pointer; border-left: 1px solid var(--line);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% var(--hour-pct);
}
.wk-col.is-today { background-color: var(--accent-soft); }
.wk-ev {
  position: absolute; box-sizing: border-box; overflow: hidden;
  display: flex; flex-direction: column; gap: 1px; margin: 0;
  padding: 3px 6px; border: 1px solid var(--surface); border-radius: 6px;
  background: var(--strand); color: var(--strand-fg);
  font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
/* No end time: it starts here, its length is a guess — so no solid edge. */
.wk-ev.open-end {
  border-bottom: 2px dashed var(--strand-fg); border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, rgba(0,0,0,.55));
          mask-image: linear-gradient(to bottom, #000 70%, rgba(0,0,0,.55));
}
/* Clamped to the day shown: a marker says there is more. */
.wk-ev.before-start::before, .wk-ev.continues::after {
  position: absolute; right: 4px; font-size: 10px; font-weight: 700; opacity: .9;
}
.wk-ev.before-start::before { content: "▲"; top: 2px; }
.wk-ev.continues::after { content: "▼"; bottom: 2px; }
.wk-ev.before-start { border-top: 2px dashed var(--strand-fg); border-top-left-radius: 0; border-top-right-radius: 0; }
.wk-ev.continues { border-bottom: 2px dashed var(--strand-fg); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wk-time { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: 0.85; }
.wk-what { font-size: 13px; font-weight: 700; line-height: 1.25; }
.wk-where { font-size: 12px; opacity: 0.85; }
/* Now: across today's column, above the blocks. */
.tg-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--accent); z-index: 2; pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.wk-col .mg-add { top: 6px; }
@media (hover: hover) {
  .wk-col:hover .mg-add { display: block; }
  .wk-col:hover { background: var(--accent-soft); }
}

/* ── strands (brief 8 A) ── */
/* One class per strand sets --strand and --strand-fg; everything after
   reads those two, so a fill always gets the text colour made for it. */
.strand-kino     { --strand: var(--strand-kino);     --strand-fg: var(--strand-kino-fg);
                   --strand-band: var(--strand-kino-band);     --strand-band-fg: var(--strand-kino-band-fg); }
.strand-kavarna  { --strand: var(--strand-kavarna);  --strand-fg: var(--strand-kavarna-fg);
                   --strand-band: var(--strand-kavarna-band);  --strand-band-fg: var(--strand-kavarna-band-fg); }
.strand-soukroma { --strand: var(--strand-soukroma); --strand-fg: var(--strand-soukroma-fg);
                   --strand-band: var(--strand-soukroma-band); --strand-band-fg: var(--strand-soukroma-band-fg); }
.strand-nabidka  { --strand: var(--strand-nabidka);  --strand-fg: var(--strand-nabidka-fg);
                   --strand-band: var(--strand-nabidka-band);  --strand-band-fg: var(--strand-nabidka-band-fg); }
.strand-filter {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px;
}
.strand-chip {
  padding: 5px var(--s3); border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent; font: inherit; font-size: 13px; font-weight: 700;
  color: var(--muted); cursor: pointer;
}
.strand-chip.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.strand-chip[data-strand="kino"]     { --strand: var(--strand-kino); }
.strand-chip[data-strand="kavarna"]  { --strand: var(--strand-kavarna); }
.strand-chip[data-strand="soukroma"] { --strand: var(--strand-soukroma); }
.strand-chip[data-strand="nabidka"]  { --strand: var(--strand-nabidka); }
.strand-chip:not([data-strand=""])::before {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px;
  border-radius: 50%; vertical-align: 0; background: var(--strand);
}
.event-row[data-strand] { border-left: 5px solid var(--strand); }
.strand-tag {
  display: inline-block; margin-top: var(--s1); padding: 1px 7px;
  border-radius: 999px; background: var(--strand); color: var(--strand-fg);
  font-size: var(--type-meta); font-weight: 700; letter-spacing: 0.02em;
}
.strand-pick { border: none; padding: 0; margin: 0 0 var(--s3); display: flex; flex-wrap: wrap; gap: 6px; }
/* The legend reads as every other field's label; the options are not labels in that sense. */
.strand-pick legend {
  padding: 0; margin-bottom: var(--s1); width: 100%;
  font-size: var(--type-meta); letter-spacing: var(--type-meta-tracking); text-transform: uppercase;
  font-weight: var(--type-meta-weight); color: var(--muted);
}
.field .strand-opt {
  text-transform: none; letter-spacing: normal; margin: 0;
  display: inline-flex; align-items: center; gap: 6px; position: relative;
  padding: 6px var(--s3); border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.strand-opt input { position: absolute; opacity: 0; pointer-events: none; }
.strand-opt::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--strand); }
.strand-opt[data-strand="kino"]     { --strand: var(--strand-kino); --strand-fg: var(--strand-kino-fg); }
.strand-opt[data-strand="kavarna"]  { --strand: var(--strand-kavarna); --strand-fg: var(--strand-kavarna-fg); }
.strand-opt[data-strand="soukroma"] { --strand: var(--strand-soukroma); --strand-fg: var(--strand-soukroma-fg); }
.strand-opt[data-strand="nabidka"]  { --strand: var(--strand-nabidka); --strand-fg: var(--strand-nabidka-fg); }
.field .strand-opt:has(input:checked) { background: var(--strand); border-color: var(--strand); color: var(--strand-fg); }
.strand-opt:has(input:checked)::before { background: var(--strand-fg); }
.strand-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.link-strand-row {
  display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2);
  font-size: 14px; color: var(--muted);
}
.link-strand-row select { flex: 1; }
.cal-week-nav {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  margin: 0 0 10px;
}
.cal-week-range { flex: 1; text-align: center; font-weight: 700; color: var(--ink); font-size: 15px; }
.cal-this-week {
  display: block; margin: -4px auto var(--s3); padding: 5px var(--s3);
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent;
  font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.agenda-day.is-empty { margin-bottom: 6px; }
.agenda-day.is-empty .agenda-day-head { margin-bottom: 0; font-weight: 400; font-size: 13px; opacity: .8; }

/* Today, marked in every view: a bar down its side and its heading in the
   accent colour, so it is found at a glance, not by reading. */
.agenda-day.is-today { position: relative; padding-left: var(--s3); }
.agenda-day.is-today::before {
  content: ""; position: absolute; left: 0; top: 1px; bottom: 6px;
  width: 4px; border-radius: 2px; background: var(--accent);
}
.agenda-day.is-today .agenda-day-head { color: var(--accent); }

/* ── chrome (brief 6, stage 3) ── */
/* Hide checked: a view toggle beside the filter, pressed when on. */
.filter-toggle {
  flex-shrink: 0; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  font: inherit; font-family: var(--font-ui); font-size: 12.5px; font-weight: 700;
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
}
.filter-toggle.active { background: var(--text); border-color: var(--text); color: var(--bg); }
/* Reset lives in the room menu, as the room's own action, in the danger red. */
.room-menu-reset {
  display: block; width: 100%; margin-top: var(--s1); padding: 10px var(--s3);
  border: none; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px;
  background: transparent; text-align: left; cursor: pointer;
  font: inherit; font-family: var(--font-ui); font-size: 14px; font-weight: 700; color: var(--danger);
}
.room-menu-reset:hover { background: var(--danger-soft); }
/* Brief 10: the deletes, under Untick but set apart from it. */
.room-menu-reset:has(+ .room-menu-sep) { border-radius: 0; }
.room-menu-sep { height: 0; margin: var(--s2) var(--s3) 0; border-top: 2px solid var(--border); }
.room-menu-delete { margin-top: 0; border-top: none; border-radius: 0; }
.room-menu-delete:last-child { border-radius: 0 0 8px 8px; }

/* Storage full: the one loud case. */
#storage-alarm {
  position: sticky; top: 0; z-index: 60; padding: var(--s3) var(--s4);
  background: var(--danger); color: #fff; font-weight: 700; font-size: 14px; line-height: 1.35;
}

/* ── attached menu, duplicate (brief 7 B, C) ── */
.event-menu-row { margin-top: var(--s2); }
.field select#event-menu { width: 100%; }
.event-warn { color: var(--warn); font-weight: 700; }
.event-open-menu { display: inline-block; margin: 0 0 var(--s2); }
.event-fill { margin-top: var(--s2); }

/* ── notes (brief 7 E) ── */
.notes-pill {
  display: inline-block; margin-left: var(--s2); padding: 0 var(--s2); border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; cursor: pointer;
  font: inherit; font-family: var(--font-ui); font-style: normal; font-size: 12px; font-weight: 700; color: var(--text-muted);
}
.item-note .notes-pill:first-child { margin-left: 0; }
.event-main .notes-pill { margin: var(--s1) 0 0; }
.notes-list { list-style: none; margin: 0 0 var(--s3); padding: 0; max-height: 50dvh; overflow-y: auto; }
.note { position: relative; padding: var(--s2) 36px var(--s2) 0; border-bottom: 1px solid var(--border); }
.note-text { white-space: pre-line; overflow-wrap: anywhere; color: var(--text); }
.note-meta { margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.note-del { position: absolute; right: 0; top: var(--s2); width: 28px; height: 28px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 50%; }
.notes-empty { padding: var(--s3) 0; color: var(--text-muted); }
.notes-add { display: flex; gap: var(--s2); align-items: flex-end; }
.notes-add textarea { flex: 1; min-height: 44px; }

/* ═══════════════ PRINT (brief 7 F) ═══════════════
   The paper-only parts never show on screen. */
@media screen {
  #print-header:not(.pm-measure), #print-preps, #print-month:not(.pm-measure) { display: none !important; }
  /* The month sheet is measured before it prints, to fit it on one page
     (brief 12): laid out off screen at the paper's width for a moment. */
  #print-header.pm-measure, #print-month.pm-measure {
    display: block; position: absolute; left: -10000px; top: 0; width: 277mm; visibility: hidden;
  }
}
/* The header's type, here rather than under print, so the measurement
   above sees the sizes the paper gets. */
#print-header { margin: 0 0 var(--s3); padding-bottom: 6px; border-bottom: 2px solid #000; }
.ph-kind { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.ph-name { font-size: 15px; font-weight: 700; }
.ph-meta { font-size: 11px; color: #444; }

/* ── the month on paper (brief 12) ──────────────────────────────────
   A4 landscape, read at two metres, often on a cheap or mono printer:
   - a print palette, not the screen's: a light tint of the strand, black
     text, a 4px bar down the left in the strand's colour;
   - colour is never the only signal: a letter on every event (K, C, S)
     and a different bar per strand (solid, dashed, double);
   - a key under the heading, the footer line and the date printed.
   Browsers drop background colours when printing unless
   print-color-adjust says otherwise — silently, as a blank calendar.
   The customer page (kalender/) has the same sheet; keep them in step.
   No rule here is under @media print: #print-month only shows on paper,
   or for the moment it is measured. */
:root {
  --p-kino-tint: #e3eaf7;      --p-kino-bar: #2f5596;
  --p-kavarna-tint: #fbf0cc;   --p-kavarna-bar: #c8920c;
  --p-soukroma-tint: #d9eeea;  --p-soukroma-bar: #2e7d73;
  --p-nabidka-tint: #efe4f3;   --p-nabidka-bar: #7a4b8f;
}
#print-month .strand-kino     { --p-tint: var(--p-kino-tint);     --p-bar: 4px solid var(--p-kino-bar); }
#print-month .strand-kavarna  { --p-tint: var(--p-kavarna-tint);  --p-bar: 4px dotted var(--p-kavarna-bar); }
#print-month .strand-soukroma { --p-tint: var(--p-soukroma-tint); --p-bar: 4px double var(--p-soukroma-bar); }
#print-month .strand-nabidka  { --p-tint: var(--p-nabidka-tint);  --p-bar: 4px dashed var(--p-nabidka-bar); }
#print-month { --pf: 1; --grid-h: 130mm; color: #000; }
#print-month .pm-key { display: flex; flex-wrap: wrap; gap: 2mm 7mm; margin: 0 0 2.5mm; font-size: calc(13px * var(--pf)); font-weight: 700; }
#print-month .pm-key-item { display: inline-flex; align-items: center; gap: 2mm; }
#print-month .pm-sw { display: inline-block; min-width: 7mm; padding: .5mm 1.5mm; background: var(--p-tint); border-left: var(--p-bar); }
#print-month .month-grid {
  height: var(--grid-h); overflow: visible; border: 1px solid #000; border-radius: 0; background: #fff;
  grid-template-rows: auto repeat(6, minmax(min-content, 1fr));
}
#print-month .mg-dow { padding: 1mm 1.5mm; font-size: calc(11px * var(--pf)); background: #fff; color: #000; border-bottom: 1px solid #000; }
#print-month .mg-cell { overflow: visible; padding: .8mm 1.2mm; gap: .6mm; background: #fff; border-color: #000; cursor: default; }
#print-month .mg-cell.is-out > * { opacity: .45; }
#print-month .mg-cell.is-today .mg-num { background: none; color: #000; }
#print-month .mg-num { height: auto; min-width: 0; padding: 0; font-size: calc(14px * var(--pf)); line-height: 1.2; color: #000; }
#print-month .mg-ev, #print-month .mg-band {
  white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
  background: var(--p-tint); color: #000; border-left: var(--p-bar); border-radius: 0;
  padding: .3mm 1.2mm; font-size: calc(11px * var(--pf)); font-weight: 600; line-height: 1.25;
}
#print-month .mg-ev { width: 100%; }
/* All day: a band across the whole cell, as on screen. */
#print-month .mg-band { margin: 0 -1.2mm; }
#print-month .mg-mk { font-weight: 800; margin-right: 1mm; }
#print-month .mg-ev, #print-month .mg-band, #print-month .pm-sw { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#print-month .pm-foot { display: flex; justify-content: space-between; gap: 6mm; margin: 2mm 0 0; font-size: calc(12px * var(--pf)); }
@media print {
  /* The app may be dark; paper is white. The dark-mode variables are
     overridden here, not trusted — a dark print is a solid black A4. */
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --surface-warm: #fff; --surface-2: #fff;
    --ink: #000; --ink-soft: #000; --text: #000; --muted: #444; --text-muted: #444;
    --line: #999; --line-strong: #555; --border: #999;
    --accent: #000; --accent-soft: transparent; --accent-glow: transparent;
    --danger: #000; --danger-soft: transparent; --ok: #000; --warn: #000;
    --shadow: none;
    color-scheme: light;
  }
  html, body { background: #fff !important; color: #000 !important; }
  *, *::before, *::after {
    box-shadow: none !important; text-shadow: none !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    animation: none !important; transition: none !important;
  }
  /* Nav, tabs, FAB, filter, status chips and every button: not on paper. */
  header, .view-tabs, .filter-box, .fab, .cloud-status, button, .sheet, .modal-backdrop,
  .toast, .ctx-menu, .save-bar, #storage-alarm, .menus-head, .menus-status, .cal-views, .strand-filter,
  .cal-week-nav, .cal-this-week, .cal-jump, .cal-pull, #cal-earlier, #agenda-earlier,
  .swipe-bg, .notes-pill, .menu-readonly { display: none !important; }
  .app { max-width: none; margin: 0; padding: 0; }

  /* A sheet prints only itself: the other sheets' paper-only parts stay
     hidden unless their body class says otherwise. */
  /* The week prints as it is on screen: the stacked days from a phone,
     the time grid from a wide screen — portrait, one page (addendum 4). */
  #calendar-view:not(.week-wide) #week-view { display: none !important; }
  #calendar-view.week-wide #agenda { display: none !important; }
  #calendar-view.week-wide #week-view { display: block !important; }
  /* The grid's days and events are buttons on screen; on paper they are the content. */
  #week-view .wk-head, #week-view .wk-ev { display: flex !important; }
  #week-view .wk-band { display: block !important; }
  .tg { border-color: #000; border-radius: 0; }
  /* An overflow:auto box prints clipped — one screen of hours and no
     error. On paper the column and the scroller let everything through. */
  #calendar-view.week-wide #week-view { height: auto !important; min-height: 0; overflow: visible !important; }
  .tg, .tg-time { overflow: visible !important; height: auto !important; flex: none; }
  .tg-days, .tg-allday-row, .tg-time { scrollbar-gutter: auto; }
  .tg-body { height: 205mm !important; }
  .wk-col { background-color: transparent !important; border-color: #999; }
  .wk-ev { background: #fff !important; color: #000 !important; border: 1px solid #000; border-left: 3px solid var(--strand); }
  .wk-ev.open-end, .wk-ev.continues, .wk-ev.before-start { border-style: solid dashed dashed solid; -webkit-mask-image: none; mask-image: none; }
  .wk-what { font-size: 9.5px; } .wk-time, .wk-where { font-size: 8.5px; }
  .tg-now, .mg-add { display: none !important; }
  #print-preps, #print-month { display: none; }
  #print-header { display: block !important; }

  /* Every card and section keeps together where it can. */
  section.section, .item, .agenda-day, .event-row, .pp-prep, .mg-cell, .menu-row { break-inside: avoid; }
  .section-head, .agenda-day-head, .pp-prep h3 { break-after: avoid; }

  /* The shopping list: empty boxes for a pen; quantities right-aligned. */
  section.section { margin-top: 10px; }
  .item { min-height: 0; padding: var(--s1) 0; gap: var(--s2); align-items: baseline; }
  .item .checkbox { width: 14px; height: 14px; border: 1.5px solid #000 !important; background: #fff !important; border-radius: 2px; }
  .item .checkbox::after { display: none !important; }
  .item-text {
    display: flex; align-items: baseline; gap: 6px;
    -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; font-size: 13px;
  }
  .item-text .qty-display { order: 2; margin-left: auto; min-width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; }
  .item-text .unit-display { order: 3; min-width: 4.5em; }
  .item-note { white-space: normal; font-size: 11px; }

  /* The prep sheet. */
  body.print-preps #menus-view > :not(#print-preps) { display: none !important; }
  body.print-preps #print-preps { display: block !important; }
  .pp-prep { margin: 0 0 14px; }
  .pp-prep h3 { margin: 0; font-family: var(--font-display); font-size: 16px; }
  .pp-sub { font-size: 11px; color: #444; margin-bottom: var(--s1); }
  .pp-prep ul { list-style: none; margin: 0; padding: 0; }
  .pp-prep li { display: grid; grid-template-columns: 14px 7em 1fr; gap: var(--s2); align-items: baseline; padding: 2px 0; border-bottom: 1px solid #ccc; font-size: 13px; }
  .pp-prep li::before { content: ""; width: 12px; height: 12px; border: 1.5px solid #000; border-radius: 2px; }
  .pp-qty { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
  .pp-notes { font-size: 11px; color: #444; }

  /* The month, landscape: a real grid with the events written in. */
  body.print-month #calendar-view > :not(#print-month) { display: none !important; }
  body.print-month #print-month { display: block !important; }
  /* Nothing after the sheet: padding under the last line still asks for
     a second page. */
  body.print-month #calendar-view, body.print-month .app { padding-bottom: 0 !important; margin-bottom: 0 !important; min-height: 0 !important; }
  #calendar-view.is-wide { width: auto; margin-left: 0; }
  /* The sheet itself is above, outside this block (brief 12). */

  /* The week, portrait: one day per block, as on screen. */
  .agenda-day.is-today::before { background: #000 !important; }
  .event-row { border: 1px solid #999; padding: 6px var(--s2); }
}

/* ── copying dishes between menus (brief 9) ── */
.course-add-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.course-add-row > * { flex: 1 1 auto; }
.menu-template {
  display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s3);
  font-size: 14px; color: var(--ink-soft); cursor: pointer;
}
.menu-template input { width: 18px; height: 18px; accent-color: var(--accent); }
.copy-empty {
  margin: 0 0 var(--s3); padding: var(--s3) var(--s4);
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
.copy-empty p { margin: 0 0 var(--s2); color: var(--ink-soft); }
.copy-menus { list-style: none; margin: var(--s2) 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.copy-menu {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  font: inherit; text-align: left; cursor: pointer; color: var(--ink);
}
.copy-menu.is-template { border-color: var(--accent); }
.copy-menu-name { font-weight: 700; }
.copy-menu-meta { font-size: 12.5px; color: var(--muted); }
.copy-course { margin: var(--s3) 0 var(--s1); font-size: var(--type-meta); letter-spacing: var(--type-meta-tracking); font-weight: var(--type-meta-weight); text-transform: uppercase; color: var(--muted); }
.copy-dish {
  display: flex; align-items: flex-start; gap: 10px; padding: var(--s2) 10px;
  border: 1px solid var(--line); border-radius: 10px; margin: 0 0 6px; background: var(--surface); cursor: pointer;
}
.copy-dish input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.copy-dish > span { display: flex; flex-direction: column; min-width: 0; }
.copy-dish-title { font-weight: 700; color: var(--ink); }
.copy-dish-preps { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
/* Addendum: Dishes | Preps, after the source menu is chosen. A prep row
   is a dish row by another name, so the dish helpers never match it. */
.copy-tabs { grid-template-columns: repeat(2, 1fr); margin: 0 0 var(--s2); }
.copy-prep {
  display: flex; align-items: flex-start; gap: 10px; padding: var(--s2) 10px;
  border: 1px solid var(--line); border-radius: 10px; margin: 0 0 6px; background: var(--surface); cursor: pointer;
}
.copy-prep input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.copy-prep > span { display: flex; flex-direction: column; min-width: 0; }
.copy-prep-name { font-weight: 700; color: var(--ink); }
.copy-prep-meta { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
/* Reuse is right; silent reuse is not. */
.copy-reuse p {
  margin: var(--s2) 0 0; padding: var(--s2) var(--s3); border-left: 3px solid var(--warn);
  background: var(--surface-warm); font-size: 13.5px; color: var(--ink);
}
/* The copy button on its own row; Another menu and Cancel share the next. */
#copy-sheet .sheet-actions > .primary { flex: 1 1 100%; }

/* ── print link (brief 12) ── */
.cal-print { margin: 0 0 10px var(--s2); vertical-align: top; padding-top: var(--s2); padding-bottom: var(--s2); }
#calendar-view.is-wide .cal-print { order: 1; padding-top: 6px; padding-bottom: 6px; }
.print-link-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0; }
.print-link-actions > * { flex: 1 1 auto; text-align: center; }
a.menu-primary { display: inline-block; text-decoration: none; }

/* ── Brief 20: a prep's method ─────────────────────────────────────── */
.method { margin-top: var(--s5); }
.method[hidden], .method-proposal[hidden], .method-previous[hidden] { display: none; }
.method-head { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.method-head h3 { margin: 0; font-family: var(--font-ui); font-size: 15px; }
.method-draft {
  font-size: var(--type-meta); font-weight: 700; letter-spacing: var(--type-meta-tracking);
  color: var(--warn); border: 1px solid var(--warn); border-radius: 999px; padding: 1px var(--s2);
}
.method-scope { margin: var(--s1) 2px var(--s2); font-size: 12.5px; color: var(--muted); }
.method-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.method-step { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.method-step::before {
  counter-increment: step; content: counter(step); flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.method-step-body { flex: 1; min-width: 0; }
.method-step-text { margin: 0; line-height: 1.45; white-space: pre-wrap; }
.method-step-mins { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.method-step textarea {
  width: 100%; min-height: 3.2em; resize: vertical; font: inherit; font-family: var(--font-ui); font-size: 15px;
  padding: var(--s1) var(--s2); border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.method-step-tools { display: flex; gap: var(--s1); align-items: center; margin-top: var(--s1); flex-wrap: wrap; }
.method-step-tools input { width: 64px; font: inherit; padding: var(--s1); border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.method-step-tools button {
  min-width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer; font: inherit;
}
.method-step-warn { margin: var(--s1) 0 0; font-size: 12.5px; color: var(--warn); font-weight: 700; }
.method-proposal { margin: var(--s2) 0; padding: 10px var(--s3); background: var(--accent-soft); border: 1px solid var(--accent-glow); border-radius: var(--radius); }
.method-proposal-says { margin: 0 0 var(--s1); }
.method-actions { display: flex; gap: var(--s2); margin-top: var(--s2); }
.method-confirm { margin-top: var(--s2); }
.method-previous { margin-top: var(--s3); font-size: 13px; }
.method-previous summary { cursor: pointer; color: var(--muted); font-weight: 700; }

/* ── Brief 20/21: cooking, one step at a time ──────────────────────── *
 * After cooking.html (Brief 21): a fixed header with a rail weighted by
 * minutes, the step as the hero, the ring as the one bold object (and the
 * timer's only control), a quiet edit link, fixed Back / Next. In the app's
 * own tokens; the alarm is --warn, the running ring --accent, so it reads as
 * the same system. Read at two metres: big step text, bigger digits. */
.method-cook { margin: var(--s2) 0; }
.cook {
  position: fixed; inset: 0; z-index: 90; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; overflow: hidden;
}
body.cooking { overflow: hidden; }
/* Not the app's header: none of its sticky, negative margins or blur. */
.cook-head { position: static; z-index: auto; margin: 0; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none;
  flex: 0 0 auto; padding: 14px var(--s4) 10px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--line); }
.cook-top { display: flex; align-items: baseline; gap: var(--s3); min-width: 0; }
.cook-dish { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook-count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cook-done {
  margin-left: auto; flex: 0 0 auto; background: none; border: 1px solid var(--line); color: var(--muted);
  font: inherit; font-family: var(--font-ui); font-size: .85rem; padding: 5px var(--s3); border-radius: 999px; cursor: pointer;
}
.cook-rail { display: flex; gap: 2px; height: 5px; margin-top: 11px; }
.cook-seg { background: var(--line-strong); border-radius: 2px; min-width: 3px; transition: background .3s; }
.cook-seg.past { background: var(--muted); }
.cook-seg.now { background: var(--accent); }
.cook-seg.now.ticking { animation: cook-breathe 2.4s ease-in-out infinite; }
@keyframes cook-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.cook-railfoot { display: flex; justify-content: space-between; gap: var(--s3); margin-top: 6px; font-size: .72rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.cook-draft { color: var(--warn); font-weight: 700; }
.cook-left { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cook-main {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 20px var(--s4) var(--s2);
  display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center;
}
.cook-step {
  margin: 0; max-width: 30ch; font-family: var(--font-ui); font-weight: 500;
  font-size: clamp(1.35rem, 4.8vw, 1.8rem); line-height: 1.34; text-wrap: balance; overflow-wrap: anywhere; white-space: pre-wrap;
}
.cook-step .shout { color: var(--accent); font-weight: 700; }
.cook-ring { position: relative; width: min(250px, 68vw); aspect-ratio: 1; flex: 0 0 auto; }
.cook-ring-svg { width: 100%; height: 100%; display: block; transform: rotate(-90deg); }
.cook-ring .track { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.cook-ring .arc { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .45s linear; }
.cook-ring .tick { stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.cook-ring .tick.lit { stroke: var(--accent); }
.cook-ring-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-radius: 50%; padding: 0;
}
.cook-ring-face:focus-visible { outline: 2px solid var(--accent); outline-offset: var(--s1); }
.cook-digits { font-family: var(--font-ui); font-size: clamp(2.7rem, 11.5vw, 3.5rem); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.cook-ring-label { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.cook-ring.idle .arc { stroke: var(--line-strong); }
.cook-ring.idle .cook-digits { color: var(--accent); }
.cook-ring.rang .arc, .cook-ring.rang .tick.lit { stroke: var(--warn); }
.cook-ring.rang .cook-digits { color: var(--warn); }
.cook-edit {
  background: none; border: 0; padding: 6px; color: var(--muted); cursor: pointer;
  font: inherit; font-family: var(--font-ui); font-size: .85rem; text-decoration: underline; text-underline-offset: 3px;
}
.cook-note { margin: 0; max-width: 34ch; font-size: .75rem; line-height: 1.5; color: var(--muted); }
.cook-running {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%;
  padding: var(--s2) var(--s3); border-radius: var(--radius); background: var(--accent-soft);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.cook-running.is-finished { background: var(--danger-soft); color: var(--warn); }
.cook-running-stop { flex: 0 0 auto; background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: var(--s1) var(--s3); font: inherit; cursor: pointer; color: inherit; }
.cook-nav {
  flex: 0 0 auto; display: flex; gap: 10px; padding: 10px var(--s4); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}
.cook-nav button {
  flex: 1; font: inherit; font-family: var(--font-ui); font-weight: 700; font-size: 1.05rem; padding: 15px 10px;
  border-radius: var(--s3); cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.cook-nav button:disabled { opacity: .3; cursor: default; }
.cook-nav .next { flex: 1.9; background: var(--accent); border-color: var(--accent); color: #fff; }
/* The alarm. The pulse stays slow — 1.25 s, 0.8 Hz; anything past about
   3 Hz is a photosensitive-epilepsy risk — and reduced motion is a steady
   tint, nothing moving. One tap anywhere silences it. */
.cook-flash { position: fixed; inset: 0; z-index: 95; background: var(--warn); opacity: 0; pointer-events: none; mix-blend-mode: soft-light; }
.cook-flash.on { pointer-events: auto; animation: cook-pulse 1.25s ease-in-out infinite; }
@keyframes cook-pulse { 0%, 100% { opacity: 0; } 50% { opacity: .9; } }
.cook-alarmbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 96; display: none; width: 100%;
  padding: var(--s4); padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom, 0px));
  background: var(--warn); color: #15100e; border: 0; cursor: pointer;
  font-family: var(--font-ui); font-weight: 700; font-size: 1.1rem; text-align: center;
}
.cook-alarmbar.on { display: block; }
@media (prefers-reduced-motion: reduce) {
  .cook-flash.on { animation: none; opacity: .35; }
  .cook-seg.now.ticking { animation: none; }
  .cook-ring .arc { transition: none; }
}

/* Brief 22: Suroviny on the cooking screen. Open on step 1 (mise en place),
   one tap away after; the rows the step names, emphasised — best effort. */
.cook-lines { width: 100%; max-width: 34rem; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cook-lines summary { cursor: pointer; padding: var(--s3); font-weight: 700; font-size: 1rem; }
.cook-portions { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3) var(--s2); color: var(--muted); }
.cook-portions input { width: 64px; text-align: center; font: inherit; font-weight: 700; font-size: 1.1rem; padding: var(--s1); border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); }
.cook-portions button { width: 40px; height: 40px; font: inherit; font-size: 1.3rem; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.cook-lines-list { list-style: none; margin: 0; padding: 0 var(--s3) var(--s3); }
.cook-lines-list li { display: flex; gap: var(--s3); padding: 6px 0; border-top: 1px solid var(--line); font-size: 1.05rem; }
.cook-lines-list .q { flex: 0 0 5.5em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cook-lines-list .n { color: var(--muted); font-size: .85rem; }
.cook-lines-list li.mentioned { background: var(--accent-soft); margin: 0 calc(-1 * var(--s2)); padding-left: var(--s2); padding-right: var(--s2); border-radius: 6px; }
.cook-lines-list li.mentioned .t { font-weight: 700; color: var(--accent); }

/* Brief 22: the day's prep. */
.today-btn {
  display: flex; width: 100%; justify-content: space-between; align-items: center; gap: var(--s2);
  margin: 0 0 var(--s3); padding: var(--s3) var(--s4); border: none; border-radius: var(--radius);
  background: var(--accent); color: #fff; cursor: pointer;
  font: inherit; font-family: var(--font-ui); font-weight: 700; font-size: 1.05rem; text-align: left;
}
.today-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.today-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-bottom: 1px solid var(--line); cursor: pointer; }
.today-row:last-child { border-bottom: none; }
.today-main { flex: 1; min-width: 0; }
.today-name { font-weight: 700; font-size: 1.05rem; }
.today-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.today-time { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }
.today-cook { flex: 0 0 auto; width: auto; padding: var(--s2) var(--s3); }
.today-row.no-method .today-time { color: var(--muted); font-weight: 400; }
/* Brief 22 addendum: ticked off. Dimmed and struck, left exactly where it was — the order is the running order. */
.today-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: 0 0 var(--s2); }
.today-sum { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.today-hide { flex: 0 0 auto; background: none; border: none; color: var(--accent); font: inherit; font-size: 14px; padding: var(--s2) 0; cursor: pointer; }
.today-tick { flex: 0 0 auto; width: 44px; height: 44px; margin: -6px 0; padding: 0; display: grid; place-items: center; background: none; border: none; cursor: pointer; }
.today-tick::before { content: ""; width: 26px; height: 26px; box-sizing: border-box; border: 2px solid var(--muted); border-radius: 6px; }
.today-tick:disabled { opacity: .35; cursor: default; }
.today-tick[aria-checked="true"]::before { content: "✓"; display: grid; place-items: center; background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 700; font-size: 18px; line-height: 1; }
.today-row.done .today-main, .today-row.done .today-time { opacity: .5; }
.today-row.done .today-name { text-decoration: line-through; }

/* Brief 22: past menus, put away by week. */
.menus-past { margin-top: var(--s4); }
.menus-past > summary { cursor: pointer; padding: var(--s2) 2px; color: var(--muted); font-weight: 700; }
.menus-week { margin: var(--s3) 2px var(--s1); font-size: var(--type-meta); letter-spacing: var(--type-meta-tracking); text-transform: uppercase; color: var(--muted); font-weight: var(--type-meta-weight); }

/* Brief 21 addendum: the ring is dialled — dragging must never scroll. */
.cook-ring { touch-action: none; user-select: none; -webkit-user-select: none; }
.cook-ring .cook-ring-delta { color: var(--accent); font-weight: 700; }
.cook-adjust { display: flex; gap: var(--s3); justify-content: center; width: 100%; max-width: 20rem; }
.cook-adjust .pair-btn { flex: 1; min-height: 52px; font-size: 1.1rem; }
.cook-keep { display: flex; align-items: center; gap: var(--s2); margin: 0; padding: var(--s2) var(--s3); border-radius: var(--radius); background: var(--accent-soft); font-weight: 700; }
.cook-keep[hidden] { display: none; }
.cook-keep .pair-btn { flex: 0 0 auto; width: auto; padding: var(--s2) var(--s3); }
