@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg: #0b0c10;
  --bg-panel: rgba(15, 16, 24, 0.65);
  --text: #e0e6ed;
  --muted: #8b92a5;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #64c8ff;

  --q-tl: rgba(142, 68, 173, 0.04);
  --q-tr: rgba(41, 128, 185, 0.04);
  --q-bl: rgba(230, 126, 34, 0.04);
  --q-br: rgba(241, 196, 15, 0.04);

  --q-tl-accent: #9b59b6;
  --q-tr-accent: #3498db;
  --q-bl-accent: #e67e22;
  --q-br-accent: #f1c40f;

  --grid-lines: rgba(255, 255, 255, 0.03);
  --axis-lines: rgba(255, 255, 255, 0.15);
}

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

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 50% 0%, #1a1b26 0%, var(--bg) 60%);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── HEADER ── */
header {
  padding: 24px 32px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 12, 16, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.header-title h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 3vw, 36px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, #fff 40%, #8888bb);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-title p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.test-link {
  align-self: flex-end;
  margin-top: 10px;
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 12px;
  border-radius: 999px;
  transition: all 0.15s ease;
}

.test-link:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}

.legend-full {
  display: inline;
}

.legend-item span:first-of-type {
  display: none;
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
}

/* ── REGION SWITCHER ── */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.region-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.region-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.region-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.region-btn.active {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

.region-btn img {
  width: 16px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
}

/* ── MAIN LAYOUT ── */
main {
  display: flex;
  flex: 1;
  gap: 0;
  overflow: hidden;
}

/* ── COMPASS CONTAINER ── */
.compass-wrap {
  flex: 1;
  padding: 20px 20px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}

.map-toolbar-side {
  position: absolute;
  top: auto;
  bottom: 15px;
  left: 15px;
  transform: none;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 10px;
  z-index: 20;
  background: rgba(10, 11, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .map-toolbar-side {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 90%;
  }
}

.side-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.side-btn.filter-btn {
  width: auto;
  height: auto;
  padding: 10px 14px;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.side-btn.filter-btn.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

.side-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.side-btn.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

.side-btn.estatales-btn.active {
  background: rgba(255, 200, 50, 0.18);
  border-color: rgba(255, 200, 50, 0.5);
  color: #FFD700;
  box-shadow: 0 0 14px rgba(255, 200, 50, 0.15);
}

.side-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 2px 0;
}

.chart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(100,200,255,0.08);
  border: 1px solid rgba(100,200,255,0.2);
  color: rgba(100,200,255,0.8);
  border-radius: 8px; /* match side-btn */
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chart-btn:hover {
  background: rgba(100,200,255,0.18);
  color: rgb(160,230,255);
  border-color: rgba(100,200,255,0.4);
  box-shadow: 0 0 14px rgba(100,200,255,0.15);
}

.chart-btn-container {
  display: none; /* removed since button moved to sidebar */
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
}

.zoom-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.zoom-reset {
  margin-left: 2px;
}

.zoom-hint {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.04em;
  opacity: 0.5;
  margin-left: 4px;
  white-space: nowrap;
}

.axis-label-top {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.compass-row {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 700px;
}

.axis-label-side {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  writing-mode: vertical-rl;
  width: 22px;
  text-align: center;
}

.axis-label-side.left  { transform: rotate(180deg); margin-right: 10px; }
.axis-label-side.right { margin-left: 10px; }

/* ── COMPASS GRID ── */
.compass {
  position: relative;
  flex: 1;
  aspect-ratio: 1 / 1;
  max-width: 660px;
  max-height: 660px;
  border: 1px solid rgba(255,255,255,0.10);
  overflow: hidden;
  cursor: default;
  user-select: none;
}

/* Inner layer: everything that zooms/pans */
.compass-inner {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

/* quadrants */
.quadrant {
  position: absolute;
  width: 50%; height: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.q-tl { top: 0; left: 0;  background: var(--q-tl); }
.q-tr { top: 0; right: 0; background: var(--q-tr); }
.q-bl { bottom: 0; left: 0;  background: var(--q-bl); }
.q-br { bottom: 0; right: 0; background: var(--q-br); }

.quadrant-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.25;
  text-align: center;
  padding: 6px;
  pointer-events: none;
  user-select: none;
}

/* grid lines */
.grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid-line-h, .grid-line-v {
  position: absolute;
  background: var(--grid-lines);
}

.grid-line-h { width: 100%; height: 1px; left: 0; }
.grid-line-v { height: 100%; width: 1px; top: 0; }

/* main axes */
.axis-h, .axis-v {
  position: absolute;
  background: var(--axis-lines);
  pointer-events: none;
  z-index: 2;
}

.axis-h { width: 100%; height: 1px; top: 50%; left: 0; }
.axis-v { height: 100%; width: 1px; left: 50%; top: 0; }

/* axis arrow tips */
.axis-h::before, .axis-h::after,
.axis-v::before, .axis-v::after {
  content: '';
  position: absolute;
  border: 4px solid transparent;
}
.axis-h::before  { border-right-color: var(--axis-lines); right: 0; top: -4px; }
.axis-h::after   { border-left-color: var(--axis-lines);  left: 0; top: -4px; }
.axis-v::before  { border-bottom-color: var(--axis-lines); bottom: 0; left: -4px; }
.axis-v::after   { border-top-color: var(--axis-lines);    top: 0; left: -4px; }

/* party pins */
.party-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.party-pin:hover {
  z-index: 20;
  transform: translate(-50%, -50%) scale(1.15);
}

.party-pin.active {
  z-index: 30;
  transform: translate(-50%, -50%) scale(1.25);
}

.pin-bubble {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #111;
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.party-pin:hover .pin-bubble {
  box-shadow: 0 6px 16px rgba(0,0,0,0.6);
}

.party-pin.active .pin-bubble {
  box-shadow: 0 0 15px currentColor, 0 8px 24px rgba(0,0,0,0.8);
  border-color: #fff !important;
}

.pin-bubble img {
  width: 32px; height: 32px;
  object-fit: contain;
}

.pin-acronym {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #fff;
  text-align: center;
  line-height: 1;
  display: none;
}

.pin-bubble.no-logo .pin-acronym { display: block; }
.pin-bubble.no-logo img { display: none; }

.pin-label {
  position: absolute;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  pointer-events: none;
}

.party-pin:hover .pin-label,
.party-pin.active .pin-label {
  color: rgba(255,255,255,0.9);
}

/* ── SIDE PANEL ── */
.side-panel {
  width: 420px;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  box-shadow: -10px 0 30px rgba(0,0,0,0.2);
}

.panel-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
}

.party-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
}

.party-list-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  margin: 0;
}

.party-list-total {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  background: rgba(255,255,255,0.1);
  padding: 4px 8px;
  border-radius: 12px;
  color: var(--text);
}

.party-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.party-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.party-list-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

.party-list-item img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
  padding: 2px;
}

.party-list-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.party-list-item-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.party-list-item-acronym {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;
  justify-content: flex-start;
}

.panel-action-btn-text {
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.panel-action-btn-text:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
}

.panel-action-btn {
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.panel-action-btn:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.1);
}

