/* Hospital Queue — design tokens & shared styles
   ============================================== */

:root {
  /* Per-tenant brand (set via JS / inline style on root) */
  --brand: oklch(0.55 0.09 195);          /* default teal */
  --brand-deep: oklch(0.42 0.1 195);
  --brand-soft: oklch(0.95 0.025 195);
  --brand-ink: #ffffff;

  /* Neutral palette — warm, calm, not clinical */
  --bg: #f7f6f1;
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --surface-3: #e8e5dc;
  --line: oklch(0.9 0.005 80);
  --line-strong: oklch(0.83 0.008 80);

  --ink: oklch(0.22 0.01 80);
  --ink-muted: oklch(0.48 0.012 80);
  --ink-faint: oklch(0.62 0.01 80);

  /* Department palette — distinct hues, balanced chroma */
  --dept-blue:   oklch(0.62 0.13 240);
  --dept-green:  oklch(0.62 0.13 150);
  --dept-purple: oklch(0.6 0.16 300);
  --dept-orange: oklch(0.68 0.15 55);
  --dept-red:    oklch(0.6 0.18 25);
  --dept-teal:   oklch(0.62 0.12 195);
  --dept-violet: oklch(0.6 0.17 280);
  --dept-pink:   oklch(0.65 0.16 350);

  --priority: oklch(0.6 0.2 25);
  --priority-soft: oklch(0.95 0.04 25);
  --warn: oklch(0.7 0.15 70);
  --warn-soft: oklch(0.96 0.05 80);
  --ok: oklch(0.62 0.13 150);
  --ok-soft: oklch(0.95 0.05 150);

  /* Layout */
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.05);
  --shadow:    0 4px 16px oklch(0.2 0.01 80 / 0.06), 0 1px 3px oklch(0.2 0.01 80 / 0.04);
  --shadow-lg: 0 20px 50px oklch(0.2 0.01 80 / 0.12), 0 4px 10px oklch(0.2 0.01 80 / 0.06);

  --font-sans: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --font-display: "Manrope", ui-sans-serif, system-ui, sans-serif;
}

[data-density="compact"] { --row-h: 44px; }
[data-density="comfortable"] { --row-h: 56px; }
[data-density="spacious"] { --row-h: 68px; }

