/* ============================================================
   GLOBAL STARTUP PULSE — Dark Futuristic Dashboard CSS
   ============================================================ */

:root {
  /* Core palette */
  --bg-deep: #050a14;
  --bg-primary: #0a1628;
  --bg-panel: #0d1b30;
  --bg-card: #101e35;
  --bg-hover: #152544;

  /* Neon accents */
  --cyan: #00F0FF;
  --cyan-dim: #00a0b0;
  --cyan-glow: rgba(0, 240, 255, 0.15);
  --magenta: #FF2D78;
  --magenta-dim: #c0245c;
  --magenta-glow: rgba(255, 45, 120, 0.15);
  --amber: #FFAA00;
  --amber-dim: #b87800;
  --amber-glow: rgba(255, 170, 0, 0.12);
  --green: #00FF88;
  --red: #FF4455;

  /* Text */
  --text-primary: #e8edf5;
  --text-secondary: #8494ab;
  --text-dim: #4a5a72;

  /* Borders */
  --border: rgba(0, 240, 255, 0.08);
  --border-active: rgba(0, 240, 255, 0.25);

  /* Fonts */
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Sizing */
  --top-bar-h: 72px;
  --bottom-bar-h: 110px;
  --filter-w: 240px;
  --detail-w: 320px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scanline overlay for CRT feel ── */
.scanline-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ============================================================
   TOP BAR
   ============================================================ */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-bar-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(10, 22, 40, 0.92) 100%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 36px;
  height: 36px;
  animation: logoSpin 20s linear infinite;
}

@keyframes logoSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.logo-text h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.data-as-of {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-left: 16px;
  flex-shrink: 0;
}

.stats-cards {
  display: flex;
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 18px;
  min-width: 130px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  opacity: 0.5;
}

.stat-card.accent::before {
  background: linear-gradient(90deg, var(--magenta), transparent);
}

.stat-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 0 20px var(--cyan-glow);
}

.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1.3;
}

.stat-card.accent .stat-value {
  color: var(--magenta);
}

.stat-unit {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-content {
  position: fixed;
  top: var(--top-bar-h);
  bottom: var(--bottom-bar-h);
  left: 0;
  right: 0;
  display: flex;
}

/* ── Filter Panel ── */
.filter-panel {
  width: var(--filter-w);
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  z-index: 50;
  transition: transform 0.3s ease;
}

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

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-secondary);
}

.filter-section {
  margin-bottom: 20px;
}

.filter-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* Year pills */
.year-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.pill:hover {
  border-color: var(--cyan-dim);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.pill.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow), inset 0 0 12px var(--cyan-glow);
}

/* Dropdowns */
.filter-select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 12px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%238494ab' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s;
}

.filter-select:hover, .filter-select:focus {
  border-color: var(--cyan-dim);
  outline: none;
}

.filter-select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Slider */
.filter-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  outline: none;
  margin-top: 4px;
}

.filter-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg-deep);
  cursor: pointer;
  box-shadow: 0 0 8px var(--cyan-glow);
  transition: box-shadow 0.2s;
}

.filter-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

.filter-summary {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.summary-row .mono {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--cyan);
}

/* ── Right panel: Pulse+ roadmap & tiers (always visible) ── */
.panel-roadmap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.panel-roadmap-heading {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.roadmap-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roadmap-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.roadmap-block.roadmap-blast {
  border-color: rgba(255, 45, 120, 0.25);
}

.roadmap-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cyan);
  text-transform: uppercase;
}

.roadmap-desc {
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.roadmap-tiers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.roadmap-tiers .roadmap-title {
  margin-bottom: 2px;
}

.tier-row {
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.tier-row strong {
  color: var(--text-primary);
  font-weight: 600;
}

.roadmap-note {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  line-height: 1.4;
  margin: 4px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   GLOBE CONTAINER
   ============================================================ */
.globe-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #0a1a30 0%, var(--bg-deep) 70%);
}

#globeViz {
  width: 100%;
  height: 100%;
}

.globe-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.5s;
}

.globe-hint .dot {
  color: var(--cyan-dim);
}

/* ============================================================
   DETAIL PANEL (right) — Pro/upsell when nothing selected; city when selected
   ============================================================ */
.detail-panel {
  width: var(--detail-w);
  flex-shrink: 0;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  position: relative;
}

.detail-panel.detail-panel-visible {
  transform: translateX(0);
}

