/* ============================================
   Claude Code 讀書會｜5/23 報到系統
   設計：Tech Minimal · Control Room
   底色 #0A0B0F + hairline + monospace + 三組 desaturated accent
   ============================================ */

:root {
  /* Surfaces */
  --bg:           #0A0B0F;
  --surface-0:    #0E1015;
  --surface-1:    #131620;
  --surface-2:    #1A1E2B;

  /* Hairlines & dividers */
  --line:         rgba(255, 255, 255, 0.06);
  --line-strong:  rgba(255, 255, 255, 0.12);
  --line-bright:  rgba(255, 255, 255, 0.20);

  /* Text */
  --ink:          #E8EAEF;
  --ink-soft:     #B0B6C1;
  --ink-muted:    #6B7280;
  --ink-faint:    #3F4654;

  /* Accent (冷青藍 — control room 主色) */
  --accent:       #00D4FF;
  --accent-soft:  rgba(0, 212, 255, 0.16);
  --accent-line:  rgba(0, 212, 255, 0.40);

  /* Status */
  --success:      #34D399;
  --success-bg:   rgba(52, 211, 153, 0.10);
  --success-line: rgba(52, 211, 153, 0.40);
  --warning:      #FBBF24;
  --warning-bg:   rgba(251, 191, 36, 0.10);
  --warning-line: rgba(251, 191, 36, 0.40);
  --danger:       #F87171;
  --danger-bg:    rgba(248, 113, 113, 0.10);
  --danger-line:  rgba(248, 113, 113, 0.40);

  /* Group accents (desaturated dark variants) */
  --g-blue:        #60A5FA;
  --g-blue-bg:     rgba(96, 165, 250, 0.12);
  --g-blue-line:   rgba(96, 165, 250, 0.35);
  --g-green:       #34D399;
  --g-green-bg:    rgba(52, 211, 153, 0.12);
  --g-green-line:  rgba(52, 211, 153, 0.35);
  --g-yellow:      #FBBF24;
  --g-yellow-bg:   rgba(251, 191, 36, 0.12);
  --g-yellow-line: rgba(251, 191, 36, 0.35);

  /* Radii — 比較克制 */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  /* Fonts */
  --f-sans: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-feature-settings: 'cv11', 'ss01', 'tnum';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100dvh;
}

/* ---- Dot grid 背景（極微弱）---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at center, rgba(255,255,255,0.04) 0.7px, transparent 0.7px);
  background-size: 24px 24px;
  background-position: 0 0;
  pointer-events: none;
  z-index: 0;
}

/* 上下 vignette，讓 dashboard 像螢幕 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
  z-index: 0;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--ink); }

/* ---- Layout ---- */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ---- Header — control panel style ---- */
.header {
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 15, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand-sub {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--ink-muted);
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}

/* 系統狀態指示燈（header 右上角）*/
.sys-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.sys-status .led {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.15);
  animation: led-pulse 2.4s ease-in-out infinite;
}
@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ---- Cards — hairline + corner brackets ---- */
.card {
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative;
}

.card + .card { margin-top: 16px; }

/* corner brackets — 在 card 四角畫 viewfinder 標記 */
.card.bracketed {
  background: var(--surface-0);
  border: 1px solid var(--line);
}
.card.bracketed::before,
.card.bracketed::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent-line);
  pointer-events: none;
}
.card.bracketed::before {
  top: -1px; left: -1px;
  border-right: none;
  border-bottom: none;
}
.card.bracketed::after {
  bottom: -1px; right: -1px;
  border-left: none;
  border-top: none;
}

.card-title {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ---- Group chip (tag pill) ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 12px;
  border-radius: 4px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}
.chip .dot {
  width: 6px; height: 6px;
  border-radius: 1px;
  background: var(--ink-muted);
}

.chip.blue   { background: var(--g-blue-bg);   color: var(--g-blue);   border-color: var(--g-blue-line); }
.chip.blue   .dot { background: var(--g-blue); }
.chip.green  { background: var(--g-green-bg);  color: var(--g-green);  border-color: var(--g-green-line); }
.chip.green  .dot { background: var(--g-green); }
.chip.yellow { background: var(--g-yellow-bg); color: var(--g-yellow); border-color: var(--g-yellow-line); }
.chip.yellow .dot { background: var(--g-yellow); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover {
  background: rgba(0, 212, 255, 0.22);
  border-color: var(--accent);
}
.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line-strong);
}
.btn.ghost:hover {
  border-color: var(--accent-line);
  color: var(--ink);
}

