/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #060811;
  --bg-2: #0c1120;
  --surface: rgba(255,255,255,0.03);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-bright: rgba(255,255,255,0.15);
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --accent: #6366f1;
  --accent-2: #06b6d4;
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(99,102,241,0.15);
  --header-h: 64px;
  --sidebar-w: 280px;
  --detail-w: 320px;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

html { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Animated Background ─────────────────────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridDrift 30s linear infinite;
}
@keyframes gridDrift {
  0% { transform: translate(0,0); }
  100% { transform: translate(48px, 48px); }
}

.bg-glow {
  position: fixed; z-index: 0; border-radius: 50%;
  filter: blur(120px); pointer-events: none;
  animation: glowFloat 12s ease-in-out infinite alternate;
}
.bg-glow-1 {
  width: 600px; height: 600px; top: -200px; left: -200px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  animation-duration: 14s;
}
.bg-glow-2 {
  width: 500px; height: 500px; top: 30%; right: -150px;
  background: radial-gradient(circle, rgba(6,182,212,0.1) 0%, transparent 70%);
  animation-duration: 11s; animation-delay: -4s;
}
.bg-glow-3 {
  width: 400px; height: 400px; bottom: -100px; left: 40%;
  background: radial-gradient(circle, rgba(168,85,247,0.08) 0%, transparent 70%);
  animation-duration: 16s; animation-delay: -8s;
}
@keyframes glowFloat {
  0% { transform: scale(1) translate(0,0); }
  100% { transform: scale(1.15) translate(20px, 30px); }
}

