/*
 * 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.
 */

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

  /* Base surfaces */
  --bg: #FBF7F0;
  --surface: #FFFFFF;
  --glass: rgba(255, 252, 246, .78);

  /* Ink / text */
  --ink: #241A12;
  --ink2: #7A6A58;
  /* Darkened from #B7A996, which read at 2.3:1 on white — below even the large-text bar. */
  --ink3: #847461;

  /* Saffron (primary brand) */
  --saffron: #F97316;
  --saffron-deep: #C2410C;
  --saffron-soft: #FFF1E4;

  /* 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: #F0E7DA;
  --hairline: rgba(240, 231, 218, .7);

  /* Radii */
  --r-card: 20px;
  --r-tab: 14px;

  /* Elevation — warm-tinted shadows, not neutral black */
  --shadow: 0 2px 12px rgba(120, 80, 30, .08), 0 1px 3px rgba(120, 80, 30, .06);
  --shadow-hi: 0 8px 30px rgba(120, 80, 30, .16);

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

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

html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
  color: var(--ink);
  background: linear-gradient(180deg, #F3E9DB 0%, var(--bg) 30%);
  -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: 0 0 60px rgba(120, 80, 30, .12);
}

/* Glass sticky top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline);
  padding: 14px var(--gutter) 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar__logo {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--saffron), var(--gold));
  font-size: 20px;
}
.topbar__titles { display: flex; flex-direction: column; }
.topbar__title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.topbar__sub { font-size: 12px; color: var(--ink2); }
.topbar__spacer { flex: 1; }

/* Language switcher in the top bar */
.locale-switch { display: flex; gap: 4px; }
.locale-switch__btn {
  border: 0;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink3);
  background: transparent;
  font-family: inherit;
}
.locale-switch__btn.is-active { color: #fff; background: var(--ink); }

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: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
  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: 700;
  color: var(--ink3);
  transition: .15s;
}
.tab__icon { font-size: 21px; line-height: 1; }
.tab--module { 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: var(--shadow);
  padding: var(--gutter);
  position: relative;
  overflow: hidden;
}

.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; }

/* ============================================================ 5. FORMS ===== */
.btn {
  padding: 12px 16px;
  border: 0;
  border-radius: var(--r-tab);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn--primary { background: var(--saffron); color: #fff; }

.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;
  font-size: 15px;
  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; }
.screen__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.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; }

/* ============================================================ 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; }
.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); }

/* ============================================================ 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: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.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 { font-size: 17px; font-variant-numeric: tabular-nums; }

/* 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; height: 100%; border-radius: 99px; transition: width .4s; }

/* Fire feed rows with an action button. */
.fire { border-left: 4px solid var(--berry); }
.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; }
.ava--live::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid 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); }
.badge--live { background: var(--saffron); color: #fff; }
.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: var(--shadow); padding: 14px 16px; margin-bottom: 11px; }
.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; }
.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: 8px; flex-wrap: wrap; margin-top: 10px; }
.person-role { display: inline-flex; align-items: center; gap: 6px; }
.person-role form { display: inline; margin: 0; }
.rchip { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.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; }
.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__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__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__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; }
.buy-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.buy-item__box { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.buy-item__label { flex: 1; font-size: 14px; }
.buy-item.is-bought .buy-item__label { color: var(--ink3); text-decoration: line-through; }
.buy-item__del { border: 0; background: none; color: var(--berry); font-weight: 800; cursor: pointer; }
.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; }

/* ===================================================== 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: var(--shadow); padding: 12px 13px; }
.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: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.sghead { padding: 14px 16px 11px; display: flex; align-items: center; gap: 10px; }
.sghead .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.sghead__body { flex: 1; }
.sghead__body b { font-size: 15px; display: block; }
.sghead .sm { font-size: 12px; color: var(--ink2); }
.sgroup__body { padding: 0 16px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Menu composer: inline add row, portions steppers, tappable status. */
.menu-add { display: flex; gap: 8px; align-items: stretch; margin: 12px 0 16px; }
.menu-add__title { flex: 1; min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 15px; font-family: inherit; }
.menu-add__portions { width: 82px; padding: 11px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 15px; font-family: inherit; text-align: center; }
.menu-add .btn { flex-shrink: 0; }
.pm-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.pm { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; display: grid; place-items: center; }
.pm:active { background: var(--saffron-soft); }
.pm-row .sm { min-width: 82px; 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); }

