/*
 * Seva Flow — "Saffron Glass" design system + mobile-first application shell.
 * Ported from the Utsava Planner prototype. Section 1 is the token layer (custom
 * properties); the shell below consumes tokens. The department color families and the
 * *-soft / *-deep / --shadow-hi tokens are the shared palette consumed by the department,
 * timeline and badge UIs added in later phases — defined here so the system is complete.
 * Mobile-first, no framework.
 */

/* ============================================================ 0. TYPE ====== */
/* Manrope, served from this app rather than from a font CDN. A temple hall has one bar of
   signal and the shells cache the page, not a third party's; a webfont fetched over the
   network is a screen that renders in the wrong face or not at all. Four subsets, 57 KB
   together, and Devanagari and Bengali fall through to the platform's own faces — Manrope
   has no glyphs for them, and a silent fallback mid-word is worse than an honest one. */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/assets/manrope-latin-822bc47d.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: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/assets/manrope-latin-ext-3c111aa4.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: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/assets/manrope-cyrillic-397e3398.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/assets/manrope-cyrillic-ext-af6aded3.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* ============================================================ 1. TOKENS ==== */
:root {
  color-scheme: light;

  /* Base surfaces */
  --bg: #faf8f5;
  --surface: #fffefc;
  --glass: rgba(255, 254, 252, .96);

  /* Ink / text */
  --ink: #20201f;
  --ink2: #716d67;
  /* The palest grey the mockups use; held at #7a7169 so normal text clears WCAG AA on the warm
     white surfaces. */
  --ink3: #7a7169;

  /* Saffron (primary brand) */
  --saffron: #d94a0b;
  --saffron-deep: #c43f08;
  --saffron-soft: #fff1e8;

  /* Department color families (main / soft background / deep text) */
  --gold: #EAB308;      --gold-soft: #FEF7DC;      --gold-deep: #92650A;      /* altar */
  --leaf: #16A34A;      --leaf-soft: #E7F6EC;      --leaf-deep: #116A33;      /* cash */
  --berry: #E11D48;     --berry-soft: #FDE8ED;     --berry-deep: #A61239;     /* hall */
  --sky: #0284C7;       --sky-soft: #E5F3FB;       --sky-deep: #075E8D;       /* program */
  --violet: #7C3AED;    --violet-soft: #F1EBFD;    --violet-deep: #5B21B6;    /* guests */

  /* States: something is waiting, something went wrong. Both carry text, so both are held to
     AA against the ink they are written in (see spec/system/palette_contrast_spec.rb). */
  --warn-bg: #FEF3C7;
  --danger: #B91C1C;

  /* Hairline / divider — opaque token plus the translucent glass-edge variant */
  --line: #e9e4dd;
  --hairline: rgba(221, 214, 205, .82);

  /* Radii — a card, a control, a small chip. Three steps, not a value per component. */
  --r-card: 13px;
  --r-tab: 10px;
  --r-ctl: 9px;

  /* Elevation — one warm, wide, nearly weightless shadow. The old pair sat close under every
     card and read as a 2014 drop shadow; this one lifts the surface without drawing a line
     under it. --shadow-hi is the same idea with the card picked further off the page. */
  --shadow: 0 1px 2px rgba(45, 32, 18, .025), 0 8px 24px -18px rgba(45, 32, 18, .18);
  --shadow-hi: 0 12px 34px -20px rgba(45, 32, 18, .25);

  /* Layout */
  --stage-max: 430px;
  --gutter: 16px;

  /* The two full-page workspaces (kitchen.css, recipe.css) sit on the same palette a shade
     cooler; their row heights are the density toggle's two stops. */
  --kt-line: #e7e3dc;
  --kt-soft: #f7f5f1;
  --kt-accent: #c65320;
  --kt-row-compact: 30px;
  --kt-row-comfortable: 42px;
  --rw-bg: #faf8f5;
  --rw-line: #e8e2db;
  --rw-muted: #716c65;
  --rw-ink: #1f211f;
  --rw-accent: #d94a0b;
  --rw-soft: #fff1e8;
}

/* ============================================================ 2. RESET ===== */
* { box-sizing: border-box; }

/* `hidden` means hidden. The browser's own rule for it is a plain `display: none`, which any
   class setting a display of its own quietly beats — which is how a submit button hidden by
   its controller went on sitting in the top bar because .btn says inline-flex. Anything that
   genuinely needs to lay out while marked hidden overrides this deliberately. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
html { background: var(--bg); }

body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
  letter-spacing: -.008em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============================================================ 3. SHELL ===== */
.stage {
  display: flex;
  flex-direction: column;
  max-width: var(--stage-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
  box-shadow: none;
}

/* Glass sticky top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 254, 252, .97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
}
.topbar__logo {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--saffron);
  font-size: 20px;
}
/* Back, in the top bar, where a native app would put it. */
.topbar__back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.topbar__back:hover { background: var(--saffron-soft); color: var(--saffron-deep); }

.topbar__titles { display: flex; flex-direction: column; min-width: 0; }
.topbar__title, .topbar__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.topbar__sub { font-size: 12px; color: var(--ink2); }
.topbar__spacer { flex: 1; }

/* Whose phone this is, and the way off it. The initials rather than a generic person glyph:
   a temple phone passes between hands, and the first thing to know is whose account is open
   on it. Forty-four across for the finger, the disc inside it thirty-four for the eye. */
.topbar__me {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 999px;
  text-decoration: none;
}
.topbar__me:hover { background: var(--saffron-soft); }
.topbar__me .ava { pointer-events: none; }

/* Language switcher in the top bar — a globe that opens a list, so the list can grow without
   eating any of the width the event's name needs. */
.locale-switch { display: flex; flex-shrink: 0; gap: 6px; margin: 0; }
/* Only ever seen by a browser that did not run the controller, which hides it on connect. */
.locale-switch__go { flex: none; }
/* The no-JavaScript select only: the combobox that replaces it is the square face below. */
.locale-switch select { width: auto; min-width: 118px; }
main { padding: 16px var(--gutter) 120px; }

/* In the Hotwire Native shells the web top bar / tab bar are hidden and replaced by
   native chrome, so drop the 120px well the fixed web tab bar would occupy. */
.hotwire-native main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* Glass bottom tab bar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--stage-max);
  z-index: 50;
  background: rgba(255, 254, 252, .98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: var(--r-tab);
  font-size: 10.5px;
  font-weight: 600;
  color: #77736d;
  transition: .15s;
}
.tab__icon { display: grid; place-items: center; line-height: 1; }

/* Every icon is a line drawing on a 24 grid, coloured by the text around it. Inline-block
   with a nudged baseline so an icon set in a sentence sits on the type rather than under it;
   .tab__icon and the round wells above centre it themselves. */
svg.ico-glyph {
  display: inline-block;
  vertical-align: -.16em;
  flex: none;
  stroke: currentColor;
  fill: none;
}
.tab--child { display: none; }
/* Desktop-only content in the tab bar partial: the brand, the event and the section labels. */
.desktop-nav__brand, .desktop-nav__event, .desktop-nav__label { display: none; }
.topbar__module { color: var(--saffron-deep); font-weight: 700; }
.topbar__module::after { content: " ·"; color: var(--ink3); font-weight: 400; }
.tab.is-active { color: var(--saffron-deep); }
.tab.is-active .tab__icon { transform: translateY(-1px); }

/* ============================================================ 4. CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: none;
  padding: var(--gutter);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink2);
}

.screen__title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 10px; }
.screen__subtitle { margin: 0 0 10px; font-size: 13.5px; color: var(--ink2); }

/* Where in the org this screen sits — event, then module (SF-B70, approved prototype). */
.breadcrumb { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 6px; }
.breadcrumb ol { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink2); }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--ink3); }
.breadcrumb li[aria-current="page"] { color: var(--ink); font-weight: 700; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb__help { width: 26px; height: 26px; min-width: 0; min-height: 0; border-radius: 999px; font-weight: 800; }

/* ============================================================ 5. FORMS ===== */
.btn {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:active { transform: translateY(1px); }
/* A toggle button (kiosk mode) that is currently on. */
.btn.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--soft {
  background: var(--saffron-soft); color: var(--saffron-deep);
  border-color: rgba(249, 115, 22, .18); box-shadow: none;
}

.auth { max-width: 360px; margin: 24px auto; }
.auth__title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 16px; }
.auth__form { display: flex; flex-direction: column; gap: 12px; }
.auth__form input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  /* 16px, not 15: see the note on the control base below — anything smaller and iOS zooms. */
  font-size: 16px;
  font-family: inherit;
}
.auth__link {
  display: inline-block;
  margin-top: 14px;
  color: var(--saffron-deep);
  font-weight: 700;
  font-size: 13px;
}

.flash {
  margin: 12px auto;
  max-width: 360px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
}
.flash--alert { background: var(--berry-soft); color: var(--berry-deep); }
.flash--notice { background: var(--leaf-soft); color: var(--leaf-deep); }

/* ============================================================ 6. DEPTS ===== */
.dept-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: var(--dept, var(--ink3));
}
.dept-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.status-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--saffron-soft);
  color: var(--saffron-deep);
}

.stack { display: flex; flex-direction: column; gap: 12px; }
.module-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mt { margin-top: 16px; }
/* The head of a list screen: what it is, and the one button that adds to it.
   It used to hold a .stack — a *vertical* utility — so the secondary links fell down the right
   edge in a staircase and the title floated in the middle of it. The title and the primary
   action share the first line; when they cannot, the action wraps under rather than sideways.
   Everything else a screen links to goes in .screen__links below, as a row. */
.screen__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.screen__head > .screen__title { margin: 0; flex: 1 1 8ch; }
.screen__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* The screens a screen leads to — the roster's swap board, the event list's temple calendar.
   Secondary by weight, so they are quieter and narrower than the primary button, and they lie
   in a row that wraps instead of a column that pushes the content down the page. */
.screen__links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.screen__links .btn {
  padding: 8px 13px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink2);
  box-shadow: none;
}
.screen__links .btn:hover { color: var(--ink); border-color: var(--ink3); background: var(--surface); }
/* The muted color above is for the secondary (print/export) buttons only — it is more
   specific than .btn--primary's own white and would otherwise win and sink the primary
   action's contrast on its own orange background. */