.panel-content {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
}

.panel-content.visible { display: flex; }

.panel-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.panel-logo {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: #1a1a28;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.panel-logo img { width: 44px; height: 44px; object-fit: contain; }

.panel-header-text { flex: 1; }

.panel-hero {
  width: 100%;
  height: 560px;
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.panel-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}

.panel-acronym {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.panel-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.panel-leader {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}



.panel-body {
  flex: 1;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.evo-btn-container {
  width: 100%;
}

.panel-evo-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(100, 200, 255, 0.08);
  border: 1px solid rgba(100, 200, 255, 0.2);
  color: rgba(100, 200, 255, 0.9);
  padding: 12px;
  border-radius: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panel-evo-btn:hover {
  background: rgba(100, 200, 255, 0.15);
  border-color: rgba(100, 200, 255, 0.4);
  box-shadow: 0 0 15px rgba(100, 200, 255, 0.1);
}

.panel-desc {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.85);
}

/* position indicator */
.position-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pos-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pos-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  width: 100px;
  flex-shrink: 0;
}

.pos-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  position: relative;
}

.pos-fill {
  height: 100%;
  border-radius: 2px;
  position: absolute;
}

.pos-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  position: absolute;
  top: -4px;
  transform: translateX(-50%);
  background: var(--bg-panel);
}

/* ideology tags */
.ideology-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-transform: uppercase;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tag:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* programa accordion */
.programa-section h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.prog-item {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}

.prog-header {
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  transition: background 0.15s;
}

.prog-header:hover { background: rgba(255,255,255,0.03); }

.prog-header .chevron {
  transition: transform 0.2s;
  font-size: 12px;
  opacity: 0.4;
}

.prog-item.open .chevron { transform: rotate(90deg); }

.prog-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.prog-item.open .prog-body { max-height: 200px; }

.prog-body p {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255,255,255,0.65);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* stats bar */
.stats-row {
  display: flex;
  gap: 1px;
}

