@font-face { font-family: 'Figtree'; src: url('/vendor/fonts/figtree-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/vendor/fonts/figtree-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/vendor/fonts/figtree-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/vendor/fonts/figtree-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/vendor/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/vendor/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/vendor/fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --bg: #F4F3EF;
  --surface: #FFFFFF;
  --surface-2: #F7F6F2;
  --ink: #17181A;
  --ink-2: #3A3D41;
  --muted: #55585D;
  --line: #E2E0D9;
  --line-2: #CFCDC6;
  --line-3: #EEECE6;
  --accent: #0E5754;
  --accent-ink: #093C3A;
  --accent-soft: #E7F1F0;
  --accent-light: #9CC3C0;
  --warn: #A4471B;
  --warn-ink: #7A3512;
  --warn-soft: #FBF3EC;
  --warn-line: #F0DCCB;
  --bad: #A3262A;
  --bad-soft: #FBECEC;
  --info: #2E2A6B;
  --info-soft: #ECEBF6;
  --ok: #1E7A4C;
  --ok-soft: #E6F4EC;
  --radius: 10px;
  --radius-lg: 12px;
  --shadow: 0 8px 30px rgba(23, 24, 26, .14);
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; }
body.modal-open { overflow: hidden; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.r { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid #2BA19B; outline-offset: 2px; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---- buttons & inputs ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #831d21; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.05); }
.btn-soft { background: var(--accent-soft); border: 2px solid var(--accent); color: var(--accent-ink); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn-xl { min-height: 64px; font-size: 18px; font-weight: 700; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: inherit; }
.icon-btn:hover { background: rgba(0,0,0,.06); }

input[type=text], input[type=search], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=email], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-size: 15px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid rgba(14, 87, 84, .25); outline-offset: 0; }
input.num, .input-num { font-family: var(--mono); text-align: right; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.field .hint { color: var(--muted); font-size: 12px; }
.field-error { color: var(--bad); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-height: 36px; cursor: pointer; }
.pin-input { font-family: var(--mono); font-size: 24px !important; letter-spacing: .4em; text-align: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }

/* ---- shell ---- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px 16px; padding: 8px 20px; background: var(--ink); color: #F4F3EF; min-height: 60px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: .02em; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand span { font-weight: 400; font-size: 13px; color: #B9BBBE; margin-left: 4px; }
.mainnav { display: flex; flex-wrap: wrap; gap: 2px; }
.mainnav a { color: #D6D8DB; padding: 8px 9px; border-radius: 6px; text-decoration: none; font-size: 14px; white-space: nowrap; }
.mainnav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.mainnav a.on { color: var(--ink); background: #F4F3EF; font-weight: 600; }
.pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #E0703A; color: #fff; font-size: 12px; text-align: center; font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: #D6D8DB; }
.topbar-right .btn-ghost { color: #D6D8DB; }
.topbar-right .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.net { display: inline-flex; align-items: center; gap: 6px; }
.net .dot { width: 8px; height: 8px; border-radius: 50%; background: #5BC08A; }
.net.down .dot { background: #E06A5A; }
.counter-pick select { min-height: 36px; padding: 4px 8px; background: #2A2B2E; color: #fff; border-color: #44464A; font-size: 13px; width: auto; }
.who { white-space: nowrap; }
.usermenu { position: relative; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #44464A; background: #2A2B2E; color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 70; display: flex; flex-direction: column; }
.menu a, .menu button { display: block; text-align: left; padding: 10px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; background: transparent; border: 0; cursor: pointer; font-size: 14px; min-height: 40px; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu-who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-who span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
input.mono { font-family: var(--mono); }
.menu-btn { display: none; color: #fff; }
.offline-bar { background: var(--bad); color: #fff; padding: 10px 20px; font-weight: 600; }
.screen { flex: 1; padding: 20px 24px 40px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb a { color: var(--muted); }
.drawer-scrim { display: none; }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; }
.kpi .v { font-family: var(--mono); font-size: 24px; font-weight: 600; margin-top: 2px; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.dark .label, .kpi.dark .s { color: #C9CBCE; }
.layout-2 { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.layout-2 > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.layout-2 > .side { flex: 1 1 340px; max-width: 460px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.sumrow { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 14px; }
.sumrow > span:first-child { color: var(--muted); }
.sumrow.big { border-top: 1px dashed var(--line-2); margin-top: 6px; padding-top: 12px; align-items: baseline; }
.sumrow.big > span:first-child { color: var(--ink); font-weight: 700; font-size: 16px; }
.sumrow.big > span:last-child { font-family: var(--mono); font-weight: 600; font-size: 32px; }

/* ---- badges ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge-ok { background: var(--accent-soft); color: var(--accent-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-dark { background: var(--ink); color: #fff; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; padding: 10px 10px; background: var(--surface); position: sticky; top: 0; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table td { padding: 11px 10px; border-top: 1px solid var(--line-3); vertical-align: top; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.table .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---- feedback ---- */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 500; }
.toast-error { background: var(--bad); }
.toast-warn { background: var(--warn); }
.loading { display: flex; align-items: center; gap: 10px; padding: 40px; justify-content: center; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-weight: 500; border: 1px solid #F1CFCF; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-line); font-size: 14px; }
.note.info { background: var(--info-soft); color: var(--info); border-color: #D9D7EE; }
.note.ok { background: var(--accent-soft); color: var(--accent-ink); border-color: #CFE3E1; }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); }
.reasons { margin: 0 0 12px; padding-left: 20px; color: var(--warn-ink); }

/* ---- modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(23, 24, 26, .45); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: min(640px, 100%); box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: 88vh; }
.modal.sm { width: min(420px, 100%); }
.modal.lg { width: min(900px, 100%); }
.modal.xl { width: min(1200px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---- tabs / segmented ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 16px; }
.tab { border: 0; background: transparent; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px; }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.tab-count { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 0 6px; border-radius: 10px; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 4px; gap: 4px; }
.segmented button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.segmented button.on { background: var(--ink); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 13px; color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; }

/* ---- search dropdown ---- */
.searchbox { position: relative; width: 100%; }
.search-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); list-style: none; margin: 0; padding: 4px; max-height: 360px; overflow-y: auto; }
.search-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.search-list li.hi { background: var(--accent-soft); }
.search-none { padding: 12px; color: var(--muted); }
.pl { display: flex; justify-content: space-between; gap: 12px; }
.pl-name { font-weight: 600; }
.pl-meta { font-size: 12px; color: var(--muted); }
.pl-right { text-align: right; font-size: 13px; white-space: nowrap; }
.pl-stock { font-size: 12px; color: var(--accent); }
.pl-stock.out { color: var(--bad); }

/* ---- billing ---- */
.bill-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.scanbox { flex: 1 1 340px; display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--accent); border-radius: 10px; padding: 0 0 0 14px; min-height: 56px; }
.scanbox .ico { color: var(--accent); width: 22px; height: 22px; }
.scanbox .searchbox input { border: 0; outline: none; min-height: 52px; font-size: 17px; padding-left: 0; }
.scanbox .searchbox input:focus { outline: none; }
.bill-lines td { vertical-align: middle; }
.qty-ctl { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.qty-ctl button { width: 36px; height: 38px; border: 0; background: transparent; font-size: 18px; cursor: pointer; }
.qty-ctl input { width: 56px; min-height: 38px; border: 0; text-align: center; padding: 0; font-family: var(--mono); font-weight: 600; }
.qty-ctl input:focus { outline: none; }
.unit-sel { min-height: 36px !important; padding: 2px 6px !important; font-size: 13px !important; width: auto !important; margin-top: 4px; }
.disc-in { width: 72px !important; min-height: 36px !important; text-align: right; font-family: var(--mono); padding: 4px 8px !important; }
.slab { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 4px; padding: 3px 8px; }
.slab.party { background: var(--info-soft); color: var(--info); }
.slab.free { background: var(--ok-soft); color: var(--ok); }
.nudge { font-size: 12px; color: var(--warn); margin-top: 4px; font-weight: 600; }
.strike { text-decoration: line-through; color: var(--muted); font-size: 12px; }
.belowcost { color: var(--bad); font-size: 12px; font-weight: 700; }
.keys { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-2); }
.keys span { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.keys b { font-family: var(--mono); }
.pay-modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pay-modes.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pay-modes button { min-height: 52px; border: 1px solid var(--line-2); background: #fff; border-radius: 8px; font-weight: 600; cursor: pointer; }
.pay-modes button.on { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.qrbox { display: flex; gap: 14px; align-items: center; background: var(--bg); border-radius: 8px; padding: 12px; }
.qrbox .qr { width: 104px; height: 104px; flex: none; background: #fff; border: 1px solid var(--line-2); border-radius: 6px; padding: 4px; }
.qrbox .qr svg { width: 100%; height: 100%; }
.credit-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; display: flex; }
.credit-bar span { display: block; height: 100%; }
.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini { background: var(--bg); border-radius: 8px; padding: 8px; font-size: 12px; }
.mini .v { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.charge-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.charge-row .btn-primary { grid-column: span 2; }

/* ---- auth ---- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.auth-card.wide { width: min(720px, 100%); }
.auth-brand { font-weight: 700; font-size: 22px; letter-spacing: .02em; }
.auth-brand span { font-weight: 400; color: var(--muted); font-size: 14px; }

/* ---- misc ---- */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline > div { display: flex; gap: 12px; font-size: 13px; }
.timeline .t { flex: none; width: 92px; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.lock-banner { display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 6px; }
.lock-banner .ico { width: 14px; height: 14px; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 28px; text-align: center; background: #fff; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; height: 180px; }
.bars .b { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; }
.bars .b .t { font-size: 11px; text-align: center; color: var(--ink-2); font-family: var(--mono); }
.bars .b .r1 { background: var(--accent-light); border-radius: 3px 3px 0 0; }
.bars .b .r2 { background: var(--accent); }
.bars-x { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.denom { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.denom > span:last-child { flex: 1; min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.denom input { width: 64px !important; min-height: 38px !important; text-align: center; font-family: var(--mono); padding: 4px !important; }
.diff-ok { color: var(--accent); font-weight: 700; }
.diff-bad { color: var(--warn); font-weight: 700; }
.scan-steps { display: flex; flex-wrap: wrap; font-size: 13px; }
.scan-steps span { padding: 8px 14px; background: #fff; border: 1px solid var(--line-2); color: var(--muted); }
.scan-steps span:first-child { border-radius: 6px 0 0 6px; }
.scan-steps span:last-child { border-radius: 0 6px 6px 0; }
.scan-steps span.done { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.scan-steps span.now { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
tr.st-check td { background: #FFFBF7; }
tr.st-new td { background: #FAFAFE; }
.preview-frame { width: 100%; height: 460px; border: 1px dashed var(--line-2); border-radius: 8px; background: #FAFAF8; }
.inline-input { min-height: 36px !important; padding: 4px 8px !important; font-size: 14px !important; }
.w-xs { width: 70px !important; } .w-sm { width: 96px !important; } .w-md { width: 130px !important; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 8px 0; border-top: 1px solid var(--line-3); }
.list-plain li:first-child { border-top: 0; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.kbd-hint { font-size: 12px; color: var(--muted); }

/* ---- responsive ---- */
@media (max-width: 1360px) {
  .menu-btn { display: inline-flex; }
  .mainnav { display: none; position: fixed; top: 60px; left: 0; bottom: 0; width: min(300px, 86vw); background: var(--ink); flex-direction: column; flex-wrap: nowrap; padding: 12px; overflow-y: auto; z-index: 50; }
  .mainnav.open { display: flex; }
  .mainnav a { padding: 12px 14px; font-size: 16px; }
  .drawer-scrim { display: block; position: fixed; inset: 60px 0 0 0; background: rgba(0,0,0,.35); z-index: 45; }
  .topbar { flex-wrap: nowrap; }
  .who { display: none; }
}
@media (max-width: 1100px) {
  .layout-2 > .side { max-width: none; }
}
@media (max-width: 720px) {
  .screen { padding: 14px 12px 32px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .denoms { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 8px 10px; gap: 8px; }
  .brand span, .net span:not(.dot) { display: none; }
  .net { font-size: 0; }
  .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); }
  .layout-2 > .side { max-width: none; }
  .pay-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sumrow.big > span:last-child { font-size: 26px; }
  .keys { display: none; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal, .modal.sm, .modal.lg, .modal.xl { width: 100%; max-height: none; min-height: 100%; border-radius: 0; }
  .modal-foot { position: sticky; bottom: 0; background: #fff; }
  .card-head, .card-pad { padding-left: 12px; padding-right: 12px; }
  .table th:first-child, .table td:first-child { padding-left: 12px; }
  .table th:last-child, .table td:last-child { padding-right: 12px; }
  h1 { font-size: 19px; }
  .kpi .v { font-size: 20px; }
  .counter-pick select { max-width: 120px; }
}
@media (max-width: 380px) {
  .topbar-right .btn-ghost { padding: 0 6px; }
  .counter-pick select { max-width: 92px; }
}
@media print {
  .topbar, .toasts, .offline-bar { display: none !important; }
}

/* ---- public document page ---- */
.docpage { max-width: 900px; margin: 0 auto; padding: 16px; }
.doc-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.doc-frame { width: 100%; min-height: 1100px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
