/* =========================================================================
   EVERY LAST PARTICLE — Style System
   Three-theme architecture: sunfire (default) / vellum / eclipse
   Based on ELJ dashboard system, simplified for single-globe product.
   ========================================================================= */

/* ---------- Google Fonts (Inter) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =========================================================================
   THEME TOKENS — :root holds shared/typed tokens.
   Per-theme values live in :root[data-theme="<name>"] blocks.
   ========================================================================= */

:root {
  /* ============ TYPE SCALE (theme-invariant) ============ */
  --fs-display-xl: clamp(56px, 8vw, 112px);
  --fs-display-lg: clamp(44px, 6vw, 80px);
  --fs-display:    clamp(36px, 4.5vw, 60px);
  --fs-h1:         44px;
  --fs-h2:         32px;
  --fs-h3:         24px;
  --fs-h4:         20px;
  --fs-body-lg:    18px;
  --fs-body:       16px;
  --fs-body-sm:    14px;
  --fs-caption:    12px;
  --fs-micro:      11px;

  --lh-tight:   1.02;
  --lh-display: 1.05;
  --lh-heading: 1.15;
  --lh-body:    1.55;
  --lh-ui:      1.3;

  --ls-tight:  -0.02em;
  --ls-display:-0.015em;
  --ls-normal: 0;
  --ls-caps:   0.12em;

  /* ============ SPACING ============ */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;
  --space-4: 16px;  --space-5: 20px;  --space-6: 24px;
  --space-8: 32px;  --space-10: 40px; --space-12: 48px;
  --space-16: 64px; --space-20: 80px; --space-24: 96px;

  /* ============ RADII ============ */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 20px; --r-pill: 999px;

  /* ============ MOTION ============ */
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 320ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ============ FONT WEIGHTS ============ */
  --fw-book: 400; --fw-medium: 500; --fw-bold: 700; --fw-black: 800;

  /* ============ LAYOUT ============ */
  --container-max: 1600px;
}

/* ================================================================
   SUNFIRE THEME — default, warm dark with gold accents
   ================================================================ */
:root,
:root[data-theme="sunfire"] {
  /* brand identity */
  --brand:               #ffd05a;
  --brand-strong:        #e6a020;
  --brand-subtle:        rgba(255, 208, 90, 0.10);
  --brand-on:            #150e08;

  /* surfaces */
  --surface-bg-1:        #2d1f0e;
  --surface-bg-2:        #1a1207;
  --surface-bg-3:        #0a0703;
  --surface-raised:      #1f160a;
  --hairline:            rgba(255, 248, 224, 0.08);
  --hairline-strong:     rgba(255, 248, 224, 0.16);

  /* foreground */
  --ink:                  #fff8e0;
  --ink-muted:            rgba(255, 248, 224, 0.65);
  --ink-soft:             rgba(255, 248, 224, 0.40);

  /* data / source categories */
  --data-landfill:       #8B5CF6;
  --data-oil-gas:         #EF4444;
  --data-biogas:          #22C55E;
  --data-coal:            #6B7280;
  --data-gas-infra:       #06B6D4;

  /* globe */
  --globe-dot-day:        #fff8e0;
  --globe-dot-night:      #c9a662;
  --globe-border:         rgba(255, 208, 90, 0.35);
  --day-gradient-1:       rgba(255, 208, 90, 0.55);
  --day-gradient-2:       rgba(230, 160, 32, 0.25);
  --day-gradient-3:       rgba(0, 0, 0, 0);
  --night-overlay:         rgba(20, 14, 5, 0.42);
  --pillar-base-alpha:    99;
  --globe-sphere-base:    #1a1207;

  /* state */
  --success:              #5eead4;
  --warning:             #ffb84d;
  --danger:              #f87171;
  --info:                #67e8f9;

  /* type */
  --font-display:        "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:           "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:           "IBM Plex Mono", ui-monospace, monospace;
  --font-sans:           var(--font-body);
  --display-weight-strong: 800;
  --display-weight-base:   600;
}

/* ================================================================
   VELLUM THEME — warm parchment
   ================================================================ */