.stat-box {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  padding: 16px 10px;
  text-align: center;
}

.stat-box:first-child { border-radius: 6px 0 0 6px; }
.stat-box:last-child  { border-radius: 0 6px 6px 0; }

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 4px;
  transition: border-color 0.15s, color 0.15s;
  align-self: flex-start;
}

.panel-link:hover {
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}

/* Members list */
.members-section {
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.members-section h3 {
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 12px;
}

.members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.member-badge:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.member-badge img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  background: #111;
}

.member-badge span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* axis bottom labels */
.axis-label-bottom {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
}

/* quadrant corner labels */
.q-corner {
  position: absolute;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 8px;
  pointer-events: none;
  z-index: 3;
}

.q-corner.tl { top: 6px; left: 8px;  color: var(--q-tl-accent); opacity: 0.6; }
.q-corner.tr { top: 6px; right: 8px; color: var(--q-tr-accent); opacity: 0.6; text-align: right; }
.q-corner.bl { bottom: 6px; left: 8px;  color: var(--q-bl-accent); opacity: 0.6; }
.q-corner.br { bottom: 6px; right: 8px; color: var(--q-br-accent); opacity: 0.6; text-align: right; }

/* scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* responsive */
/* Tablets (768px to 1024px) */
@media (max-width: 1024px) {
  header { padding: 20px 24px; }
  .region-btn { padding: 5px 10px; font-size: 9px; }
  .region-btn img { width: 14px; height: 10px; }
  .search-input { width: 180px; }
  .search-input:focus { width: 220px; }
  .legend { gap: 12px; }
  .legend-item { font-size: 10px; }
  .side-panel { width: 380px; }
}

