/* Stock Room — phone-first back-of-house tool.
   Layout: one column, sticky header, bottom tab bar, bottom sheets for every action.
   Run chips use the kitchen day-dot colors (Mon blue, Wed red, Thu brown, Fri green, Sun black). */
:root {
  --bg: #edf1ef;
  --surface: #ffffff;
  --surface-2: #e2e8e5;
  --ink: #15201b;
  --muted: #56655e;
  --line: #ccd5d0;
  --accent: #2153c4;
  --accent-ink: #ffffff;
  --accent-soft: #dbe5fb;
  --amber: #9a5b00;
  --amber-soft: #fbeccf;
  --red: #b42318;
  --red-soft: #fbe0dc;
  --green: #22744a;
  --green-soft: #d8f0e2;
  --violet: #5b3fb0;
  --violet-soft: #e6e0f8;
  --scrim: rgba(12, 18, 15, 0.45);
  --dot-mon: #2459d6; --dot-tue: #f2c230; --dot-wed: #d7322a; --dot-thu: #7a4a24;
  --dot-fri: #2e9a4e; --dot-sat: #ef7d1a; --dot-sun: #15201b;
  --font-display: "Barlow Semi Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(21, 32, 27, 0.06), 0 6px 18px rgba(21, 32, 27, 0.06);
  --brand: var(--accent);
  --brand-field: var(--line);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111614; --surface: #1a211e; --surface-2: #252e2a; --ink: #e6ede9; --muted: #9aa9a2;
    --line: #333e39; --accent: #86a8f7; --accent-ink: #0f1a33; --accent-soft: #1f2c4d;
    --amber: #f0bb63; --amber-soft: #3a2c12; --red: #f4857a; --red-soft: #45201c;
    --green: #74d29e; --green-soft: #17362a; --violet: #b9a6f5; --violet-soft: #2c2547;
    --scrim: rgba(0, 0, 0, 0.6); --dot-sun: #e6ede9;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111614; --surface: #1a211e; --surface-2: #252e2a; --ink: #e6ede9; --muted: #9aa9a2;
  --line: #333e39; --accent: #86a8f7; --accent-ink: #0f1a33; --accent-soft: #1f2c4d;
  --amber: #f0bb63; --amber-soft: #3a2c12; --red: #f4857a; --red-soft: #45201c;
  --green: #74d29e; --green-soft: #17362a; --violet: #b9a6f5; --violet-soft: #2c2547;
  --scrim: rgba(0, 0, 0, 0.6); --dot-sun: #e6ede9;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* ---------- Sam Ping's theme (Patrick's token block) ----------
   Applies to the whole page when the view is Sam Ping's (data-loc on <html>),
   and to any sheet opened for a Sam Ping's item (data-loc on .sheet), so a
   count can't land in the wrong store unnoticed. Dark in every theme setting.
   Imperial red and gold stay off state colors: red means urgent, amber means low. */
:root[data-loc="sampings"],
:root[data-loc="sampings"][data-theme="dark"],
:root[data-loc="sampings"][data-theme="light"],
.sheet[data-loc="sampings"] {
  --bg: #151110; --surface: #201a18; --surface-2: #2a2320; --ink: #f3e9d7; --muted: #a89782; --line: #3a302b;
  --accent: #f3e9d7; --accent-ink: #1a1a1a; --accent-soft: #3a302b;
  --amber: #e8a33c; --amber-soft: #3b2a0e; --red: #e8604a; --red-soft: #42160f;
  --green: #5fbf8b; --green-soft: #13301f; --violet: #b9a6f5; --violet-soft: #2a2340;
  --scrim: rgba(0, 0, 0, 0.62); --dot-sun: #f3e9d7;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.3);
  --brand: #b88a3b;        /* Roast Duck Gold: identity only, never state */
  --brand-field: #8b1e1e;  /* Imperial Red: fills only, never text */
  --font-display: "Oswald", "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-loc="sampings"] .brand { color: var(--brand); }
:root[data-loc="sampings"] .loc-name { color: var(--ink); line-height: 1.5; }   /* Oswald is tall: room for the g */
:root[data-loc="sampings"], .sheet[data-loc="sampings"] { --top-bg: #151110; --top-ink: #f3e9d7; --top-muted: #a89782; }
:root[data-loc="sampings"] .nav button[aria-current="page"] { color: var(--brand); }
:root[data-loc="sampings"] .auth h1 { color: var(--brand); }
:root[data-loc="sampings"] .top { border-bottom: 2px solid var(--brand-field); }
.sheet[data-loc="sampings"] { box-shadow: inset 0 3px 0 var(--brand-field); }

/* ---------- One look per restaurant ----------
   Each restaurant keeps its own look in every phone theme setting, so the screen
   itself says which store you are counting in. Mixed views (Decide, Buy list) stay
   neutral, and a sheet opened for one restaurant's item takes that restaurant's look.
   State colors mean the same thing everywhere: amber low, red urgent, green got. */

/* Aloha Alley: sand ground, cream cards on a hard green shadow, mango pill buttons, Montserrat. */
:root[data-loc="aloha"],
:root[data-loc="aloha"][data-theme="dark"],
:root[data-loc="aloha"][data-theme="light"],
.sheet[data-loc="aloha"] {
  --bg: #f5dca7; --surface: #fff4dc; --surface-2: #f0dcae; --ink: #282c1f; --muted: #4a4a3a; --line: #d9be84;
  --accent: #f1a638; --accent-ink: #282c1f; --accent-soft: #fbe3b4;
  --amber: #7a4700; --amber-soft: #f3d08a; --red: #b42318; --red-soft: #f8d9cf;
  --green: #1d6b45; --green-soft: #cde9d6; --violet: #5b3fb0; --violet-soft: #e6e0f8;
  --scrim: rgba(20, 24, 16, 0.45); --dot-sun: #282c1f;
  --shadow: 0 5px 0 rgba(7, 107, 87, 0.35);
  --brand: #076b57; --brand-field: #f28a30;
  --top-bg: #f5dca7; --top-ink: #282c1f; --top-muted: #4a4a3a;
  --font-display: "Montserrat", "Barlow Semi Condensed", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-loc="aloha"] .loc-name { font-weight: 900; text-transform: uppercase; font-size: 21px; letter-spacing: -0.01em; }
:root[data-loc="aloha"] .item-name, :root[data-loc="aloha"] .t-name, :root[data-loc="aloha"] .supplier-block header b { font-weight: 800; font-size: 18px; }
:root[data-loc="aloha"] h2.section { color: var(--brand); font-weight: 800; }
:root[data-loc="aloha"] .item, :root[data-loc="aloha"] .task, :root[data-loc="aloha"] .panel, :root[data-loc="aloha"] .supplier-block { border-radius: 22px; }
:root[data-loc="aloha"] .item.flag-open { box-shadow: inset 5px 0 0 var(--amber), var(--shadow); }
:root[data-loc="aloha"] .item.flag-urgent { box-shadow: inset 5px 0 0 var(--red), var(--shadow); }
:root[data-loc="aloha"] .item.flag-way { box-shadow: inset 5px 0 0 var(--brand), var(--shadow); }
:root[data-loc="aloha"] .btn, .sheet[data-loc="aloha"] .btn { border-radius: 999px; }
:root[data-loc="aloha"] .btn:not(.low):not(.danger):not(.ghost):not(.primary):not(.dark), :root[data-loc="aloha"] .chip { border-color: var(--ink); }
:root[data-loc="aloha"] .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--surface); }
:root[data-loc="aloha"] .add-row { color: var(--brand); }
.sheet[data-loc="aloha"] h3 { font-weight: 900; text-transform: uppercase; font-size: 22px; }
.sheet[data-loc="aloha"] .btn.ghost { color: var(--brand); }
.sheet[data-loc="aloha"] .choice[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

/* The two Ems use the new emrestaurants.com look (read from the private Squarespace draft, Nov 16 2026):
   green #173f35, jade #34795b, paper #f6f2e7, cream #e9e6d5, ink #243f33, gold #d1b779, line #c8cbbb,
   Cormorant Garamond display, Be Vietnam Pro body, square corners. The site gives both restaurants the
   same palette, so the app tells them apart by which site color leads:
   Bistro (DUMBO) = deep green header with a gold rule; Kitchen (86th) = cream header with a jade rule and jade buttons. */
:root[data-loc="emdumbo"],
:root[data-loc="emdumbo"][data-theme="dark"],
:root[data-loc="emdumbo"][data-theme="light"],
.sheet[data-loc="emdumbo"] {
  --bg: #f6f2e7; --surface: #ffffff; --surface-2: #e9e6d5; --ink: #243f33; --muted: #5a6853; --line: #c8cbbb;
  --accent: #173f35; --accent-ink: #f6f2e7; --accent-soft: #dfe6d6;
  --brand: #173f35; --brand-field: #d1b779;
  --top-bg: #173f35; --top-ink: #f6f2e7; --top-muted: #cad4c4;
  --amber: #8a5200; --amber-soft: #f6e3bd; --red: #b42318; --red-soft: #f8ddd6;
  --green: #1d6b45; --green-soft: #d6ead9; --violet: #5b3fb0; --violet-soft: #e6e0f8;
  --scrim: rgba(23, 63, 53, 0.45); --dot-sun: #243f33;
  --shadow: 0 1px 0 rgba(36, 63, 51, 0.06), 0 6px 18px rgba(36, 63, 51, 0.07);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, Arial, sans-serif;
  --radius: 6px; --radius-sm: 3px;
  color-scheme: light;
}
:root[data-loc="em86"],
:root[data-loc="em86"][data-theme="dark"],
:root[data-loc="em86"][data-theme="light"],
.sheet[data-loc="em86"] {
  --bg: #f6f2e7; --surface: #ffffff; --surface-2: #e9e6d5; --ink: #243f33; --muted: #5a6853; --line: #c8cbbb;
  --accent: #2f6e52; --accent-ink: #ffffff; --accent-soft: #dcebe0;
  --brand: #2f6e52; --brand-field: #34795b;
  --top-bg: #e9e6d5; --top-ink: #173f35; --top-muted: #5a6853;
  --amber: #8a5200; --amber-soft: #f6e3bd; --red: #b42318; --red-soft: #f8ddd6;
  --green: #1d6b45; --green-soft: #d6ead9; --violet: #5b3fb0; --violet-soft: #e6e0f8;
  --scrim: rgba(23, 63, 53, 0.45); --dot-sun: #243f33;
  --shadow: 0 1px 0 rgba(36, 63, 51, 0.06), 0 6px 18px rgba(36, 63, 51, 0.07);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, Arial, sans-serif;
  --radius: 6px; --radius-sm: 3px;
  color-scheme: light;
}
/* Header follows the Em site's nav: Be Vietnam Pro, medium weight, with a small tracked line under it. */
:root[data-loc^="em"] .loc-name { font-family: var(--font-body); font-size: 21px; font-weight: 600; letter-spacing: 0; }
:root[data-loc^="em"] .loc-sub { font-weight: 400; letter-spacing: 0.1em; }
/* Names use the site's heading face at its lighter weight and tight spacing. */
:root[data-loc^="em"] .item-name, :root[data-loc^="em"] .t-name, :root[data-loc^="em"] .supplier-block header b, :root[data-loc^="em"] .big-btn b, :root[data-loc^="em"] .count-item h2 { font-size: 25px; font-weight: 500; letter-spacing: -0.02em; }
:root[data-loc^="em"] .count-item h2 { font-size: 34px; }
.sheet[data-loc^="em"] h3 { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }
:root[data-loc^="em"] h2.section { font-family: var(--font-body); font-weight: 600; font-size: 12px; letter-spacing: 0.14em; }
:root[data-loc^="em"] .chip { border-radius: 3px; }
:root[data-loc^="em"] .btn, .sheet[data-loc^="em"] .btn { font-weight: 600; }

/* Shared by every restaurant look */
:root[data-loc] .top { border-bottom: 3px solid var(--brand-field); }
:root[data-loc] .nav button[aria-current="page"] { color: var(--brand); }
.sheet[data-loc] { box-shadow: inset 0 4px 0 var(--brand-field); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--top-bg, var(--bg));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

.wrap {
  max-width: 640px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- header ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--top-bg, var(--bg)); color: var(--top-ink, var(--ink)); border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.loc-pick { flex: 1; min-width: 0; }
.loc-name {
  color: inherit; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.25;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-block: 4px; margin-block: -3px;
}
.loc-sub { display: block; font-family: var(--font-body); font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--top-muted, var(--muted)); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-btn {
  appearance: none; border: 0; background: transparent; color: inherit; padding: 2px 30px 2px 0; margin: 0; text-align: left;
  position: relative; max-width: 100%; min-height: 44px; display: inline-flex; flex-direction: column; justify-content: center;
}
.loc-btn .caret { position: absolute; right: 6px; top: 50%; margin-top: -4px; opacity: 0.85; }
.loc-row {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; min-height: 64px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}
.loc-row[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.loc-row .sw { width: 34px; height: 34px; border-radius: 50%; flex: none; border: 2px solid var(--line); }
.loc-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.loc-row b { font-size: 18px; }
.loc-row small { font-size: 12.5px; color: var(--muted); }
.loc-row svg { color: var(--accent); flex: none; }
.who { font-size: 13px; color: var(--top-muted, var(--muted)); text-align: right; white-space: nowrap; }

.demo-band { background: var(--violet-soft); color: var(--violet); font-size: 13px; }
.demo-band .wrap { padding-block: 7px; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.demo-band button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; padding: 0; }

/* ---------- main ---------- */
main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
main .wrap { display: flex; flex-direction: column; gap: 18px; padding-block: 16px; }
h2.section {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
h2.section .count { font-family: var(--font-body); letter-spacing: 0; text-transform: none; font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.empty {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 18px 16px;
  color: var(--muted); text-align: center; font-size: 15px;
}

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 14px; font-size: 15px; display: inline-flex; align-items: center; gap: 7px; min-height: 38px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .badge { background: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] .badge { background: var(--bg); color: var(--ink); }

/* ---------- item card ---------- */
.item {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.item.flag-open { box-shadow: inset 4px 0 0 var(--amber), var(--shadow); }
.item.flag-urgent { box-shadow: inset 4px 0 0 var(--red), var(--shadow); }
.item.flag-way { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.item-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.item-name {
  border: 0; background: none; padding: 0; text-align: left; min-width: 0;
  font-family: var(--font-display); font-weight: 600; font-size: 21px; line-height: 1.15;
}
.item-meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.levels { display: flex; gap: 14px; flex-wrap: wrap; font-size: 15px; align-items: baseline; }
.levels b { font-size: 17px; }
.est { color: var(--muted); }
.actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }

.btn {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  min-height: 46px; padding: 8px 12px; font-weight: 700; font-size: 15.5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn.low { border-color: var(--amber); color: var(--amber); }
.btn.low.on { background: var(--amber-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; flex: none;
}
.pill.open { background: var(--amber-soft); color: var(--amber); }
.pill.urgent { background: var(--red-soft); color: var(--red); }
.pill.way { background: var(--accent-soft); color: var(--accent); }
.pill.van { background: var(--green-soft); color: var(--green); }
.pill.new { background: var(--violet-soft); color: var(--violet); }
.badge {
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: var(--surface);
}

.add-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1.5px dashed var(--line); background: transparent; border-radius: var(--radius);
  padding: 12px 14px; font-weight: 700; color: var(--accent); min-height: 50px;
}
.plus {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1;
}

/* ---------- task cards ---------- */
.task {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%;
  border: 0;
}
.task .t-name { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.15; }
.task .t-line { font-size: 14px; color: var(--muted); }
.task.stuck { box-shadow: inset 4px 0 0 var(--red), var(--shadow); }

/* ---------- pickup ---------- */
.dot { width: 13px; height: 13px; border-radius: 50%; flex: none; border: 1.5px solid var(--line); display: inline-block; }
.dot.sun { background: var(--dot-sun); border-color: var(--dot-sun); }
.dot.mon { background: var(--dot-mon); border-color: var(--dot-mon); }
.dot.wedthu { background: linear-gradient(90deg, var(--dot-wed) 50%, var(--dot-thu) 50%); border-color: transparent; }
.dot.thufri { background: linear-gradient(90deg, var(--dot-thu) 50%, var(--dot-fri) 50%); border-color: transparent; }
.supplier-block { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.supplier-block header {
  padding: 11px 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  border-bottom: 1px solid var(--line);
}
.supplier-block header b { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.loc-label {
  padding: 9px 14px 2px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.pick {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 10px 14px; min-height: 52px;
}
.pick-row { display: flex; align-items: stretch; }
.pick-row + .pick-row, .loc-label + .pick-row { border-top: 1px solid var(--surface-2); }
.pick-row .pick { flex: 1; min-width: 0; width: auto; }
.p-qty { border: 0; background: transparent; padding: 10px 14px; min-height: 52px; font-weight: 700; white-space: nowrap;
  text-decoration: underline dotted; text-underline-offset: 3px; color: var(--ink); }
.box {
  width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--line); flex: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--surface);
}
.pick.done .box { background: var(--green); border-color: var(--green); }
.pick.done .p-name { text-decoration: line-through; color: var(--muted); }
.p-name { flex: 1; min-width: 0; font-size: 16.5px; }

/* ---------- lists & panels ---------- */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.list-row {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 14px; min-height: 52px; width: 100%; text-align: left; border: 0; background: transparent;
}
.list-row + .list-row { border-top: 1px solid var(--surface-2); }
.list-row .grow { flex: 1; min-width: 0; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.nav .inner { max-width: 640px; margin: 0 auto; display: flex; }
.nav button {
  flex: 1; border: 0; background: none; padding: 9px 4px 10px; min-height: 58px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 12.5px; font-weight: 700; color: var(--muted); position: relative;
}
.nav button[aria-current="page"] { color: var(--accent); }
.nav svg { width: 24px; height: 24px; }
.nav .badge { position: absolute; top: 5px; left: calc(50% + 6px); }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; animation: fade 0.15s ease-out; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 92vh; overflow-y: auto;
  background: var(--surface); color: var(--ink); border-radius: 20px 20px 0 0;
  padding: 8px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  animation: rise 0.2s ease-out;
}
.sheet-inner { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 0; }
.sheet h3 {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.1;
  text-wrap: balance;
}
.sheet .sub { margin-top: -10px; color: var(--muted); font-size: 14.5px; }
@keyframes rise { from { transform: translateY(24px); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scrim, .sheet { animation: none; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 14px; font-weight: 700; }
.field .hint { font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); padding: 10px 12px; font-size: 17px;
}
textarea.input { min-height: 72px; resize: vertical; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two > * { min-width: 0; }

.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px 14px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 56px;
}
.choice b { font-size: 16.5px; }
.choice span { font-size: 13.5px; color: var(--muted); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice.warn[aria-pressed="true"] { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }

.stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; align-items: center; }
.stepper button { min-height: 64px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--bg); font-size: 30px; font-weight: 700; }
.stepper .input { text-align: center; font-size: 32px; font-weight: 700; min-height: 64px; }
.unit-under { text-align: center; color: var(--muted); font-size: 14px; margin-top: -4px; }

.err { background: var(--red-soft); color: var(--red); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14.5px; }
.note-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14.5px; }
.code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 30px; font-weight: 700;
  letter-spacing: 0.18em; text-align: center; padding: 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); user-select: all;
}
.history { display: flex; flex-direction: column; }
.history div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 14.5px; border-top: 1px solid var(--surface-2); }
.history div span:last-child { color: var(--muted); text-align: right; white-space: nowrap; }

.toast {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px;
  font-size: 15px; font-weight: 700; max-width: calc(100% - 32px); box-shadow: var(--shadow);
}
.toast.bad { background: var(--red); color: var(--surface); }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding-block: 40px; }
.auth h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1; }
.auth .lede { margin: 0; color: var(--muted); max-width: 32ch; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; min-height: 42px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.person {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  border: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 16px; text-align: left; min-height: 60px;
}
.person b { font-size: 17px; }
.person span { color: var(--muted); font-size: 14px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- staff home ---------- */
.sos-btn {
  width: 100%; border: 0; border-radius: var(--radius); background: #c22a1d; color: #fff; min-height: 104px;
  padding: 16px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 3px 0 #8f1c12, var(--shadow);
}
.sos-btn b { font-family: var(--font-body); font-size: 38px; font-weight: 700; letter-spacing: 0.08em; line-height: 1; }
.sos-btn span { font-size: 16px; opacity: 0.95; }
.sos-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8f1c12; }
.big-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-btn {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  min-height: 132px; padding: 14px 12px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; text-align: left; min-width: 0;
}
.big-btn svg { color: var(--brand); margin-bottom: auto; }
.big-btn b { font-family: var(--font-display); font-size: 23px; line-height: 1.1; }
.big-btn span { font-size: 13.5px; color: var(--muted); }
.quick {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--ink); padding: 14px 16px; min-height: 64px;
}
.quick .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.quick .grow span { font-size: 13.5px; color: var(--muted); }
.quick .go { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 8px 14px; font-weight: 700; white-space: nowrap; }
.flag-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 60px; }
.flag-row + .flag-row { border-top: 1px solid var(--surface-2); }
.flag-row .grow { flex: 1; min-width: 0; }
.flag-row.is-sos { box-shadow: inset 4px 0 0 var(--red); }
.f-name { font-weight: 700; font-size: 16.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.f-line { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: 14.5px; flex: none; }
.btn.big { min-height: 58px; font-size: 18px; }
.btn.sos { background: #c22a1d; border-color: #c22a1d; color: #fff; }
.center { text-align: center; align-items: center; }
.up { text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }

.sos-band { background: #c22a1d; color: #fff; }
.sos-band .wrap { padding-block: 8px; display: flex; flex-direction: column; gap: 8px; }
.sos-line { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.sos-line .grow { flex: 1; min-width: 0; }
.sos-line .tiny { opacity: 0.9; }
.sos-line .btn { background: #fff; color: #8f1c12; border-color: #fff; }

/* ---------- item picker ---------- */
.pick-list { display: flex; flex-direction: column; max-height: 46vh; overflow-y: auto; border: 1.5px solid var(--line); border-radius: var(--radius-sm); }
.pick-head { position: sticky; top: 0; background: var(--surface-2); padding: 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pick-item { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-top: 1px solid var(--surface-2); background: transparent; color: var(--ink); padding: 11px 12px; min-height: 52px; font-size: 17px; }
.pick-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-item small { font-size: 12.5px; color: var(--muted); }

/* ---------- count mode + keypads ---------- */
.count-screen, .count-done { display: flex; flex-direction: column; gap: 12px; padding-block: 12px calc(16px + env(safe-area-inset-bottom, 0px)); min-height: 100vh; }
.count-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }
.count-item { display: flex; flex-direction: column; gap: 3px; }
.count-item h2 { margin: 0; font-family: var(--font-display); font-size: 32px; line-height: 1.08; text-wrap: balance; }
.count-entry { text-align: center; font-size: 56px; font-weight: 700; line-height: 1; padding: 10px 0 4px; min-height: 70px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { min-height: 60px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 26px; font-weight: 700; }
.keypad button:active { background: var(--surface-2); }
.low-toggle { align-self: center; }
.low-toggle[aria-pressed="true"] { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.count-actions { display: flex; gap: 8px; margin-top: auto; }
.count-actions .btn { flex: 1; min-height: 58px; }
.count-actions .btn.primary { flex: 1.6; font-size: 17px; }
.count-done { justify-content: center; align-items: center; text-align: center; }
.count-done h1 { margin: 0; font-family: var(--font-display); font-size: 40px; }
.tick { width: 72px; height: 72px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.tick svg { width: 40px; height: 40px; }

/* ---------- sign-in ---------- */
.login { gap: 18px; }
.login h1 { text-align: center; }
.login .lede { max-width: none; text-align: center; }
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.name-btn { min-height: 64px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 20px; font-weight: 700; box-shadow: var(--shadow); }
.pin-dots { display: flex; justify-content: center; gap: 14px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots i.on { background: var(--ink); }
.code-in { text-align: center; font-size: 24px; letter-spacing: 0.12em; text-transform: uppercase; min-height: 58px; }
.login-foot { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ---------- door signs ---------- */
.posters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.poster { border: 2px solid #111; border-radius: 10px; background: #fff; color: #111; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.poster svg { width: 100%; height: auto; max-width: 260px; }
.poster.guide { grid-column: 1 / -1; align-items: stretch; text-align: left; gap: 10px; }
.poster.guide .p-brand { text-align: center; }
.g-lang .p-title { font-size: 17px; }
.g-lang ol { margin: 4px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.4; }
.g-lang li + li { margin-top: 3px; }
.p-brand { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.p-title { font-size: 22px; font-weight: 700; line-height: 1.1; }
.p-sub { font-size: 12.5px; }
.p-code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
@media print {
  #app-root, #toast-root, .scrim, .sheet .grab, .sheet h3, .sheet .sub, .sheet .field, .sheet .btn, .sheet .note-box { display: none !important; }
  .sheet { position: static; max-height: none; overflow: visible; box-shadow: none; padding: 0; background: #fff; }
  .posters { display: block; }
  .poster { page-break-after: always; break-after: page; border-width: 4px; margin: 0 auto; padding: 40px; max-width: 6.5in; gap: 18px; }
  .poster svg { max-width: 5in; }
  .poster.guide { max-width: 7in; }
  .g-lang .p-title { font-size: 30px !important; } .g-lang ol { font-size: 21px; padding-left: 30px; } .g-lang { margin-bottom: 18px; }
  .p-brand { font-size: 18px; } .p-title { font-size: 54px; } .p-sub { font-size: 24px; } .p-code { font-size: 18px; }
}