.screen__links .btn--primary, .screen__links .btn--primary:hover { color: #fff; }
.list-card { display: block; margin-bottom: 10px; }
.list-card__title { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.muted { color: var(--ink2); font-size: 13px; }

/* ── The shared components (app/views/shared, ComponentsHelper) ── */
/* A card's title reads like a bold first line, not a heading of its own. */
.card__title { margin: 0; font-size: inherit; font-weight: 700; }
/* Nothing to list yet: one muted sentence, an optional drawing, an optional action. */
.empty { margin: 12px 0; color: var(--ink2); font-size: 13px; }
.empty__icon { display: block; margin-bottom: 8px; color: var(--ink3); }
.empty__text { margin: 0; }
.empty__action { margin-top: 10px; }
/* A stacked form field: the caption above the control, a hint under it. */
.field__label { color: var(--ink2); font-size: 13px; }
.field__hint { display: block; margin-top: 4px; font-size: 12px; color: var(--ink2); }
/* One row of a list: a leading well, the title and its meta, and what trails on the right. */
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row__body { flex: 1; min-width: 0; }
.list-row__title { display: block; overflow-wrap: anywhere; }
.list-row__meta { display: block; font-size: 12px; color: var(--ink2); }
.list-row__end { flex: none; margin-left: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ============================================================ 7. CHECKS ==== */
.readiness { margin-top: 10px; }
.readiness__pct { font-size: 15px; font-weight: 800; }
.readiness__bar {
  margin-top: 6px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.readiness__fill { height: 100%; border-radius: 999px; transition: width .3s; }

.checklist__title { font-weight: 800; font-size: 14px; margin-bottom: 4px; }

/* Department show — icon + name + readiness ring header. */
.dept-head { display: flex; align-items: center; gap: 12px; }
.dept-head__ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.dept-head__title { flex: 1; }
.dept-head__title b { font-size: 15.5px; display: block; }
.dept-head__sm { font-size: 12px; color: var(--ink2); margin-top: 1px; }
.dring {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0);
}
.dring > div { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 11px; font-weight: 800; }

/* Checklist rows with round check boxes. */
.chk { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chk:last-child { border-bottom: 0; }
.cbx {
  width: 28px; height: 28px; border-radius: 9px; border: 2px solid #DFCFB8; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
  transition: .15s; background: var(--surface); cursor: pointer; padding: 0; font-family: inherit;
}
.chk.done .cbx { background: var(--leaf); border-color: var(--leaf); }
.chk .n { flex: 1; min-width: 0; }
.chk .n b { font-size: 14px; display: block; font-weight: 600; }
.chk.done .n b { text-decoration: line-through; color: var(--ink2); }
.chk .n span { font-size: 11.5px; color: var(--ink2); }
.chk .n span.overdue { color: var(--berry-deep); font-weight: 700; }

/* ============================================================ 8. PULSE ===== */
.pulse-stats { display: flex; gap: 20px; }
.pulse-stat { display: flex; flex-direction: column; }
.pulse-stat__num { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.pulse-stat__label { font-size: 12px; color: var(--ink2); }
.pulse-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pulse-dept { display: block; text-decoration: none; color: inherit; }

/* Turbo's stream-source elements carry no content; keep them out of layout flow so
   they don't occupy a grid/flex cell (they sit inline with the pulse cards). */
turbo-cable-stream-source { display: none; }

/* ============================================================ 8b. FIRE ===== */
.fire__title { color: var(--berry-deep); }
.fire__list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fire__item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: var(--berry-soft); }
.fire__item--open { background: var(--saffron-soft); }
.fire__item--conflict { background: var(--berry-soft); }
.fire__icon { font-size: 18px; line-height: 1.2; }
.fire__body { display: flex; flex-direction: column; }
.fire__label { font-weight: 700; font-size: 14px; }

/* ===================================================== 8c. DASHBOARD ======= */
/* Section header row with an optional right-aligned hint or badge. */
.h-section { display: flex; align-items: baseline; gap: 8px; margin: 22px 2px 10px; }
.h-section b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.h-section > span { font-size: 13px; color: var(--ink2); margin-left: auto; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; }
/* A pill states what something *is*; the dot lets the state read at arm's length, before the
   word does. Pills that already carry an icon or a number keep to the word alone. */
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }
.badge--berry { background: var(--berry-soft); color: var(--berry-deep); }

/* Hero — the dark saffron "next event" card. */
.hero {
  background: linear-gradient(135deg, #3A1D07 0%, #7C3005 55%, var(--saffron-deep) 100%);
  color: #fff; border-radius: 24px; padding: 20px; box-shadow: var(--shadow-hi);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 190, 80, .35), transparent 70%);
}
.hero__eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: rgba(255, 230, 200, .85); margin: 0; }
.hero__title { font-size: 23px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 4px; }
.hero__meta { font-size: 13px; color: rgba(255, 230, 200, .9); margin: 0; }
.hero__row { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.hero__stats { display: flex; gap: 18px; }
.hero__stats b { display: block; font-size: 21px; font-weight: 800; }
.hero__stats span { font-size: 11.5px; color: rgba(255, 230, 200, .8); }
.ring {
  width: 78px; height: 78px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255, 255, 255, .18) 0);
}
.ring > div { width: 62px; height: 62px; border-radius: 50%; background: rgba(40, 18, 4, .85); display: grid; place-items: center; font-size: 17px; font-weight: 800; color: #FFD98A; }
.countdown { margin-top: 14px; background: rgba(255, 255, 255, .12); border-radius: 14px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.countdown b { display: inline-block; min-width: 18ch; white-space: nowrap; font-size: 17px; font-variant-numeric: tabular-nums; }
/* Same widget on a light screen (the prep station), where the dark hero's translucent white
   chip would be nearly invisible. */
.countdown--light { background: var(--surface); border: 1px solid var(--line); color: var(--ink); margin: 10px 0; }

/* Department bento — two-column readiness cards with icon, head and progress. */
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dept-mini { display: block; text-decoration: none; color: inherit; transition: transform .15s; }
.dept-mini:active { transform: scale(.97); }
.dept-mini__ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; margin-bottom: 8px; }
.dept-mini b { font-size: 14.5px; display: block; }
.dept-mini__sm { font-size: 11.5px; color: var(--ink2); margin-top: 2px; }
.mini-prog { height: 5px; border-radius: 99px; background: var(--line); margin-top: 10px; overflow: hidden; }
.mini-prog i { display: block; width: calc(var(--p, 0) * 1%); height: 100%; border-radius: 99px; background: var(--dept); transition: width .4s; }

/* Fire feed rows with an action button. */
.fire-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.fire-item:last-child { border-bottom: 0; }
.fire-item__icon { font-size: 18px; }
.fire-item__body { flex: 1; }
.fire-item__body b { display: block; font-size: 13.5px; }
.fire-item__body span { font-size: 11.5px; color: var(--ink2); }

/* My-tasks and activity rows share the round action button. */
.gobtn { margin-left: auto; padding: 9px 15px; border-radius: 12px; background: var(--saffron-soft); color: var(--saffron-deep); font-size: 13px; font-weight: 800; flex-shrink: 0; text-decoration: none; }
.tasknow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tasknow:last-child { border-bottom: 0; }
.tasknow__emoji { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; flex-shrink: 0; }
.tasknow__body { flex: 1; }
.tasknow__body b { font-size: 15px; display: block; }
.tasknow__body span { font-size: 12.5px; color: var(--ink2); }

/* Live presence / activity. */
.pers { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 6px 0; }
.ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0; position: relative; }
/* One solid hue per family, picked from the person's name (avatar_tone) so they keep it everywhere. */
.ava--saffron { background: var(--saffron); }
.ava--gold { background: var(--gold); }
.ava--leaf { background: var(--leaf); }
.ava--berry { background: var(--berry); }
.ava--sky { background: var(--sky); }
.ava--violet { background: var(--violet); }
.ava--live::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--leaf); animation: ava-pulse 1.8s infinite; }
@keyframes ava-pulse { 0% { opacity: 1; transform: scale(1); } 70% { opacity: 0; transform: scale(1.25); } 100% { opacity: 0; } }
.pers__body b { font-weight: 700; }
.pers__body span { color: var(--ink2); }
.livecur { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: #7C6AE0; background: #F0EDFB; border-radius: 99px; padding: 4px 10px; margin-left: auto; animation: live-pulse 2s infinite; }
.activity-all { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--saffron-deep); text-decoration: none; }
@keyframes live-pulse { 50% { opacity: .55; } }

/* ============================================================ 9. TIMELINE == */
.timeline { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.timeline__item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow);
  padding: 12px 14px; border-left: 4px solid var(--dept, var(--ink3));
}
.timeline__time { font-weight: 800; font-size: 15px; min-width: 46px; }
.timeline__body { flex: 1; }
.timeline__title { font-weight: 700; font-size: 15px; color: var(--ink1); text-decoration: none; }
.timeline__shift { display: flex; gap: 6px; margin-top: 8px; }
/* Scoped to the timeline so it no longer overrides the base .badge (:313, padding 4px 10px)
   app-wide — dashboard/people/hero badges now render at the prototype's size. */
.timeline__shift .badge { background: var(--line); color: var(--ink2); }
.badge--approved { background: var(--leaf-soft); color: var(--leaf-deep); border: 0; cursor: pointer; font-family: inherit; }
.badge--live { background: var(--saffron); color: #fff; border: 0; cursor: pointer; font-family: inherit; }
.timeline__item.is-live { outline: 2px solid var(--saffron); }

/* Presenter (hall display) */
.presenter { padding: 24px 8px; text-align: center; }
.presenter__event { font-size: 13px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; }
.presenter__label { font-size: 13px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; }
.presenter__now { margin: 20px 0; padding: 24px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); border-top: 6px solid var(--dept, var(--saffron)); }
.presenter__title { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0; }
.presenter__title--idle { color: var(--ink3); }
.presenter__meta { font-size: 16px; color: var(--ink2); }
.presenter__next { margin-top: 16px; }
.presenter__nexttitle { font-size: 18px; font-weight: 700; }

