:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --surface-3: #f1ede6;
  --ink: #1d1916;
  --ink-2: #57514a;
  --ink-3: #8a8379;
  --line: #e6e0d6;
  --line-2: #d6cfc3;
  --brand: #8c1d2f;
  --brand-ink: #ffffff;
  --brand-soft: #f7e9eb;
  --accent: #d97706;
  --side: #1d1916;
  --side-ink: #e9e3da;
  --side-ink-2: #a39a8e;
  --side-hover: #2a2420;
  --good: #0f7a3a; --good-bg: #e6f4ea;
  --warn: #9a5b00; --warn-bg: #fdf1dc;
  --bad: #b42318; --bad-bg: #fde8e6;
  --info: #1c5cab; --info-bg: #e8f0fb;
  --veg: #12813b; --nonveg: #b42318; --egg: #c27c0e;
  /* chart tokens (validated reference palette) */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --grid: #e1e0d9; --axis: #c3c2b7; --chart-muted: #898781;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(29, 25, 22, .05), 0 4px 16px rgba(29, 25, 22, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12100e; --surface: #1b1815; --surface-2: #211d19; --surface-3: #2a2520; --ink: #f2ede6; --ink-2: #c4bbb0; --ink-3: #8f877c;
    --line: #2f2a24; --line-2: #3d362f; --brand: #d0566a; --brand-ink: #1b0b0e; --brand-soft: #3a1c22; --side: #0c0a09; --side-hover: #1d1916;
    --good: #4cc27a; --good-bg: #13301e; --warn: #f0b04a; --warn-bg: #352610; --bad: #f2786d; --bad-bg: #3a1512; --info: #7ab0f0; --info-bg: #152438;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --grid: #2c2c2a; --axis: #383835;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12100e; --surface: #1b1815; --surface-2: #211d19; --surface-3: #2a2520; --ink: #f2ede6; --ink-2: #c4bbb0; --ink-3: #8f877c;
  --line: #2f2a24; --line-2: #3d362f; --brand: #d0566a; --brand-ink: #1b0b0e; --brand-soft: #3a1c22; --side: #0c0a09; --side-hover: #1d1916;
  --good: #4cc27a; --good-bg: #13301e; --warn: #f0b04a; --warn-bg: #352610; --bad: #f2786d; --bad-bg: #3a1512; --info: #7ab0f0; --info-bg: #152438;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --grid: #2c2c2a; --axis: #383835;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
