/* ═══════════════════════════════════════════════════
   Timetrekk — History Explorer
   Stage 6: Dashboard composition correction
   Fonts: Zodiak (display) + Satoshi (body)
   ═══════════════════════════════════════════════════ */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
}

/* ── Design Tokens ── */
:root, [data-theme="light"] {
  --font-display: 'Zodiak', 'Georgia', serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  --color-bg: #f4f0e7;
  --color-surface: #faf7f0;
  --color-surface-2: #fff;
  --color-surface-offset: #ebe6da;
  --color-surface-dynamic: #e0dbd0;
  --color-divider: #d4cfc2;
  --color-border: #c9c3b6;

  --color-text: #2a2214;
  --color-text-muted: #74695a;
  --color-text-faint: #ada394;
  --color-text-inverse: #faf7f0;

  --color-primary: #b5751a;
  --color-primary-hover: #95600f;
  --color-primary-active: #7a4d08;
  --color-primary-highlight: #f0e2c8;

  --color-cat-politics: #8b5e3c;
  --color-cat-science: #3a7a6e;
  --color-cat-culture: #8a5090;
  --color-cat-war: #a04040;
  --color-cat-exploration: #2d6a8f;
  --color-cat-economics: #7a8530;

  --color-map-land: #d9d3c4;
  --color-map-land-hover: #c9c1ad;
  --color-map-active: #b5751a;
  --color-map-active-hover: #95600f;

  --map-panel-bg: #0e0f11;
  --map-panel-border: #1e2024;
  --map-ocean: #0a0c10;
  --map-grid-color: #1c2230;
  --map-compass-stroke: #2a3040;
  --map-land-fill: #1e2330;
  --map-land-stroke: #3a4050;
  --map-land-hover-fill: #2c3242;
  --map-linked-fill: #252b3c;
  --map-label-fill: #6a7888;
  --map-label-active-fill: #58c4ff;
  --map-active-fill: #2ea4e8;
  --map-active-stroke: #58c4ff;
  --map-active-hover-fill: #3ab4f0;
  --map-hotspot-glow: rgba(46, 164, 232, 0.35);
  --map-hotspot-ring: rgba(88, 196, 255, 0.2);

  --landing-bg: #0c0e14;
  --landing-surface: #12151e;
  --landing-surface-2: #181c28;
  --landing-border: #1e2438;
  --landing-border-glow: #2a3450;
  --landing-text: #c8d0e0;
  --landing-text-muted: #6a7490;
  --landing-text-faint: #404a60;
  --landing-accent: #58c4ff;
  --landing-accent-dim: #2a80c0;
  --landing-accent-glow: rgba(88, 196, 255, 0.12);

  --stat-bg: var(--landing-surface);
  --stat-border: var(--landing-border);
  --stat-value-color: var(--landing-accent);
  --stat-label-color: var(--landing-text-muted);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-panel: 300ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px rgba(42, 34, 20, 0.08);
  --shadow-md: 0 4px 12px rgba(42, 34, 20, 0.1);
  --shadow-lg: 0 12px 32px rgba(42, 34, 20, 0.14);

  --sidebar-width: 280px;
  --topbar-height: 56px;
  --detail-width: 420px;
}

/* ── Dark Mode (timeline view) ── */
[data-theme="dark"] {
  --color-bg: #18160f;
  --color-surface: #1f1c15;
  --color-surface-2: #26231b;
  --color-surface-offset: #1b1912;
  --color-surface-dynamic: #302d24;
  --color-divider: #2c2922;
  --color-border: #3a3730;

  --color-text: #d0cbc0;
  --color-text-muted: #8a8474;
  --color-text-faint: #5e5a4e;
  --color-text-inverse: #18160f;

  --color-primary: #d4983a;
  --color-primary-hover: #c08425;
  --color-primary-active: #a87020;
  --color-primary-highlight: #3a3224;

  --color-cat-politics: #c4926a;
  --color-cat-science: #5ab8a6;
  --color-cat-culture: #c07acc;
  --color-cat-war: #d46666;
  --color-cat-exploration: #5a9fc4;
  --color-cat-economics: #b0bd58;

  --color-map-land: #302d24;
  --color-map-land-hover: #3a3730;
  --color-map-active: #d4983a;
  --color-map-active-hover: #c08425;

  --map-panel-bg: #0c0d10;
  --map-panel-border: #1a1c22;
  --map-ocean: #080a0e;
  --map-grid-color: #1a2028;
  --map-compass-stroke: #252b38;
  --map-land-fill: #1c2130;
  --map-land-stroke: #363c4e;
  --map-land-hover-fill: #2a3040;
  --map-linked-fill: #232a3a;
  --map-label-fill: #607080;
  --map-label-active-fill: #58c4ff;
  --map-active-fill: #2ea4e8;
  --map-active-stroke: #58c4ff;
  --map-active-hover-fill: #3ab4f0;

  --stat-bg: var(--landing-surface);
  --stat-border: var(--landing-border);
  --stat-value-color: var(--landing-accent);
  --stat-label-color: var(--landing-text-muted);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #18160f;
    --color-surface: #1f1c15;
    --color-surface-2: #26231b;
    --color-surface-offset: #1b1912;
    --color-surface-dynamic: #302d24;
    --color-divider: #2c2922;
    --color-border: #3a3730;
    --color-text: #d0cbc0;
    --color-text-muted: #8a8474;
    --color-text-faint: #5e5a4e;
    --color-text-inverse: #18160f;
    --color-primary: #d4983a;
    --color-primary-hover: #c08425;
    --color-primary-active: #a87020;
    --color-primary-highlight: #3a3224;
    --color-cat-politics: #c4926a;
    --color-cat-science: #5ab8a6;
    --color-cat-culture: #c07acc;
    --color-cat-war: #d46666;
    --color-cat-exploration: #5a9fc4;
    --color-cat-economics: #b0bd58;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.15;
}
p, li, figcaption {
  text-wrap: pretty;
  max-width: 72ch;
}

::selection {
  background: var(--color-primary-highlight);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a, button, [role="button"], [role="link"], input, textarea, select {
  transition: color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link:focus {
  position: fixed; top: var(--space-2); left: var(--space-2);
  width: auto; height: auto; padding: var(--space-2) var(--space-4);
  clip: auto; white-space: normal;
  background: var(--color-primary); color: var(--color-text-inverse);
  border-radius: var(--radius-sm); z-index: 9999;
  font-size: var(--text-sm); font-weight: 500;
}


/* ═══════════════════════════════════════════════════
   LANDING VIEW — Dashboard Composition (Stage 6)
   ═══════════════════════════════════════════════════ */

.landing-view {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--landing-bg);
  color: var(--landing-text);
  position: relative;
  overflow-x: hidden;
}

.landing-view[hidden] { display: none; }


/* ── Dashboard Header Bar ── */
.dash-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: var(--landing-surface);
  border-bottom: 1px solid var(--landing-border);
}

