@font-face {
  font-family: 'Outfit';
  src: url('/static/fonts/outfit-400-normal-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('/static/fonts/playfair-display-500-normal-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0710;
  --panel: rgba(23, 14, 30, 0.88);
  --panel-border: rgba(232, 196, 136, 0.16);
  --ink: #f6efe6;
  --muted: #a99bb0;
  --gold: #e8c488;
  --crimson: #f43f5e;
  --emerald: #4ade80;
  --violet: #a78bfa;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(800px 420px at 15% -5%, rgba(244, 63, 94, 0.14), transparent 65%),
    radial-gradient(700px 420px at 85% 5%, rgba(232, 196, 136, 0.11), transparent 65%);
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(11, 7, 16, 0.86);
  border-bottom: 1px solid var(--panel-border);
}

.topbar-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-link {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.brand-sep { color: var(--muted); }
.page-kicker { color: var(--muted); font-size: 0.9rem; }

.topbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.range-pills, .chart-modes {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.pill-btn, .action-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pill-btn:hover, .action-btn:hover { color: var(--ink); }

.pill-btn.is-active {
  background: rgba(232, 196, 136, 0.16);
  border-color: rgba(232, 196, 136, 0.4);
  color: var(--gold);
}

.action-btn {
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.action-btn.is-primary {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(232, 196, 136, 0.2));
  border-color: rgba(232, 196, 136, 0.45);
  color: var(--gold);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.auth-gate {
  max-width: 520px;
  margin: 80px auto;
  padding: 34px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
}

.auth-gate h1 {
  margin: 0 0 10px;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--gold);
}

.auth-gate p { color: var(--muted); margin: 0 0 22px; }

.hero-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.hero-header h1 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  color: var(--ink);
}

.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.09);
  border: 1px solid rgba(74, 222, 128, 0.28);
  color: var(--emerald);
  font-size: 0.86rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 18px 20px;
}

.kpi-card.is-highlight {
  border-color: rgba(244, 63, 94, 0.42);
  background: linear-gradient(155deg, rgba(244, 63, 94, 0.11), rgba(23, 14, 30, 0.92));
}

.kpi-label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  font-size: 2rem;
  line-height: 1.15;
  margin: 8px 0 6px;
  color: var(--ink);
  font-weight: 600;
}

.kpi-sub { font-size: 0.82rem; color: var(--muted); }
.delta-pill { color: var(--emerald); }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  color: var(--gold);
}

.panel-sub { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted); }

.chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
}

#trend-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.chart-tooltip {
  position: absolute;
  top: 10px;
  left: 10px;
  pointer-events: none;
  background: rgba(13, 8, 18, 0.96);
  border: 1px solid rgba(232, 196, 136, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.8rem;
  min-width: 175px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
  z-index: 5;
}

.chart-tooltip strong { display: block; color: var(--gold); margin-bottom: 4px; }
.chart-tooltip div { display: flex; justify-content: space-between; gap: 14px; color: var(--ink); }
.chart-tooltip span { color: var(--muted); }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

.bar-list { display: flex; flex-direction: column; gap: 11px; }

.bar-row-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.bar-label { color: var(--ink); word-break: break-word; }
.bar-val { color: var(--gold); white-space: nowrap; }

.bar-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--crimson), var(--gold));
}

.clean-table-wrap { overflow-x: auto; }
.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.clean-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 0 8px 10px 0;
  border-bottom: 1px solid var(--panel-border);
}

.clean-table td {
  padding: 9px 8px 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.clean-table td:last-child, .clean-table th:last-child { text-align: right; padding-right: 0; }

.signups-list { display: flex; flex-direction: column; gap: 10px; }

.signup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.signup-name { font-weight: 500; color: var(--ink); }
.signup-meta { font-size: 0.78rem; color: var(--muted); }

.badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge.is-verified {
  color: var(--emerald);
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.1);
}

.badge.is-pending {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.1);
}

.empty-note { color: var(--muted); font-size: 0.88rem; margin: 6px 0; }
