/* ── Driving Side Map ──────────────────────────────────────────────────────── */

:root {
  --drv-left:      #e8634a;
  --drv-left-bg:   rgba(232,99,74,0.12);
  --drv-right:     #2aaa8e;
  --drv-right-bg:  rgba(42,170,142,0.11);
}

/* ── Edge fades ── */
.drv-fade { position: absolute; pointer-events: none; z-index: 5; left: 0; right: 0; }
.drv-fade-top    { top:    0; height: 52px; background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%); }
.drv-fade-bottom { bottom: 0; height: 80px; background: linear-gradient(to top,    var(--bg) 0%, transparent 100%); }

/* ── Map title (top-left) ── */
.drv-map-title {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.drv-map-title-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  flex-shrink: 0;
}
.drv-map-title-icon svg { width: 20px; height: 20px; color: var(--ink); }
.drv-map-title-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.drv-map-title-text {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}

/* ── Road graphic (floating decorative element) ── */
.drv-road-graphic {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  display: flex;
  align-items: stretch;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.14);
  pointer-events: none;
}
.drv-road-lane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 58px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.drv-road-lane--left  { background: var(--drv-left-bg);  color: var(--drv-left);  }
.drv-road-lane--right { background: var(--drv-right-bg); color: var(--drv-right); }
.drv-road-lane svg    { width: 22px; height: 22px; }