.dash-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dash-header-center {
  flex: 1;
  max-width: 420px;
  margin: 0 var(--space-6);
}

.header-search-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-4);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-full);
  color: var(--landing-text-faint);
  font-size: var(--text-xs);
  cursor: text;
}

.header-search-box svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.header-search-placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--landing-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.header-icon-btn:hover {
  background: var(--landing-surface-2);
  color: var(--landing-text);
}

.header-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--landing-surface-2);
  border: 1px solid var(--landing-border);
  color: var(--landing-text-muted);
}

.header-avatar--sm {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Logo (reused for header and sidebar) */
.logo {
  flex-shrink: 0;
  color: var(--landing-accent);
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--landing-text);
  letter-spacing: -0.02em;
}

/* Theme toggle — on landing */
.landing-view .theme-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--landing-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.landing-view .theme-toggle:hover {
  background: var(--landing-surface-2);
  color: var(--landing-text);
}

/* Theme toggle generic (timeline view) */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}


/* ═══════════════════════════════════════════════════
   DASHBOARD GRID — The core layout (Stage 6)
   Reference: hero left, map right, stats below hero,
   editorial bottom-left, explore bottom-right
   ═══════════════════════════════════════════════════ */

.dash-grid {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "hero    map"
    "stats   map"
    "editorial explore";
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ── Hero / Introduction Block ── */
.dash-hero {
  grid-area: hero;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-6) var(--space-4) var(--space-4);
}

.dash-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1rem + 2vw, 2.4rem);
  font-weight: 700;
  color: var(--landing-text);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

.dash-hero-brand {
  color: var(--landing-accent);
}

.dash-hero-sub {
  font-size: var(--text-sm);
  color: var(--landing-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-5);
  max-width: 48ch;
}

.dash-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--landing-bg);
  background: linear-gradient(135deg, var(--landing-accent) 0%, #4ae0ff 100%);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 4px 20px rgba(88, 196, 255, 0.25);
  width: fit-content;
}

.dash-hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(88, 196, 255, 0.35);
}

.dash-hero-cta:active {
  transform: translateY(0);
}


/* ── Map Panel (right side, spans multiple rows) ── */
.dash-map-panel {
  grid-area: map;
  background: var(--map-panel-bg);
  border: 1px solid var(--map-panel-border);
  border-radius: var(--radius-xl);
  padding: var(--space-3);
  box-shadow:
    0 0 0 1px rgba(46, 164, 232, 0.06),
    0 0 60px rgba(46, 164, 232, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 340px;
}

.world-map-container {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.world-map {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

/* Map info strip */
.map-info-strip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 0.6875rem;
  color: var(--landing-text-faint);
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: var(--space-2);
  min-height: 28px;
  transition: opacity 200ms ease;
}

.mis-idle {
  color: var(--landing-text-faint);
  font-size: 0.6875rem;
}

.mis--active { opacity: 1; }

.mis-flag {
  font-size: 1rem;
  line-height: 1;
}

.mis-name {
  font-weight: 600;
  color: var(--landing-text);
}

.mis-divider {
  width: 1px;
  height: 12px;
  background: var(--landing-border);
  flex-shrink: 0;
}

.mis-stat {
  color: var(--landing-text-muted);
  font-variant-numeric: tabular-nums;
}

.mis-coming {
  color: var(--landing-text-faint);
  font-style: italic;
}

.mis-cue {
  margin-left: auto;
  color: var(--landing-accent);
  font-weight: 600;
}


/* ── Stat Cards Row ── */
.dash-stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

.dash-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-3) var(--space-2);
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: border-color var(--transition-interactive), background var(--transition-interactive);
}

.dash-stat-card:hover {
  border-color: var(--landing-border-glow);
  background: var(--landing-surface-2);
}

.dash-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--landing-text);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.dash-stat-value::before {
  content: '';
}

.dash-stat-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--landing-text-muted);
  text-transform: capitalize;
}


/* ── Editorial Panel (On This Day, bottom-left) ── */
.dash-editorial {
  grid-area: editorial;
}

.dash-panel-card {
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  height: 100%;
  overflow: hidden;
  transition: border-color var(--transition-interactive);
}

.dash-panel-card:hover {
  border-color: var(--landing-border-glow);
}

.dash-panel-heading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--landing-accent);
  margin-bottom: var(--space-4);
}

.dash-panel-body {
  position: relative;
}


/* ── Spotlight Panel (bottom center) ── */
/* dash-spotlight: merged into explore panel, no separate grid area */
.dash-explore-spotlight {
  background: var(--map-panel-bg);
  border: 1px solid var(--map-panel-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  overflow-y: auto;
  min-height: 120px;
  max-height: 360px;
}

.dash-featured-event {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--landing-border);
}


/* ── Interactive Explore Panel (bottom right) ── */
.dash-explore {
  grid-area: explore;
  display: flex;
  gap: 0;
}

/* Vertical icon toolbar on explore panel's left edge */
.dash-explore-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 6px;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-right: none;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  color: var(--landing-text-faint);
}

.dash-explore-toolbar svg {
  cursor: pointer;
  transition: color var(--transition-interactive);
}

.dash-explore-toolbar svg:hover {
  color: var(--landing-accent);
}

.dash-explore .dash-panel-card {
  flex: 1;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}

.dash-panel--explore {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-explore-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--landing-border);
  margin-bottom: var(--space-3);
}

.dash-explore-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--landing-text-faint);
}

.dash-explore-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--landing-text);
  white-space: nowrap;
}

.dash-explore-search {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  padding: 3px var(--space-3);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-full);
  font-size: 0.625rem;
  color: var(--landing-text-faint);
  white-space: nowrap;
}

.dash-explore-search svg {
  flex-shrink: 0;
  opacity: 0.4;
}

.dash-explore-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-3);
}

.dash-explore-content {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-3);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dash-explore-sidebar-data {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: hidden;
}

.dash-data-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.dash-data-quote {
  border-top: 1px solid var(--landing-border);
  padding-top: var(--space-3);
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════
   Reused panel content styles (same as stage 5)
   ═══════════════════════════════════════════════════ */

/* On This Day featured image */
.otd-featured-image {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-3);
  cursor: pointer;
}