small, .muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #d97706, #8c1d2f); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.brand-sub { font-size: 11.5px; color: var(--side-ink-2); }
.nav-group { margin: 10px 0 4px; padding: 0 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-ink-2); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--side-ink); font-size: 13.5px; }
.nav a:hover { background: var(--side-hover); text-decoration: none; }
.nav a.active { background: var(--side-hover); box-shadow: inset 3px 0 0 var(--accent); color: #fff; }
.nav svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav .badge { margin-left: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
/* The title keeps at least ~280px; when the buttons need more room they move to a second line */
.top .title { flex: 1 1 280px; min-width: 0; }
.top .actions { flex-wrap: wrap; }
.top .actions > * { flex: none; } /* header buttons size to their label */
.top .crumb { font-size: 12px; color: var(--ink-3); }
.btn.menu-btn { display: none; }
.content { padding: 22px 28px 60px; max-width: 1400px; width: 100%; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
select, input, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; height: 34px; padding: 0 10px; min-width: 0; }
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input[type="checkbox"] { height: 16px; width: 16px; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input.num { text-align: right; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.toolbar input[type="search"] { width: 240px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 32px; font: inherit; color: var(--ink-2); cursor: pointer; white-space: nowrap; flex: none; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: thin; } /* many filters: scroll sideways instead of squashing labels */
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* ---------- cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.card-h .grow { flex: 1; }
.card-b { padding: 8px 16px 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stack > * + * { margin-top: 14px; }
.kpi { padding: 14px 16px; }
.kpi .label { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -0.01em; }
.kpi .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.delta-up { color: var(--good); } .delta-down { color: var(--bad); }
/* Compact row of key figures (dashboard): hairline-separated cells in one card */
.kpi-strip { display: grid; grid-template-columns: minmax(0, 1.35fr) repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.kpi-strip > div { background: var(--surface); padding: 10px 14px 11px; min-width: 0; }
.kpi-strip .label { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-strip .value { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; margin-top: 1px; }
.kpi-strip .sub { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; margin-top: 1px; }
@media (max-width: 1100px) { .kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi-strip.kpi-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .kpi-strip.kpi-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-strip > div { padding: 8px 11px 9px; } .kpi-strip .value { font-size: 18px; }
  /* Phones: title on its own line, month/branch pickers below; card titles don't get squeezed by their notes */
  .top .title { flex: 1 1 calc(100% - 56px); }
  .top .actions, #loc-select { flex: 1 1 0; }
  .top .actions select { width: 100%; }
  .card-h { flex-wrap: wrap; row-gap: 2px; }
  .card-h h2 { white-space: nowrap; }
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th .arrow { opacity: .6; font-size: 10px; }
tbody tr:hover td { background: var(--surface-2); }
tr.click { cursor: pointer; }
td.wrap { white-space: normal; }
tfoot td { font-weight: 650; background: var(--surface-2); }
.card > .table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
table.compact td, table.compact th { padding: 5px 8px; }
.row-sec td { background: var(--surface-3); font-weight: 650; }
.row-total td { font-weight: 700; border-top: 2px solid var(--line-2); }
.row-key td { font-weight: 700; background: var(--brand-soft); }
.indent { padding-left: 26px !important; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.diet { display: inline-block; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; vertical-align: -1px; margin-right: 6px; flex: none; }
.diet::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: currentColor; }
.diet.veg { color: var(--veg); } .diet.nonveg { color: var(--nonveg); } .diet.egg { color: var(--egg); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

/* ---------- notices ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 9px; background: var(--info-bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.notice.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.notice.good { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty h2 { margin-bottom: 6px; color: var(--ink); }
.empty p { margin: 0 auto 14px; max-width: 460px; }

/* ---------- forms ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field > small { font-size: 11.5px; }
.field input, .field select, .field textarea { width: 100%; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > * { flex: 1; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px 14px; margin: 0; }
legend { font-size: 12px; font-weight: 650; color: var(--ink-2); padding: 0 6px; }

/* ---------- modal ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.wide { width: min(960px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(20, 16, 12, .45); }
.modal-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h2 { flex: 1; }
.modal-b { padding: 16px 20px; overflow-y: auto; max-height: calc(100vh - 190px); }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.modal-f .left { margin-right: auto; }
.form-error { color: var(--bad); font-size: 13px; margin-top: 10px; }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 380px; animation: tin .18s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart text { fill: var(--chart-muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hover-band { fill: var(--ink); opacity: .04; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin: 2px 0 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 3px; border-radius: 2px; vertical-align: 3px; width: 14px; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 150px; z-index: 3; display: none; }
.tip .t { font-weight: 650; margin-bottom: 4px; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; }
.tip .r span:first-child { color: var(--ink-2); }
.bar-list { display: flex; flex-direction: column; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 10px; background: var(--surface-3); border-radius: 0 4px 4px 0; overflow: hidden; }
.bar-fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }

/* ---------- schedule ---------- */
.sched { table-layout: fixed; min-width: 900px; }
.sched td { vertical-align: top; height: 56px; padding: 4px; }
.sched td.emp { width: 190px; }
.sched .slot { cursor: pointer; border-radius: 6px; min-height: 46px; padding: 2px; }
.sched .slot:hover { background: var(--surface-3); }
.shift { display: block; font-size: 12px; background: var(--info-bg); color: var(--info); border-radius: 6px; padding: 3px 6px; margin-bottom: 3px; font-weight: 600; }
.shift.ot { background: var(--warn-bg); color: var(--warn); }
.sched th.today { color: var(--brand); }

/* ---------- misc ---------- */
.pill-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.pill-tabs a { padding: 8px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; }
.pill-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); text-decoration: none; }
.pill-tabs a:hover { text-decoration: none; color: var(--ink); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); margin-top: 2px; display: none; }
.picker-list div { padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.picker-list div small { color: var(--ink-3); }
.picker-list div.on, .picker-list div:hover { background: var(--brand-soft); }
.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quad .q { padding: 12px 14px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.quad .q b { font-size: 20px; display: block; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 28px; text-align: center; color: var(--ink-2); background: var(--surface-2); }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 50px; display: grid; place-items: center; color: var(--ink-3); }
.hide { display: none !important; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .btn.menu-btn { display: inline-flex; }
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .content { padding: 16px 16px 60px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .form { grid-template-columns: 1fr; }
  .toolbar input[type="search"] { width: 100%; }
}
/* Stock count: one tab per division (Kitchen / Bar / Dining / All) with progress */
.div-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.div-tab { display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 14px 11px; cursor: pointer; box-shadow: var(--shadow); min-width: 0; }
.div-tab:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line-2)); }
.div-tab.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); }
.div-tab .label { font-weight: 650; font-size: 15px; }
.div-tab .sub { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.div-tab .bar { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 6px; }
.div-tab .bar i { display: block; height: 100%; background: var(--brand); border-radius: 2px; }
.div-tab .bar i.done { background: var(--good); }
@media (max-width: 720px) { .div-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .div-tab { padding: 8px 11px 9px; } }
.print-only { display: none; }
/* Catering quote builder: dishes on the left, live price on the right */
.quote-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.quote-side { position: sticky; top: 76px; }
.big-price { font-size: 32px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; margin: 2px 0 4px; }
.brk-list { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.brk { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.brk > span:first-child { color: var(--ink-2); }
.brk > span:last-child { text-align: right; white-space: nowrap; }
.brk.sub { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 6px; font-weight: 600; }
.brk.sub > span:first-child { color: var(--ink); }
@media (max-width: 1000px) { .quote-grid { grid-template-columns: 1fr; } .quote-side { position: static; } }
@media (max-width: 820px) { #ev .form { grid-template-columns: 1fr 1fr !important; } }
.count-sheet small.u { display: inline-block; min-width: 3.2em; text-align: left; }

@media print {
  .side, .top .actions, .toolbar, .btn, .div-tabs, .no-print { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; break-inside: avoid-page; }
  .print-only { display: block; }
  .print-head { margin-bottom: 12px; font-size: 13px; }
  .print-head h2 { margin: 0 0 4px; font-size: 17px; }
  .print-head .sign { margin-top: 10px; }
  /* Blind count sheet: counters see the item and unit, not what the system expects */
  .count-sheet .c-exp, .count-sheet .c-diff, .count-sheet .c-val { display: none; }
  .count-sheet input { border: 0; border-bottom: 1px solid #999; border-radius: 0; background: transparent; }
  .proposal { font-size: 14px; line-height: 1.5; }
  .proposal h2 { font-size: 16px; margin: 14px 0 4px; }
}

/* ---------- sign-in, signed-in person, role limits ---------- */
[hidden] { display: none !important; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.gate-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 22px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.gate-brand { padding: 0 0 12px; }
.gate-brand .brand-sub { color: var(--ink-2, #6b6259); }
.gate .field input { width: 100%; font-size: 16px; }
.side-user { margin: 18px 4px 4px; padding: 12px 8px 4px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user-name { font-weight: 600; font-size: 13.5px; }
.side-user-role { font-size: 12px; color: var(--side-ink-2); margin-top: 2px; }
.side-user-btns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.side-user-btns .btn { color: var(--side-ink); border-color: rgba(255,255,255,.15); }
.side-user-btns .btn:hover { background: var(--side-hover); }
.no-access { display: none !important; }
body.no-costs .cost-only { display: none !important; }
.temp-pass { font: 600 22px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; padding: 10px 12px; background: var(--brand-soft); border-radius: 8px; text-align: center; user-select: all; }