.drv-road-divider {
  width: 14px;
  background: var(--bg-warm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding: 10px 0;
}
.drv-road-divider span {
  display: block;
  width: 3px;
  height: 10px;
  border-radius: 2px;
  background: var(--ink-faint);
  opacity: 0.5;
}

/* ── Stats overlay (bottom) ── */
.drv-stats-overlay {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.drv-stat-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.drv-stat-badge--left  { background: var(--drv-left-bg);  color: var(--drv-left);  }
.drv-stat-badge--right { background: var(--drv-right-bg); color: var(--drv-right); }
.drv-stat-badge-sep    { color: var(--ink-faint); font-size: 14px; }

/* ── Card connector SVG ── */
.drv-card-line-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 21;
  overflow: visible;
}

/* ── Click card (persistent on-map popup) ── */
.drv-click-card {
  position: absolute;
  z-index: 22;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 13px;
  padding: 12px 38px 12px 14px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  pointer-events: all;
  min-width: 200px;
  animation: drv-card-pop 0.16s ease;
}
.drv-click-card.visible { display: flex; }
@keyframes drv-card-pop {
  from { opacity: 0; transform: scale(0.92) translateY(4px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}
.drv-click-card-close {
  position: absolute;
  top: 7px; right: 9px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-faint);
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
}
.drv-click-card-close:hover { color: var(--ink); background: var(--bg-warm); }
.drv-click-card-inner { display: flex; align-items: center; gap: 12px; }
.drv-cc-flag { flex-shrink: 0; }
.drv-cc-name { font-size: 14px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.drv-cc-side { font-size: 11px; font-weight: 700; margin-top: 3px; }
.drv-cc-side--left  { color: var(--drv-left);  }
.drv-cc-side--right { color: var(--drv-right); }

/* ── Tooltip ── */
.drv-tooltip {
  position: absolute;
  z-index: 20;
  background: var(--popup-bg, #fff);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 9px 13px;
  display: none;
  align-items: center;
  gap: 10px;
  font-family: 'Nunito', system-ui, sans-serif;
  box-shadow: 0 6px 20px rgba(26,58,92,0.13);
  pointer-events: none;
  white-space: nowrap;
}
.drv-tooltip.visible { display: flex; }
.drv-tt-flag { flex-shrink: 0; }
.drv-tt-name { font-size: 13px; font-weight: 800; color: var(--ink); }
.drv-tt-side { font-size: 11px; font-weight: 700; margin-top: 2px; }
.drv-tt-left  { color: var(--drv-left);  }
.drv-tt-right { color: var(--drv-right); }

/* ── Map controls ── */
.drv-map-controls {
  position: absolute;
  bottom: 96px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drv-map-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 18px;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.12s;
}
.drv-map-btn svg { width: 14px; height: 14px; }
.drv-map-btn:hover { background: var(--bg-warm); }

/* ════════════════════════════
   LEFT PANEL
════════════════════════════ */
.drv-panel-head {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.drv-panel-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.drv-panel-wheel {
  width: 36px; height: 36px;
  flex-shrink: 0;
  color: var(--ink);
}
.drv-panel-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}
.drv-panel-sub {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* Legend */
.drv-legend {
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--rule);
}
.drv-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.drv-legend-item:hover { background: var(--bg-warm); }
.drv-legend-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.drv-legend-dot--left  { background: var(--drv-left);  }
.drv-legend-dot--right { background: var(--drv-right); }
.drv-legend-text { flex: 1; min-width: 0; }
.drv-legend-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.drv-legend-count {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 1px;
}
.drv-legend-arrow {
  font-size: 16px;
  color: var(--drv-left);
  flex-shrink: 0;
}
.drv-legend-arrow--right { color: var(--drv-right); }

/* Stat strip */
.drv-stat-strip {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.drv-stat-pill {
  flex: 1;
  border-radius: 10px;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.drv-stat-pill--left  { background: var(--drv-left-bg); }
.drv-stat-pill--right { background: var(--drv-right-bg); }
.drv-stat-pct {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}
.drv-stat-pill--left  .drv-stat-pct { color: var(--drv-left);  }
.drv-stat-pill--right .drv-stat-pct { color: var(--drv-right); }
.drv-stat-desc {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* Fun facts */
.drv-facts {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.drv-facts-head {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.drv-facts-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drv-facts-list li {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.45;
  padding-left: 14px;
  position: relative;
}
.drv-facts-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--ink-faint);
  font-size: 10px;
  top: 1px;
}

/* LHT country list */
.drv-panel-section-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding: 12px 16px 6px;
}
.drv-lht-list { padding: 0 8px 16px; }
.drv-lht-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.1s;
}
.drv-lht-row:hover { background: var(--bg-warm); }
.drv-lht-name { font-size: 13px; font-weight: 600; color: var(--ink); }

/* ════════════════════════════
   RIGHT PANEL — Country list
════════════════════════════ */
.drv-list-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.drv-list-tab {
  flex: 1;
  padding: 13px 10px;
  border: none;
  background: none;
  font: 700 12px/1 'Nunito', system-ui, sans-serif;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.13s, border-color 0.13s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.drv-list-tab:hover { color: var(--ink); }
.drv-list-tab--active { color: var(--ink); border-bottom-color: var(--accent); }
.drv-list-tab-count {
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-warm);
  border-radius: 10px;
  padding: 1px 6px;
  color: var(--ink-faint);
}
.drv-list-tab--active .drv-list-tab-count { background: rgba(232,99,74,0.12); color: var(--accent); }

/* Back button */
.drv-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 7px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  background: none;
  font: 600 12px/1 'Nunito', system-ui, sans-serif;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.drv-back-btn:hover { background: var(--bg-warm); color: var(--ink); }

/* ════════════════════════════
   RIGHT PANEL — Country detail
════════════════════════════ */
.drv-detail { padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 16px; }

.drv-detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}
.drv-detail-flag img,
.drv-detail-flag .hej-flag {
  width: 52px; height: 38px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.16);
}
.drv-detail-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.drv-detail-side {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 20px;
}
.drv-detail-side--left  { background: var(--drv-left-bg);  color: var(--drv-left);  }
.drv-detail-side--right { background: var(--drv-right-bg); color: var(--drv-right); }

.drv-detail-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg-warm);
}
.drv-detail-card-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.drv-detail-card-icon svg { width: 18px; height: 18px; color: var(--ink); }
.drv-detail-card-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-faint); }
.drv-detail-card-value { font-size: 14px; font-weight: 800; color: var(--ink); margin-top: 2px; }

.drv-detail-section-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.drv-detail-peers {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.drv-peer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.1s;
}
.drv-peer:hover { background: var(--bg-warm); }