/* ===================================================== 9b. RUNDOWN ========= */
.run-row { display: flex; gap: 14px; position: relative; }
.run-rail { width: 52px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.run-time { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; padding-top: 14px; }
.run-line { width: 2.5px; flex: 1; background: var(--line); min-height: 14px; }
.run-card { flex: 1; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 13px 15px; margin-bottom: 10px; border-left: 4px solid var(--dc, var(--ink3)); }
.run-row.is-live .run-card { box-shadow: var(--shadow-hi); outline: 2px solid var(--saffron); }
.run-card__title { font-size: 15px; font-weight: 700; display: block; color: inherit; text-decoration: none; }
.run-card__sm { font-size: 12.5px; color: var(--ink2); margin-top: 3px; }
.run-foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.run-foot form { display: inline; margin: 0; }
.badge--draft { background: var(--line); color: var(--ink2); border: 0; cursor: pointer; font-family: inherit; }
.badge--rejected { background: var(--berry-soft); color: var(--berry-deep); }
.badge--shift { background: var(--saffron-soft); color: var(--saffron-deep); border: 0; cursor: pointer; font-family: inherit; }

/* ============================================================ 10. PEOPLE == */
.person { background: var(--surface); border-radius: var(--r-card); box-shadow: none; padding: 14px 16px; margin-bottom: 11px; border: 1px solid var(--line); }
.person.sick { border: 1.5px solid var(--berry); }
.p-top { display: flex; align-items: center; gap: 12px; }
.p-top .ava { width: 42px; height: 42px; font-size: 15px; }
.p-top__name { flex: 1; min-width: 0; }
.p-top__name b { font-size: 15.5px; display: block; }
.p-top__name .sm { font-size: 12px; color: var(--ink2); }
.p-status { margin-left: auto; }
.p-roles { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
/* One role and the answers to it. The group used to be a non-wrapping inline row, so a person
   with a long role name pushed their last button off the edge of the card; now the group wraps
   inside itself and the chips stay on one line each. */
.person-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.person-role form { display: inline; margin: 0; }
.rchip { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.rchip-act { border: 0; background: var(--line); color: var(--ink2); padding: 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; }
.person__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.person__name { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.assign-list { display: flex; flex-direction: column; gap: 8px; }
.assign-chip {
  border-radius: 12px; padding: 8px 10px; background: var(--surface);
  border-left: 4px solid var(--dept, var(--ink3)); box-shadow: var(--shadow);
}
.assign-chip__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.assign-chip__role { font-weight: 700; font-size: 14px; }
.assign-chip__status { font-size: 12px; font-weight: 700; color: var(--ink2); }
.assign-chip--confirmed .assign-chip__status { color: var(--leaf-deep); }
.assign-chip--sick .assign-chip__status,
.assign-chip--declined .assign-chip__status { color: var(--berry-deep); }
.assign-chip--swap_offered .assign-chip__status { color: var(--saffron-deep); }
.assign-chip__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ============================================================ 11. KDS ====== */
.kds { background: #12100d; color: #f4ece0; margin: -16px -16px 0; min-height: 100vh; padding: 16px; }
.kds__event { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #a99; }
.kds__head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.kds__head-row .kds__event { margin: 0; }
/* Station-screen controls (fullscreen), dark to match the board they sit on. */
.kds__toggle {
  background: rgba(255, 255, 255, .12); color: inherit; border: 0; border-radius: 10px;
  padding: 8px 12px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.kds__toggle.is-on { background: var(--saffron); color: #fff; }
.kds__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.kds__card { border-radius: 14px; padding: 14px; background: #1e1a14; border-left: 5px solid #4a4239; }
.kds__head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.kds__card--prepping { border-left-color: var(--saffron); }
.kds__card--ready { border-left-color: var(--leaf); }
.kds__card--served { border-left-color: #4a4239; opacity: .55; }
.kds__dish { font-size: 18px; font-weight: 800; }
.kds__time { font-size: 13px; color: #c9bdac; display: flex; align-items: center; gap: 4px; }
.kds__portions { font-size: 13px; color: #c9bdac; }
.kds__status { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.kds__btn { margin-top: 10px; width: 100%; padding: 10px; border: 0; border-radius: 10px;
  background: var(--saffron); color: #fff; font-weight: 800; font-size: 14px; font-family: inherit; cursor: pointer; }
.kds__empty { color: #a99; margin-top: 20px; }

/* ============================================================ 12. BUY ====== */
.buy-list { list-style: none; margin: 10px 0 0; padding: 0; }
/* Aligned to the top, not the middle: a catalogue row grows when its price line is opened,
   and a delete button that drifts to the middle of the history is a mis-tap waiting. */
/* A label, its box, and anything folded under it — one item to a form's layout. */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group > .translations > summary { cursor: pointer; font-size: 13px; }

.buy-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.buy-item:last-child { border-bottom: 0; }

/* The tick. It was an emoji, which carried its own colour; as a drawing it inherited white
   and vanished, and the line read as a blank strip with the goods pushed to the middle of it.
   It is a real checkbox now: a bordered square inside a fingertip-sized target, filled when
   the thing has been bought. */
.buy-item__box {
  width: 40px;
  height: 40px;
  padding: 0;
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}
/* The square you see, drawn inside the target you tap. */
.buy-item__box::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1.5px solid #DFCFB8;
  border-radius: 8px;
  background: var(--surface);
  transition: background .15s, border-color .15s;
}
.buy-item__box:hover::before { border-color: var(--saffron); }
.buy-item.is-bought .buy-item__box::before { background: var(--leaf); border-color: var(--leaf); }
.buy-item__box svg { position: relative; }
.buy-item form.button_to { display: flex; flex: none; }

/* In-store mode (SF-245): a buyer's thumb at the market, not a mouse pointer at a desk —
   bigger tap target, bigger type. */
body.in-store .buy-item__box { width: 56px; height: 56px; }
body.in-store .buy-item__box::before { width: 36px; height: 36px; }
body.in-store .buy-item__label { font-size: 16px; }

.buy-item__label { flex: 1; min-width: 0; font-size: 14px; }

/* Only the shopping list lays its label out as a row of parts; the catalogue and the supplier
   list share .buy-item but keep a plain text label with things folded underneath. */
.buy-list--shop .buy-item__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.buy-item__goods { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; min-width: 0; }
.buy-item__name { font-weight: 600; }
.buy-item__qty { color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.buy-list--shop .buy-item__sum { margin-left: auto; }
.buy-item__sum { color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.buy-item__who { flex: 1 1 100%; font-size: 12.5px; color: var(--ink3); }
.buy-item__label > .buy-item__inline { flex: 1 1 100%; margin-top: 2px; }
/* Struck through where it means something — the goods — not across the department chip. */
.buy-item.is-bought .buy-item__goods { color: var(--ink3); text-decoration: line-through; }
.buy-item.is-bought .buy-item__sum { color: var(--ink3); }

.buy-item__del {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink3);
  cursor: pointer;
}
.buy-item__del:hover { background: var(--berry-soft); color: var(--berry-deep); }

/* The catalogue's picture. A photograph when somebody took one; otherwise the category drawn
   on a tint the product's own name picks, so a hundred rows are told apart at a glance
   instead of showing the same saucepan a hundred times. */
.p-pic {
  flex: none;
  width: var(--pic-size, 38px);
  height: var(--pic-size, 38px);
  border-radius: 11px;
  overflow: hidden;
  background: var(--saffron-soft);
}
.p-pic .ico__pic { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-pic--blank { color: var(--ink2); background: var(--pic-tint, var(--saffron-soft)); }

/* The camera. A file input dressed as a button — the input itself is the tap target, so a
   phone opens the camera in one press with no intermediate screen. */
.p-shot { flex: none; display: flex; }
.p-shot__go {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--ink3);
  cursor: pointer;
}
.p-shot__go:hover { background: var(--saffron-soft); color: var(--saffron-deep); }
.p-shot__go input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}
.dept-ref__thumb { display: block; max-width: 200px; border-radius: 12px; }
.kb-body { margin-top: 12px; line-height: 1.55; }
.kb-body h1, .kb-body h2 { font-weight: 800; letter-spacing: -.01em; margin: 14px 0 6px; }
.kb-body ul, .kb-body ol { padding-left: 20px; margin: 8px 0; }
.kb-body code { background: var(--line); padding: 1px 5px; border-radius: 6px; font-size: 13px; }
.kb-body pre { background: var(--ink1); color: #f4ece0; padding: 12px; border-radius: 10px; overflow-x: auto; }
.report { width: 100%; border-collapse: collapse; font-size: 14px; }
.report th, .report td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.report th:first-child, .report td:first-child { text-align: left; font-weight: 600; }
.report thead th { color: var(--ink2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.report-depts { display: flex; flex-direction: column; gap: 10px; }
.report-dept { display: flex; align-items: center; gap: 12px; }
.report-dept__body { display: flex; flex-direction: column; }
.report-fire { list-style: none; padding: 0; margin: 0; }

/* ===================================================== 12b. CASH =========== */
.statrow { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 14px 0; }
.stat { background: var(--surface); border-radius: 16px; box-shadow: none; padding: 12px 13px; border: 1px solid var(--line); }
.stat b { font-size: 21px; font-weight: 800; display: block; letter-spacing: -.02em; }
.stat span { font-size: 11px; color: var(--ink2); font-weight: 600; }
.sgroup { background: var(--surface); border-radius: var(--r-card); box-shadow: none; margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line); }
.sghead { padding: 14px 16px 11px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.sghead .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
/* Wide enough for what is inside it, not as narrow as it will go. min-width:0 was put here to
   stop long dish names pushing the card sideways, and it worked — but it also let the column
   shrink to 138px on a 390px phone while the portions stepper inside needs 158px, so the minus,
   the count and the plus sat on top of one another. The name wraps by character
   (.sghead__body b), the row wraps by item (.sghead), and neither has to squeeze. */
.sghead__body { flex: 1 1 160px; min-width: 160px; }
.sghead > .badge, .sghead > form { flex: none; margin-left: auto; }
.sghead__body b { font-size: 15px; display: block; overflow-wrap: anywhere; }
.sghead .sm { font-size: 12px; color: var(--ink2); }
.sgroup__body { padding: 0 16px 14px; }
/* The dish card's actions are a row of icons, not a stack. */

/* Menu composer: inline add row, portions steppers, tappable status. */
.menu-add { display: flex; gap: 8px; align-items: stretch; margin: 12px 0 16px; }
/* 16px, like every other control: these two are <input>s, and the class was beating the
   :where() rule in 13b that keeps Safari on iOS from zooming the page on focus. */
.menu-add__title { flex: 1; min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; font-family: inherit; }
.menu-add__portions { width: 82px; padding: 11px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; font-family: inherit; text-align: center; }
.menu-add .btn { flex-shrink: 0; }
.pm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 4px; }
.pm { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink2); font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; display: grid; place-items: center; transition: background .15s, color .15s; }
.pm:hover { color: var(--saffron-deep); border-color: rgba(249, 115, 22, .3); }
.pm:active { background: var(--saffron-soft); color: var(--saffron-deep); }
.pm-row .sm { min-width: 74px; font-variant-numeric: tabular-nums; }
.menu-step { border: 0; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 700; }
.cash-count { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cash-count b { font-weight: 800; font-variant-numeric: tabular-nums; }
.cash-count span { font-size: 12px; color: var(--ink2); }
.cash-count__end { margin-left: auto; }
.inventory-item__alert { color: var(--berry); }
/* A survey's tally: one bar per option, scaled to the most-chosen one. */
.tally { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.tally__label { flex: 0 0 30%; }
.tally__track { flex: 1; height: 14px; border-radius: 6px; background: var(--berry-soft); }
.tally__fill { display: block; width: calc(var(--p, 0) * 1%); height: 100%; border-radius: 6px; background: var(--saffron); }
.tally__count { flex: 0 0 auto; }

/* Announcements, references, swap board. */
.announce__head { display: flex; align-items: center; gap: 10px; }
.announce__ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.announce__body b { display: block; font-size: 15px; margin-bottom: 3px; }
.announce__text { margin-top: 8px; line-height: 1.5; }
.announce__by { margin-top: 8px; font-size: 12px; }
.ref-card__head { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ref-card__title { font-weight: 700; font-size: 15px; }
.ref-card__thumb { display: block; width: 100%; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; margin-top: 10px; }
.recipe__photo { display: block; width: 100%; max-width: 420px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; margin: 10px 0 16px; }
.ref-card__body { margin-top: 8px; line-height: 1.5; }
.swap-card { border-left: 4px solid var(--dept, var(--line)); }
.swap-card__head { display: flex; align-items: center; gap: 8px; }
.swap-card__head b { font-size: 15px; }
.swap-card__when { margin-top: 6px; font-size: 13px; }


/* Cabinet — the person's own seva, each row links into its department module. */
.cabinet-list { list-style: none; display: grid; gap: 10px; margin: 12px 0 0; padding: 0; }
.cabinet-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow);
  padding: 14px; text-decoration: none; color: var(--ink);
}
.cabinet-card__ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: none; }
.cabinet-card__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cabinet-cta { display: block; text-align: center; margin-top: 12px; }

/* The round wells behind a department, a module or a task. They held an emoji before, which
   centred itself; a drawing has to be told to. */
.ico, .dept-mini__ic, .dept-head__ic, .announce__ic, .tasknow__ic, .step__ic, .gallery__blank,
.fire-item__icon, .checklist__mark, .cut-card__tool, .cut-card__ok {
  display: inline-grid;
  place-items: center;
}

/* Segmented control — one control with the views inside it, instead of loose pills that look
   like separate buttons. Used where a screen shows the same list three ways. */
.seg {
  display: inline-flex;
  background: #F5EEE3;
  border-radius: var(--r-tab);
  padding: 3px;
  gap: 2px;
  margin: 10px 0;
  max-width: 100%;
  /* Wrapping, not scrolling. Five filters on a phone do not fit one line, and a strip that
     scrolls sideways hides the last option from someone who has no reason to suspect it is
     there — the prep station's "Мои" was off the edge of the screen. */
  flex-wrap: wrap;
  row-gap: 3px;
}
.seg > a, .seg > button {
  /* Still 44px: this is tapped by someone holding a knife (see the target rule below). */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg > .is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(120, 80, 30, .1);
}

/* ── A dish's composition ──────────────────────────────────────────────────────
   The screen a cook opens to say what goes into a dish and how much of it per plate.
   It used to print the whole catalogue underneath as a hundred and sixteen buttons, with a
   search form above them and a second picker below — three ways to add one line. One row per
   ingredient now, and one way in. */
.comp-scale {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 4px 0 14px;
}
.comp-scale > b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.comp-scale__mode {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink2);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.comp-scale__mode:hover { color: var(--saffron-deep); border-color: rgba(249, 115, 22, .3); }

/* A real table (the owner's prototype, SF-B58): the amount column is the toggle's — it shows
   per portion or the whole dish depending on the qty-mode switch above — while the total and
   cost columns always read the whole dish. The wrapper scrolls sideways on its own so a long
   name or a narrow phone never pushes the dialog itself off the screen. */
.comp-table__scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.comp-table { width: 100%; min-width: 520px; border-collapse: collapse; }
.comp-table th, .comp-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
.comp-table tbody tr:last-child td { border-bottom: 0; }
.comp-table thead th {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2);
}
.comp-table th.num, .comp-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.comp-table__col-num { width: 92px; }
.comp-table__col-action { width: 44px; }

.comp__name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.comp__name b { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.comp__prep {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--ink2);
}
.comp__prep em { font-style: normal; font-size: 11px; color: var(--ink3); margin-left: 4px; }

.comp__edit { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 0; }
.comp__edit input[type="number"] { width: 76px; min-height: 44px; text-align: right; }
.comp__edit select { min-height: 44px; }
.comp__per { font-size: 12.5px; color: var(--ink3); white-space: nowrap; }

.comp__del {
  width: 44px; height: 44px; padding: 0; margin-left: auto;
  display: grid; place-items: center;
  border: 0; border-radius: 9px; background: none;
  color: var(--ink3); cursor: pointer;
}
.comp__del:hover { background: var(--berry-soft); color: var(--berry-deep); }

/* Adding a line: pick it, say how much per plate, add. */
.comp-add { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.comp-add label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.comp-add__product { grid-column: 1 / -1; }
.comp-add__go { grid-column: 1 / -1; }
.comp-add__free { grid-column: 1 / -1; }
.comp-add__free > summary { cursor: pointer; list-style: none; padding: 4px 0; }
.comp-add__free > summary::-webkit-details-marker { display: none; }
.comp-add__free > summary::before { content: "+ "; }
.comp-add__free input { margin-top: 6px; }

/* Filter chips — a row of pill toggles (cutting library, later the KDS). */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink2); text-decoration: none;
  font-size: 13px; font-weight: 600; transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--ink); border-color: var(--ink3); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Cutting library — a gallery of cut cards. */
.cut-grid { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0 0; padding: 0; }
.cut-card { background: var(--surface); border-radius: var(--r-card); box-shadow: none; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
.cut-card__pic { position: relative; aspect-ratio: 4 / 3; background: var(--line); display: grid; place-items: center; }
.cut-card__pic img { width: 100%; height: 100%; object-fit: cover; }
.cut-card__shape { font-weight: 700; color: var(--ink2); }
.cut-card__tool { position: absolute; top: 6px; left: 6px; background: var(--surface); border-radius: 8px; padding: 1px 5px; font-size: 13px; }
.cut-card__ok { position: absolute; top: 6px; right: 6px; background: var(--leaf); color: #fff; border-radius: 999px; width: 20px; height: 20px; display: grid; place-items: center; font-size: 12px; }
.cut-card__body { padding: 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cut-card__acts { display: flex; gap: 6px; padding: 0 10px 10px; }

/* Prep chain — an ordered list of preparation steps for an ingredient. */
.prep-chain { list-style: none; counter-reset: step; display: grid; gap: 8px; margin: 10px 0 0; padding: 0; }
.prep-step { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; }
.prep-step__ic { font-size: 18px; flex: none; }
.prep-step__body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }

/* Prep station — cook/cutter task board with tap-to-cycle step pills. */
.prep-task { border-top: 1px solid var(--line); padding: 10px 0; }
.prep-task:first-of-type { border-top: 0; }
.prep-task__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.prep-task__id { display: flex; align-items: center; gap: 8px; }
.prep-task--done .prep-task__head b { text-decoration: line-through; color: var(--ink3); }
.prep-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.prep-pill { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; }
.prep-pill.is-done { background: var(--leaf-soft); color: var(--leaf-deep); border-color: var(--leaf-soft); }
.prep-pill.is-next { border-color: var(--saffron); color: var(--saffron-deep); }
.prep-task__foot { display: flex; align-items: center; gap: 10px; }

/* Supplier portal — one report row per routed item. */
.report-row { border-top: 1px solid var(--line); padding: 10px 0; }
.report-row:first-of-type { border-top: 0; }
.report-row__title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.report-row__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.report-row__controls select, .report-row__controls input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; }
.report-row__bought { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.btn--tiny { padding: 6px 12px; font-size: 13px; background: var(--ink); color: #fff; }

/* AI sous-chef draft answer. */
.sous-answer { margin-top: 8px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.cabinet-card__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Notification bell + inbox. */
/* Framed bell matching the prototype .iconbtn: 38×38 surface card with an 8px berry dot. */
.notif-bell { position: relative; width: 38px; height: 38px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 18px; }
.notif-bell__dot { position: absolute; top: 8px; right: 8px; min-width: 8px; height: 8px; padding: 0 2px; border-radius: 999px; background: var(--berry); color: #fff; font-size: 9px; font-weight: 800; display: grid; place-items: center; }
.notif-list { list-style: none; display: grid; gap: 8px; margin: 12px 0 0; padding: 0; }
.notif-item__btn { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; font-family: inherit; text-align: left; cursor: pointer; }
.notif-item.is-unread .notif-item__btn { border-color: var(--saffron); }
.notif-item__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.notif-item__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--saffron); flex: none; }

/* Scheduling-conflict banner on a person card. */
.conflict-banner { margin: 6px 0; padding: 6px 10px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-deep); font-size: 12px; font-weight: 700; }

/* ============================================================ 13. PROTOTYPE PARITY == */
/* Departments accordion (prototype .dept) — one screen of expandable dept cards. */
.dept { background: var(--surface); border-radius: var(--r-card); box-shadow: none; margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); }
.dept > summary { list-style: none; }
.dept > summary::-webkit-details-marker { display: none; }
.dept-h { display: flex; align-items: center; gap: 12px; padding: 15px 16px; cursor: pointer; user-select: none; }
.dept-h .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.dept-h__body { flex: 1; }
.dept-h b { font-size: 15.5px; display: block; }
.dept-h .sm { font-size: 12px; color: var(--ink2); margin-top: 1px; }
.dept-body { border-top: 1px solid var(--line); padding: 6px 16px 12px; }
.kitchen-link { display: flex; align-items: center; gap: 8px; padding: 11px 0 4px; font-size: 13px; font-weight: 700; color: var(--saffron-deep); }

/* Full-width dark "approve whole program" bar (prototype .approve-all). */
.approve-all { display: block; width: 100%; padding: 14px; border: 0; border-radius: 16px; background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 800; font-family: inherit; margin: 8px 0 4px; cursor: pointer; text-align: center; }

/* Cashier shift row (prototype .shift) — a time column + name + action. */
.shift { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.shift:first-child { border-top: 0; }
.shift__t { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; width: 82px; flex-shrink: 0; }
.shift__n { flex: 1; }
.shift__n b { font-size: 14px; display: block; }
.shift__n span { font-size: 11.5px; color: var(--ink2); }

/* Berry "find a replacement" banner for a sick person (prototype .replace). */
.replace { display: flex; align-items: center; gap: 8px; margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--berry-soft); color: var(--berry-deep); font-size: 12px; font-weight: 700; }
.replace__btn { margin-left: auto; padding: 7px 12px; border: 0; border-radius: 10px; background: var(--berry); color: #fff; font-size: 12px; font-weight: 800; font-family: inherit; cursor: pointer; }
.kds__offered { font-size: 11px; color: var(--gold); font-weight: 700; margin-top: 4px; }

/* Course heading on the menu and the kitchen display (prototype's kanban column head). */
.course { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 8px; }
.card > .course:first-child { margin-top: 0; }
.card > .course:first-child + .buy-list { margin-top: 6px; }
.course__name { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.course__meta { font-size: 12px; color: var(--ink2); }
.kds__course { grid-column: 1 / -1; margin: 14px 0 0; color: #c9bdac; }
.kds__course .course__meta { color: #a99; }

/* Dragging a dish card between course groups on the menu board. */
.dish[data-course] { touch-action: pan-y; }
.dish.is-dragging { opacity: .5; }
[data-menu-board-target="zone"].is-over .course { outline: 2px dashed var(--saffron); outline-offset: 4px; border-radius: 8px; }

/* Dish photo: fills the menu card's icon tile, and sits above the title on the KDS. */
.ico__pic { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.kds__pic { width: 100%; height: 90px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }

/* Prep progress: how much of the board's cutting and soaking is behind the kitchen. */
.prep-progress { margin: 12px 0; }
.prep-progress__head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress__fill { width: calc(var(--p, 0) * 1%); height: 100%; border-radius: 999px; background: var(--saffron); }
.kds .progress { background: #3a3229; }

/* Presence strip: who else has this board open, and what they are moving right now. */
.presence { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 18px; font-size: 12px; color: var(--ink2); }
.presence__dot { width: 8px; height: 8px; border-radius: 999px; background: var(--leaf); flex-shrink: 0; }
.presence__count { font-weight: 800; color: var(--ink); }
.presence__who {
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px; background: var(--saffron-soft); color: var(--saffron-deep); font-weight: 700;
}
.presence__doing { font-weight: 400; color: var(--ink2); }

/* Event pipeline: the six stages of preparation, each with its own progress. */
.step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.step:first-of-type { border-top: 0; }
.step__ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--saffron-soft); flex-shrink: 0; }
.step__body { flex: 1; min-width: 0; }
.step__body b { display: block; font-size: 14px; }
.step__body .progress { margin-top: 6px; }
.step__pct { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Catalogue chips: one tap drops a product into the dish, and the amount is set on the line. */
.qty-edit { display: inline-flex; align-items: center; gap: 6px; }
.qty-edit input[type="number"] { width: 92px; padding: 6px 8px; font-size: 16px; }

/* Gallery view of the menu: the feast as pictures. */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.gallery__card { display: block; background: var(--surface); border-radius: var(--r-card);
  padding: 10px; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.gallery__card img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; margin-bottom: 6px; }
.gallery__blank { display: grid; place-items: center; height: 110px; border-radius: 10px;
  background: var(--saffron-soft); font-size: 30px; margin-bottom: 6px; }

/* Printable QR badges and the donation table sign. */
.badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.badges > * { min-width: 0; }
.badge-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; text-align: center; }
.badge-card b { display: block; margin-top: 6px; font-size: 13px; }
/* QR is painted by Stimulus after the first layout; reserve its square before connect. */
[data-controller="qr"][data-qr-size-value="140"] { width: 140px; height: 140px; margin-inline: auto; }
[data-controller="qr"][data-qr-size-value="150"] { width: 150px; height: 150px; margin-inline: auto; }
[data-controller="qr"][data-qr-size-value="200"] { width: 200px; height: 200px; margin-inline: auto; }

/* ── Four-language entry, the first-run wizard and the offline queue ───────────── */

/* The other three languages of a name, collapsed: the common case is one box (ADR 0016). */
.translations { margin: 0 0 12px; }
.translations > summary { font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px 0; }

/* The first-run wizard: a banner on Today until the temple can plan a festival. */
.onboarding-banner { display: block; text-decoration: none; }
.checklist__row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist__row:last-child { border-bottom: 0; }
.checklist__mark { width: 22px; text-align: center; font-weight: 800; }
.checklist__row .checklist__title { margin: 0; flex: 1; }

/* A row of counters, used by the import report. */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* How many taps are still waiting for a signal (ADR 0018). Sits under the top bar so it is
   visible from every screen that can queue, and takes no space while there is nothing to say. */
.queue-bar { display: flex; gap: 8px; align-items: center; padding: 8px 16px; font-size: 12px;
             font-weight: 700; background: var(--warn-bg); color: var(--ink); }
.queue-bar[hidden] { display: none; }
.queue-bar__conflict { font-weight: 600; color: var(--danger); }
/* A line ticked with no signal, until the queue reaches the server. */
.is-queued { opacity: .6; }

/* The page shown instead of a browser network error, in all four languages at once. */
.offline { text-align: center; }
.offline__block { padding: 10px 0; border-bottom: 1px solid var(--line); }
.offline__block:last-of-type { border-bottom: 0; }

/* ── Reachable by keyboard and by thumb (ADR 0020) ────────────────────────────── */

/* A visible focus ring, on the ring-friendly saffron rather than the browser default, which
   disappears against a warm background. :focus-visible only, so a mouse tap does not leave a
   halo behind it. */
:focus-visible {
  outline: 3px solid var(--saffron-deep);
  outline-offset: 2px;
  border-radius: 6px;
}
/* The dark kitchen board needs the ring the other way round to be seen at all. */
.kds :focus-visible, .prep-board :focus-visible { outline-color: #FFD9AE; }

/* Anything tapped in a kitchen, by someone holding a knife, is at least 44×44 (WCAG 2.2 AA).
   The stepper buttons, the shopping checkboxes and the prep pills were smaller. */
.btn, .pm, .prep-pill, .kds__btn, .chip {
  min-height: 44px;
  min-width: 44px;
}
.btn--tiny { min-height: 36px; box-shadow: none; }

/* Icon-only action: a square the size of a fingertip, the word left to the label. */
.btn--icon {
  width: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  color: var(--ink2);
  box-shadow: none;
}
.btn--icon:hover { background: var(--saffron-soft); color: var(--saffron-deep); border-color: rgba(249, 115, 22, .22); }
.btn--danger { background: var(--berry-soft); color: var(--berry-deep); border-color: rgba(225, 29, 72, .18); box-shadow: none; }
.btn--icon.btn--danger:hover { background: var(--berry-soft); color: var(--berry-deep); border-color: rgba(225, 29, 72, .38); }
/* The primary action: the one solid saffron control on a card full of white buttons. After the
   other modifiers so that a small primary button ("btn btn--primary btn--tiny") stays saffron. */
.btn--primary { background: var(--saffron-deep); color: #fff; border-color: transparent; }

/* The price line behind a catalogue product: what it cost last time, and the dates before
   that. Folded away by default — the buyer wants one number, the coordinator wants the run. */
.price-line { margin-top: 4px; }
.price-line > summary { cursor: pointer; list-style: none; }
.price-line > summary::-webkit-details-marker { display: none; }
.price-line > summary::before { content: "📈 "; }
.price-line__list { margin: 6px 0 0; padding: 0 0 0 18px; list-style: none; font-size: 12.5px; }
.price-line__list li { display: flex; justify-content: space-between; gap: 12px; max-width: 220px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.price-line__list b { font-variant-numeric: tabular-nums; }

/* A <button> does not inherit its colour — every browser hands it one of its own. That was
   harmless while every glyph on a button was an emoji carrying its own colour; a line drawing
   takes the colour of the text it sits in, so on any button that never set one it came out
   white and vanished. Zero specificity, so a button that does name a colour still wins. */
:where(button) { color: inherit; }

/* ===================================================== 13b. CONTROLS ======= */
/*
 * Form controls are styled by element, not by class: a screen that renders a select should
 * not have to remember a class name for it to look like the rest of the application, and the
 * next screen somebody adds is right by default. The selectors sit inside :where() so they
 * carry no specificity at all — every component class already in this file (.menu-add__title,
 * .auth__form input, .menu-add__portions) still wins wherever it sets something of its own.
 */
:where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="image"]):not([type="range"]),
  select,
  textarea
) {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  /* 16px is not a taste decision. Safari on iOS zooms the page whenever focus lands on a
     control whose text is smaller, and the zoom does not come back on blur — the sevak is
     left on a page one and a half times too big, mid-task, and has to pinch their way out.
     Every focusable control in the app is therefore at least 16px. */
  font-size: 16px;
  line-height: 1.35;
  min-height: 44px;
  max-width: 100%;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}

:where(textarea) { min-height: 96px; resize: vertical; }

/* The stacked label is the shape every form in this application is built from: a caption on
   one line, the control filling the next. */
:where(
  label > input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
  label > select,
  label > textarea,
  label > .combo
) {
  display: block;
  width: 100%;
  margin-top: 4px;
}

/* A chevron of our own, for the moment before the combobox takes over and for anything that
   opts out of it with data-combobox-skip. */
:where(select) {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%237A6A58' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

:where(input, select, textarea):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--saffron-soft);
}
:where(input, select, textarea):disabled {
  background: var(--bg);
  color: var(--ink3);
  cursor: not-allowed;
}
:where(input, textarea)::placeholder { color: var(--ink3); }

/* Tick boxes and radios: the browser's own control, in the brand colour, at a size a finger
   finds. */
:where(input[type="checkbox"], input[type="radio"]) {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  accent-color: var(--saffron);
  cursor: pointer;
}

/* File pickers: the button is ours, the file name stays the browser's. */
:where(input[type="file"]) { font-family: inherit; font-size: 16px; color: var(--ink2); max-width: 100%; }
:where(input[type="file"])::file-selector-button {
  margin-right: 10px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--saffron-soft);
  color: var(--saffron-deep);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* No browser spinners on number fields — where stepping matters the app draws its own
   steppers (.pm), and the tiny arrows are a mis-tap waiting to happen in a kitchen. */
:where(input[type="number"]) { -moz-appearance: textfield; }
:where(input[type="number"])::-webkit-outer-spin-button,
:where(input[type="number"])::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Combobox: the select, with a search box (combobox_controller.js) ── */

/* The native select stays in the page — it is what the form posts and what validation points
   at — but it is taken out of sight rather than out of the document, so a required field can
   still be focused when the browser complains about it. */
/* select.…, not .… alone: whatever sizes the visible control (.locale-switch select gives it
   a 118px floor) would otherwise size this one too, and a 118px box parked at the right edge
   of a phone screen is a horizontal scrollbar on every page. Out of sight means no size. */
select.combo__native {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  min-width: 0;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}

.combo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.combo:focus-visible { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-soft); }
.combo[aria-expanded="true"] { border-color: var(--saffron); }
.combo:disabled { background: var(--bg); color: var(--ink3); cursor: not-allowed; }
:where(.menu-add, .row, .screen__head) .combo { width: auto; min-width: 132px; }

/* A combobox that shows a drawing instead of what is chosen: square, the size of a fingertip,
   no value text and no chevron. The list it opens is the ordinary one. It has to come after
   the .combo rules it overrides — one class each, so the later one is the one that counts. */
.combo--face {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
  gap: 0;
  color: var(--ink2);
}
.combo--face:hover { color: var(--saffron-deep); border-color: rgba(249, 115, 22, .35); }
.combo--face[aria-expanded="true"] { color: var(--saffron-deep); }
.combo__face { display: grid; place-items: center; }

/* On a phone the composer's four controls cannot share one line and still leave room to type
   a dish name: the name takes the first line, the course, the count and the button the next. */
@media (max-width: 699px) {
  .menu-add { flex-wrap: wrap; }
  .menu-add__title { flex: 1 1 100%; }
}

.combo__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo__value.is-blank { color: var(--ink3); }
/* A status pill, colour set inline from the option's own data-style — the dot is a plain
   currentColor circle, so it always matches without a second color to keep in sync. */
.combo--pill { border-radius: 999px; box-shadow: none; }
.combo--pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentcolor; flex-shrink: 0; }
.combo--pill .combo__chev { display: none; }
.combo__chev {
  width: 12px;
  height: 8px;
  flex-shrink: 0;
  background: currentcolor;
  opacity: .45;
  transition: transform .15s;
  clip-path: polygon(0 0, 12px 0, 6px 8px);
}
.combo[aria-expanded="true"] .combo__chev { transform: rotate(180deg); }

/* The panel lives on <body> and is positioned against the trigger, because the cards these
   controls sit in clip their overflow and a nested panel would be cut off at the card edge. */
.combo-panel {
  position: fixed;
  z-index: 200;
  margin: 0;
  padding: 6px;
  /* A ceiling. The controller narrows it further to whatever room the visible window has,
     which on a phone with the keyboard up is a good deal less than this. */
  max-height: 320px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-hi);
  overflow: hidden;
}
.combo-panel:popover-open { display: flex; }
.combo-panel[hidden] { display: none; }

.combo-panel__search {
  flex-shrink: 0;
  margin-bottom: 6px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font: inherit;
  /* The one field that opens with the list. At 14.5px iOS zoomed the page the moment the
     panel appeared, and the screen behind the list lurched. */
  font-size: 16px;
  min-height: 44px;
}
.combo-panel__search:focus-visible { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-soft); }

.combo-panel__list { margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.combo-panel__opt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 14.5px;
  cursor: pointer;
}
.combo-panel__opt[hidden] { display: none; }
.combo-panel__opt.is-blank { color: var(--ink3); }
.combo-panel__opt.is-active { background: var(--saffron-soft); color: var(--saffron-deep); }
.combo-panel__opt[aria-selected="true"] { font-weight: 700; }
.combo-panel__opt[aria-selected="true"]::after { content: "✓"; margin-left: auto; color: var(--saffron-deep); }
.combo-panel__opt[aria-disabled="true"] { color: var(--ink3); cursor: not-allowed; }
.combo-panel__empty { margin: 10px; font-size: 14px; color: var(--ink2); text-align: center; }

/* ===================================================== 14. RESPONSIVE ====== */
/*
 * The shell above is a phone: a 430px column that is also what the installed PWA shows.
 * This section grows it into a real desktop application — a persistent side navigation,
 * a full-width top bar, roomier type and grids that use the width they are given — without
 * changing a single line of markup.
 *
 * Everything here is scoped away from `body.hotwire-native`: the iOS and Android shells
 * supply their own top and tab bars and must stay phone-shaped whatever the window size
 * (an iPad in landscape is still the native app).
 */

/* ── Tablet ── a wider column and roomier gutters; the tab bar stays at the bottom. */
@media (min-width: 700px) {
  :root { --stage-max: 680px; --gutter: 22px; }
}

/* ── Desktop ── the bottom tab bar becomes a side rail and the column becomes a window. */
@media (min-width: 1024px) {
  :root { --gutter: 24px; --sidebar: 214px; --topbar-h: 52px; }

  body:not(.hotwire-native) .stage {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) auto 1fr;
    grid-template-areas: 
      "nav topbar"
      "nav queue"
      "nav main";
    align-items: start;
    max-width: none;
    box-shadow: none;
    min-height: 100dvh;
    width: 100%;
  }

  /* @hide_community_nav (supplier portal, kitchen KDS wall board — ADR 0037) drops .tabbar
     from the DOM entirely; without this the grid still reserves its column and the content
     just sits in the remaining space with a sidebar-shaped gap on the left. */
  body:not(.hotwire-native) .stage:not(:has(.tabbar)) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "topbar"
      "queue"
      "main";
  }

  body:not(.hotwire-native) .topbar {
    grid-area: topbar;
    min-height: var(--topbar-h);
    padding: 6px 24px;
    border-bottom: 1px solid var(--line);
    background: #fcfbf9;
    box-shadow: none;
  }
  body:not(.hotwire-native) .topbar__logo { display: none; }
  body:not(.hotwire-native) .topbar__titles { max-width: min(720px, 65vw); }
  body:not(.hotwire-native) .topbar__title { font-size: 13px; font-weight: 700; }
  body:not(.hotwire-native) .topbar__sub { font-size: 10.5px; }
  body:not(.hotwire-native) .topbar__back { width: 34px; height: 34px; border: 0; }
  body:not(.hotwire-native) .notif-bell { width: 34px; height: 34px; border-radius: 8px; box-shadow: none; border: 1px solid var(--line); }
  body:not(.hotwire-native) .topbar__me { width: 38px; height: 38px; }
  body:not(.hotwire-native) .queue-bar { grid-area: queue; }

  /* The tab bar, rotated into a rail: same markup, same five destinations, read top to
     bottom with the label beside the icon instead of under it. */
  body:not(.hotwire-native) .tabbar {
    grid-area: nav;
    align-self: start;
    position: sticky;
    transform: none;
    width: var(--sidebar);
    max-width: none;
    height: 100dvh;
    align-content: start;
    flex-direction: column;
    gap: 2px;
    padding: 18px 12px 14px;
    background: #f3f1ed;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    inset: 0 auto auto 0;
    border: 0;
    border-right: 1px solid #e3ddd5;
    overflow-y: auto;
    z-index: 60;
  }
  body:not(.hotwire-native) .desktop-nav__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1px 9px 19px;
    color: var(--ink);
  }
  .desktop-nav__mark {
    width: 34px;
    height: 34px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: var(--saffron-deep);
  }
  .desktop-nav__brand strong { display: block; font-size: 21px; line-height: 1.05; letter-spacing: -.8px; }
  .desktop-nav__brand small {
    display: block;
    margin-top: 4px;
    color: var(--ink3);
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
  }
  body:not(.hotwire-native) .desktop-nav__event {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 50px;
    margin: 0 0 16px;
    padding: 8px 9px;
    border: 1px solid #e1dcd4;
    border-radius: 9px;
    background: #fbfaf8;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
  }
  body:not(.hotwire-native) .desktop-nav__event > span { min-width: 0; flex: 1; }
  body:not(.hotwire-native) .desktop-nav__event b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body:not(.hotwire-native) .desktop-nav__event small {
    display: block;
    margin-top: 3px;
    color: var(--ink3);
    font-weight: 500;
  }
  body:not(.hotwire-native) .desktop-nav__label {
    display: block;
    margin: 10px 9px 6px;
    color: var(--ink3);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 1.15px;
    text-transform: uppercase;
  }

  body:not(.hotwire-native) .tab {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    min-height: 38px;
    font-weight: 550;
    color: #706d68;
  }
  body:not(.hotwire-native) .tab__icon { font-size: 20px; }
  body:not(.hotwire-native) .tab .tab__icon svg { width: 17px; height: 17px; }
  body:not(.hotwire-native) .tab:hover { background: var(--saffron-soft); color: var(--saffron-deep); }
  body:not(.hotwire-native) .tab.is-active { background: #f9e8db; color: #b93f09; font-weight: 750; }
  body:not(.hotwire-native) .tab.is-active .tab__icon { transform: none; }

  /* The departments under "Отделы", on every screen, so the rows never move. Indented and
     tied to the parent by a rule down the left edge; the one you are standing in is filled in. */
  body:not(.hotwire-native) .tab--child {
    display: flex;
    margin: 1px 0 1px 18px;
    padding: 7px 9px;
    border-left: 2px solid var(--line);
    border-radius: 0 8px 8px 0;
    font-size: 11.5px;
    min-height: 34px;
    border-left-color: #ddd7ce;
  }
  body:not(.hotwire-native) .tab--child .tab__icon { font-size: 16px; }
  body:not(.hotwire-native) a.tab--child:hover { background: var(--saffron-soft); color: var(--saffron-deep); }
  body:not(.hotwire-native) .tab--child.is-here {
    border-left-color: var(--saffron);
    background: var(--saffron-soft);
    color: var(--saffron-deep);
    font-weight: 700;
  }

  /* The rail already says it — the top bar would only repeat itself. */
  body:not(.hotwire-native) .topbar__module { display: none; }

  /* No fixed bar at the bottom of the window any more, so no well to leave for it. */
  body:not(.hotwire-native) main {
    grid-area: main;
    padding: 18px 24px 54px;
    min-width: 0;
  }

  /* Type and controls at desktop size rather than thumb size. */
  body:not(.hotwire-native) .screen__title { font-size: 25px; margin: 6px 0 14px; letter-spacing: -.8px; }
  body:not(.hotwire-native) .h-section b { font-size: 20px; }

  /* A form field has no reason to be 1200px wide. */
  body:not(.hotwire-native) main input[type="text"],
  body:not(.hotwire-native) main input[type="email"],
  body:not(.hotwire-native) main input[type="password"],
  body:not(.hotwire-native) main input[type="number"],
  body:not(.hotwire-native) main input[type="search"],
  body:not(.hotwire-native) main input[type="date"],
  body:not(.hotwire-native) main input[type="time"],
  body:not(.hotwire-native) main input[type="datetime-local"],
  body:not(.hotwire-native) main select,
  body:not(.hotwire-native) main textarea,
  body:not(.hotwire-native) main .combo { max-width: 560px; }

  /* Grids that were pinned to two phone-width columns follow the window instead. */
  body:not(.hotwire-native) .bento { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
  body:not(.hotwire-native) .gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  body:not(.hotwire-native) .kds__grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

  /* The prep station's task card stacked name/pills/claim three deep (~180px a line) even
     though a desktop window has room to spare beside it — 240 lines of that is twice the
     scroll of the 400-row procurement list next to it (SF-B118). One row: name+qty, then the
     step pills, then the claim/release button pushed to the far edge. */
  body:not(.hotwire-native) .prep-task {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 8px 0;
  }
  body:not(.hotwire-native) .prep-task__head { flex: 1 1 220px; min-width: 0; }
  body:not(.hotwire-native) .prep-pills { flex: 2 1 320px; margin: 0; }
  body:not(.hotwire-native) .prep-task__foot { flex: 0 0 auto; margin-left: auto; }

  /* A stacked form is right on a phone and absurd on a desktop, where it becomes one field
     per screen-width line. Two columns, and a submit button the size of its own words.
     The sign-in card keeps its narrow single column — it is inside .auth. */
  body:not(.hotwire-native) .auth__form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 18px;
    align-items: end;
    max-width: 860px;
  }
  body:not(.hotwire-native) .auth__form > .flash,
  body:not(.hotwire-native) .auth__form > .row { grid-column: 1 / -1; }
  body:not(.hotwire-native) .auth__form > [type="submit"] { grid-column: 1 / -1; width: fit-content; }

  /* The sign-in card is the exception: one narrow column, the way a sign-in should be. */
  body:not(.hotwire-native) .auth .auth__form {
    display: flex;
    flex-direction: column;
    max-width: none;
  }
  body:not(.hotwire-native) .auth .auth__form > [type="submit"] { width: 100%; }

  /* A list of rows reads better at arm's length than at monitor's length: the delete button
     stays beside the name it deletes instead of at the far edge of the window. */
  body:not(.hotwire-native) .buy-list { max-width: 760px; }

  /* A screen's actions belong beside each other on the right, not flung to both edges. */
  body:not(.hotwire-native) .screen__head { justify-content: flex-start; }
  body:not(.hotwire-native) .screen__head > :nth-child(2) { margin-left: auto; }

  /* A call to action is a button, not a banner two thirds of a metre wide. */
  body:not(.hotwire-native) .cabinet-cta { width: fit-content; margin-inline: auto; }

  body:not(.hotwire-native) .card,
  body:not(.hotwire-native) .sgroup,
  body:not(.hotwire-native) .person,
  body:not(.hotwire-native) .dept { border-radius: 10px; }

  body:not(.hotwire-native) .board__layout { gap: 10px; }
  body:not(.hotwire-native) .dish { border-radius: 10px; box-shadow: none; border-color: var(--line); }
  body:not(.hotwire-native) .summary-bar { background: #fcfbf9; backdrop-filter: none; }
}

/* ── Wide desktop ── the reading column stops growing; cards get a second column. */
@media (min-width: 1400px) {
  body:not(.hotwire-native) .bento { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

@media (min-width: 1440px) {
  body:not(.hotwire-native) main { padding-inline: 28px; }
}

/* A pointer is not a fingertip: the 44px minimum stays, but hover feedback is worth having. */
@media (hover: hover) and (pointer: fine) {
  .card a:hover b, .step:hover .step__body b { text-decoration: underline; text-underline-offset: 3px; }
  .btn:hover { filter: brightness(1.05); }
}

/* ── The menu board (SF-168) ──────────────────────────────────────────────────────────────
   A dense card is two rows: name, cook and tools; status, price, time and portions. Twelve
   dishes fit a laptop screen without scrolling, which is the point. */
.board { position: relative; }
.summary-bar {
  z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 0 -8px 12px; padding: 8px 8px;
  background: var(--glass); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hairline);
}
.guests__field { display: inline-flex; align-items: center; gap: 6px; }
.guests__field input {
  width: 74px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); font: inherit; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums;
}
.guests__field small, .summary__item small { font-size: 11px; color: var(--ink2); font-weight: 600; }
.summary-shell { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-width: 0; }
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
.summary__item { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.summary__item b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.summary__item em { font-style: normal; color: var(--berry-deep); }
.summary__chip { margin-left: 6px; min-height: 20px; padding: 2px 8px; font-size: 10px; }
.summary__dots { display: inline-flex; gap: 3px; margin-left: 6px; }
.summary__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.summary__dot.is-filled { background: #44785c; }
.summary-bar__help { margin-left: 4px; }
/* The reference's single attention bar (SF-B71): a count, a plain-text breakdown, one action
   that really hides everything without an issue — kitchen-table#filter does that hiding. */
.attn-bar {
  display: flex; align-items: center; gap: 8px; min-height: 34px; margin: 0 0 10px; padding: 6px 12px;
  border: 1px solid #eed5bf; border-radius: 8px; background: #fff2e8; color: #8c4f2d; font-size: 11px;
}
.attn-bar__breakdown { color: #a1734f; }
.attn-bar__show { margin-left: auto; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

.board__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.board__main { min-width: 0; }
/* As many lanes to a row as fit at a width a dish card is still readable at, and no more.
   Counting the columns by breakpoint instead — two from a tablet, four from a laptop — is
   what put four 200px lanes on a 1100px laptop and drew 330px cards across all of them. The
   card is what has a minimum width; the number of lanes follows from it. min() so that a
   360px phone gets one lane rather than a 244px column and a sideways scrollbar. */
.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(244px, 100%), 1fr)); gap: 12px; }
.lane { min-width: 0; }
.lane .course { margin: 0 0 8px; }
/* minmax(0, 1fr), not the implicit auto: a card whose chips do not wrap has a min-content
   width of its own, and an auto track would grow to it and push the card out of its lane. */
.lane__cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-height: 40px; }

.dish {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 12px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid transparent;
  outline: none;
}
.dish:focus-visible { border-color: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-soft), var(--shadow); }
/* Wrapping, so that the row of tools drops below the name rather than out of the card: four
   34px targets and a thumbnail do not fit a lane on a laptop, and a target that is shrunk to
   fit is worse than one on the next line. */
.dish__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.dish__thumb { width: 36px; height: 36px; border-radius: 10px; cursor: grab; background: var(--saffron-soft); }
.dish__title { flex: 1 1 120px; min-width: 0; display: grid; gap: 2px; }
.dish__name { font-weight: 800; font-size: 15px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.dish__name:hover { color: var(--saffron-deep); }
.dish__meta { font-size: 11.5px; color: var(--ink2); }
.dish__rename-input {
  width: 100%; padding: 6px 8px; border: 1px solid var(--saffron); border-radius: 8px;
  font: inherit; font-weight: 800; font-size: 15px; background: var(--surface);
}
.dish.is-renaming .dish__name { display: none; }
.dish__side { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.dish__side form { margin: 0; }
.dish__cook {
  width: 34px; height: 34px; border-radius: 50%; border: 1px dashed var(--ink3); background: transparent;
  display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--ink2);
}
.dish__cook:not(.is-empty) { border: 0; }
.ava--mini { width: 28px; height: 28px; font-size: 11px; }
.dish__tools { display: flex; gap: 4px; }
.dish__tools .btn--icon { width: 34px; height: 34px; min-height: 34px; padding: 0; }
@media (hover: hover) {
  /* A mouse sees the tools when it is over the card; a finger always sees them. Hidden, not
     removed: a layout that shifts under the pointer puts the wrong button under a click. */
  .dish__tools { visibility: hidden; opacity: 0; transition: opacity .15s; }
  .dish:hover .dish__tools, .dish:focus-within .dish__tools { visibility: visible; opacity: 1; }
}
.dish__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dish__foot .badge { cursor: pointer; border: 0; font-family: inherit; }
.dish__foot > form { margin: 0; }
.chip--price { color: var(--leaf-deep); background: var(--leaf-soft); border-color: transparent; }
.chip--attn { color: var(--gold-deep); background: var(--warn-bg); border-color: transparent; }
.dish__foot .chip { min-height: 30px; padding: 3px 9px; font-size: 11.5px; gap: 4px; }
/* The inline status/cook selects and time input are native controls whose intrinsic
   min-content width (a long crew name, a long status label) can exceed a narrow lane's
   card and force the whole card to overflow, since a flex item does not shrink below its
   own min-content width by default. A capped width + ellipsis keeps every card's own box
   its own box, however long the content (SF-B53 follow-up: same failure, new fields). */
.dish__status-form, .dish__cook-form, .dish__time-form { min-width: 0; max-width: 100%; }
.dish__status-select, .dish__cook-select {
  max-width: 118px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dish__time-input { width: 84px; min-width: 0; }
.dish__price { display: flex; flex-direction: column; align-items: flex-end; gap: 0; min-width: 0; }
.dish__unit-price { font-size: 10px; color: var(--ink2); }
.dish__total-price { font-weight: 800; font-size: 11.5px; }
/* Same bargain in the second row: the mode chip goes above the stepper when the lane is
   narrow, and the stepper keeps its full-size buttons. */
.dish__portions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; margin-left: auto; }
.dish__portions form { margin: 0; }
.dish__mode {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink2); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.dish__mode--auto { color: var(--violet-deep); background: var(--violet-soft); border-color: transparent; }
.dish__input {
  width: 64px; padding: 5px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font: inherit; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums;
}
.dish__input.is-auto { color: var(--violet-deep); }
.dish__input:focus-visible { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-soft); }

/* The activity rail: a native disclosure that is one line closed and the feed open. */
.feed-rail { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 4px 12px; }
.feed-rail > summary { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--ink2); list-style: none; }
.feed-rail > summary::-webkit-details-marker { display: none; }
.feed-rail[open] > summary { color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.feed { display: grid; gap: 8px; padding: 4px 0 10px; }
.feed__item { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; }
.feed__body { min-width: 0; }
.feed__body time { display: block; font-size: 11px; color: var(--ink3); }

/* Undo instead of confirm. */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h, 72px) + 12px); transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 12px; max-width: min(92vw, 420px); padding: 10px 14px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(36, 26, 18, .25);
}
.toast[hidden] { display: none; }
.toast__undo { border: 0; background: transparent; color: #FDBA74; font: inherit; font-weight: 800; cursor: pointer; padding: 6px 4px; }

/* The key list. */
.shortcuts { border: 0; border-radius: 16px; padding: 18px 20px; max-width: 360px; box-shadow: var(--shadow); }
.shortcuts::backdrop { background: rgba(36, 26, 18, .45); }
.shortcuts h2 { margin: 0 0 12px; font-size: 16px; }
.shortcuts dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 14px; font-size: 13px; align-items: center; }
.shortcuts dt { white-space: nowrap; }
.shortcuts dd { margin: 0; color: var(--ink2); }
.shortcuts kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--bg); font: 600 12px/1.5 inherit; text-align: center; }

@media (min-width: 700px) {
  /* Sticky from a tablet up; on a phone the bar is three lines and would eat the screen. */
  .summary-bar { position: sticky; top: 0; }
}
@media (hover: none) {
  /* Keys need a keyboard. */
  .summary-bar__help { display: none; }
}
@media (min-width: 1100px) {
  .board__layout { grid-template-columns: minmax(0, 1fr) auto; }
  .feed-rail { position: sticky; top: 64px; width: 48px; overflow: hidden; }
  .feed-rail > summary span { display: none; }
  .feed-rail[open] { width: 260px; }
  .feed-rail[open] > summary span { display: inline; }
}

/* ── The dish dialog (SF-169) ─────────────────────────────────────────────────────────────
   A native dialog: head, a scrolling body of sections, a footer that stays put. Full screen
   on a phone, a sheet on a desktop. */
.dish-dialog {
  width: min(960px, 96vw); max-height: 92vh; padding: 0; border: 0; border-radius: 18px;
  background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px rgba(36, 26, 18, .35);
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden;
}
.dish-dialog:not([open]) { display: none; }
.dish-dialog::backdrop { background: rgba(36, 26, 18, .45); backdrop-filter: blur(2px); }
.dish-dialog__head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.dish-dialog__title { flex: 1 1 200px; min-width: 0; display: grid; gap: 2px; }
.dish-dialog__title strong { font-size: 18px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dish-dialog__title small { font-size: 12px; color: var(--ink2); }
.dish-dialog__head form { margin: 0; }
.dish-dialog__flash:empty { display: none; }
.dish-dialog__flash { flex: 1 1 100%; }
.dish-dialog__flash .flash { margin: 0; }
.dish-dialog__body { overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px; display: grid; gap: 12px; align-content: start; }
.dish-dialog__section { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; }
.dish-dialog__heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; }
.dish-dialog__heading--inner { margin-top: 14px; }
.dish-dialog__heading h2 { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.dish-dialog__heading span { font-size: 12px; color: var(--ink2); margin-left: auto; }
.dish-dialog__footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px;
  background: var(--surface); border-top: 1px solid var(--line);
}
.dish-dialog__footer form { margin: 0; }
.dish-dialog__done { margin-left: auto; }

/* Basics/composition vs. notes tabs (SF-B104): a radio pair + :checked ~ sibling, no JS. */
.dish-dialog__tablist { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.dish-dialog__tab { padding: 8px 14px; font-size: 13px; font-weight: 700; color: var(--ink2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
#dish_tab_basics:checked ~ .dish-dialog__tablist label[for="dish_tab_basics"],
#dish_tab_notes:checked ~ .dish-dialog__tablist label[for="dish_tab_notes"] { color: var(--ink); border-bottom-color: var(--saffron); }
.dish-dialog__tab-panel { display: grid; gap: 12px; }
#dish_tab_notes:checked ~ .dish-dialog__tab-panel[data-tab-panel="basics"] { display: none; }
#dish_tab_basics:checked ~ .dish-dialog__tab-panel[data-tab-panel="notes"] { display: none; }

.dialog-field--split .dialog-field__pair { display: flex; gap: 6px; }
.dialog-field__pair input { flex: 1 1 0; min-width: 0; }

.dish-form { display: grid; gap: 12px; }
.dish-form input[type="submit"] { justify-self: start; }
.dish-form__photo { display: none; }
.dish-form__drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 120px; padding: 10px; border: 1px dashed var(--saffron); border-radius: 14px; background: var(--saffron-soft);
  font-size: 12px; font-weight: 700; color: var(--saffron-deep); cursor: pointer;
}
.dish-form__drop input[type="file"] { width: 1px; height: 1px; opacity: 0; position: absolute; }
.dish-form__drop .ico { background: var(--saffron-soft); }
.dish-form__pic { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.dish-form__fields { display: grid; gap: 10px; }
.dish-form__names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dish-form__meta, .dish-form__serving { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.dialog-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dialog-field > span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); }
.dialog-field input, .dialog-field select {
  min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); font: inherit;
}
.dish-form__flag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px; border-radius: var(--r-ctl);
  background: var(--leaf-soft); color: var(--leaf-deep); font-size: 13px; font-weight: 700; align-self: end;
}
.dish-form__flag.is-off { background: var(--warn-bg); color: var(--gold-deep); }
.dish-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.dish-facts dt { color: var(--ink2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; align-self: center; }
.dish-facts dd { margin: 0; }

.qty-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-left: auto; }
.qty-mode button { min-height: 32px; padding: 4px 12px; border: 0; background: var(--surface); color: var(--ink2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.qty-mode button[aria-pressed="true"] { background: var(--violet-soft); color: var(--violet-deep); }

@media (min-width: 700px) {
  .dish-form { grid-template-columns: 160px 1fr; }
  .dish-form__photo { display: block; }
  .dish-form__drop { min-height: 100%; }
  .dish-form > .dish-dialog__heading--inner, .dish-form > .dish-form__serving, .dish-form > input[type="submit"] { grid-column: 1 / -1; }
  .dish-form__names { grid-template-columns: repeat(4, 1fr); }
  .dish-form__meta { grid-template-columns: repeat(4, 1fr); }
  .dish-form__serving { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 699px) {
  .dish-dialog { width: 100vw; height: 100dvh; max-height: none; max-width: none; border-radius: 0; }
  .dish-dialog__footer .btn { flex: 1 1 auto; justify-content: center; }
  .dish-dialog__done { flex: 1 1 100%; }
  .dish-dialog__done .btn { width: 100%; }
}

/* The meals of the board (SF-170). */
.meal-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.meal-tabs__add { margin: 0; }
.meal-tabs__add select { min-height: 40px; }

/* Two people on one dish (SF-170): both values, nothing overwritten. Two columns, not a
   one-line diff (SF-B104) — the mobile reference draws this as its own "Конфликт изменений"
   screen; here it's the same comparison inline on the board. */
.conflict-banner--choice { display: grid; gap: 10px; font-weight: 600; padding: 10px 12px; }
.conflict-banner--choice form { margin: 0; }
.conflict-banner__head { display: flex; align-items: center; gap: 8px; }
.conflict-banner__compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.conflict-banner__column { background: var(--surface); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.conflict-banner__column h3 { margin: 0 0 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--gold-deep); }
.conflict-banner__column dl { margin: 0; display: grid; gap: 2px; }
.conflict-banner__column dt { font-size: 10px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .02em; }
.conflict-banner__column dd { margin: 0 0 4px; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.conflict-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 480px) { .conflict-banner__compare { grid-template-columns: 1fr; } }

/* The thread on a dish. */
.thread { display: grid; gap: 10px; margin-bottom: 10px; }
.thread__note { display: flex; align-items: flex-start; gap: 8px; }
.thread__body { flex: 1 1 auto; min-width: 0; font-size: 13.5px; }
.thread__body time { margin-left: 6px; font-size: 11px; color: var(--ink3); }
.thread__body p { margin: 2px 0 0; overflow-wrap: anywhere; }
.thread__add { display: flex; gap: 8px; }
.thread__add input[type="text"] {
  flex: 1; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--r-ctl); background: var(--surface); font: inherit;
}

/* ── The collaborative layer (SF-171) ─────────────────────────────────────────────────────
   Pointers, the card somebody is holding, the field somebody is typing in. None of it is
   written down; all of it is over the board rather than in it. */
.cursor-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.live-cursor { position: absolute; top: 0; left: 0; display: flex; align-items: flex-start; gap: 2px; transition: transform .08s linear; }
.live-cursor__name {
  padding: 1px 7px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 700;
  white-space: nowrap; transform: translateY(10px);
}
.presence__who--follow { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.presence__who--follow[aria-pressed="true"] { background: var(--ink); color: #fff; }
.kitchen-workspace #past_event_options { display: block; min-height: 44px; }
.dish.is-held { box-shadow: 0 0 0 2px var(--held-colour, var(--saffron)), var(--shadow); }
.dish__held {
  position: absolute; top: -9px; left: 10px; padding: 1px 8px; border-radius: 999px;
  background: var(--held-colour, var(--saffron)); color: #fff; font-size: 10.5px; font-weight: 800;
}
.dish.is-held .dish__held::before { content: "✋ "; }
/* Held by a colleague (presence_controller#markFieldLock): the dialog's own fields and the
   composition rows' amount cells, each outranked by the scope so the field's own box loses. */
.dialog-field .is-locked, .comp__edit .is-locked { border-color: var(--violet); background: var(--violet-soft); cursor: not-allowed; }

/* The recipe book (SF-172). */
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.recipe { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.recipe__head { display: grid; gap: 2px; }
.recipe__head b { font-size: 15px; overflow-wrap: anywhere; }
.recipe__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.recipe__actions form { margin: 0; }

/* ============================================================ 13c. TONES === */
/* A soft tint with its deep-tone text, for wells, badges and chips — a department's colour,
   a status, a task's mood. The view names the family; the palette stays here. Last among the
   components so a tone outranks a component's own default background and colour. */
.tone--saffron { background: var(--saffron-soft); color: var(--saffron-deep); }
.tone--gold { background: var(--gold-soft); color: var(--gold-deep); }
.tone--leaf { background: var(--leaf-soft); color: var(--leaf-deep); }
.tone--berry { background: var(--berry-soft); color: var(--berry-deep); }
.tone--sky { background: var(--sky-soft); color: var(--sky-deep); }
.tone--violet { background: var(--violet-soft); color: var(--violet-deep); }
.tone--muted { background: var(--line); color: var(--ink3); }
.tone--plain { background: var(--line); color: var(--ink2); }

/* prefers-reduced-motion (SF-248): one rule for every transition and animation in the sheet,
   present and future, rather than hunting each one down by hand. Like [hidden] above, this is
   a reset whose whole purpose is to beat every other rule, so it is the other place
   !important is allowed (docs/FRONTEND_STANDARD.md §1). */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================ 14. PRINT ==== */
/* Last, so that every screen's own display rule is already behind it. */
@media print {
  .topbar, .tabbar, .no-print { display: none; }
  main { padding: 0; }
  /* The kitchen display is a dark screen on purpose; printed it is a solid black page with no
     contrast at all, and its own action buttons print nothing but ink nobody can act on
     (SF-B94). Reset it to the same light/print theme every other printable screen uses. */
  .kds, .kds__card { background: #fff; color: #1a1a1a; }
  .kds__event, .kds__time, .kds__portions, .kds__empty, .kds__course, .kds__course .course__meta { color: #444; }
  .kds__btn, .kds__toggle { display: none; }
}