/* Tenant theme application — driven by JS, swaps --brand */
[data-tenant="northgate"] {
  --brand: oklch(0.45 0.16 260);
  --brand-deep: oklch(0.34 0.18 260);
  --brand-soft: oklch(0.95 0.03 260);
}
[data-tenant="cedar"] {
  --brand: oklch(0.55 0.17 25);
  --brand-deep: oklch(0.42 0.19 25);
  --brand-soft: oklch(0.95 0.04 25);
}
[data-tenant="helena"] {
  --brand: oklch(0.5 0.1 195);
  --brand-deep: oklch(0.38 0.11 195);
  --brand-soft: oklch(0.94 0.03 195);
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
}
body { overflow: hidden; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

#root { height: 100vh; width: 100vw; overflow: hidden; }

.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* =========================================================================
   PROTOTYPE CHROME (top bar showing screen switcher — out of design surface)
   ========================================================================= */
.proto-chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 44px;
  background: oklch(0.2 0.01 80);
  color: oklch(0.95 0.005 80);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 14px;
  z-index: 100;
  font-size: 12.5px;
  border-bottom: 1px solid oklch(0.3 0.01 80);
}
.proto-chrome .logo {
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: oklch(0.95 0.005 80);
}
.proto-chrome .logo svg { width: 18px; height: 18px; }
.proto-chrome .tabs {
  display: flex;
  align-items: center;
  background: oklch(0.15 0.01 80);
  padding: 3px;
  border-radius: 9px;
  gap: 2px;
  margin-left: 6px;
}
.proto-chrome .tab {
  padding: 5px 11px;
  border-radius: 6px;
  color: oklch(0.7 0.008 80);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.proto-chrome .tab:hover { color: oklch(0.95 0.005 80); }
.proto-chrome .tab.active {
  background: oklch(0.32 0.01 80);
  color: white;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.proto-chrome .tab .k {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: oklch(0.32 0.01 80);
  border-radius: 3px;
  color: oklch(0.65 0.008 80);
}
.proto-chrome .tab.active .k { background: oklch(0.4 0.01 80); color: white; }
.proto-chrome .spacer { flex: 1; }
.proto-chrome .url {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: oklch(0.65 0.008 80);
  background: oklch(0.15 0.01 80);
  padding: 4px 10px;
  border-radius: 6px;
}
.proto-chrome .tenant-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: oklch(0.15 0.01 80);
  border-radius: 6px;
  padding: 4px 10px;
  color: oklch(0.85 0.005 80);
}
.proto-chrome .tenant-pick .swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.stage {
  position: absolute;
  inset: 44px 0 0 0;
  overflow: hidden;
  background: var(--bg);
}
.stage[data-fit="contain"] {
  overflow: auto;
  display: grid;
  place-items: center;
  background: oklch(0.95 0.005 80);
  padding: 16px;
}

/* =========================================================================
   COMMON ELEMENTS
   ========================================================================= */

/* Buttons */
.btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}
.btn.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--priority); }
.btn.danger.solid { background: var(--priority); color: white; border-color: var(--priority); }
.btn.lg { height: 56px; padding: 0 26px; font-size: 16px; border-radius: 12px; }
.btn.xl { height: 76px; padding: 0 36px; font-size: 19px; border-radius: 16px; font-weight: 700; }
.btn.touch {
  height: 96px;
  font-size: 22px;
  padding: 0 32px;
  border-radius: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.btn svg { width: 16px; height: 16px; }
.btn.lg svg { width: 18px; height: 18px; }
.btn.xl svg { width: 22px; height: 22px; }
.btn.touch svg { width: 28px; height: 28px; }

/* Field */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.field > label .sub { color: var(--ink-faint); font-weight: 500; margin-left: 4px; }
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="date"],
.field select,
.field textarea {
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.field input.touch {
  height: 76px;
  font-size: 22px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 500;
}
.field textarea { padding: 12px 14px; height: auto; min-height: 96px; resize: vertical; }
.field .help { font-size: 12px; color: var(--ink-faint); }
.field .err { font-size: 12.5px; color: var(--priority); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.brand { background: var(--brand-soft); color: var(--brand-deep); }
.chip.priority { background: var(--priority-soft); color: var(--priority); }
.chip.warn { background: var(--warn-soft); color: oklch(0.45 0.15 65); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }

/* Status pulse */
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  position: relative;
}
.live-dot::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  background: var(--ok);
  opacity: .4;
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.6); opacity: .55; }
  100% { transform: scale(2); opacity: 0; }
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-muted);
  font-weight: 500;
}

/* =========================================================================
   DISPLAY BOARD (public TV)
   ========================================================================= */