/* Small tablets and large phones (768px) */
@media (max-width: 900px) {
  main { flex-direction: column; }
  .side-panel { width: 100%; border-left: none; border-top: 1px solid var(--border); min-height: 320px; }
  header { 
    padding: 16px 20px; 
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-right {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .search-wrap {
    width: 100%;
    margin-bottom: 10px;
  }
  .search-input {
    width: 100%;
  }
  .search-input:focus {
    width: 100%;
  }
  .region-switcher {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }
  .legend {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
  }
  .compass-wrap { padding: 16px; }
  .map-toolbar-side {
    flex-direction: row;
    bottom: auto;
    top: 8px;
    left: 8px;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
  }
  .side-btn.filter-btn {
    padding: 8px 10px;
    font-size: 9px;
  }
  .compass-row {
    max-width: 100%;
  }
  .compass {
    max-width: 100%;
    max-height: 400px;
  }
  .axis-label-side {
    width: 18px;
    font-size: 9px;
  }
  .axis-label-side.left { margin-right: 6px; }
  .axis-label-side.right { margin-left: 6px; }
  .axis-label-top, .axis-label-bottom {
    font-size: 10px;
    margin: 6px 0;
  }
  .party-pin .pin-bubble {
    width: 36px;
    height: 36px;
  }
  .party-pin .pin-bubble img {
    width: 28px;
    height: 28px;
  }
  .pin-label {
    font-size: 9px;
    top: 50px;
  }
  .pin-acronym {
    font-size: 9px;
  }
}

/* Phones (640px) */
@media (max-width: 768px) {
  body { 
    height: auto; 
    overflow-y: auto; 
    overflow-x: hidden;
  }
  
  header {
    padding: 16px 16px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    position: sticky;
    top: 0;
  }

  .header-title h1 {
    font-size: 22px;
  }

  .header-right {
    width: 100%;
    align-items: stretch;
    gap: 12px;
  }

  .search-wrap {
    width: 100%;
    margin-bottom: 0;
  }

  .search-input {
    width: 100%;
    font-size: 12px;
    padding: 10px 14px 10px 38px;
  }

  .search-input:focus {
    width: 100%;
  }

  .search-dropdown {
    width: 100%;
    right: 0;
    left: 0;
  }

  .region-switcher {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .region-btn {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 9px;
  }

  .region-btn span {
    display: block;
  }

  .legend {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .legend-item {
    font-size: 9px;
  }

  .legend-full {
    display: none;
  }

  .legend-item span:first-of-type {
    display: inline;
  }

  main {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .compass-wrap {
    padding: 12px;
    min-height: 400px;
    position: relative;
    z-index: 1;
  }

  .compass-row {
    max-width: 100%;
  }

  .compass {
    max-width: 100%;
    height: calc(100vw - 40px);
    max-height: 400px;
    border-radius: 12px;
  }

  .map-toolbar-side {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
    background: transparent;
    border: none;
    backdrop-filter: none;
    padding: 0;
    box-shadow: none;
  }

  .side-btn.filter-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 4px;
    font-size: 8px;
    text-align: center;
    justify-content: center;
  }

  .side-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    background: var(--bg);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.4);
    min-height: 100vh;
  }

  .panel-empty {
    padding: 60px 20px;
  }

  .panel-header {
    padding: 24px 20px;
  }

  .panel-name {
    font-size: 24px;
  }

  .panel-hero {
    height: 350px;
  }

  .stats-row {
    flex-direction: row;
  }

  .stat-box {
    padding: 12px 4px;
  }

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

  .zoom-controls {
    display: none; /* Hide zoom buttons on mobile, use pinch */
  }

  .axis-label-top, .axis-label-bottom {
    font-size: 9px;
  }

  .axis-label-side {
    font-size: 8px;
  }
}

@media (max-width: 480px) {
  .header-title h1 {
    font-size: 20px;
  }

  .panel-hero {
    height: 280px;
  }

  .stats-row {
    flex-direction: column;
    gap: 8px;
  }

  .stat-box {
    border-radius: 8px !important;
  }
}

/* ── SEARCH BAR ── */

/* ── SEARCH BAR ── */
.search-wrap {
  position: relative;
  margin-bottom: 8px;
  align-self: flex-end;
}

.search-input {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 8px 14px 8px 36px;
  border-radius: 999px;
  width: 230px;
  outline: none;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238b92a5' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.search-input::placeholder { color: var(--muted); }

.search-input:focus {
  border-color: rgba(255,255,255,0.28);
  background-color: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
  width: 280px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #12131e;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  display: none;
}

.search-dropdown.open {
  display: block;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.search-result:last-child { border-bottom: none; }

.search-result:hover {
  background: rgba(255,255,255,0.07);
}

.search-result-logo {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.1);
  object-fit: contain;
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-leader {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.search-no-results {
  padding: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.06em;
}

/* ── CHART MODAL ── */
.chart-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.chart-modal.open {
  display: flex;
}

.chart-modal-inner {
  background: #0f1018;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 32px;
  max-width: 940px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
}

.chart-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.chart-modal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
}

.chart-subtitle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}

.chart-close-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chart-close-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.chart-canvas-wrap {
  width: 100%;
}

.chart-canvas-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.chart-legend-logo {
  width: 10px;
  height: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.chart-legend-dot {
  width: 10px; height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Party toggles */
.chart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.chart-toggle-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0.4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-toggle-logo {
  width: 10px;
  height: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.chart-toggle-btn.on {
  opacity: 1;
}

/* Chart tooltip */
.chart-tooltip {
  position: absolute;
  background: rgba(10,11,18,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 14px;
  pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  z-index: 100;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.chart-tooltip-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}

.chart-tooltip-president {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pres-name {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.pres-logo {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  padding: 1px;
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.chart-tooltip-namewrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.chart-tooltip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-tooltip-logo {
  width: 10px;
  height: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.chart-tooltip-label {
  flex: 1;
  color: rgba(255,255,255,0.6);
}

.chart-tooltip-value {
  font-weight: 600;
  color: #fff;
}

.chart-canvas-wrap {
  position: relative;
}

.comp-distance-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  margin-bottom: 16px;
}

.comparator-modal-inner {
  max-width: 1000px;
  padding: 0;
}

.comparator-modal-header {
  padding: 24px;
  align-items: center;
}

.comparator-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comparator-body {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  height: 70vh;
  overflow: hidden;
}

.comparator-affinity-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 24px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.comparator-affinity-badge {
  margin: 0;
  min-width: 220px;
  text-align: center;
}

.comparator-grid {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.comparator-col {
  flex: 1;
  min-width: 0;
  padding: 24px;
  overflow: visible;
}

.comparator-col-left {
  border-right: 1px solid var(--border);
}

.comparator-col-right {
  background: transparent;
}

.comp-search-wrap {
  position: relative;
  width: 420px;
  max-width: 48vw;
}

.comp-search-input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.comp-search-input:focus {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
}

.comp-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #12131e;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  overflow: hidden;
  z-index: 1002;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  max-height: 320px;
  overflow-y: auto;
  display: none;
}

.comp-search-dropdown.open {
  display: block;
}

.comp-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
}

.comp-search-item:last-child {
  border-bottom: none;
}

.comp-search-item:hover {
  background: rgba(255,255,255,0.06);
}

.comp-search-item-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 2px;
  flex-shrink: 0;
}

.comp-search-item-text {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comp-search-empty {
  padding: 12px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.comp-party-hero {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 420px;
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #10121b;
}

.comp-party-hero img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 25%;
}

.comp-party-hero-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .comparator-modal-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .comparator-header-controls {
    width: 100%;
  }

  .comp-search-wrap {
    width: 100%;
    max-width: none;
  }

  .comparator-body {
    height: 78vh;
  }

  .comparator-grid {
    flex-direction: column;
  }

  .comparator-col-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .comp-party-hero {
    max-height: 320px;
  }
}

@media (max-width: 480px) {
  .comparator-body {
    height: calc(100vh - 120px);
  }

  .comparator-col {
    padding: 16px;
  }

  .comp-party-hero {
    max-height: 260px;
  }
}

.parliament-tooltip {
  position: fixed;
  background: rgba(10,11,18,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 12px;
  pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  z-index: 1001;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.parliament-tooltip-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.parliament-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.75);
}

.parliament-tooltip-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(10,11,18,0.25);
  border-radius: 4px;
  padding: 2px;
}

.parliament-tooltip-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.parliament-logo {
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}

.parliament-logo-bg {
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}

.parliament-legend-logo {
  width: 18px;
  height: 14px;
  object-fit: contain;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(10,11,18,0.25);
  border-radius: 3px;
  padding: 2px;
}

/* ── SEARCH BAR ── */
.search-wrap {
  position: relative;
  margin-bottom: 8px;
  align-self: flex-end;
}

.search-input {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 8px 14px 8px 36px;
  border-radius: 999px;
  width: 230px;
  outline: none;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238b92a5' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.search-input::placeholder { color: var(--muted); }

.search-input:focus {
  border-color: rgba(255,255,255,0.28);
  background-color: rgba(255,255,255,0.1);
  width: 280px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: #161822;
  border: 1px solid var(--border);
  border-radius: 12px;
  z-index: 200;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: none;
}

.search-dropdown.open { display: block; }

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: rgba(255,255,255,0.04); }

.search-result-logo {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: #111;
  object-fit: contain;
}

.search-result-info { flex: 1; }
.search-result-name { font-size: 13px; font-weight: 600; color: #fff; }
.search-result-leader { font-size: 10px; color: var(--muted); margin-top: 2px; }

.search-no-results {
  padding: 16px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}
/* ══════════════════════════════════════════════
   EVOLUTION TIMELINE SLIDER
══════════════════════════════════════════════ */
.evo-btn {
  background: rgba(100,200,255,0.1);
  color: #64c8ff;
  border-color: rgba(100,200,255,0.3);
}
.evo-btn:hover {
  background: rgba(100,200,255,0.2);
}
.evo-btn.active {
  background: rgba(100,200,255,0.3);
  color: #fff;
  border-color: rgba(100,200,255,0.6);
}

.evolution-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(8, 9, 16, 0.98), rgba(12, 13, 24, 0.94));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 28px 16px;
  z-index: 35;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  animation: slideUpBar 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.evolution-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--evo-color, #64c8ff) 40%, var(--evo-color, #64c8ff) 60%, transparent);
  opacity: 0.7;
}

@keyframes slideUpBar {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.evo-party-tag {
  display: flex;
  align-items: center;
  gap: 8px;
}

.evo-party-logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
}

.evo-party-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
}

.evo-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 1;
  text-align: center;
}

.evo-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.evo-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.evo-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.evo-year-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 38px;
}

.evo-year-label:last-child {
  text-align: right;
}

.evo-slider-track {
  flex: 1;
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
}

.evo-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.evo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--evo-color, #64c8ff);
  box-shadow: 0 0 10px var(--evo-color, #64c8ff), 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s;
}

.evo-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.evo-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--evo-color, #64c8ff);
  cursor: pointer;
}

.evo-track-dots {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 1;
  padding: 0 1px;
}

.evo-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.evo-dot.passed {
  background: var(--evo-color, #64c8ff);
  opacity: 0.6;
}

.evo-dot.current {
  background: var(--evo-color, #64c8ff);
  opacity: 1;
  transform: scale(1.3);
}

.evo-current {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.evo-current-year {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.evo-current-pos {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* Trail ghost pin on the compass */
.ghost-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}

.ghost-bubble {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ghost-bubble img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.5;
}

.ghost-year {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

/* Evolution trail line on canvas */
.evo-trail-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

@media (max-width: 768px) {
  .evolution-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 450;
    padding: 10px 16px 14px;
  }
  .evo-label {
    display: none;
  }
  .evo-current-year {
    font-size: 15px;
  }
}