.otd-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.7) saturate(0.8);
  transition: filter 300ms ease;
}

.otd-featured-image:hover img {
  filter: brightness(0.8) saturate(1);
}

.otd-featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
}

.otd-featured-year {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--landing-accent);
  font-variant-numeric: tabular-nums;
}

.otd-featured-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

/* On This Day list items */
.otd-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.otd-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition-interactive), background var(--transition-interactive);
}

.otd-item:hover {
  border-color: var(--landing-border);
  background: rgba(255, 255, 255, 0.04);
}

.otd-item-year {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--landing-accent);
  font-variant-numeric: tabular-nums;
  min-width: 56px;
  flex-shrink: 0;
  padding-top: 1px;
}

.otd-item-content { flex: 1; min-width: 0; }

.otd-item-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--landing-text);
  line-height: 1.3;
  margin-bottom: 2px;
}

.otd-item-desc {
  font-size: var(--text-xs);
  color: var(--landing-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.otd-item-arrow {
  color: var(--landing-text-faint);
  flex-shrink: 0;
  margin-top: 4px;
  transition: color 180ms ease, transform 180ms ease;
}

.otd-item:hover .otd-item-arrow {
  color: var(--landing-accent);
  transform: translateX(2px);
}

.otd-empty {
  font-size: var(--text-xs);
  color: var(--landing-text-faint);
  font-style: italic;
  padding: var(--space-4) 0;
}

/* Country Spotlight content */
.spotlight-top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.spotlight-flag {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

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

.spotlight-name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--landing-text);
  line-height: 1.2;
  margin-bottom: 2px;
}

.spotlight-sub {
  font-size: var(--text-xs);
  color: var(--landing-text-muted);
  font-style: italic;
  margin-bottom: var(--space-2);
}

.spotlight-blurb {
  font-size: var(--text-xs);
  color: var(--landing-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spotlight-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--landing-border);
}

.spotlight-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.spotlight-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--landing-accent);
  font-variant-numeric: tabular-nums;
}

.spotlight-stat-label {
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--landing-text-faint);
}

.spotlight-cta-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.spotlight-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--landing-bg);
  background: linear-gradient(135deg, var(--landing-accent) 0%, #4ae0ff 100%);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 2px 12px rgba(88, 196, 255, 0.2);
}

.spotlight-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(88, 196, 255, 0.3);
}

.spotlight-cta svg {
  transition: transform 180ms ease;
}

.spotlight-cta:hover svg {
  transform: translateX(2px);
}

/* Spotlight category chips */
.spotlight-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-3);
}

.spotlight-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--landing-text-muted);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color var(--transition-interactive), background var(--transition-interactive);
}

.spotlight-cat-chip:hover {
  border-color: var(--landing-accent);
  background: rgba(88, 196, 255, 0.06);
}

.spotlight-cat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.spotlight-cat-count {
  color: var(--landing-text-faint);
  margin-left: 2px;
}


/* Era Distribution as tags */
.era-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.era-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 28px 16px;
  align-items: center;
  gap: var(--space-3);
}

.era-bar-row--clickable {
  cursor: pointer;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  transition: background var(--transition-interactive);
}

.era-bar-row--clickable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.era-bar-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--landing-text-muted);
  text-align: right;
  white-space: nowrap;
}

.era-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
}

.era-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--landing-accent-dim), var(--landing-accent));
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 4px;
}

.era-bar-count {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--landing-accent);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.era-bar-arrow {
  color: var(--landing-text-faint);
  transition: color 180ms ease, transform 180ms ease;
}

.era-bar-row--clickable:hover .era-bar-arrow {
  color: var(--landing-accent);
  transform: translateX(2px);
}

.era-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--landing-border);
}

.era-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--landing-text-muted);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.era-cat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* Featured discovery event */
.panel-event {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.panel-event-year {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--landing-accent);
  font-variant-numeric: tabular-nums;
}

.panel-event-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--landing-text);
  line-height: 1.25;
}

.panel-event-desc {
  font-size: var(--text-xs);
  color: var(--landing-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.panel-event-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--landing-border);
}

.panel-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--landing-text-muted);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-full);
}

.panel-event-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.panel-event-figures {
  font-size: 0.6875rem;
  color: var(--landing-text-faint);
  font-style: italic;
}

.panel-event-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--landing-accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) 0 0;
  font-family: var(--font-body);
  transition: color 180ms ease;
}

.panel-event-cta:hover { color: #8ad8ff; }

.panel-event-cta svg {
  transition: transform 180ms ease;
}

.panel-event-cta:hover svg {
  transform: translateX(2px);
}

/* Panel quote */
.panel-quote {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--landing-accent-dim);
  background: rgba(88, 196, 255, 0.03);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.panel-quote p {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--landing-text);
  margin-bottom: var(--space-1);
}

.panel-quote footer {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--landing-text-muted);
}


/* Key Figures in explore panel */
.figures-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.figure-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px var(--space-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition-interactive), background var(--transition-interactive);
}

.figure-chip:hover {
  border-color: var(--landing-border);
  background: rgba(255, 255, 255, 0.04);
}

.figure-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--landing-surface-2);
  border: 1px solid var(--landing-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--landing-accent);
  flex-shrink: 0;
  font-family: var(--font-display);
}

.figure-details { flex: 1; min-width: 0; }