.display {
  height: 100%;
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  position: relative;
  overflow: hidden;
}
.display .head { flex-shrink: 0; height: 90px; }
.display .ticker { flex-shrink: 0; height: 56px; }
.display .media-slot { flex-shrink: 0; height: 110px; }
.display .body.single,
.display .grid-body,
.display .spotlight-body { flex: 1; min-height: 0; }
.display:fullscreen { width: 100vw; height: 100vh; }
.display:fullscreen { cursor: none; }
.display:fullscreen:hover { cursor: default; }
.display .display-fs-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  margin-right: 6px;
}
.display .display-fs-btn:hover { background: var(--surface-3); color: var(--ink); }
.display:fullscreen .display-fs-btn { background: transparent; opacity: 0; }
.display:fullscreen:hover .display-fs-btn { opacity: 1; }
.display .head {
  display: flex;
  align-items: center;
  padding: 0 56px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  gap: 24px;
}
.display .hosp {
  display: flex;
  align-items: center;
  gap: 14px;
}
.display .hosp .logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 19px;
}
.display .hosp .name { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.1; }
.display .hosp .sub { font-size: 13px; color: var(--ink-muted); font-weight: 500; margin-top: 2px; }
.display .head .dept-tag {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: 48px;
  background: var(--surface-2);
  border-radius: 12px;
  font-weight: 600;
  font-size: 18px;
}
.display .head .dept-tag .dept-dot { width: 12px; height: 12px; border-radius: 50%; }
.display .head .spacer { flex: 1; }
.display .head .clock {
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.display .head .date {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 500;
  text-align: right;
}

.display .body.single {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  overflow: hidden;
}

.display .now {
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.display .now h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
}
.display .now-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
  align-content: start;
}
.display .now-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  position: relative;
}
.display .now-card .ticket {
  font-size: clamp(52px, 5.4vw, 96px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}
.display .now-card .sp {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: -0.01em;
}
.display .now-card .sp b { color: var(--ink); font-weight: 700; }
.display .now-card .dept-strip {
  position: absolute;
  left: 0; top: 22px; bottom: 22px;
  width: 5px;
  border-radius: 0 4px 4px 0;
}
.display .now-card .name {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-top: auto;
}
.display .now-card.empty .ticket { color: var(--ink-faint); }
.display .now-card.empty .sp { color: var(--ink-faint); }

.display .next {
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  background: var(--surface-2);
}
.display .next h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.display .next h2 .count {
  font-family: var(--font-mono);
  background: var(--surface);
  color: var(--ink);
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  letter-spacing: 0;
}
.display .next-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}
.display .next-row {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
}
.display .next-row .pos {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-faint);
  font-weight: 600;
}
.display .next-row .num {
  font-size: clamp(26px, 2vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.display .next-row .name {
  font-size: 14px;
  color: var(--ink-muted);
  font-weight: 500;
  margin-top: 1px;
}
.display .next-row .wait {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
}
.display .next-row.priority {
  background: var(--priority-soft);
  border-color: oklch(0.6 0.2 25 / 0.3);
}
.display .next-row.priority .pri-tag {
  background: var(--priority);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 8px;
}

.display .foot {
  display: flex;
  align-items: center;
  padding: 0 56px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-muted);
  gap: 24px;
}
.display .foot .stat { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.display .foot .stat b { color: var(--ink); }
.display .foot .spacer { flex: 1; }

/* ===== Ticker (bottom strip for ads/notices) ===== */
.display .ticker {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: oklch(0.95 0.005 80);
  height: 56px;
  overflow: hidden;
}
.display .ticker-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  height: 100%;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--brand);
  color: var(--brand-ink);
}
.display .ticker-track {
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
}
.display .ticker-strip {
  display: inline-flex;
  white-space: nowrap;
  animation: tickerScroll 50s linear infinite;
}
.display .ticker-item {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0 16px;
}
.display .ticker-sep {
  display: inline-block;
  margin: 0 8px 0 22px;
  color: var(--brand);
  font-weight: 700;
}
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== Media slot (top banner) ===== */
.display .media-slot {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(95deg, var(--brand-deep), var(--brand));
  color: var(--brand-ink);
  padding: 16px 56px;
  height: 110px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.display .media-content {
  display: flex;
  align-items: center;
  gap: 30px;
  width: 100%;
  min-width: 0;
}
.display .media-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.display .media-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.78;
}
.display .media-headline {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.display .media-sub {
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.display .media-aside { margin-left: auto; flex-shrink: 0; }
.display .qr-block {
  background: rgba(255,255,255,.94);
  color: var(--ink);
  padding: 8px 12px 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.display .qr-block svg { color: var(--ink); flex-shrink: 0; }
.display .qr-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1.2;
  max-width: 70px;
}

/* ===== GRID body (multi-dept all at once) ===== */
.display .grid-body {
  display: grid;
  gap: 14px;
  padding: 18px 24px;
  background: var(--bg);
  overflow: hidden;
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
}
.display .grid-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.display .grid-cell-head {
  padding: 12px 18px 14px;
  color: white;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.display .grid-cell-head .gc-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.display .grid-cell-head .gc-meta {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.display .grid-cell-head .gc-code {
  font-family: var(--font-mono);
  background: rgba(255,255,255,.18);
  padding: 1px 6px;
  border-radius: 4px;
}
.display .grid-cell-head .gc-sep { opacity: 0.55; }
.display .grid-cell-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.display .gc-section-lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.display .gc-section-lbl .gc-count {
  font-family: var(--font-mono);
  background: var(--surface-2);
  color: var(--ink-muted);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0;
  margin-left: 2px;
}
.display .gc-serving {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.display .gc-serv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 14px;
}
.display .gc-ticket {
  font-size: clamp(28px, 2.6vw, 44px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.display .gc-sp {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
}
.display .gc-sp b { color: var(--ink); font-weight: 700; }
.display .gc-empty {
  font-size: 13px;
  color: var(--ink-faint);
  font-weight: 600;
  text-align: center;
  padding: 14px 0;
}
.display .gc-next {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}
.display .gc-next-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}
.display .gc-next-row.pri {
  background: var(--priority-soft);
  border-color: oklch(0.6 0.2 25 / 0.25);
}
.display .gc-pos {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  font-weight: 600;
}
.display .gc-nextnum {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.display .gc-priflag {
  background: var(--priority);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}
.display .gc-waited {
  font-size: 12px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}
.display .gc-more {
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 600;
  padding: 6px 0;
}

/* ===== SPOTLIGHT body ===== */
.display .spotlight-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  overflow: hidden;
  background: var(--bg);
}
.display .spot-rail {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 12px;
  gap: 6px;
}
.display .spot-rail-item {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 12px;
  padding: 12px 14px 12px 8px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  background: var(--surface-2);
  align-items: center;
}
.display .spot-rail-item .rail-bar {
  width: 6px;
  height: 44px;
  border-radius: 3px;
}
.display .spot-rail-item.active {
  background: var(--ink);
  color: white;
}
.display .spot-rail-item.active .rail-stats { color: oklch(0.7 0.008 80); }
.display .spot-rail-item.active .rail-current { color: white; }
.display .rail-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.display .rail-stats {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  display: flex;
  gap: 10px;
  margin-top: 3px;
  grid-column: 2;
}
.display .rail-stat { display: inline-flex; align-items: baseline; gap: 4px; }
.display .rs-num { font-weight: 800; color: inherit; font-size: 13px; }
.display .spot-rail-item.active .rs-num { color: white; }
.display .rail-current {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  grid-row: span 2;
}

.display .spot-main {
  display: grid;
  grid-template-rows: 64px 1.2fr 1fr;
  overflow: hidden;
}
.display .spot-deptbar {
  padding: 0 36px;
  color: white;
  display: flex;
  align-items: center;
  gap: 14px;
}
.display .spot-deptname { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.display .spot-deptcode {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 2px 8px;
  background: rgba(255,255,255,.2);
  border-radius: 5px;
  font-weight: 700;
}
.display .spot-rotating {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
}
.display .spot-now {
  padding: 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.display .spot-now h2,
.display .spot-next h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.display .spot-now h2 .count,
.display .spot-next h2 .count {
  font-family: var(--font-mono);
  background: var(--surface);
  color: var(--ink);
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: 0;
  border: 1px solid var(--line);
}
.display .spot-now-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  flex: 1;
}
.display .spot-now-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  min-height: 0;
}
.display .spot-now-card .dept-strip {
  position: absolute;
  left: 0; top: 22px; bottom: 22px;
  width: 5px;
  border-radius: 0 4px 4px 0;
}
.display .spot-now-card .ticket {
  font-size: clamp(48px, 4.6vw, 84px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.display .spot-now-card .sp { font-size: 15px; font-weight: 600; color: var(--ink-muted); }
.display .spot-now-card .sp b { color: var(--ink); }
.display .spot-now-card .name { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: auto; }
.display .spot-now-card.empty .ticket { color: var(--ink-faint); }

.display .spot-next {
  padding: 18px 36px 28px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.display .spot-next-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
  flex: 1;
  overflow: hidden;
}
.display .spot-next-row {
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
}
.display .spot-next-row.priority { background: var(--priority-soft); border-color: oklch(0.6 0.2 25 / 0.25); }
.display .spot-next-row .pos { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.display .spot-next-row .num { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.display .spot-next-row .pri-tag {
  background: var(--priority);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.display .spot-next-row .wait { font-size: 12px; color: var(--ink-muted); font-family: var(--font-mono); }

/* Call overlay */
.call-overlay {
  position: absolute;
  inset: 0;
  background: var(--brand);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  z-index: 50;
  animation: callIn .35s ease;
}
@keyframes callIn { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.call-overlay .inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 40px;
}
.call-overlay .label {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}
.call-overlay .big-ticket {
  font-size: clamp(160px, 22vw, 380px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}
.call-overlay .row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 18px;
  font-size: 36px;
  font-weight: 700;
}
.call-overlay .row .arrow { opacity: .55; font-size: 32px; }
.call-overlay .sp {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.call-overlay .name { font-size: 26px; font-weight: 600; opacity: 0.82; margin-top: 6px; }
.call-overlay .chime-bar {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  align-items: end;
  height: 32px;
}
.call-overlay .chime-bar span {
  width: 6px;
  background: var(--brand-ink);
  border-radius: 3px;
  opacity: .8;
  animation: chime 1.4s ease-in-out infinite;
}
@keyframes chime {
  0%, 100% { height: 8px; }
  50% { height: 28px; }
}

/* =========================================================================
   KIOSK
   ========================================================================= */
.kiosk {
  height: 100%;
  width: 100%;
  background: var(--bg);
  display: grid;
  grid-template-rows: 84px 1fr 92px;
  position: relative;
  overflow: hidden;
}
.kiosk .head {
  display: flex;
  align-items: center;
  padding: 0 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  gap: 18px;
}
.kiosk .head .logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
}
.kiosk .head .name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.kiosk .head .sub { font-size: 13px; color: var(--ink-muted); font-weight: 500; }
.kiosk .head .spacer { flex: 1; }
.kiosk .head .lang {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 10px;
}
.kiosk .head .lang button {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  color: var(--ink-muted);
}
.kiosk .head .lang button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.kiosk .body {
  padding: 40px 56px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.kiosk .step-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.kiosk .step-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-deep);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.kiosk .step-head h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.kiosk .step-head .step-sub {
  font-size: 19px;
  color: var(--ink-muted);
  font-weight: 500;
  max-width: 720px;
}

.kiosk .dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.kiosk .dept-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  position: relative;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  min-height: 188px;
}
.kiosk .dept-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}
.kiosk .dept-card .icon-circle {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
}
.kiosk .dept-card .icon-circle svg { width: 28px; height: 28px; color: white; }
.kiosk .dept-card .label {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.kiosk .dept-card .meta { display: flex; gap: 14px; margin-top: auto; align-items: baseline; }
.kiosk .dept-card .wait-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kiosk .dept-card .wait-unit {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 600;
  margin-left: -8px;
}
.kiosk .dept-card .waiting-count {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 600;
}
.kiosk .dept-card .waiting-count b { color: var(--ink); font-weight: 700; }

.kiosk .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  max-width: 880px;
}
.kiosk .form-grid .full { grid-column: 1 / -1; }
.kiosk .priority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.kiosk .priority-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}
.kiosk .priority-card .check {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  flex-shrink: 0;
}
.kiosk .priority-card.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.kiosk .priority-card.selected .check {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
}
.kiosk .priority-card.selected .check svg { width: 14px; height: 14px; color: white; }
.kiosk .priority-card .pc-lbl { font-size: 16px; font-weight: 600; }
.kiosk .priority-card .pc-sub { font-size: 13px; color: var(--ink-muted); font-weight: 500; }

.kiosk .foot {
  display: flex;
  align-items: center;
  padding: 0 56px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  gap: 14px;
}

.kiosk .ticket-print {
  margin: 32px auto;
  max-width: 480px;
  background: var(--surface);
  border-radius: 22px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.kiosk .ticket-print .tp-top {
  background: var(--brand);
  color: var(--brand-ink);
  padding: 28px 32px;
  text-align: center;
}
.kiosk .ticket-print .tp-top .hosp { font-size: 13px; font-weight: 600; opacity: .8; letter-spacing: 0.06em; text-transform: uppercase; }
.kiosk .ticket-print .tp-top .dept { font-size: 18px; font-weight: 700; margin-top: 4px; }
.kiosk .ticket-print .tp-num {
  text-align: center;
  padding: 36px 32px 32px;
}
.kiosk .ticket-print .tp-num .lbl {
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--ink-muted); text-transform: uppercase;
}
.kiosk .ticket-print .tp-num .num {
  font-size: 120px; font-weight: 800; letter-spacing: -0.04em;
  line-height: 0.95; font-variant-numeric: tabular-nums;
  margin: 6px 0 8px;
}
.kiosk .ticket-print .tp-num .name { font-size: 18px; font-weight: 600; }
.kiosk .ticket-print .tp-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px dashed var(--line-strong);
  border-bottom: 1px dashed var(--line-strong);
}
.kiosk .ticket-print .tp-meta .m {
  padding: 16px 22px;
  border-right: 1px dashed var(--line-strong);
}
.kiosk .ticket-print .tp-meta .m:last-child { border-right: none; }
.kiosk .ticket-print .tp-meta .lbl {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--ink-muted); text-transform: uppercase;
}
.kiosk .ticket-print .tp-meta .val { font-size: 18px; font-weight: 700; margin-top: 4px; }
.kiosk .ticket-print .tp-bottom { padding: 18px 32px; text-align: center; font-size: 13px; color: var(--ink-muted); font-weight: 500; }

.kiosk .countdown {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink-muted);
  font-weight: 600;
}
.kiosk .countdown b { color: var(--brand-deep); font-variant-numeric: tabular-nums; }

/* =========================================================================
   STAFF — shared
   ========================================================================= */
.staff {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100%;
}
.staff .side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.staff .side .brand-row {
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.staff .side .brand-row .logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
}
.staff .side .brand-row .name { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.staff .side .brand-row .sub { font-size: 11.5px; color: var(--ink-faint); font-weight: 500; }

.staff .side .nav { padding: 12px 10px; flex: 1; overflow: auto; }
.staff .side .nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  font-weight: 600;
  padding: 14px 10px 8px;
}
.staff .side .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.staff .side .nav-item:hover { background: var(--surface-2); color: var(--ink); }
.staff .side .nav-item.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.staff .side .nav-item svg { width: 16px; height: 16px; opacity: 0.85; }
.staff .side .nav-item .badge {
  margin-left: auto;
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
}
.staff .side .nav-item.active .badge { background: white; color: var(--brand-deep); border-color: transparent; }
.staff .side .nav-item .badge.urgent { color: var(--priority); background: var(--priority-soft); border-color: transparent; }

.staff .side .foot {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.staff .side .foot .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.65 0.1 280), oklch(0.55 0.16 240));
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.staff .side .foot .who { font-size: 13px; line-height: 1.2; }
.staff .side .foot .who b { font-weight: 600; display: block; }
.staff .side .foot .who span { color: var(--ink-faint); font-size: 11.5px; }

.staff .main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.staff .topbar {
  height: 60px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 26px;
  gap: 14px;
  flex-shrink: 0;
}
.staff .crumb { font-size: 13px; color: var(--ink-muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.staff .crumb b { color: var(--ink); font-weight: 600; }
.staff .crumb .sep { color: var(--ink-faint); }
.staff .topbar .spacer { flex: 1; }
.staff .topbar .iconbtn {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  background: var(--surface);
}
.staff .topbar .iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.staff .topbar .iconbtn svg { width: 16px; height: 16px; }

.staff .content { flex: 1; overflow: auto; padding: 24px 26px 32px; }
.staff .page-head { display: flex; align-items: flex-end; margin-bottom: 22px; gap: 18px; }
.staff .page-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.staff .page-head .sub { margin: 4px 0 0; color: var(--ink-muted); font-size: 14px; font-weight: 500; }
.staff .page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* Staff dashboard — department grid */
.dept-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.dept-overview-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.dept-overview-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.dept-overview-card .ribbon {
  position: absolute;
  left: 0; top: 22px; bottom: 22px;
  width: 4px;
  border-radius: 0 4px 4px 0;
}
.dept-overview-card .top { display: flex; align-items: flex-start; gap: 12px; padding-left: 6px; }
.dept-overview-card .top .icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.dept-overview-card .top .icon svg { width: 20px; height: 20px; color: white; }
.dept-overview-card .top .meta { display: flex; flex-direction: column; }
.dept-overview-card .top .name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.dept-overview-card .top .code { font-size: 11.5px; color: var(--ink-faint); font-family: var(--font-mono); margin-top: 2px; }
.dept-overview-card .top .open-btn { margin-left: auto; }

.dept-overview-card .stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding-left: 6px;
}
.dept-overview-card .stat .lbl { font-size: 11px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.dept-overview-card .stat .val { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 2px; }
.dept-overview-card .stat .val .unit { font-size: 13px; color: var(--ink-muted); font-weight: 600; margin-left: 3px; }

.dept-overview-card .live {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 12px 12px;
  margin-left: 6px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  font-weight: 600;
}
.dept-overview-card .live .now-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  margin-left: 4px;
}

/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.kpi .lbl { font-size: 11.5px; text-transform: uppercase; color: var(--ink-faint); letter-spacing: 0.08em; font-weight: 700; }
.kpi .val { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 4px; }
.kpi .val .unit { font-size: 13px; color: var(--ink-muted); font-weight: 600; margin-left: 4px; }
.kpi .delta { font-size: 12px; color: var(--ink-muted); font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--priority); }

/* =========================================================================
   STAFF — DEPARTMENT PANEL (queue working UI)
   ========================================================================= */
.panel {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
  height: 100%;
}
.panel .main-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.now-serving {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.now-serving::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--brand);
}
.now-serving .ns-num {
  font-size: 96px;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.now-serving .ns-meta { display: flex; flex-direction: column; gap: 6px; }
.now-serving .ns-name { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.now-serving .ns-detail { display: flex; gap: 16px; color: var(--ink-muted); font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.now-serving .ns-detail b { color: var(--ink); }
.now-serving .ns-actions { display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.now-serving .ns-empty {
  font-size: 18px;
  color: var(--ink-faint);
  font-weight: 600;
}
.now-serving .ns-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-2);
  padding: 5px 11px;
  border-radius: 8px;
  color: var(--ink-muted);
}

.call-next-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  align-items: center;
}
.call-next-row .next-up {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-left: 4px;
}
.call-next-row .next-up .lbl { font-size: 11px; text-transform: uppercase; color: var(--ink-faint); letter-spacing: 0.1em; font-weight: 700; }
.call-next-row .next-up .ticket { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.call-next-row .next-up .name { font-size: 14px; color: var(--ink-muted); font-weight: 600; }

.queue-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.queue-toolbar {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.queue-toolbar h3 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.queue-toolbar .count {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 5px;
  color: var(--ink-muted);
  font-weight: 600;
}
.queue-toolbar .spacer { flex: 1; }
.queue-toolbar .filter {
  display: inline-flex;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
}
.queue-toolbar .filter.active { background: var(--brand-soft); color: var(--brand-deep); border-color: transparent; }

.qrow {
  display: grid;
  grid-template-columns: 50px 110px 1fr 100px 100px 36px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  gap: 10px;
}
.qrow:last-child { border-bottom: none; }
.qrow:hover { background: var(--surface-2); }
.qrow .pos { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.qrow .num { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.qrow .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qrow .who .name { font-weight: 600; }
.qrow .who .sub { font-size: 11.5px; color: var(--ink-faint); }
.qrow .waited { font-variant-numeric: tabular-nums; color: var(--ink-muted); font-weight: 600; font-size: 12.5px; }
.qrow .waited.over { color: var(--priority); }
.qrow.priority { background: var(--priority-soft); }
.qrow.priority:hover { background: oklch(0.95 0.05 25); }
.qrow.priority .pri { background: var(--priority); color: white; }

.qhead {
  display: grid;
  grid-template-columns: 50px 110px 1fr 100px 100px 36px;
  padding: 8px 16px;
  background: var(--surface-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 700;
  gap: 10px;
}

.panel .side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.activity {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.activity h3 { margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.activity .item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.4;
}
.activity .item .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  margin-top: 6px;
  margin-left: 7px;
}
.activity .item .dot.ok { background: var(--ok); }
.activity .item .dot.brand { background: var(--brand); }
.activity .item .dot.warn { background: var(--warn); }
.activity .item .dot.pri { background: var(--priority); }
.activity .item b { color: var(--ink); font-weight: 600; }
.activity .item .t { color: var(--ink-faint); font-size: 11px; font-family: var(--font-mono); }

.sp-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.sp-selector .top { display: flex; align-items: center; gap: 8px; }
.sp-selector .top .lbl { font-size: 12px; text-transform: uppercase; color: var(--ink-faint); letter-spacing: 0.1em; font-weight: 700; }
.sp-selector .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-selector .pill {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  border: 1px solid transparent;
}
.sp-selector .pill.active {
  background: var(--brand);
  color: var(--brand-ink);
}

/* =========================================================================
   ONBOARDING WIZARD
   ========================================================================= */
.onb {
  height: 100%;
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--bg);
}
.onb .rail {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow: auto;
}
.onb .rail .logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 16px; letter-spacing: -0.01em;
}
.onb .rail .logo .mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--surface);
  display: grid; place-items: center;
}
.onb .rail .logo .mark svg { width: 18px; height: 18px; }
.onb .rail h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 0; line-height: 1.2; }
.onb .rail .intro { font-size: 13.5px; color: var(--ink-muted); font-weight: 500; line-height: 1.55; }
.onb .rail .steps { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.onb .rail .step {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 10px;
  align-items: center;
  font-size: 13.5px;
  color: var(--ink-muted);
  font-weight: 500;
  position: relative;
}
.onb .rail .step.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.onb .rail .step.done { color: var(--ink); }
.onb .rail .step .marker {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  color: var(--ink-muted);
}
.onb .rail .step.active .marker { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.onb .rail .step.done .marker { background: var(--ok); color: white; border-color: var(--ok); }
.onb .rail .step.done .marker svg { width: 13px; height: 13px; }
.onb .rail .step::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 38px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}
.onb .rail .step:last-child::before { display: none; }
.onb .rail .step.done::before { background: var(--ok); }

.onb .pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.onb .pane-head {
  padding: 28px 44px 12px;
  display: flex;
  align-items: flex-end;
  gap: 18px;
}
.onb .pane-head .step-of {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-deep);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.onb .pane-head h1 { margin: 4px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.onb .pane-head .sub { font-size: 15px; color: var(--ink-muted); margin: 6px 0 0; font-weight: 500; max-width: 640px; }
.onb .pane-body { padding: 14px 44px 26px; overflow: auto; flex: 1; max-width: 920px; }
.onb .pane-foot {
  padding: 18px 44px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  gap: 10px;
  align-items: center;
}
.onb .pane-foot .spacer { flex: 1; }
.onb .pane-foot .saved { font-size: 12px; color: var(--ok); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.color-tile {
  border-radius: 12px;
  height: 96px;
  cursor: pointer;
  border: 3px solid transparent;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
  font-size: 11.5px;
  color: white;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}
.color-tile.selected { border-color: var(--ink); box-shadow: 0 0 0 4px var(--surface) inset; }
.color-tile.selected::after {
  content: "✓";
  position: absolute;
  top: 8px; right: 10px;
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  border-radius: 50%;
}

.dept-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 44px 1fr 110px 110px 32px;
  gap: 14px;
  align-items: center;
}
.dept-row .swatch {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
}
.dept-row .name-in {
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  height: 32px;
  outline: none;
  padding: 0 4px;
  border-radius: 6px;
}
.dept-row .name-in:focus { background: var(--surface-2); }
.dept-row .codepad input { height: 32px; padding: 0 8px; border-radius: 7px; }
.dept-row .pts { font-size: 13px; color: var(--ink-muted); font-weight: 600; }
.dept-row .x { color: var(--ink-faint); }
.dept-row .x:hover { color: var(--priority); }

.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.review-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.review-card h3 { margin: 0 0 12px; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.review-card h3 .edit { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--brand-deep); cursor: pointer; }
.review-card .kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13.5px; }
.review-card .kv dt { color: var(--ink-muted); font-weight: 500; }
.review-card .kv dd { margin: 0; font-weight: 600; }
.review-card .deplist { display: flex; flex-wrap: wrap; gap: 6px; }
.review-card .deplist .pill {
  font-size: 12px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.review-card .deplist .pill .dot { width: 8px; height: 8px; border-radius: 50%; }

/* Voice preview */
.voice-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.voice-card .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.voice-card .preview {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.5;
  position: relative;
}
.voice-card .preview .play {
  position: absolute;
  right: 12px; top: 12px;
  height: 30px;
  padding: 0 12px;
}
.voice-card .preview b { color: var(--ink); }
.voice-card .slider-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.voice-card input[type="range"] { flex: 1; }

/* Sound bars decoration */
.sb { display: inline-flex; align-items: end; gap: 2px; height: 14px; }
.sb span { width: 2.5px; background: currentColor; border-radius: 1px; }
.sb span:nth-child(1) { height: 50%; }
.sb span:nth-child(2) { height: 80%; }
.sb span:nth-child(3) { height: 40%; }
.sb span:nth-child(4) { height: 100%; }
.sb span:nth-child(5) { height: 65%; }