/* 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; max-width: 100%; border-radius: 12px; margin-top: 10px; }
.ref-card__body { margin-top: 8px; line-height: 1.5; }
.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; }

@media print {
  .topbar, .tabbar, .no-print { display: none !important; }
  .card { box-shadow: none; border: 1px solid var(--line); }
  main { padding: 0; }
}

/* 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; }

/* Filter chips — a row of pill toggles (cutting library, later the KDS). */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600;
}
.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: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.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--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; border-radius: 10px; 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: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.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 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; }
.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. */
.sgroup[data-course] { touch-action: pan-y; }
.sgroup.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 { 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 { 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; }
.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. */
.cat-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.cat-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 12px; border: 0;
  border-radius: 999px; background: var(--saffron-soft); color: var(--saffron-deep);
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.qty-edit { display: inline-flex; align-items: center; gap: 6px; }
.qty-edit input[type="number"] { width: 92px; padding: 6px 8px; font-size: 13px; }

/* 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: 1fr 1fr; gap: 12px; margin-top: 10px; }
.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; }

/* ── 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, .buy-item__box, .prep-pill, .kds__btn, .chip, .locale-switch__btn {
  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;
  font-size: 17px;
  line-height: 1;
}
.btn--danger { background: var(--berry-soft); color: var(--berry-deep); }

/* ===================================================== 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;
  font-size: 15px;
  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;
  border-color: var(--saffron);
  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: 14px; 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. */
.combo__native {
  position: absolute;
  width: 1px;
  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; }

/* 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); }
.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;
  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;
  font-size: 14.5px;
  min-height: 40px;
}
.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: 28px; --sidebar: 244px; --topbar-h: 67px; }

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

  body:not(.hotwire-native) .topbar { grid-area: topbar; padding: 14px var(--gutter) 12px; }
  body:not(.hotwire-native) .topbar__logo { width: 40px; height: 40px; }
  body:not(.hotwire-native) .topbar__title { font-size: 18px; }
  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;
    top: var(--topbar-h);
    left: auto;
    bottom: auto;
    transform: none;
    width: auto;
    max-width: none;
    height: calc(100dvh - var(--topbar-h));
    align-content: start;
    flex-direction: column;
    gap: 4px;
    padding: 18px 14px;
    border-top: 0;
    border-right: 1px solid var(--hairline);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body:not(.hotwire-native) .tab {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 13px;
    font-size: 14.5px;
  }
  body:not(.hotwire-native) .tab__icon { font-size: 20px; }
  body:not(.hotwire-native) .tab:hover { background: var(--saffron-soft); color: var(--saffron-deep); }
  body:not(.hotwire-native) .tab.is-active { background: var(--saffron-soft); }
  body:not(.hotwire-native) .tab.is-active .tab__icon { transform: none; }

  /* The module you are inside, indented under the section it belongs to and tied to it by a
     rule down its left edge. It is a label, not a link — you are already there. */
  body:not(.hotwire-native) .tab--module {
    display: flex;
    margin: 2px 0 2px 26px;
    padding: 8px 12px;
    border-left: 2px solid var(--saffron);
    border-radius: 0 11px 11px 0;
    background: var(--saffron-soft);
    color: var(--saffron-deep);
    font-size: 13.5px;
    cursor: default;
  }
  body:not(.hotwire-native) .tab--module .tab__icon { font-size: 17px; }

  /* 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: 24px var(--gutter) 64px;
  }

  /* Type and controls at desktop size rather than thumb size. */
  body:not(.hotwire-native) .screen__title { font-size: 26px; margin: 6px 0 14px; }
  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)); }

  /* A course of the menu is a board of dish cards, not one tall column. */
  body:not(.hotwire-native) [data-menu-board-target="zone"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px;
    align-items: start;
  }
  body:not(.hotwire-native) [data-menu-board-target="zone"] .course { grid-column: 1 / -1; }
  body:not(.hotwire-native) [data-menu-board-target="zone"] .sgroup { margin-bottom: 0; }

  /* 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; }
}

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

/* 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); }
}