#particles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h); z-index: 100;
  background: rgba(6, 8, 17, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03), var(--shadow);
}
.header-inner {
  max-width: 100%; height: 100%;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 36px; height: 36px; flex-shrink: 0; animation: spinSlow 20s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, #e2e8f0 0%, #6366f1 60%, #06b6d4 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}
.brand-sub { font-size: 10px; color: var(--text-muted); letter-spacing: 0.8px; text-transform: uppercase; margin-top: 1px; }

.header-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.header-link {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px;
  font-size: 12px; font-weight: 600; color: var(--text-dim); text-decoration: none;
  padding: 0 12px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.03); transition: var(--transition);
  white-space: nowrap;
}
.header-link:hover, .header-share:hover { color: #fff; border-color: var(--accent); background: rgba(99,102,241,0.12); }
.header-link.is-active {
  color: #fff;
  border-color: rgba(99,102,241,0.45);
  background: rgba(99,102,241,0.18);
  cursor: default;
}
.header-share { cursor: pointer; font-family: inherit; }

.header-stats { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.hstat { display: flex; flex-direction: column; align-items: center; padding: 0 16px; }
.hstat-num {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hstat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.hstat-divider { width: 1px; height: 32px; background: var(--border); }

/* ── Live News Ticker ────────────────────────────────────────────────────── */
.news-ticker {
  position: fixed; top: var(--header-h); left: 0; right: 0;
  height: 32px; z-index: 99;
  background: rgba(6, 8, 17, 0.95);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.ticker-content {
  display: flex; white-space: nowrap; gap: 40px;
  animation: tickerScroll 120s linear infinite;
  padding-left: 100vw; /* Start off-screen */
}
.ticker-content:hover { animation-play-state: paused; }
.ticker-item {
  font-size: 11px; font-weight: 500; color: var(--text-dim);
  display: flex; align-items: center; gap: 8px; cursor: default;
}
.ticker-item strong { color: var(--text); }
.ticker-badge {
  background: rgba(99,102,241,0.2); color: var(--accent);
  padding: 2px 6px; border-radius: 4px; font-size: 9px;
  text-transform: uppercase; font-weight: 800; letter-spacing: 0.5px;
}
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ── Main Layout ─────────────────────────────────────────────────────────── */
.main-layout {
  display: flex;
  height: 100vh;
  padding-top: calc(var(--header-h) + 32px);
  position: relative; z-index: 1;
  overflow: hidden;
}

/* ── Sidebar Rankings ─────────────────────────────────────────────────────── */
.sidebar-rankings {
  width: var(--sidebar-w); flex-shrink: 0;
  background: rgba(6, 8, 17, 0.7);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(99,102,241,0.3) transparent;
}
.sidebar-rankings::-webkit-scrollbar { width: 4px; }
.sidebar-rankings::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 2px; }

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-title {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted);
}
.sidebar-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.ranking-list { padding: 12px 12px; display: flex; flex-direction: column; gap: 6px; }

.rank-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  position: relative; overflow: hidden;
  background: var(--surface);
}
.rank-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--card-color, #6366f1) 0%, transparent 60%);
  opacity: 0; transition: opacity var(--transition);
}
.rank-card:hover, .rank-card.active {
  border-color: var(--card-color, #6366f1);
  background: rgba(99,102,241,0.08);
  transform: translateX(4px);
  box-shadow: 0 0 20px var(--card-glow, rgba(99,102,241,0.2));
}
.rank-card:hover::before, .rank-card.active::before { opacity: 0.08; }

.rank-badge {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 12px; font-weight: 800;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--card-color, #6366f1), rgba(255,255,255,0.1));
  color: #fff;
  position: relative; z-index: 1;
}
.rank-flag { font-size: 20px; position: relative; z-index: 1; }
.rank-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.rank-country { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-model { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.rank-elo {
  font-family: var(--font-display); font-size: 14px; font-weight: 800;
  position: relative; z-index: 1;
  color: var(--card-color, #6366f1);
  line-height: 1.1;
}
.rank-score-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.rank-elo-sub { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.rank-delta { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.rank-delta.delta-up { color: #10b981; background: rgba(16,185,129,0.12); }
.rank-delta.delta-down { color: #ef4444; background: rgba(239,68,68,0.12); }
.rank-delta.delta-flat { color: var(--text-muted); }

.rank-spread {
  font-size: 9px;
  font-weight: 700;
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 4px;
}
.rank-spread.spread-down { color: #f59e0b; background: rgba(245,158,11,0.12); }
.rank-spread.spread-up { color: #10b981; background: rgba(16,185,129,0.12); }

.view-toggle {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.view-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 8px 6px;
  border-radius: 7px;
  cursor: pointer;
  transition: var(--transition);
}
.view-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.view-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99,102,241,0.35), rgba(6,182,212,0.2));
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.35);
}

.bmark-item.hidden { display: none; }

.stacked-ranks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stacked-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}
.stacked-row.stacked-active {
  border-color: rgba(99,102,241,0.35);
  background: rgba(99,102,241,0.08);
}
.stacked-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.stacked-value { font-size: 13px; font-weight: 700; text-align: right; }
.stacked-spread {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 700;
}
.stacked-spread.spread-down { color: #f59e0b; }
.stacked-spread.spread-up { color: #10b981; }
.stacked-empty { color: var(--text-muted); font-size: 12px; }

.tt-stack { margin-top: 6px; }
.tt-stack-row { font-size: 10px; color: var(--text-dim); line-height: 1.5; }

.tt-rank .rank-delta, .gauge-value .rank-delta { margin-left: 4px; }

/* ── Map Section ──────────────────────────────────────────────────────────── */
.map-section {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
  height: 100%;
}
.map-container {
  flex: 1; position: relative;
  background: radial-gradient(ellipse at center, #0d1428 0%, #060811 100%);
  overflow: hidden;
  min-height: 400px;
}
#worldMap { width: 100%; height: 100%; min-height: 400px; display: block; }

/* Map country paths */
.country-path {
  stroke-width: 0.4;
  transition: fill 0.35s ease, opacity 0.25s ease, filter 0.25s ease;
  cursor: default;
}
.country-path.unindexed {
  fill: #991b1b;
  stroke: rgba(127, 29, 29, 0.65);
}
.country-path.no-model {
  fill: #dc2626;
  stroke: #991b1b;
  cursor: pointer;
}
.country-path.has-model {
  cursor: pointer;
  stroke-width: 1.2;
}
.country-path.ranked:hover,
.country-path.has-model:hover {
  filter: brightness(1.12) drop-shadow(0 0 14px rgba(34, 197, 94, 0.35));
  stroke-width: 1.6;
}
.country-path.unindexed:hover {
  filter: brightness(1.08);
}
.country-path.active-country {
  filter: brightness(1.2) drop-shadow(0 0 18px rgba(34, 197, 94, 0.5));
  stroke-width: 2;
}

/* Rank labels on map */
.country-label {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  fill: #fff;
  text-anchor: middle;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
}
.country-label-bg {
  rx: 6; ry: 6;
  pointer-events: none;
}
.country-rank-circle {
  pointer-events: none;
}

/* Ocean */
.sphere-fill { fill: url(#oceanGradient); }
.graticule { fill: none; stroke: rgba(99,102,241,0.06); stroke-width: 0.5; }

/* Open adoption download stack lines (map) */
.open-stack-layer { pointer-events: none; }
.open-stack-track {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 3;
  stroke-linecap: round;
}
.open-stack-seg {
  stroke-width: 6;
  stroke-linecap: butt;
  filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.35));
}
.open-stack-tip {
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 1;
}
.open-stack-label {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  fill: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.95);
}

.legend-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.legend-line-track {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
}
.legend-line-stack {
  width: 22px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.45) 0%, #22c55e 55%, #06b6d4 100%);
}
.legend-note {
  font-size: 10px;
  color: var(--text-dim);
  padding-left: 18px;
}

/* Live Traffic Lines */
.traffic-line {
  fill: none;
  stroke: url(#grad1); /* Uses the header gradient */
  stroke-width: 1.5;
  stroke-dasharray: 4, 12;
  opacity: 0.6;
  pointer-events: none;
  animation: trafficDash 1s linear infinite;
}
@keyframes trafficDash {
  to { stroke-dashoffset: -16; }
}

/* ── Map Tooltip ──────────────────────────────────────────────────────────── */
.map-tooltip {
  position: absolute; pointer-events: none;
  background: rgba(6, 8, 17, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 180px;
  box-shadow: var(--shadow), 0 0 20px rgba(99,102,241,0.15);
  opacity: 0; transition: opacity 0.2s ease;
  z-index: 50;
}
.map-tooltip.visible { opacity: 1; }
.tt-flag { font-size: 24px; margin-bottom: 4px; display: block; }
.tt-name { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text); }
.tt-rank { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tt-model { font-size: 11px; color: var(--accent-2); margin-top: 6px; font-style: italic; }
.tt-elo { font-family: var(--font-display); font-size: 13px; font-weight: 700; margin-top: 6px; }

/* ── Map Controls ─────────────────────────────────────────────────────────── */
.map-controls {
  position: absolute; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.map-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(6, 8, 17, 0.9); backdrop-filter: blur(10px);
  border: 1px solid var(--border-bright); color: var(--text-dim);
  font-size: 16px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.map-btn:hover { background: rgba(99,102,241,0.2); border-color: var(--accent); color: #fff; transform: scale(1.05); }

/* ── Map Legend ───────────────────────────────────────────────────────────── */
.map-legend {
  position: absolute; bottom: 20px; left: 20px;
  background: rgba(6, 8, 17, 0.85); backdrop-filter: blur(16px);
  border: 1px solid var(--border-bright); border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.legend-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 8px; }
.legend-items { display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-dim); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-gradient-bar {
  height: 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, #eab308 0%, #84cc16 50%, #22c55e 100%);
  border: 1px solid rgba(255,255,255,0.08);
}
.legend-dot.legend-green { background: #22c55e; }
.legend-dot.legend-yellow { background: #eab308; }
.legend-dot.legend-red { background: #dc2626; }
.tier-1 { background: linear-gradient(135deg, #6366f1, #06b6d4); box-shadow: 0 0 8px rgba(99,102,241,0.6); }
.tier-2 { background: linear-gradient(135deg, #a855f7, #f59e0b); box-shadow: 0 0 8px rgba(168,85,247,0.4); }
.tier-3 { background: linear-gradient(135deg, #10b981, #ec4899); box-shadow: 0 0 8px rgba(16,185,129,0.4); }

/* ── Benchmark Bar ────────────────────────────────────────────────────────── */
.benchmark-bar {
  flex-shrink: 0;
  padding: 16px 24px;
  background: rgba(6, 8, 17, 0.9);
  border-top: 1px solid var(--border);
  display: flex; gap: 24px;
  backdrop-filter: blur(10px);
}
.bmark-item { flex: 1; }
.bmark-item.bmark-primary .bmark-label { color: #c7d2fe; }
.bmark-item.bmark-primary .bmark-bar { box-shadow: 0 0 12px rgba(99,102,241,0.35); }
.bmark-label {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}
.bmark-unit { font-weight: 400; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.bmark-bars { display: flex; gap: 3px; align-items: flex-end; height: 40px; }
.bmark-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; cursor: pointer; }
.bmark-bar {
  width: 100%; border-radius: 4px 4px 0 0;
  background: var(--bar-color, #6366f1);
  transition: all var(--transition);
  position: relative;
  min-height: 4px;
  opacity: 0.7;
}
.bmark-bar.active-bar, .bmark-bar-wrap:hover .bmark-bar { opacity: 1; filter: brightness(1.2); }
.bmark-bar-flag { font-size: 10px; line-height: 1; }
.bmark-bar-val { font-size: 8px; color: var(--text-muted); line-height: 1; }

/* ── Detail Sidebar ───────────────────────────────────────────────────────── */
.sidebar-detail {
  width: var(--detail-w); flex-shrink: 0;
  background: rgba(6, 8, 17, 0.7);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(99,102,241,0.3) transparent;
}
.sidebar-detail::-webkit-scrollbar { width: 4px; }
.sidebar-detail::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 2px; }

.detail-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; padding: 40px 24px; text-align: center;
  gap: 16px;
}
.placeholder-icon { font-size: 48px; opacity: 0.4; animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.placeholder-text { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

.detail-content { padding: 0; }
.hidden { display: none !important; }

/* Detail Content Styles */
.detail-hero {
  padding: 24px 20px 20px;
  background: linear-gradient(180deg, rgba(99,102,241,0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.detail-hero::before {
  content: '';
  position: absolute; top: -20px; right: -20px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, var(--hero-color, rgba(99,102,241,0.3)) 0%, transparent 70%);
  filter: blur(20px);
}
.detail-rank-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border-bright);
  color: var(--text-dim); margin-bottom: 12px;
}
.detail-flag { font-size: 36px; margin-bottom: 4px; display: block; }
.detail-country-name {
  font-family: var(--font-display); font-size: 20px; font-weight: 800;
  background: linear-gradient(135deg, #e2e8f0, var(--hero-color2, #6366f1));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 4px;
}
.detail-badge { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.detail-agi-hero {
  font-family: var(--font-display); font-size: 36px; font-weight: 800;
  margin-bottom: 8px; line-height: 1;
}
.detail-agi-hero span { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-left: 6px; }
.detail-unaccounted {
  font-size: 13px; color: #fbbf24; background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.25); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; line-height: 1.5;
}
.header-share-wrap { display: flex; align-items: center; }
.header-share-wrap .share-bar { gap: 6px; margin-top: 0; flex-wrap: nowrap; }
.header-share-wrap .share-bar-label { display: none; }
.header-share-wrap .share-bar-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.header-share-wrap .share-btn {
  height: 32px;
  padding: 0 10px;
  font-size: 11px;
  min-width: auto;
  line-height: 1;
}

.share-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 14px;
}
.share-bar-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted); margin-right: 4px;
}
.share-bar-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; padding: 8px 11px; border-radius: 9px;
  border: 1px solid var(--border-bright); background: rgba(255,255,255,0.04);
  color: var(--text); font-size: 12px; font-weight: 700; font-family: inherit;
  text-decoration: none; cursor: pointer; transition: var(--transition);
}
.share-btn:hover { background: rgba(99,102,241,0.18); border-color: var(--accent); color: #fff; }
.share-btn.share-x:hover { background: rgba(255,255,255,0.12); }
.share-btn.share-linkedin:hover { background: rgba(10,102,194,0.25); border-color: #0a66c2; }
.share-btn.share-facebook:hover { background: rgba(24,119,242,0.25); border-color: #1877f2; }
.share-btn.share-whatsapp:hover { background: rgba(37,211,102,0.2); border-color: #25d366; }
.share-btn.share-copy-link,
.share-btn.share-copy-text { min-width: auto; }
.share-btn.copied { background: rgba(16,185,129,0.2); border-color: #10b981; color: #6ee7b7; }

.static-page { padding-top: calc(var(--header-h) + 40px); }
.static-wrap { max-width: 760px; margin: 0 auto; padding: 0 24px 80px; }
.static-wrap h1 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 8px; color: var(--text); }
.static-wrap .sub { color: var(--text-muted); margin-bottom: 32px; }
.static-wrap h2 { font-size: 1.15rem; margin: 32px 0 12px; color: #fff; }
.static-wrap p, .static-wrap li { color: var(--text-muted); margin-bottom: 12px; }
.static-wrap ul { padding-left: 20px; }
.static-wrap a { color: var(--accent-2); }
.static-wrap code { background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 6px; color: #c7d2fe; }
.static-wrap .formula { background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2); border-radius: 16px; padding: 20px 24px; margin: 20px 0; font-size: 1.05rem; color: var(--text); }
.static-wrap table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.95rem; }
.static-wrap th, .static-wrap td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.static-wrap th { color: #fff; }

.detail-share-bar { margin-top: 14px; }
.detail-share-bar .share-bar { margin-top: 0; }
.detail-share-bar .share-bar-buttons { width: 100%; }
.detail-share-bar .share-btn { flex: 1 1 auto; }

@media (max-width: 900px) {
  .header-share-wrap { display: none; }
}
.rank-unaccounted { opacity: 0.55; }
.detail-model-name {
  font-size: 12px; color: var(--accent-2);
  font-weight: 500; font-style: italic;
}

.detail-section { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.detail-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 12px;
}

/* Score gauges */
.score-gauges { display: flex; flex-direction: column; gap: 12px; }
.gauge-row { display: flex; flex-direction: column; gap: 4px; }
.gauge-row.gauge-primary .gauge-label { color: #c7d2fe; }
.method-link {
  display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600;
  color: var(--accent-2); text-decoration: none;
}
.method-link:hover { text-decoration: underline; }
.gauge-header { display: flex; justify-content: space-between; align-items: center; }
.gauge-label { font-size: 11px; color: var(--text-dim); }
.gauge-value { font-family: var(--font-display); font-size: 13px; font-weight: 700; }
.gauge-track {
  height: 6px; border-radius: 6px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
.gauge-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--gauge-color, #6366f1), rgba(255,255,255,0.3));
  width: 0;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* Developer info */
.detail-dev { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.detail-dev strong { color: var(--text); }

/* Type badge */
.type-badge {
  display: inline-flex; padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.3);
  color: var(--accent-2);
}

/* Strengths tags */
.strength-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.strength-tag {
  padding: 4px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 600;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-bright);
  color: var(--text-dim);
  transition: all var(--transition);
}
.strength-tag:hover { background: rgba(99,102,241,0.12); border-color: var(--accent); color: var(--text); }

/* Ecosystem */
.ecosystem-text { font-size: 12px; color: var(--text-dim); line-height: 1.7; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
}
.modal-box {
  width: 100%; max-width: 500px; max-height: 85vh;
  background: var(--bg-2); border-radius: 20px 20px 16px 16px;
  border: 1px solid var(--border-bright);
  overflow-y: auto; position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: sticky; top: 12px; float: right; margin: 12px 12px 0 0;
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: rgba(239,68,68,0.2); color: #ef4444; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 3px; }

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeSlideIn 0.4s ease forwards; }

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .sidebar-detail { width: 280px; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 240px; }
  .benchmark-bar { padding: 12px 16px; gap: 16px; }
  .sidebar-detail { display: none; }
  .modal-overlay { display: flex !important; }
}

@media (max-width: 600px) {
  .sidebar-rankings { display: none; }
  .main-layout { flex-direction: column; }
  .map-section { flex: 1; }
  .benchmark-bar { flex-direction: column; gap: 8px; }
  .header-stats { display: none; }
}

/* ── Pulse rings on map ───────────────────────────────────────────────────── */
.pulse-ring {
  animation: pulseRing 2.5s ease-out infinite;
  pointer-events: none;
}
@keyframes pulseRing {
  0% { r: 10; opacity: 0.6; }
  100% { r: 30; opacity: 0; }
}

/* ── Number counter animation ─────────────────────────────────────────────── */
.count-up { transition: all 0.5s ease; }