.figure-name {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--landing-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.figure-event {
  font-size: 0.5rem;
  color: var(--landing-text-faint);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.figure-arrow {
  color: var(--landing-text-faint);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 180ms ease;
}

.figure-chip:hover .figure-arrow {
  opacity: 1;
}


/* Notable Quote */
.notable-quote-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.notable-quote-block {
  position: relative;
  padding: var(--space-2) var(--space-3);
  background: rgba(88, 196, 255, 0.03);
  border-left: 2px solid var(--landing-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.notable-quote-mark {
  position: absolute;
  top: 2px;
  left: var(--space-2);
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--landing-accent);
  opacity: 0.15;
  line-height: 1;
  pointer-events: none;
}

.notable-quote-text {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--landing-text);
  line-height: 1.5;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notable-quote-attribution {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.notable-quote-attr-text {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--landing-accent);
}

.notable-quote-event {
  font-size: 0.5625rem;
  color: var(--landing-text-faint);
}

.notable-quote-separator {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--landing-text-faint);
  flex-shrink: 0;
}

.notable-quote-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--landing-accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
  transition: color 180ms ease;
}

.notable-quote-cta:hover { color: #8ad8ff; }

.notable-quote-cta svg {
  transition: transform 180ms ease;
}

.notable-quote-cta:hover svg {
  transform: translateX(2px);
}


/* ═══════════════════════════════════════════════════
   MAP ZOOM CONTROLS
   ═══════════════════════════════════════════════════ */

.map-zoom-controls {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(14, 18, 28, 0.85);
  border: 1px solid rgba(88, 196, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.7;
  transition: opacity 200ms ease;
}

.map-zoom-controls:hover,
.map-zoom-controls:focus-within {
  opacity: 1;
}

.map-zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: rgba(200, 215, 235, 0.7);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  padding: 0;
}

.map-zoom-btn:hover {
  background: rgba(88, 196, 255, 0.12);
  color: #58c4ff;
}

.map-zoom-btn:active {
  background: rgba(88, 196, 255, 0.2);
}

.map-zoom-btn:focus-visible {
  outline: 2px solid #58c4ff;
  outline-offset: -2px;
}

.map-zoom-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.map-zoom-btn:disabled:hover {
  background: transparent;
  color: rgba(200, 215, 235, 0.7);
}

.map-zoom-btn--reset {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Zoom level indicator */
.map-zoom-level {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(200, 215, 235, 0.35);
  text-align: center;
  line-height: 1;
  padding: 2px 0;
  pointer-events: none;
  user-select: none;
}

/* Cursor states for pan mode */
.world-map-container.is-pannable {
  cursor: grab;
}

.world-map-container.is-panning {
  cursor: grabbing;
}

.world-map-container.is-pannable .map-country {
  cursor: pointer;
}

/* Smooth viewBox transitions for button zoom */
.world-map.zoom-animating {
  transition: none; /* viewBox is animated via JS */
}

@media (max-width: 600px) {
  .map-zoom-controls {
    top: var(--space-2);
    right: var(--space-2);
  }

  .map-zoom-btn {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  .map-zoom-controls {
    top: var(--space-2);
    right: auto;
    left: var(--space-2);
    padding: 2px;
  }

  .map-zoom-btn {
    width: 30px;
    height: 30px;
  }
}

/* ═══════════════════════════════════════════════════
   MAP SVG STYLES — Full Country Map
   ═══════════════════════════════════════════════════ */

/* Individual country paths */
.map-country {
  fill: var(--map-land-fill);
  stroke: var(--map-land-stroke);
  stroke-width: 0.4;
  stroke-linejoin: round;
  transition: fill 180ms ease, stroke 180ms ease, opacity 180ms ease;
  cursor: pointer;
  opacity: 0.95;
}

.map-country:hover,
.map-country.map-country--hovered {
  fill: var(--map-land-hover-fill);
  stroke: var(--map-label-fill);
  stroke-width: 0.65;
  opacity: 1;
}

/* Countries linked to data model — subtle brighter fill */
.map-country--linked {
  fill: var(--map-linked-fill, var(--map-land-fill));
  opacity: 1;
  stroke-width: 0.5;
}

/* Flash animation for country highlight from grid click */
.map-country--flash {
  fill: var(--map-land-hover-fill) !important;
  stroke: var(--map-label-fill) !important;
  stroke-width: 0.65;
  opacity: 1 !important;
  animation: map-flash-pulse 0.8s ease-in-out 2;
}

@keyframes map-flash-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* UK — active/clickable country */
.map-country--uk {
  fill: var(--map-active-fill);
  stroke: var(--map-active-stroke);
  stroke-width: 1.2;
  opacity: 1;
  filter: url(#glow-active);
}

.map-country--uk:hover {
  fill: var(--map-active-hover-fill);
  stroke: var(--map-active-stroke);
  stroke-width: 1.5;
  filter: url(#glow-active);
}

/* Countries group */
.map-countries-group {
  pointer-events: all;
}

/* Pulse indicator on UK */
.map-pulse-uk {
  fill: var(--map-active-fill);
  opacity: 0.7;
  animation: pulse-ring 2.5s ease-in-out infinite;
  pointer-events: none;
}

.map-pulse-uk-outer {
  fill: none;
  stroke: var(--map-active-stroke);
  stroke-width: 1;
  opacity: 0;
  animation: pulse-ring-outer 3s ease-out infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0%, 100% { r: 4; opacity: 0.7; }
  50% { r: 14; opacity: 0; }
}

@keyframes pulse-ring-outer {
  0% { r: 6; opacity: 0.5; stroke-width: 1.5; }
  100% { r: 28; opacity: 0; stroke-width: 0.3; }
}

/* Map label styles */
.map-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  fill: var(--map-label-fill);
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
}

.map-label--active {
  fill: var(--map-label-active-fill);
  font-weight: 700;
  font-size: 12px;
}

.map-compass-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  fill: var(--map-label-fill);
}

/* Country tooltip on hover */
.map-country-tooltip {
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 600;
  fill: var(--map-label-fill);
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.map-country:hover + .map-country-tooltip,
.map-country-tooltip.visible {
  opacity: 1;
}

/* Focus styles for keyboard nav */
.map-country:focus-visible {
  outline: none;
  stroke: #58c4ff;
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(88, 196, 255, 0.3));
}

.map-tooltip {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(10, 18, 35, 0.95);
  color: #b0d4f0;
  padding: var(--space-2) var(--space-4);
  border: 1px solid rgba(46, 164, 232, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

.map-tooltip.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58c4ff;
  box-shadow: 0 0 6px rgba(88, 196, 255, 0.5);
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}


/* ═══════════════════════════════════════════════════
   COUNTRY LIST / GRID
   ═══════════════════════════════════════════════════ */

.dash-country-list-section {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-5) var(--space-6);
}

.country-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: 100%;
}

.country-grid-section {
  width: 100%;
}

.country-grid-heading {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--landing-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--landing-border);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.country-grid-heading-count {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--landing-text-faint);
  background: var(--landing-border);
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0;
  text-transform: none;
}

.country-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-2);
  width: 100%;
}

.country-card {
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: box-shadow var(--transition-interactive),
              transform var(--transition-interactive),
              border-color var(--transition-interactive);
  font-family: var(--font-body);
}

.country-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
  border-color: var(--landing-accent-dim);
}

.country-card:active { transform: translateY(0); }

.country-card.coming-soon {
  opacity: 0.55;
  cursor: pointer;
}

.country-card.coming-soon:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  border-color: var(--landing-border);
  opacity: 0.75;
}

.country-card-top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.country-card-flag {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.country-card-info { flex: 1; min-width: 0; }

.country-card-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--landing-text);
  line-height: 1.2;
}

