/* Staff PWA (spec 26.1, 26.2): light theme, high contrast, big tabular numbers, 56 px money
   buttons. Customer-facing amounts 64 px, staff amounts 48 px. Accent only on the primary button. */
:root {
  /* v1 §6 shared visual system: base #F5F7FA, ink #152238, primary #155EEF, success #067647,
     error #B42318, attention #92400E. Pairs checked at >= 4.5:1 for text, >= 7:1 for amounts. */
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #152238;
  --muted: #4a5568;
  --border: #d5dce6;
  --accent: #155eef;
  --accent-text: #ffffff;
  --ok: #067647;
  --ok-bg: #e7f4ec;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --warn: #92400e;
  --warn-bg: #fff4e0;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; }

.strip { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; padding: 8px 16px;
  font-size: 12px; background: var(--panel); border-bottom: 1px solid var(--border); }
.strip-left { display: flex; flex-direction: column; }
.strip-left strong { font-size: 16px; }
.strip-left span { color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); }
.icon-btn { min-width: 48px; min-height: 48px; background: none; border: 0; font-size: 20px; }
.preview-banner { background: var(--warn-bg); color: var(--warn); font-weight: 700; font-size: 14px; text-align: center; padding: 6px 16px; }
.strip-right { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); display: inline-block; }
.dot-on { background: var(--ok); }