/* Default right-panel content: Pro & upsell */
.panel-upsell-default {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-upsell-header h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.panel-upsell-tagline {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.panel-plans {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-row {
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.plan-row strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.plan-row.plan-free strong { color: var(--cyan); }
.plan-row.plan-pro strong { color: var(--magenta); }
.plan-row.plan-enterprise strong { color: var(--amber); }

.plan-row.plan-pro {
  border-color: rgba(255, 45, 120, 0.3);
}

.plan-row .btn-block {
  margin-top: 10px;
  width: 100%;
}

.panel-upsell-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-upsell-actions .btn-block {
  width: 100%;
}

.panel-spotlight {
  margin-top: auto;
  justify-content: center;
  padding: 10px;
}

/* City detail view (when a city is selected) */
.panel-city-detail {
  position: relative;
}

.panel-city-detail[hidden] {
  display: none !important;
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 9px; }

.close-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-panel:hover {
  border-color: var(--magenta);
  color: var(--magenta);
  background: var(--magenta-glow);
}

.detail-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.detail-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.detail-country {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-rank {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-glow);
  border: 1px solid rgba(255, 170, 0, 0.2);
  border-radius: 4px;
  padding: 2px 8px;
}

.detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}

.detail-stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.detail-stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section h3 {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* Industry breakdown bars */
.industry-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ind-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ind-name {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  width: 80px;
  flex-shrink: 0;
  text-align: right;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ind-bar-bg {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.ind-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.ind-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: inherit;
  filter: brightness(1.5);
  border-radius: 0 4px 4px 0;
}

.ind-val {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}

/* Sparkline */
.sparkline-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

#sparklineCanvas {
  width: 100%;
  height: 80px;
}

/* ============================================================
   BOTTOM BAR — TOP 10 CITIES
   ============================================================ */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-bar-h);
  z-index: 100;
  background: linear-gradient(0deg, var(--bg-primary) 0%, rgba(10, 22, 40, 0.95) 100%);
  border-top: 1px solid var(--border);
  padding: 8px 24px 12px;
  backdrop-filter: blur(16px);
}

.bottom-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.bottom-header h3 {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-secondary);
}

.bottom-year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
}

.top-cities-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 60px;
  padding-top: 4px;
}

.city-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
  justify-content: flex-end;
  cursor: pointer;
  transition: opacity 0.2s;
}

.city-bar-col:hover {
  opacity: 0.85;
}

.city-bar-val {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--cyan);
  white-space: nowrap;
}

.city-bar {
  width: 100%;
  max-width: 60px;
  border-radius: 3px 3px 0 0;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.city-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 60%);
}

.city-bar-name {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
  text-align: center;
}

/* ============================================================
   TOOLTIP
   ============================================================ */
.globe-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: rgba(10, 22, 40, 0.95);
  border: 1px solid var(--border-active);
  border-radius: 8px;
  padding: 12px 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px var(--cyan-glow);
  display: none;
  max-width: 260px;
  font-family: var(--font-body);
}

.globe-tooltip.visible {
  display: block;
}

.tt-city {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.tt-country {
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.tt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  font-size: 11px;
}

.tt-row span:first-child {
  color: var(--text-secondary);
}

.tt-row span:last-child {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--cyan);
}

.tt-row.highlight span:last-child {
  color: var(--magenta);
}

.tt-industries {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.tt-ind-label {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.tt-ind-list {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 2px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 8px var(--cyan-glow); }
  50% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.25); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Filter toggle (mobile) — visible only when panel is hidden */
.filter-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--cyan);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-toggle:hover {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 12px var(--cyan-glow);
}
.filter-toggle svg {
  width: 20px;
  height: 20px;
}

/* Upgrade CTA in header */
.upgrade-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--magenta);
  background: var(--magenta-glow);
  border: 1px solid rgba(255, 45, 120, 0.3);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}
.upgrade-cta:hover {
  background: rgba(255, 45, 120, 0.25);
  border-color: var(--magenta);
  box-shadow: 0 0 16px var(--magenta-glow);
}

/* Detail panel upsell block */
.detail-upsell {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.detail-upsell h4 {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.detail-upsell p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}
.detail-upsell .btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.detail-upsell .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.detail-upsell .btn-primary {
  background: linear-gradient(135deg, var(--cyan), #00a0b0);
  color: var(--bg-deep);
  border: 1px solid var(--cyan);
}
.detail-upsell .btn-primary:hover {
  box-shadow: 0 0 16px var(--cyan-glow);
}
.detail-upsell .btn-secondary {
  background: var(--bg-hover);
  color: var(--cyan);
  border: 1px solid var(--border-active);
}
.detail-upsell .btn-secondary:hover {
  border-color: var(--cyan);
}
.detail-upsell .email-capture {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-upsell .email-capture input {
  flex: 1;
  min-width: 140px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
}
.detail-upsell .email-capture input::placeholder {
  color: var(--text-dim);
}
.detail-upsell .email-capture input:focus {
  outline: none;
  border-color: var(--cyan);
}
.detail-upsell .email-capture .btn {
  flex-shrink: 0;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.visible {
  display: flex;
}
.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 32px var(--cyan-glow);
}
.modal-box h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.modal-box p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}
.modal-box .modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.modal-box .modal-actions .btn {
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
}
.modal-box .modal-actions .btn-primary {
  background: var(--magenta);
  color: #fff;
}
.modal-box .modal-actions .btn-primary:hover {
  box-shadow: 0 0 20px var(--magenta-glow);
}
.modal-box .modal-actions .btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.modal-box .modal-actions .btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-active);
}