.country-card-sub {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--landing-text-muted);
  font-style: italic;
  margin-top: 2px;
}

.country-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  border-top: 1px solid var(--landing-border);
}

.country-card-count {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--landing-accent);
}

.country-card-arrow {
  color: var(--landing-text-faint);
  transition: transform var(--transition-interactive), color var(--transition-interactive);
}

.country-card:hover .country-card-arrow {
  transform: translateX(3px);
  color: var(--landing-accent);
}

.country-card-coming {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--landing-text-faint);
}


/* ── Globe hint ── */
.landing-footer {
  margin-top: var(--space-6);
  text-align: center;
  padding: 0 var(--space-5) var(--space-8);
}

.globe-hint {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--landing-text-faint);
  padding: var(--space-2) var(--space-4);
  border: 1px dashed var(--landing-border);
  border-radius: var(--radius-full);
}

.globe-hint svg {
  flex-shrink: 0;
  display: inline;
}


/* Explore tag pills (Stage 6 — matches reference screenshot) */
.explore-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--landing-text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: border-color var(--transition-interactive), background var(--transition-interactive), color var(--transition-interactive);
  white-space: nowrap;
}

.explore-tag:hover {
  border-color: var(--landing-accent);
  color: var(--landing-text);
  background: rgba(88, 196, 255, 0.06);
}

.explore-tag--active {
  background: var(--landing-accent);
  color: var(--landing-bg);
  border-color: var(--landing-accent);
}

.explore-tag--active:hover {
  background: #7ad4ff;
  border-color: #7ad4ff;
  color: var(--landing-bg);
}


/* ═══════════════════════════════════════════════════
   MOBILE RESPONSIVE — Dashboard landing
   ═══════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "hero"
      "stats"
      "map"
      "editorial"
      "explore";
    max-width: 100%;
    overflow: hidden;
  }

  /* Prevent every grid child from stretching beyond the column */
  .dash-grid > * {
    min-width: 0;
    max-width: 100%;
  }

  .dash-map-panel {
    min-height: 280px;
    overflow: hidden;
  }

  .dash-hero-title {
    font-size: clamp(1.2rem, 1rem + 1.5vw, 1.8rem);
  }

  .dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-explore-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-header-center {
    display: none;
  }

  .dash-explore-toolbar {
    display: none;
  }

  .dash-explore .dash-panel-card {
    border-radius: var(--radius-xl);
    min-width: 0;
    overflow: hidden;
  }

  /* Ensure panels don't overflow their grid cell */
  .dash-panel-card {
    min-width: 0;
    overflow: hidden;
  }

  /* Explore header: allow wrapping on narrow screens */
  .dash-explore-header {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .dash-explore-title {
    white-space: normal;
  }

  .dash-explore-search {
    white-space: normal;
    flex-shrink: 1;
    min-width: 0;
  }

  /* Globe hint: allow wrapping */
  .globe-hint {
    white-space: normal;
    text-align: left;
    max-width: 100%;
  }

  /* Country grid: smaller minimum for narrow phones */
  .country-grid-inner {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 600px) {
  .dash-grid {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }

  .dash-stat-value { font-size: var(--text-lg); }

  .dash-header {
    padding: var(--space-2) var(--space-3);
  }

  .dash-country-list-section {
    padding: 0 var(--space-3) var(--space-4);
  }

  .landing-footer {
    padding: 0 var(--space-3) var(--space-6);
  }

  /* Tighter hero padding on small screens */
  .dash-hero {
    padding: var(--space-4) var(--space-3) var(--space-3);
  }
}

@media (max-width: 400px) {
  /* Very narrow phones: single-column stats */
  .dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1);
  }

  .dash-stat-card {
    padding: var(--space-2) var(--space-1);
  }

  .dash-stat-value {
    font-size: clamp(1rem, 0.9rem + 1vw, 1.25rem);
  }

  .dash-hero-title {
    font-size: clamp(1.1rem, 0.9rem + 1.5vw, 1.5rem);
  }

  /* Explore header: hide tools row on very narrow screens */
  .dash-explore-tools {
    display: none;
  }

  .dash-explore-search {
    font-size: 0.5625rem;
  }

  /* Country grid: full width on very narrow phones */
  .country-grid-inner {
    grid-template-columns: 1fr;
  }
}


/* ═══════════════════════════════════════════════════
   TIMELINE VIEW — Country Timeline
   ═══════════════════════════════════════════════════ */

.timeline-view {
  display: flex;
  min-height: 100dvh;
  overflow: hidden;
}

.timeline-view[hidden] { display: none; }

/* ═══════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════ */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100dvh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-divider);
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-4);
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.back-btn:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.logo-sm {
  width: 24px;
  height: 24px;
}

.sidebar-brand .logo-text {
  font-size: var(--text-sm);
  color: var(--color-text);
}

/* Sidebar logo color uses theme primary (not landing accent) */
.sidebar-brand .logo {
  color: var(--color-primary);
}

/* ── Country Badge ── */
.sidebar-country {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
}

.sidebar-country-flag {
  font-size: 1.5rem;
  line-height: 1;
}

.sidebar-country-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.sidebar-country-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.3;
}

/* ── Filter controls ── */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.filter-heading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  font-family: var(--font-body);
}

.chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-highlight);
}

.chip.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ── Data actions ── */
.data-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
}

.btn-secondary {
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-dynamic);
  color: var(--color-text);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-divider);
}

.sidebar-count {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
}


/* ═══════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════ */

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  gap: var(--space-4);
}

.topbar-left {
  flex: 1;
  max-width: 400px;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: text;
}

.search-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}

.search-icon {
  flex-shrink: 0;
  color: var(--color-text-faint);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
  min-width: 0;
}

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.era-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-faint);
  white-space: nowrap;
}


/* ═══════════════════════════════════════════════════
   VERTICAL TIMELINE
   ═══════════════════════════════════════════════════ */

.timeline-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-6) var(--space-6) var(--space-16);
  position: relative;
}

.timeline-vertical {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding-left: var(--space-10);
}

/* The vertical line */
.timeline-vertical::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-divider);
}

/* Era separator in timeline */
.timeline-era-marker {
  position: relative;
  padding: var(--space-6) 0 var(--space-3);
}

.timeline-era-marker:first-child {
  padding-top: 0;
}

.timeline-era-label {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.timeline-era-label::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-10) + 8px);
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-surface-dynamic);
  border: 2px solid var(--color-border);
  transform: translateY(-50%);
}