:root[data-theme="vellum"] {
  --brand:               #ece4d2;
  --brand-strong:        #b3a684;
  --brand-subtle:        rgba(236, 228, 210, 0.10);
  --brand-on:            #1a1814;

  --surface-bg-1:        #221f1a;
  --surface-bg-2:        #15130f;
  --surface-bg-3:        #0c0b09;
  --surface-raised:      #1c1a16;
  --hairline:            rgba(236, 228, 210, 0.08);
  --hairline-strong:     rgba(236, 228, 210, 0.18);

  --ink:                 #ece4d2;
  --ink-muted:           rgba(236, 228, 210, 0.65);
  --ink-soft:            rgba(236, 228, 210, 0.40);

  --data-landfill:       #a78bfa;
  --data-oil-gas:         #f87171;
  --data-biogas:          #4ade80;
  --data-coal:           #9ca3af;
  --data-gas-infra:       #22d3ee;

  --globe-dot-day:       #f8f1dc;
  --globe-dot-night:      #a89a76;
  --globe-border:         rgba(236, 228, 210, 0.30);
  --day-gradient-1:       rgba(236, 228, 210, 0.40);
  --day-gradient-2:       rgba(179, 166, 132, 0.20);
  --day-gradient-3:       rgba(0, 0, 0, 0);
  --night-overlay:        rgba(20, 18, 14, 0.40);
  --pillar-base-alpha:    ee;
  --globe-sphere-base:    #15130f;

  --success:             #4f8cff;
  --warning:             #ffb84d;
  --danger:              #d64545;
  --info:                #4f8cff;

  --font-display:        "Inter", -apple-system, sans-serif;
  --font-body:           "Inter", -apple-system, sans-serif;
  --font-mono:           "IBM Plex Mono", monospace;
  --font-sans:           var(--font-body);
  --display-weight-strong: 700;
  --display-weight-base:   500;
}

/* ================================================================
   ECLIPSE THEME — cool monochrome
   ================================================================ */
:root[data-theme="eclipse"] {
  --brand:               #fafafa;
  --brand-strong:        #d4d4d4;
  --brand-subtle:        rgba(250, 250, 250, 0.08);
  --brand-on:            #050505;

  --surface-bg-1:        #0d0d0d;
  --surface-bg-2:        #050505;
  --surface-bg-3:        #020202;
  --surface-raised:      #111111;
  --hairline:            rgba(250, 250, 250, 0.08);
  --hairline-strong:     rgba(250, 250, 250, 0.18);

  --ink:                 #fafafa;
  --ink-muted:           rgba(250, 250, 250, 0.65);
  --ink-soft:            rgba(250, 250, 250, 0.38);

  --data-landfill:       #c084fc;
  --data-oil-gas:         #f87171;
  --data-biogas:          #86efac;
  --data-coal:           #d1d5db;
  --data-gas-infra:       #67e8f9;

  --globe-dot-day:        #ffffff;
  --globe-dot-night:      #888888;
  --globe-border:         rgba(250, 250, 250, 0.30);
  --day-gradient-1:       rgba(250, 250, 250, 0.40);
  --day-gradient-2:       rgba(212, 212, 212, 0.18);
  --day-gradient-3:       rgba(0, 0, 0, 0);
  --night-overlay:         rgba(20, 18, 14, 0.40);
  --pillar-base-alpha:    99;
  --globe-sphere-base:    #050505;

  --success:             #ec4899;
  --warning:             #ffb84d;
  --danger:              #ff6b6b;
  --info:                #ec4899;

  --font-display:        "Inter", -apple-system, sans-serif;
  --font-body:           "Inter", -apple-system, sans-serif;
  --font-mono:           "IBM Plex Mono", monospace;
  --font-sans:           var(--font-body);
  --display-weight-strong: 900;
  --display-weight-base:   700;
}

/* Fallback: if no theme set, default to Sunfire */
:root:not([data-theme]) { color-scheme: dark; }
:root:not([data-theme]),
html:not([data-theme]) body {
  background: radial-gradient(ellipse at 50% 40%, var(--surface-bg-1) 0%, var(--surface-bg-2) 60%, var(--surface-bg-3) 100%);
  color: var(--ink);
}

/* ================================================================
   BASE / RESET
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 40%, var(--surface-bg-1) 0%, var(--surface-bg-2) 60%, var(--surface-bg-3) 100%);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

/* ================================================================
   TYPOGRAPHY
   ================================================================ */
h1, h2, h3, h4, .display, .display-lg, .display-xl {
  font-family: var(--font-sans);
  color: var(--ink);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-heading);
  font-weight: var(--fw-bold);
  text-wrap: balance;
  margin: 0;
}