/* Footer spotlight CTA */
.spotlight-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px dashed var(--border);
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s;
}
.spotlight-cta:hover {
  color: var(--amber);
  border-color: var(--amber-dim);
}

@media (max-width: 1200px) {
  :root {
    --filter-w: 220px;
    --detail-w: 300px;
  }
  .stats-cards {
    gap: 10px;
  }
  .stat-card {
    min-width: 110px;
    padding: 6px 14px;
  }
  .stat-value {
    font-size: 16px;
  }
}

@media (max-width: 1024px) {
  :root {
    --filter-w: 200px;
    --detail-w: 280px;
    --top-bar-h: 64px;
  }

  .top-bar {
    flex-wrap: wrap;
    padding: 0 16px;
    gap: 8px;
    min-height: var(--top-bar-h);
    height: auto;
    padding-bottom: 10px;
  }

  .stats-cards {
    gap: 8px;
    flex-wrap: wrap;
  }

  .stat-card {
    padding: 6px 12px;
    min-width: 90px;
  }

  .stat-value {
    font-size: 14px;
  }

  .data-as-of {
    width: 100%;
    margin-left: 0;
    margin-top: 2px;
  }
}

@media (max-width: 768px) {
  :root {
    --top-bar-h: 56px;
    --bottom-bar-h: 100px;
    --filter-w: 280px;
    --detail-w: 100%;
  }

  html, body {
    overflow-x: hidden;
  }

  .top-bar {
    padding: 0 12px;
    flex-wrap: nowrap;
    height: var(--top-bar-h);
    padding-bottom: 0;
  }

  .filter-toggle {
    display: flex;
    order: -1;
    margin-right: 8px;
  }

  .logo-area {
    flex: 1;
    min-width: 0;
  }

  .logo-icon svg {
    width: 28px;
    height: 28px;
  }

  .logo-text h1 {
    font-size: 11px;
    letter-spacing: 2px;
  }

  .logo-sub {
    display: none;
  }

  .stats-cards {
    display: none; /* Shown in drawer or after scroll on mobile; optional: show 1–2 key stats */
  }

  .stats-cards.mobile-visible {
    display: flex;
    position: fixed;
    top: var(--top-bar-h);
    left: 0;
    right: 0;
    z-index: 90;
    padding: 8px 12px;
    gap: 6px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .stats-cards .stat-card {
    flex: 0 0 auto;
    min-width: 80px;
    padding: 6px 10px;
  }

  .stat-value {
    font-size: 13px;
  }

  .stat-label, .stat-unit {
    font-size: 8px;
  }

  .data-as-of {
    display: none;
  }

  .upgrade-cta {
    padding: 6px 10px;
    font-size: 9px;
  }

  .main-content {
    top: var(--top-bar-h);
    bottom: var(--bottom-bar-h);
  }

  .filter-panel {
    position: fixed;
    left: 0;
    top: var(--top-bar-h);
    bottom: var(--bottom-bar-h);
    width: var(--filter-w);
    max-width: 85vw;
    z-index: 150;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .filter-panel.open {
    transform: translateX(0);
  }

  .filter-panel .panel-header {
    margin-bottom: 16px;
  }

  .detail-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    z-index: 150;
    padding: 16px;
    padding-bottom: 80px;
  }

  .detail-panel.detail-panel-visible {
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .detail-header h2 {
    font-size: 18px;
  }

  .detail-stats {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }

  .detail-stat-value {
    font-size: 12px;
  }

  .globe-container {
    width: 100%;
  }

  .globe-hint {
    font-size: 9px;
    gap: 6px;
    bottom: 12px;
  }

  .bottom-bar {
    padding: 8px 12px 12px;
    height: var(--bottom-bar-h);
  }

  .bottom-header {
    flex-wrap: wrap;
    gap: 4px;
  }

  .top-cities-chart {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 4px;
    margin: 0 -4px;
  }

  .city-bar-col {
    flex: 0 0 auto;
    min-width: 56px;
  }

  .city-bar-name {
    max-width: 52px;
  }

  .spotlight-cta {
    margin-left: 0;
    margin-top: 4px;
  }
}

@media (max-width: 480px) {
  :root {
    --top-bar-h: 52px;
    --bottom-bar-h: 92px;
  }

  .logo-text h1 {
    font-size: 10px;
    letter-spacing: 1px;
  }

  .detail-upsell .btn-row {
    flex-direction: column;
  }
  .detail-upsell .btn {
    width: 100%;
  }
  .detail-upsell .email-capture {
    flex-direction: column;
  }
  .detail-upsell .email-capture input {
    min-width: 0;
  }
}

/* Touch targets */
@media (pointer: coarse) {
  .pill {
    min-height: 44px;
    padding: 10px 8px;
  }
  .filter-select {
    min-height: 44px;
  }
  .close-panel {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .city-bar-col {
    min-height: 44px;
  }
}