/* ── Standard Event card ── */
.timeline-event {
  position: relative;
  margin-bottom: var(--space-4);
  cursor: pointer;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition-interactive),
              transform var(--transition-interactive),
              border-color var(--transition-interactive);
}

.timeline-event:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
  border-color: var(--color-primary);
}

.timeline-event.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-highlight), var(--shadow-md);
}

/* Dot on the timeline line */
.timeline-event::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-10) + 9px);
  top: var(--space-5);
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-surface);
  z-index: 2;
  transition: transform var(--transition-interactive), box-shadow var(--transition-interactive);
}

.timeline-event:hover::before {
  transform: scale(1.3);
  box-shadow: 0 0 0 4px var(--color-primary-highlight);
}

/* Connector line from dot to card */
.timeline-event::after {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-10) + 20px);
  top: calc(var(--space-5) + 5px);
  width: calc(var(--space-10) - 22px);
  height: 1px;
  background: var(--color-divider);
}

.timeline-event-year {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-1);
  letter-spacing: 0.02em;
}

.timeline-event-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: var(--space-2);
}

.timeline-event-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.timeline-event-desc--expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.timeline-event-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.event-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 2px 8px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
}

.event-badge svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.event-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.event-figures {
  font-size: 0.6875rem;
  color: var(--color-text-faint);
  font-style: italic;
}


/* ═══════════════════════════════════════════════════
   FEATURED EVENT CARD (image-ready)
   ═══════════════════════════════════════════════════ */

.timeline-event--featured {
  border: 2px solid var(--color-primary);
  background: var(--color-surface-2);
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.timeline-event--featured:hover {
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-lg);
}

/* Image slot */
.featured-image-slot {
  width: 100%;
  aspect-ratio: 16 / 7;
  background: var(--color-surface-offset);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-divider);
}

.featured-image-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-image-placeholder {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-text-faint);
  position: absolute;
  inset: 0;
  background: var(--color-surface-offset);
  text-align: center;
  padding: var(--space-4);
}

.featured-image-slot.image-error .featured-image-placeholder {
  display: flex;
}

.featured-image-placeholder svg {
  opacity: 0.4;
}

.featured-image-placeholder span {
  font-size: var(--text-xs);
  font-weight: 500;
}

.featured-body {
  padding: var(--space-5) var(--space-5) var(--space-4);
}

.featured-body .timeline-event-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

/* Inline quote on featured card */
.timeline-event-quote {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-primary);
  background: var(--color-primary-highlight);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.timeline-event-quote p {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.timeline-event-quote footer {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-muted);
}


/* ═══════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════ */

.empty-state[hidden] { display: none; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--color-text-muted);
  margin: auto;
}

.empty-state svg {
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}

.empty-state h3 {
  color: var(--color-text);
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.empty-state p {
  max-width: 36ch;
  font-size: var(--text-sm);
}


/* ═══════════════════════════════════════════════════
   DETAIL PANEL
   ═══════════════════════════════════════════════════ */

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  justify-content: flex-end;
}

.detail-overlay[hidden] { display: none; }

.detail-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(30, 25, 15, 0.4);
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.detail-panel {
  position: relative;
  width: min(var(--detail-width), 90vw);
  height: 100%;
  background: var(--color-surface);
  border-left: 1px solid var(--color-divider);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: slideIn var(--transition-panel) forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.detail-header {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-4) var(--space-5);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}

.detail-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.detail-close:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.detail-body {
  padding: 0 var(--space-6) var(--space-8);
}

/* Featured image in detail panel */
.detail-featured-image {
  margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-6)) var(--space-5);
  padding: 0;
  aspect-ratio: 16 / 9;
}

.detail-image-placeholder {
  aspect-ratio: 16 / 9;
  padding: var(--space-6);
  border-radius: 0;
}

.detail-badges-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.detail-category-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.detail-featured-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.detail-date {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.detail-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  line-height: 1.2;
}

.detail-description {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

.detail-location {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: calc(var(--space-4) * -1) 0 var(--space-5);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
}

.detail-facts {
  list-style: disc;
  padding-left: var(--space-5);
  margin-bottom: var(--space-2);
}

.detail-facts li {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.detail-quote {
  margin: 0 0 var(--space-2);
  padding: var(--space-4);
  border-left: 3px solid var(--color-primary);
  background: var(--color-surface-offset);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.detail-quote p {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.detail-quote footer {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}

.detail-section-heading {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}

.detail-key-figures {
  list-style: none;
  padding: 0;
}

.detail-key-figures li {
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-divider);
}

.detail-key-figures li:last-child {
  border-bottom: none;
}

.detail-significance {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-muted);
  font-style: italic;
}

.detail-nearby-events {
  list-style: none;
  padding: 0;
}

.detail-nearby-events li {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-divider);
  cursor: pointer;
  transition: color var(--transition-interactive);
}

.detail-nearby-events li:last-child {
  border-bottom: none;
}

.detail-nearby-events li:hover {
  color: var(--color-primary);
}

.detail-nearby-year {
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-faint);
  min-width: 60px;
}

.detail-nearby-title {
  color: var(--color-text);
  flex: 1;
}

.detail-nearby-events li:hover .detail-nearby-title {
  color: var(--color-primary);
}


/* ═══════════════════════════════════════════════════
   MOBILE NAVIGATION CONTROLS
   ═══════════════════════════════════════════════════ */