.display-xl  { font-size: var(--fs-display-xl); font-weight: var(--fw-black); line-height: var(--lh-display); letter-spacing: var(--ls-tight); }
.display-lg  { font-size: var(--fs-display-lg);  font-weight: var(--fw-black); line-height: var(--lh-display); letter-spacing: var(--ls-tight); }
.display     { font-size: var(--fs-display);     font-weight: var(--fw-bold);  line-height: var(--lh-display); letter-spacing: var(--ls-tight); }
h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-bold); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-medium); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-medium); }

p { margin: 0; text-wrap: pretty; }
p.lead { font-size: var(--fs-body-lg); color: var(--ink-muted); line-height: 1.5; }

.eyebrow {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--brand);
}

.caption { font-size: var(--fs-caption); color: var(--ink-muted); }
.micro   { font-size: var(--fs-micro); color: var(--ink-soft); letter-spacing: 0.04em; }

.mono, code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-feature-settings: "tnum", "zero";
}

.num-tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ================================================================
   PAGE LOADER
   ================================================================ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at 50% 40%, var(--surface-bg-1) 0%, var(--surface-bg-2) 60%, var(--surface-bg-3) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  pointer-events: none;
}

#page-loader.is-fading {
  animation: loader-fade-out 0.38s ease-out forwards;
}

@keyframes loader-fade-out {
  to { opacity: 0; }
}

.loader-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.loader-topbar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: var(--brand);
  /* CSS-only progress: fills to ~75% over 6s, then stalls — JS overrides */
  animation: loader-prefill 6s cubic-bezier(0.05, 0, 0.1, 1) forwards;
  transition: width 0.4s ease-out;
}

.loader-topbar-fill.is-determinate {
  animation: none;
}

@keyframes loader-prefill {
  0%   { width: 0%; }
  30%  { width: 35%; }
  60%  { width: 55%; }
  80%  { width: 65%; }
  100% { width: 72%; }
}

.loader-center-mark {
  font-size: 28px;
  color: var(--brand);
  animation: loader-pulse 2s ease-in-out infinite;
  line-height: 1;
}

@keyframes loader-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50%       { opacity: 1;   transform: scale(1.06); }
}

.loader-center-text {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-mono, monospace);
}

/* ================================================================
   APP SHELL LAYOUT
   ================================================================ */
.app-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 24px 32px;
  gap: 16px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.app-header-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-mark {
  color: var(--brand);
  font-size: 20px;
}

.app-wordmark {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.app-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-left: 14px;
  border-left: 1px solid var(--hairline-strong);
  margin-left: 2px;
}

.app-nav {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.app-nav a {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  border: 1px solid transparent;
}

.app-nav a:hover {
  background: var(--brand-subtle);
  color: var(--ink);
  border-color: var(--brand);
}

/* ================================================================
   APP BODY — two-column: left panel + globe
   ================================================================ */
.app-body {
  display: grid;
  grid-template-columns: minmax(300px, 340px) 1fr;
  gap: 32px;
  align-items: stretch;
  padding: 24px 0;
}

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

.panel-left {
  justify-content: center;
}

.panel-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  position: relative;
}

/* ================================================================
   GLOBE CANVAS
   ================================================================ */
#globe-canvas {
  display: block;
  width: 100%;
  max-width: 580px;
  aspect-ratio: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#globe-canvas.is-dragging {
  cursor: grabbing;
}

#globe-canvas[hidden] {
  visibility: hidden;
}

/* Globe placeholder */
.globe-placeholder {
  width: 100%;
  max-width: 580px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,208,90,0.12), rgba(255,208,90,0.04) 35%, rgba(255,255,255,0.02) 60%, transparent 75%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03), rgba(0,0,0,0) 72%);
  border: 1px solid rgba(255,255,255,0.06);
}

.globe-placeholder-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.58);
}

/* Globe controls */
.globe-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-end;
  max-width: 580px;
  width: 100%;
  justify-content: flex-end;
  padding-top: 8px;
}

.globe-zoom-label {
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.40);
  user-select: none;
  flex-shrink: 0;
}

.globe-zoom-slider {
  width: 110px;
  cursor: pointer;
  accent-color: rgba(255,255,255,0.65);
  opacity: 0.65;
  transition: opacity 0.15s;
}

.globe-zoom-slider:hover,
.globe-zoom-slider:focus {
  opacity: 1;
  outline: none;
}

/* ================================================================
   LEFT PANEL — stats + legend
   ================================================================ */