/* ---- Big numbers ---- */
.bignum {
  font-family: var(--f-mono);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}

/* ---- Progress ---- */
.progress {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress > .bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 480ms cubic-bezier(.2,.7,.2,1);
}
.progress.blue   .bar { background: var(--g-blue); }
.progress.green  .bar { background: var(--g-green); }
.progress.yellow .bar { background: var(--g-yellow); }

/* ---- Mono key-value pairs ---- */
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  font-family: var(--f-mono);
  font-size: 12px;
}
.kv dt {
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kv dd {
  margin: 0;
  color: var(--ink);
}

/* ---- Utilities ---- */
.row   { display: flex; align-items: center; }
.col   { display: flex; flex-direction: column; }
.grow  { flex: 1; }
.between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.muted { color: var(--ink-muted); }
.soft  { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.t-11 { font-size: 11px; }
.t-12 { font-size: 12px; }
.t-13 { font-size: 13px; }
.t-14 { font-size: 14px; }
.t-16 { font-size: 16px; }
.t-18 { font-size: 18px; }
.t-22 { font-size: 22px; font-weight: 600; }
.center { text-align: center; }
.mono  { font-family: var(--f-mono); }
.upper { text-transform: uppercase; letter-spacing: 0.10em; }

/* ============================================
   Ticket page — QR is the hero
   ============================================ */

.ticket-id {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.qr-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: #FFFFFF;
  border-radius: var(--r-md);
  position: relative;
}
/* QR 四角 corner bracket */
.qr-wrap::before,
.qr-wrap::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-color: rgba(0,0,0,0.4);
  border-style: solid;
}
.qr-wrap::before {
  top: 10px; left: 10px;
  border-width: 1px 0 0 1px;
}
.qr-wrap::after {
  bottom: 10px; right: 10px;
  border-width: 0 1px 1px 0;
}

#qrcode canvas {
  display: block;
}

/* QR 已報到狀態 - 蓋一層 ✓ */
.qr-wrap.checked-in {
  background: var(--surface-1);
  border: 1px dashed var(--success-line);
}
.qr-wrap.checked-in::before,
.qr-wrap.checked-in::after {
  border-color: var(--success);
}
.qr-wrap.checked-in canvas {
  opacity: 0.18;
  filter: grayscale(1);
}
.qr-checked-stamp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
.qr-checked-stamp .ring {
  width: 80px; height: 80px;
  border-radius: 999px;
  border: 1.5px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--success);
  font-family: var(--f-mono);
}
.qr-checked-stamp .label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--success);
}

/* ============================================
   Scan page — viewfinder with scan line
   ============================================ */

.scanner {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 480px;
  margin: 0 auto;
  background: #000;
  border-radius: var(--r-md);
  overflow: hidden;
}
#reader { width: 100%; height: 100%; }
#reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
#reader__dashboard,
#reader__dashboard_section,
#reader__scan_region img { display: none !important; }

.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 四個角的 viewfinder bracket */
.scan-corner {
  position: absolute;
  width: 28px; height: 28px;
  border: 1.5px solid var(--accent);
}
.scan-corner.tl { top: 16%; left: 16%; border-right: none; border-bottom: none; }
.scan-corner.tr { top: 16%; right: 16%; border-left: none; border-bottom: none; }
.scan-corner.bl { bottom: 16%; left: 16%; border-right: none; border-top: none; }
.scan-corner.br { bottom: 16%; right: 16%; border-left: none; border-top: none; }

/* 移動的掃描線 */
.scan-line {
  position: absolute;
  left: 16%;
  right: 16%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  top: 16%;
  animation: scan-line-move 2.4s cubic-bezier(.4,0,.6,1) infinite;
  opacity: 0;
}
.scanner.scanning .scan-line { opacity: 1; }
@keyframes scan-line-move {
  0%   { top: 16%; }
  50%  { top: calc(100% - 16% - 1px); }
  100% { top: 16%; }
}