/* Hidden on desktop — shown in mobile media query */
.mobile-back-btn,
.mobile-filter-btn {
  display: none;
  position: fixed;
  z-index: 200;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* Back button: top-left, replaces old hamburger */
.mobile-back-btn {
  top: 0;
  left: 0;
  height: var(--topbar-height);
  width: 48px;
  border: none;
  border-right: 1px solid var(--color-divider);
  border-radius: 0;
  box-shadow: none;
  background: var(--color-surface);
}

/* Filter button: top-right area */
.mobile-filter-btn {
  top: 0;
  right: 0;
  height: var(--topbar-height);
  width: 48px;
  border: none;
  border-left: 1px solid var(--color-divider);
  border-radius: 0;
  box-shadow: none;
  background: var(--color-surface);
}

/* Keep legacy id selector working for sidebar toggle JS */
.sidebar-toggle {
  display: none;
}


/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .landing-hero {
    padding: var(--space-6) 0 var(--space-8);
  }
  .landing-title {
    font-size: var(--text-xl);
  }
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
  .stat-card {
    padding: var(--space-3) var(--space-2);
  }
  .stat-value {
    font-size: var(--text-lg);
  }
  .stat-icon {
    display: none;
  }
  .dashboard-row--spotlight,
  .dashboard-row--twin {
    grid-template-columns: 1fr;
  }
  .spotlight-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .figures-grid {
    grid-template-columns: 1fr;
  }
  .country-grid-inner {
    grid-template-columns: 1fr;
  }
  .world-map-container {
    padding: var(--space-2);
    border-radius: var(--radius-lg);
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform var(--transition-panel);
    box-shadow: var(--shadow-lg);
    z-index: 500;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-back-btn {
    display: flex;
  }
  .mobile-filter-btn {
    display: flex;
  }
  .topbar {
    padding-left: 56px;
    padding-right: 56px;
  }
  .timeline-vertical {
    padding-left: var(--space-8);
  }
  .timeline-event::before {
    left: calc(-1 * var(--space-8) + 9px);
  }
  .timeline-event::after {
    left: calc(-1 * var(--space-8) + 20px);
    width: calc(var(--space-8) - 22px);
  }
  .timeline-era-label::before {
    left: calc(-1 * var(--space-8) + 8px);
  }
  .timeline-vertical::before {
    left: 14px;
  }
}

@media (max-width: 480px) {
  .landing-main {
    padding: var(--space-2) var(--space-3) var(--space-8);
  }
  .landing-header {
    padding: var(--space-3) var(--space-3);
  }
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
  .stat-value {
    font-size: var(--text-lg);
  }
  .country-grid-inner {
    grid-template-columns: 1fr;
  }
  .hero-cta {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
  }
}


/* ═══════════════════════════════════════════════════
   SCROLLBARS
   ═══════════════════════════════════════════════════ */

.timeline-container::-webkit-scrollbar {
  width: 8px;
}
.timeline-container::-webkit-scrollbar-track {
  background: var(--color-surface-offset);
}
.timeline-container::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}
.timeline-container::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
}
.timeline-container {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) var(--color-surface-offset);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}


/* ═══════════════════════════════════════════════════
   Stage 4: Integration Upgrade — CSS
   Deep-links, info strip, pulse highlight, hover cues
   ═══════════════════════════════════════════════════ */

/* ── Map Info Strip ── */
.map-info-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  min-height: 40px;
  background: rgba(10, 16, 28, 0.6);
  border: 1px solid rgba(46, 164, 232, 0.08);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: rgba(200, 210, 225, 0.5);
  transition: all 250ms ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.map-info-strip.mis--active {
  opacity: 1;
  color: rgba(200, 210, 225, 0.85);
  background: rgba(14, 22, 38, 0.85);
  border-color: rgba(46, 164, 232, 0.15);
}

.map-info-strip.mis--available {
  border-color: rgba(46, 164, 232, 0.3);
}

.mis-idle {
  font-style: italic;
  opacity: 0.5;
}

.mis-flag {
  font-size: 1.1em;
}

.mis-name {
  font-weight: 600;
  color: rgba(230, 236, 245, 0.9);
  white-space: nowrap;
}

.mis-divider {
  width: 1px;
  height: 14px;
  background: rgba(88, 196, 255, 0.15);
  flex-shrink: 0;
}

.mis-stat {
  white-space: nowrap;
  color: rgba(200, 210, 225, 0.7);
  font-variant-numeric: tabular-nums;
}

.mis-cue {
  margin-left: auto;
  color: #58c4ff;
  font-weight: 500;
  white-space: nowrap;
  animation: mis-cue-pulse 2s ease infinite;
}

@keyframes mis-cue-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.mis-coming {
  font-style: italic;
  color: rgba(200, 210, 225, 0.4);
}

/* ── Event Pulse Highlight (scroll-to target) ── */
@keyframes event-pulse {
  0% { box-shadow: 0 0 0 0 rgba(181, 117, 26, 0.35); }
  40% { box-shadow: 0 0 0 8px rgba(181, 117, 26, 0.12); }
  100% { box-shadow: 0 0 0 0 rgba(181, 117, 26, 0); }
}

.timeline-event.event-pulse-highlight {
  animation: event-pulse 700ms ease 2;
  border-color: var(--color-primary) !important;
  background: var(--color-primary-highlight) !important;
}

[data-theme="dark"] .timeline-event.event-pulse-highlight {
  background: rgba(181, 117, 26, 0.12) !important;
}

/* ── OTD Item Arrow (reveals on hover) ── */
.otd-item-arrow {
  display: flex;
  align-items: center;
  opacity: 0;
  color: var(--landing-text-muted);
  transition: opacity 180ms ease, transform 180ms ease;
  flex-shrink: 0;
}

.otd-item:hover .otd-item-arrow,
.otd-item:focus-visible .otd-item-arrow {
  opacity: 0.7;
  transform: translateX(2px);
}

/* ── Era Bar clickable row ── */
.era-bar-row--clickable {
  cursor: pointer;
  transition: background 150ms ease;
  padding: var(--space-1) var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--radius-sm);
}

.era-bar-row--clickable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.era-bar-row--clickable:focus-visible {
  outline: 2px solid #58c4ff;
  outline-offset: 2px;
}

.era-bar-arrow {
  display: flex;
  align-items: center;
  opacity: 0;
  color: var(--landing-text-muted);
  transition: opacity 180ms ease, transform 180ms ease;
  flex-shrink: 0;
  margin-left: var(--space-1);
}

.era-bar-row--clickable:hover .era-bar-arrow,
.era-bar-row--clickable:focus-visible .era-bar-arrow {
  opacity: 0.7;
  transform: translateX(2px);
}

/* ── Country Spotlight: Category Chips ── */
.spotlight-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
  margin-bottom: var(--space-2);
}

.spotlight-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--landing-text);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
}

.spotlight-cat-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.spotlight-cat-chip:focus-visible {
  outline: 2px solid #58c4ff;
  outline-offset: 2px;
}

.spotlight-cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.spotlight-cat-count {
  color: var(--landing-text-muted);
  font-weight: 400;
  font-size: 0.7rem;
  margin-left: var(--space-1);
}

/* ── Key Figures: arrow + avatar border ── */
.figure-chip {
  position: relative;
}

.figure-arrow {
  display: flex;
  align-items: center;
  opacity: 0;
  color: var(--landing-text-muted);
  transition: opacity 180ms ease, transform 180ms ease;
  flex-shrink: 0;
  margin-left: auto;
}

.figure-chip:hover .figure-arrow,
.figure-chip:focus-visible .figure-arrow {
  opacity: 0.7;
  transform: translateX(2px);
}