.stats-block {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: var(--fs-h2);
  font-weight: var(--fw-black);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1;
}

.stat-label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.stat-divider {
  width: 100%;
  height: 1px;
  background: var(--hairline);
}

/* Year selector */
.year-select-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.year-select-wrapper label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

select {
  font-family: var(--font-sans);
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  padding: 6px 28px 6px 10px;
  font-size: var(--fs-body-sm);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff66' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 140ms ease, background-color 140ms ease;
}

select:hover {
  border-color: var(--brand);
  background-color: var(--surface-bg-1);
}

select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

/* ================================================================
   LEGEND
   ================================================================ */
.legend {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legend-title {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--brand);
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-body-sm);
  color: var(--ink-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-item-name {
  flex: 1;
  color: var(--ink);
}

.legend-item-detail {
  font-size: var(--fs-caption);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.legend-size-hint {
  font-size: var(--fs-micro);
  color: var(--ink-soft);
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
  font-style: italic;
}

/* ================================================================
   FOOTER
   ================================================================ */
.app-footer {
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.app-footer p.caption {
  font-size: var(--fs-caption);
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ================================================================
   TOOLTIP
   ================================================================ */
.tooltip {
  position: fixed;
  background: var(--surface-bg-1);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  font-size: var(--fs-body-sm);
  max-width: 280px;
  pointer-events: none;
  z-index: 200;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.tooltip-name {
  font-weight: var(--fw-bold);
  font-size: var(--fs-body);
  margin-bottom: 8px;
  color: var(--ink);
}

.tooltip-category {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  line-height: 1.7;
}

.tooltip-row span:first-child {
  color: var(--ink-soft);
  font-size: var(--fs-caption);
}

.tooltip-row span:last-child {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ================================================================
   CHANGELOG PANEL
   ================================================================ */
#changelog-bar {
  padding: 8px 0;
  font-size: var(--fs-caption);
  color: var(--ink-muted);
  display: none;
}

#changelog-bar.is-visible {
  display: block;
}

.changelog-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.delta-add    { color: var(--success); font-weight: var(--fw-bold); }
.delta-remove { color: var(--danger);  font-weight: var(--fw-bold); }
.delta-change { color: var(--warning); font-weight: var(--fw-bold); }

.changelog-toggle {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  color: var(--ink-muted);
  padding: 3px 10px;
  font-size: var(--fs-micro);
  cursor: pointer;
  transition: background 140ms ease;
}

.changelog-toggle:hover {
  background: var(--hairline);
  color: var(--ink);
}

#changelog-panel {
  display: none;
  max-height: 260px;
  overflow-y: auto;
  border-top: 1px solid var(--hairline);
}

#changelog-panel.is-visible {
  display: block;
}

.changelog-panel-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4px;
  padding: 10px 0;
}

.changelog-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--hairline);
}

.changelog-entry-name {
  font-weight: var(--fw-medium);
  color: var(--ink);
  font-size: var(--fs-body-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.changelog-entry-country {
  font-size: var(--fs-micro);
  color: var(--ink-soft);
}

.changelog-entry-change {
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

/* ================================================================
   SOURCE FILTER TOGGLE
   ================================================================ */
.source-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-filters label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-caption);
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition: all 140ms ease;
}

.source-filters label:hover {
  background: var(--brand-subtle);
  color: var(--ink);
  border-color: var(--brand);
}

.source-filters input {
  accent-color: var(--brand);
  width: 12px;
  height: 12px;
  cursor: pointer;
}

.source-filters label:has(input:checked) {
  background: var(--brand-subtle);
  color: var(--ink);
  border-color: var(--brand);
}

/* ================================================================
   THEME TOGGLE BUTTON
   ================================================================ */
#theme-toggle-mount button,
.theme-toggle-btn {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  color: var(--ink-muted);
  padding: 6px 12px;
  font-size: var(--fs-caption);
  cursor: pointer;
  transition: all 140ms ease;
  font-family: var(--font-sans);
}

#theme-toggle-mount button:hover,
.theme-toggle-btn:hover {
  background: var(--brand-subtle);
  color: var(--ink);
  border-color: var(--brand);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  .app-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .panel-center {
    min-height: 360px;
    order: -1;
  }

  #globe-canvas,
  .globe-placeholder {
    max-width: 100%;
  }

  .app-shell {
    padding: 16px 20px;
  }
}

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