/* Tap-to-start overlay（user gesture 啟動相機）*/
.scan-tap-start {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: var(--surface-1);
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--f-mono);
  transition: background 0.15s;
}
.scan-tap-start:hover { background: var(--surface-2); }
.scan-tap-start .play-icon {
  width: 64px; height: 64px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px; /* 三角形視覺平衡 */
}
.scan-tap-start .label {
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--ink);
  font-weight: 500;
}
.scan-tap-start .hint {
  font-family: var(--f-sans);
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0;
}
.scanner.scanning .scan-tap-start { display: none; }

/* 取景區暗化遮罩 */
.scan-mask {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(0,0,0,0.55) 0,
      rgba(0,0,0,0.55) 16%,
      transparent 16%,
      transparent 84%,
      rgba(0,0,0,0.55) 84%,
      rgba(0,0,0,0.55) 100%
    ),
    linear-gradient(to right,
      rgba(0,0,0,0.55) 0,
      rgba(0,0,0,0.55) 16%,
      transparent 16%,
      transparent 84%,
      rgba(0,0,0,0.55) 84%,
      rgba(0,0,0,0.55) 100%
    );
}

/* ============================================
   Viewfinder Takeover · 掃描結果全屏覆蓋
   時間軸（success）：
     t=0      wash fade in 200ms
     t=80     check ring fade in
     t=80     check stroke draw 260ms
     t=180    name slide-up + fade 320ms
     t=280    chip slide-up + fade 240ms
     t=380    sub fade 200ms
     t=2500   全部 fade out 300ms
   ============================================ */

.takeover {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  background: rgba(10, 11, 15, 0.92);
  transition: opacity 0.3s ease-in;
}
.takeover[data-kind="success"]   { background: linear-gradient(180deg, rgba(52,211,153,0.32) 0%, rgba(10,11,15,0.94) 70%); }
.takeover[data-kind="duplicate"] { background: linear-gradient(180deg, rgba(251,191,36,0.32) 0%, rgba(10,11,15,0.94) 70%); }
.takeover[data-kind="invalid"]   { background: linear-gradient(180deg, rgba(248,113,113,0.32) 0%, rgba(10,11,15,0.94) 70%); }

.takeover.active {
  display: flex;
  opacity: 1;
  animation: takeover-fade-in 200ms ease-out;
}
@keyframes takeover-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Invalid 抖動 */
.takeover[data-kind="invalid"].active {
  animation: takeover-fade-in 200ms ease-out, takeover-shake 280ms 80ms ease-in-out;
}
@keyframes takeover-shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* Tag · status label */
.takeover-tag {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-6px);
  animation: takeover-tag-in 240ms 60ms ease-out forwards;
}
.takeover[data-kind="success"]   .takeover-tag { color: var(--success); }
.takeover[data-kind="duplicate"] .takeover-tag { color: var(--warning); }
.takeover[data-kind="invalid"]   .takeover-tag { color: var(--danger); }
@keyframes takeover-tag-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Icon container */
.takeover-icon {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.takeover-icon svg {
  width: 100%;
  height: 100%;
  display: none;
}
.takeover[data-kind="success"]   .ti-check   { display: block; }
.takeover[data-kind="duplicate"] .ti-diamond { display: block; }
.takeover[data-kind="invalid"]   .ti-cross   { display: block; }

/* Ring · 共用 */
.ti-ring {
  stroke: currentColor;
  opacity: 0.35;
  stroke-dasharray: 182;
  stroke-dashoffset: 182;
  animation: ring-draw 360ms 80ms ease-out forwards;
}
@keyframes ring-draw {
  to { stroke-dashoffset: 0; }
}

/* Stroke · path 主體 draw 動畫 */
.ti-stroke {
  stroke: currentColor;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: stroke-draw 280ms 200ms ease-out forwards;
}
@keyframes stroke-draw {
  to { stroke-dashoffset: 0; }
}

/* Per-kind icon color */
.takeover[data-kind="success"]   .takeover-icon { color: var(--success); }
.takeover[data-kind="duplicate"] .takeover-icon { color: var(--warning); }
.takeover[data-kind="invalid"]   .takeover-icon { color: var(--danger); }

/* Name · slide up from below */
.takeover-name {
  font-family: var(--f-sans);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  text-align: center;
  margin: 4px 0 0;
  opacity: 0;
  transform: translateY(24px);
  animation: name-slide-in 320ms 180ms cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes name-slide-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Group chip · same slide-up motion, 100ms later */
.takeover-chip {
  opacity: 0;
  transform: translateY(20px);
  animation: chip-slide-in 240ms 280ms cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes chip-slide-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Sub · 額外 metadata 行 */
.takeover-sub {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  opacity: 0;
  animation: sub-fade-in 200ms 380ms ease-out forwards;
}
@keyframes sub-fade-in {
  to { opacity: 1; }
}

/* Fading out — applied when takeover is closing */
.takeover.fading {
  opacity: 0;
  transition: opacity 300ms ease-in;
}

/* Mobile · shrink hero typography */
@media (max-width: 480px) {
  .takeover-name { font-size: 34px; }
  .takeover-icon { width: 80px; height: 80px; }
}

/* ============================================
   結果面板（舊版，未使用，但保留以防樣式被引用）
   ============================================ */
/* 結果面板 — 大字 + status tag */
.result {
  position: relative;
  padding: 28px 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface-0);
  overflow: hidden;
}
.result::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--ink-muted);
}
.result.success    { border-color: var(--success-line); background: linear-gradient(180deg, var(--success-bg) 0%, var(--surface-0) 80%); }
.result.success::before { background: var(--success); }
.result.duplicate  { border-color: var(--warning-line); background: linear-gradient(180deg, var(--warning-bg) 0%, var(--surface-0) 80%); }
.result.duplicate::before { background: var(--warning); }
.result.invalid    { border-color: var(--danger-line);  background: linear-gradient(180deg, var(--danger-bg) 0%, var(--surface-0) 80%); }
.result.invalid::before { background: var(--danger); }