.figure-avatar {
  border: 2px solid rgba(255, 255, 255, 0.12);
  transition: border-color 250ms ease, box-shadow 250ms ease;
}

.figure-chip:hover .figure-avatar {
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
}

/* ── Interactive cues: make clickable panels feel responsive ── */
.otd-item {
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.otd-item:hover {
  transform: translateX(2px);
}

.figure-chip {
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.figure-chip:hover {
  transform: translateX(2px);
}

/* ── Panel CTA upgrade: consistent "jump to" styling ── */
.panel-event-cta,
.notable-quote-cta {
  position: relative;
}

.panel-event-cta::before,
.notable-quote-cta::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: #d4983a;
  border-radius: 2px;
  transition: height 200ms ease;
}

.panel-event-cta:hover::before,
.notable-quote-cta:hover::before {
  height: 16px;
}

/* ── Map Info Strip responsive ── */
@media (max-width: 600px) {
  .map-info-strip {
    font-size: 0.7rem;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    flex-wrap: wrap;
    min-height: 32px;
  }
  .mis-cue {
    display: none;
  }
  .mis-stat:nth-child(n+5) {
    display: none;
  }
}


/* ═══════════════════════════════════════════════════
   STAGE 5 — Timetrekk Rebrand & Polish
   ═══════════════════════════════════════════════════ */

/* ── Upgraded Hero CTA — Start Exploring button ── */
.hero-cta.hero-cta--primary {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
  border-radius: 14px;
  background: linear-gradient(135deg, #1a6aa0 0%, #2ea4e8 100%);
  color: #fff;
  border: 1px solid rgba(46, 164, 232, 0.3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
  box-shadow: 0 4px 20px rgba(46, 164, 232, 0.25), 0 0 0 0 rgba(46, 164, 232, 0);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.hero-cta.hero-cta--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(46, 164, 232, 0.35), 0 0 0 2px rgba(46, 164, 232, 0.15);
  background: linear-gradient(135deg, #1d75b0 0%, #35b0f0 100%);
}

.hero-cta.hero-cta--primary:active {
  transform: translateY(0);
}

.hero-cta.hero-cta--primary:focus-visible {
  outline: 2px solid #2ea4e8;
  outline-offset: 3px;
}

.hero-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.hero-cta-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-cta-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: 0.01em;
}

.hero-cta-sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-xs);
  opacity: 0.75;
}

.hero-cta-arrow {
  margin-left: auto;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero-cta.hero-cta--primary:hover .hero-cta-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* Animated shimmer across the CTA */
.hero-cta.hero-cta--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: hero-shimmer 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hero-shimmer {
  0%, 100% { left: -100%; }
  50% { left: 120%; }
}


/* ── Quick Start Guide ── */
.quick-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-4);
  margin: 0 auto var(--space-6);
  max-width: 780px;
}

.quick-start-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease;
  flex: 1;
  min-width: 0;
}

.quick-start-step:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(46, 164, 232, 0.15);
}

.qs-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(46, 164, 232, 0.15);
  color: #5abae8;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
  border: 1px solid rgba(46, 164, 232, 0.2);
}

.qs-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.qs-text strong {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.01em;
}

.qs-text span {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.3;
}

.qs-connector {
  color: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* Quick Start responsive — stack on mobile */
@media (max-width: 720px) {
  .quick-start {
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-4);
  }
  .qs-connector {
    transform: rotate(90deg);
    margin: calc(-1 * var(--space-1)) 0;
  }
  .quick-start-step {
    width: 100%;
    max-width: 360px;
  }
}


/* ── Refined logo text for Timetrekk ── */
.logo-text {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ── Improved panel card header hover effect ── */
.panel-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.panel-card:hover {
  border-color: rgba(46, 164, 232, 0.15);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(46, 164, 232, 0.08);
}

/* ── Improved dashboard divider with gradient ── */
.dashboard-divider-line {
  background: linear-gradient(90deg, transparent, rgba(46, 164, 232, 0.2), transparent) !important;
}

.dashboard-divider-label {
  letter-spacing: 0.08em !important;
}


/* ── Breadcrumb in timeline topbar ── */
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-right: var(--space-3);
}

.topbar-breadcrumb-link {
  color: var(--color-text-faint);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

.topbar-breadcrumb-link:hover {
  color: var(--color-text);
}

.topbar-breadcrumb-sep {
  opacity: 0.4;
}

.topbar-breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
}


/* ── Country cards improved hover — lift + glow ── */
.country-card:not(.coming-soon) {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.country-card:not(.coming-soon):hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(46, 164, 232, 0.12);
  border-color: rgba(46, 164, 232, 0.2);
}


/* ── Scroll-to-top fab for timeline view ── */
.scroll-top-fab {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent, #2ea4e8);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 100;
}

.scroll-top-fab.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-fab:hover {
  background: #35b0f0;
  box-shadow: 0 6px 24px rgba(46, 164, 232, 0.4);
}

.scroll-top-fab:focus-visible {
  outline: 2px solid #2ea4e8;
  outline-offset: 3px;
}


/* ── Light theme adjustments for Stage 5 ── */
[data-theme="light"] .quick-start-step {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .quick-start-step:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(30, 106, 160, 0.15);
}

[data-theme="light"] .qs-number {
  background: rgba(30, 106, 160, 0.1);
  color: #1a6aa0;
  border-color: rgba(30, 106, 160, 0.2);
}

[data-theme="light"] .qs-text strong {
  color: var(--color-text);
}

[data-theme="light"] .qs-text span {
  color: var(--color-text-faint);
}

[data-theme="light"] .qs-connector {
  color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .hero-cta.hero-cta--primary {
  background: linear-gradient(135deg, #1a6aa0 0%, #2383c5 100%);
  box-shadow: 0 4px 16px rgba(26, 106, 160, 0.2);
}

[data-theme="light"] .hero-cta.hero-cta--primary:hover {
  box-shadow: 0 8px 28px rgba(26, 106, 160, 0.3);
}


/* ── Landing view entrance animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing-hero {
  animation: fadeInUp 0.6s ease both;
}

.quick-start {
  animation: fadeInUp 0.6s ease 0.15s both;
}

.stats-strip {
  animation: fadeInUp 0.6s ease 0.25s both;
}

.map-section {
  animation: fadeInUp 0.6s ease 0.35s both;
}


/* ── Refined stats-strip card hover ── */
.stat-card {
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(46, 164, 232, 0.12);
  transform: translateY(-1px);
}

[data-theme="light"] .stat-card:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(30, 106, 160, 0.1);
}