.screen { max-width: 480px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
h1 { font-size: 24px; margin: 0; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.error { color: var(--bad); min-height: 1.4em; margin: 0; font-size: 16px; }

.amount { font-size: 48px; font-weight: 700; text-align: center; line-height: 1.1; word-break: break-word; }
.amount-customer { font-size: 64px; }

.amount-entry { display: flex; flex-direction: column; gap: 12px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-btn { min-height: 48px; border: 1px solid var(--border); background: var(--panel); border-radius: 10px; font-size: 16px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key { min-height: 56px; font-size: 24px; border: 1px solid var(--border); background: var(--panel); border-radius: 10px; }
.key:active, .quick-btn:active { background: var(--border); }

.actions { display: flex; gap: 12px; }
.actions > button { flex: 1; }
.actions-bottom { margin-top: auto; }
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app > .screen { width: 100%; }
.confirm { flex: 1; }
.primary, .secondary { min-height: 48px; border-radius: 10px; padding: 0 16px; font-weight: 600; }
.primary { background: var(--accent); color: var(--accent-text); border: 0; }
.primary:disabled { opacity: 0.4; }
.secondary { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.money { min-height: 56px; font-size: 20px; }
.link { background: none; border: 0; color: var(--accent); padding: 4px; text-decoration: underline; }

.chip { margin: 0; padding: 10px 12px; border-radius: 10px; font-weight: 700; text-align: center; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-info { background: var(--panel); border: 1px solid var(--border); font-weight: 600; }

.breakdown { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-size: 18px; }
.breakdown dt { color: var(--muted); }
.breakdown dd { margin: 0; text-align: right; }

.waiting { align-items: center; text-align: center; padding-top: 32px; }
.waiting .actions { width: 100%; }
.arm { font-size: 24px; font-weight: 700; margin: 0; }
.pulse { width: 96px; height: 96px; border-radius: 50%; border: 6px solid var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(0.85); opacity: 0.5; } 50% { transform: scale(1); opacity: 1; } }
.spinner { width: 64px; height: 64px; border-radius: 50%; border: 6px solid var(--border); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.charging { align-items: center; text-align: center; padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { .pulse, .spinner { animation: none; } }

.full { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 24px 16px; text-align: center; }
.full-ok { background: var(--ok-bg); color: var(--ok); }
.full-bad { background: var(--bad-bg); color: var(--bad); }
.full-warn { background: var(--warn-bg); color: var(--warn); }
.full-mark { font-size: 72px; font-weight: 700; line-height: 1; }
.full h1 { font-size: 32px; }
.full .reason { font-size: 22px; color: var(--text); }
.full .actions { width: 100%; max-width: 480px; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.field input, .field select { min-height: 48px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text); font-size: 18px; }

.scan { display: flex; flex-direction: column; gap: 12px; padding: 16px; max-width: 480px; margin: 0 auto; text-align: center; }
.scan video { width: 100%; border-radius: 12px; background: #000; }

/* v1 §6 screen catalogue: label-over-value blocks, one bottom action, bottom navigation. */
.page h1 { font-size: 28px; }
.page h2 { font-size: 18px; margin: 8px 0 4px; }
.page.has-nav, .screen.has-nav { padding-bottom: 88px; }
.page .actions-bottom { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
.has-nav .actions-bottom { bottom: 64px; }
.context { margin: 0; color: var(--muted); font-size: 14px; }
.back { align-self: flex-start; text-decoration: none; min-height: 44px; }
.page-body { display: flex; flex-direction: column; gap: 12px; }
.unwired { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.toast { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--text); color: #fff; font-size: 14px; }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-label { color: var(--muted); font-size: 16px; }
.kv-value { font-size: 24px; font-weight: 700; }
.kv-big .kv-value { font-size: 32px; }
.kv-ok .kv-value { color: var(--ok); }
.kv-bad .kv-value { color: var(--bad); }
.kv-warn .kv-value { color: var(--warn); }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kv-grid .kv-value { font-size: 20px; }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; min-height: 56px; }
.row + .row { border-top: 1px solid var(--border); }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { color: var(--muted); font-size: 14px; }
.row-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.row-right { font-weight: 700; }
.small { min-height: 40px; padding: 0 12px; font-size: 15px; display: inline-flex; align-items: center; text-decoration: none; }
a.secondary { border-radius: 10px; }
.chip-inline { display: inline-block; padding: 4px 8px; font-size: 13px; }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { min-height: 56px; font-size: 16px; }
.denoms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.denom { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 4px 8px; font-size: 15px; }
.denom input { width: 64px; min-height: 40px; text-align: right; border: 1px solid var(--border); border-radius: 8px; font-size: 18px; }
.toggle { display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 0 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.toggle input { width: 28px; height: 28px; }
.field textarea { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }
.section { display: flex; flex-direction: column; gap: 8px; }
details { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.pulse-small { width: 64px; height: 64px; align-self: center; }
.navbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--panel); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.nav-item { flex: 1; min-height: 56px; background: none; border: 0; color: var(--muted); font-size: 14px; }
.nav-on { color: var(--accent); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); }
.code-display { letter-spacing: 0.08em; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 40px; }
/* v1.2 counter app pages (`#/alur/counter`). Sizes follow the design's phone screen
   (ui/shell.html): 15 px text, 25 px title, 20 px side padding. */
.cp { display: flex; flex-direction: column; width: 100%; max-width: 480px; min-height: 100vh; margin: 0 auto; background: var(--panel); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.cp-header { display: flex; flex-direction: column; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.cp-header small { font-size: 12px; color: #526277; }
.cp-body { flex: 1; display: flex; flex-direction: column; padding: 24px 20px; }
.cp-body h1 { font-size: 25px; line-height: 1.2; margin: 0 0 20px; }
.cp-intro { margin: 0; color: #526277; }
.cp-hint { margin: 15px 0 0; padding: 12px; border-radius: 9px; background: #f0f4fa; color: #526277; font-size: 13px; }
.cp-field { margin-top: 16px; font-size: 13px; color: #526277; }
.cp-field input, .cp-field select { min-height: 48px; padding: 12px; border: 1px solid #c3cddd; border-radius: 8px; font-size: 15px; background: var(--panel); color: var(--text); }
.cp-field select { width: 100%; box-sizing: border-box; }
.cp-body .error { margin-top: 8px; font-size: 13px; }
.cp-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 17px; }
.cp-actions button { min-height: 48px; border-radius: 9px; }
.cp-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.cp-metric { border: 1px solid var(--border); border-radius: 10px; padding: 14px; overflow-wrap: anywhere; }
.cp-metric small { display: block; color: #526277; }
.cp-metric strong { display: block; font-size: 19px; margin-top: 6px; }
.cp-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 12px; table-layout: fixed; }
.cp-table th, .cp-table td { text-align: left; border-bottom: 1px solid var(--border); padding: 9px 5px; overflow-wrap: anywhere; vertical-align: top; }
.cp-table th { background: #f0f4fa; }
.cp-table th:first-child, .cp-table td:first-child { width: 32%; }
.cp-note { margin: 0; padding: 15px; background: #fff1db; color: #854e00; border-radius: 10px; }
.cp-blocked { display: block; font-size: 12px; color: #92400e; }
.cp-check { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.cp-check input { width: 22px; min-height: 22px; margin: 0 0 0 4px; }
.cp-nav { display: flex; border-top: 1px solid var(--border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
.cp-nav button { flex: 1; border: 0; background: none; padding: 8px 4px; font-size: 12px; color: #526277; }
.cp-nav button[aria-current="page"] { color: #155eef; font-weight: 700; }
.cp-amount { margin: 4px 0 20px; font-size: 46px; font-weight: 700; line-height: 1.1; color: var(--text); overflow-wrap: anywhere; }
.cp-quick, .cp-keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cp-quick button, .cp-keypad button { border: 1px solid var(--border); background: var(--panel); color: var(--text); }
.cp-quick { margin-bottom: 10px; }
.cp-quick button { min-height: 44px; border-radius: 9px; font-size: 13px; }
.cp-keypad button { min-height: 58px; border-radius: 9px; font-size: 22px; }
.cp-wait { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 8px; text-align: center; }
.cp-wait .pulse { margin: 8px 0; }
.cp-wait .cp-intro { max-width: 28ch; }
/* Temporary phone log. Sits above the page so a tap can be copied after the error. */
.phone-log { position: fixed; top: 8px; right: 8px; z-index: 40; width: min(92vw, 420px); font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.phone-log-toggle { min-height: 36px; padding: 6px 12px; border: 0; border-radius: 999px; background: #111827; color: #fff; font: inherit; }
.phone-log-panel { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding: 8px; max-height: 46vh; border-radius: 10px; background: #111827; color: #e5e7eb; }
.phone-log-panel[hidden] { display: none; }
.phone-log-hint { margin: 0; color: #cbd5e1; }
.phone-log-panel pre { margin: 0; max-height: 28vh; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.phone-log-actions { display: flex; gap: 8px; }
.phone-log-actions button { flex: 1; min-height: 36px; border: 0; border-radius: 8px; background: #e5e7eb; color: #111827; font: inherit; }
.cp-ok { background: #e5f4ea; color: #067647; }
.cp-inline { align-self: flex-start; margin-top: 16px; min-height: 48px; }
.cp-balance { margin-top: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.cp-balance small { display: block; font-size: 13px; color: #526277; }
.cp-balance strong { display: block; margin-top: 4px; font-size: 25px; }