.result-tag {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.result.success    .result-tag { color: var(--success); }
.result.duplicate  .result-tag { color: var(--warning); }
.result.invalid    .result-tag { color: var(--danger); }

.result-headline {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 6px;
}

/* ============================================
   Dashboard — Control room grid
   ============================================ */

/* Event Banner — 活動主題明顯區塊 */
.event-banner {
  padding: 28px 28px;
}
.event-banner-eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.10em;
  color: var(--accent);
  margin-bottom: 10px;
}
.event-banner-title {
  font-family: var(--f-sans);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}
.event-banner-sub {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 8px;
}
@media (max-width: 480px) {
  .event-banner-title { font-size: 24px; }
}


.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* Big number panel */
.dash-hero {
  position: relative;
  display: flex;
  flex-direction: column;
}
.dash-hero .top {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.dash-hero .num {
  font-family: var(--f-mono);
  font-size: 88px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.dash-hero .denom {
  font-family: var(--f-mono);
  font-size: 28px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.dash-hero .pct {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-top: 12px;
}

/* Pulse on update */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.45); }
  100% { box-shadow: 0 0 0 18px rgba(0, 212, 255, 0); }
}
.pulse-once {
  animation: pulse-ring 0.9s ease-out;
  border-radius: var(--r-lg);
}

/* Group row */
.group-row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.group-row:first-child { border-top: none; padding-top: 6px; }
.group-row .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
  position: static;
  backdrop-filter: none;
}
.group-row .count {
  font-family: var(--f-mono);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.group-row .leaders {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-top: 6px;
  text-transform: uppercase;
}

/* Recent list — terminal style */
.list { display: flex; flex-direction: column; gap: 0; }
.list-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--f-mono);
  position: relative;
}
.list-item:last-child { border-bottom: none; }
.list-item .time {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.list-item .name {
  font-family: var(--f-sans);
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
@keyframes row-flash {
  0%   { background: rgba(0, 212, 255, 0.15); }
  100% { background: transparent; }
}
.list-item.fresh {
  animation: row-flash 1.2s ease-out;
}
.list-item.fresh::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 14px;
  background: var(--accent);
  border-radius: 1px;
}

/* Footer */
.footer {
  padding: 20px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  border-top: 1px solid var(--line);
  background: rgba(10,11,15,0.5);
}

/* Responsive */
@media (max-width: 480px) {
  .container { padding: 16px 14px 32px; }
  .card { padding: 18px 16px; border-radius: var(--r-md); }
  .dash-hero .num { font-size: 64px; }
  .dash-hero .denom { font-size: 22px; }
  .result-headline { font-size: 28px; }
}
