/* =========================================================================
   STACKED — COLORS & TYPE
   Your Bitcoin — Stacked.
   ========================================================================= */

/* ---------- Fonts ---------- */
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-Thin.ttf") format("truetype");         font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-ThinItalic.ttf") format("truetype");   font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-XLight.ttf") format("truetype");       font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-XLightItalic.ttf") format("truetype"); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-Light.ttf") format("truetype");        font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-LightItalic.ttf") format("truetype");  font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-Book.ttf") format("truetype");         font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-BookItalic.ttf") format("truetype");   font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-Medium.ttf") format("truetype");       font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-MediumItalic.ttf") format("truetype"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-Bold.ttf") format("truetype");         font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-BoldItalic.ttf") format("truetype");   font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-Black.ttf") format("truetype");        font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-BlackItalic.ttf") format("truetype");  font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-Ultra.ttf") format("truetype");        font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/Gotham-UltraItalic.ttf") format("truetype");  font-weight: 900; font-style: italic; font-display: swap; }

:root {
  /* ============ BRAND COLORS ============ */
  /* Teal — primary. Sampled from the logo: rgb(20,175,172). */
  --teal-900: #093c3b;
  --teal-800: #0b5250;
  --teal-700: #0e7370;
  --teal-600: #12918e;
  --teal-500: #14afac;   /* ← primary brand teal */
  --teal-400: #3fc1be;
  --teal-300: #6fd2d0;
  --teal-200: #a6e3e2;
  --teal-100: #d3f1f0;
  --teal-50:  #ecf9f9;

  /* Slate — "black". Sampled from reverse logo: rgb(22,23,24). Slightly warm, near-pure. */
  --slate-900: #0b0c0d;
  --slate-800: #161718;   /* ← primary brand slate */
  --slate-700: #23252a;
  --slate-600: #343740;
  --slate-500: #4a4e59;
  --slate-400: #6b7180;
  --slate-300: #9aa0ad;
  --slate-200: #c5c9d2;
  --slate-100: #e4e6eb;
  --slate-50:  #f3f4f6;

  /* Pure white — often used as reverse fg on slate. */
  --white: #ffffff;

  /* ============ SEMANTIC TOKENS ============ */
  --brand:              var(--teal-500);
  --brand-hover:        var(--teal-600);
  --brand-pressed:      var(--teal-700);
  --brand-subtle:       var(--teal-100);
  --brand-subtlest:     var(--teal-50);
  --brand-on:           var(--slate-800);   /* text on teal — slate, not white */

  --ink:                var(--slate-800);   /* primary fg on light */
  --ink-muted:          var(--slate-500);
  --ink-soft:           var(--slate-400);

  --surface:            var(--white);
  --surface-raised:     var(--white);
  --surface-sunken:     var(--slate-50);
  --surface-inverse:    var(--slate-800);   /* dark bg */
  --surface-inverse-alt:var(--slate-900);

  --fg-on-dark:         var(--white);
  --fg-on-dark-muted:   var(--slate-300);

  --border:             var(--slate-100);
  --border-strong:      var(--slate-200);
  --border-inverse:     var(--slate-700);

  /* States */
  --success: #2fa37a;
  --warning: #e0a82e;
  --danger:  #d64545;
  --info:    var(--teal-500);

  /* Bitcoin accent — reserved, for price/BTC-specific contexts only.
     Do NOT use as a general accent. */
  --btc-orange: #f7931a;

  /* ============ TYPOGRAPHY ============ */
  --font-sans: "Gotham", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Weights (Gotham). Defaults favor Book (400) for body, Bold (700) for emphasis. */
  --fw-thin: 100;
  --fw-xlight: 200;
  --fw-light: 300;
  --fw-book: 400;
  --fw-medium: 500;
  --fw-bold: 700;
  --fw-black: 800;
  --fw-ultra: 900;

  /* Type scale — geometric, optimized for the Gotham wordmark aesthetic.
     Display steps are tight-tracked; body is set normal. */
  --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;   /* ALL-CAPS eyebrows — signature */

  /* ============ SPACING ============ */
  --space-0: 0;
  --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;
  --space-32: 128px;

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

  /* ============ SHADOWS ============ */
  --shadow-xs: 0 1px 2px rgba(11, 12, 13, 0.04);
  --shadow-sm: 0 2px 6px rgba(11, 12, 13, 0.06);
  --shadow-md: 0 8px 20px rgba(11, 12, 13, 0.08);
  --shadow-lg: 0 20px 40px rgba(11, 12, 13, 0.10);
  --shadow-teal: 0 10px 30px rgba(20, 175, 172, 0.25);
  --shadow-focus: 0 0 0 3px rgba(20, 175, 172, 0.35);

  /* ============ 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);

  /* ============ LAYOUT ============ */
  --container-max: 1200px;
  --container-wide: 1400px;
}

/* ============ SEMANTIC ELEMENT STYLES ============ */
html, body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--surface);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-book);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.display-xl, .display-lg, .display,
h1, h2, h3, h4 {
  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; }
p.small { font-size: var(--fs-body-sm); }

.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; }

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

/* Tabular figures for money/BTC amounts */
.num-tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Utility: ink on dark backgrounds */
.on-dark        { color: var(--fg-on-dark); }
.on-dark.muted  { color: var(--fg-on-dark-muted); }

/* Dashboard body - always dark.
   Target html as well as body so mobile overscroll shows dark chrome, not the
   white fallback that the Stacked base sheet applies to html.
   Gradient stops are intentionally darker than --slate-800 (#161718) for depth;
   the start (#0f1517) is teal-shifted for cool chrome feel. */
html,
body {
  background: radial-gradient(ellipse at 30% 40%, #0f1517 0%, #0a0b0c 60%, #050607 100%);
  color: var(--white);
  min-height: 100vh;
}

/* =========================================================================
   RESPONSIVENESS & ACCESSIBILITY
   ========================================================================= */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-size: clamp(15px, 0.95rem + 0.15vw, var(--fs-body));
}

@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;
  }
}

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

@media (max-width: 640px) {
  main > div[style*="display: flex"][style*="gap: 2rem"] {
    flex-wrap: wrap;
    gap: 1rem !important;
  }

  body {
    padding-inline: 4vw;
  }

  .display-xl {
    line-height: 1;
  }
}

main table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

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

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

.app-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  padding-left: 14px;
  border-left: 1px solid rgba(255,255,255,0.15);
  margin-left: 2px;
}

.app-methodology {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
}

.app-methodology:hover {
  background: rgba(20,175,172,0.08);
  color: var(--white);
  border-color: var(--teal-500);
}

/* Primary nav (right-aligned in header) */
.app-nav {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.app-nav a {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  border: 1px solid transparent;
}
.app-nav a:hover,
.app-nav a[aria-current="page"] {
  background: rgba(20,175,172,0.08);
  color: var(--white);
  border-color: rgba(20,175,172,0.4);
}

.app-body {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(400px, 2fr) minmax(280px, 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: grid;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  position: relative;
}

.panel-center > * {
  grid-area: 1 / 1;
}

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

#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 {
  width: 100%;
  max-width: 580px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(20,175,172,0.12), rgba(20,175,172,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);
}

#pct-readout .pct-sign,
#pct-readout {
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--white);
}

#pct-readout {
  display: inline-block;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.flare-footnote {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,0.55);
}

.flare-footnote #flare-readout {
  color: var(--btc-orange);
  font-weight: 600;
}

/* =========================================================================
   REGION TOOLTIP — floating card shown on globe hotspot click
   ========================================================================= */

.region-tooltip {
  position: fixed;
  z-index: 100;
  width: 260px;
  padding: 12px 14px 10px;
  background: rgba(16, 22, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(20, 175, 172, 0.12) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: auto;
  animation: region-tooltip-in 140ms var(--ease-out, cubic-bezier(0.2, 0.8, 0.2, 1));
}

@keyframes region-tooltip-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.region-tooltip[hidden] { display: none; }

.region-tooltip-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 120ms, color 120ms;
}
.region-tooltip-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.region-tooltip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 22px;
  margin-bottom: 8px;
}
.region-tooltip-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.region-tooltip-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.region-tooltip-country {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 1px;
}

.region-tooltip-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.region-tooltip-stat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.region-tooltip-stat > span:first-child {
  color: rgba(255, 255, 255, 0.55);
}
.region-tooltip-stat > span:last-child {
  color: var(--white);
  font-weight: 500;
}

.region-tooltip-sparkline {
  display: block;
  width: 100%;
  height: 48px;
  margin: 4px 0 8px;
  border-radius: 4px;
}

.region-tooltip-source {
  font-size: 11px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.region-tooltip-source a {
  color: var(--teal-400, #3fc1be);
  text-decoration: none;
}
.region-tooltip-source a:hover {
  text-decoration: underline;
}

.region-tooltip-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
}
.region-tooltip-footer a {
  color: var(--teal-400, #3fc1be);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}
.region-tooltip-footer a:hover { text-decoration: underline; }

.region-tooltip-freshness-live {
  color: #3fc1be;
  font-size: 10.5px;
  white-space: nowrap;
}
.region-tooltip-freshness-cached {
  color: #f5c542;
  font-size: 10.5px;
  white-space: nowrap;
}

.region-tooltip-note {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.4);
}

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

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
}

.stat-unit {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
}

.hotspot-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-top: 10px;
}

.hotspot-columns-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: min-content;
  gap: 10px;
}

@media (max-width: 1100px) {
  .hotspot-columns-three {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .hotspot-columns-three {
    grid-template-columns: 1fr;
  }
}

.hotspot-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hotspot-column-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.6);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.hotspot-column-subtitle {
  font-size: 9.5px;
  line-height: 1.25;
  color: rgba(255,255,255,0.38);
  margin: 3px 0 4px;
  letter-spacing: 0.02em;
  font-style: italic;
}

.hotspot-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 240px;
  overflow-y: auto;
  min-height: 36px;
}

.hotspot-list:empty::after {
  content: "—";
  color: rgba(255,255,255,0.25);
  font-size: 12px;
  padding: 4px 0;
}

.hotspot-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 6px;
  row-gap: 1px;
  align-items: start;
  font-size: 11.5px;
  color: rgba(255,255,255,0.82);
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.hotspot-item .dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  grid-row: 1 / span 2;
}

.hotspot-name {
  grid-column: 2;
  grid-row: 1;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
  color: var(--white);
  font-weight: 500;
}

.hotspot-gw {
  grid-column: 2;
  grid-row: 2;
  color: rgba(255,255,255,0.62);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.hotspot-country { display: none; }

@media (max-width: 900px) {
  .hotspot-columns {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.hotspot-country {
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hotspot-gw {
  color: var(--white);
  font-weight: 500;
}

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

.dot-teal {
  background: var(--teal-500);
  box-shadow: 0 0 10px rgba(20,175,172,0.5);
}

.dot-orange {
  background: var(--btc-orange);
  box-shadow: 0 0 10px rgba(247,147,26,0.5);
}

.legend {
  display: flex;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.app-footer .caption {
  color: rgba(255,255,255,0.55);
  font-size: 11.5px;
  line-height: 1.6;
  max-width: 1100px;
}

.app-footer .caption strong {
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.app-footer .caption a {
  color: var(--teal-400, #3fc1be);
  text-decoration: none;
}
.app-footer .caption a:hover { text-decoration: underline; }

.footer-refresh {
  display: inline-block;
  margin-left: 6px;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .app-body {
    grid-template-columns: 1fr;
  }

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

  #globe-canvas {
    max-width: 400px;
  }
}

@media (max-width: 540px) {
  .app-shell {
    padding: 16px 4vw;
  }

  .app-tag {
    display: none;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
}

main > h1:first-child {
  display: none;
}

/* ============ TIMELINE + CONTROLS ============ */
.app-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 8px;
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.timeline-header .caption {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
}
#timeline-canvas {
  width: 100%;
  height: 88px;
  display: block;
  cursor: ew-resize;
}
.timeline-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
#timeline-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}
.ctl-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal-500);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--slate-800);
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 140ms ease, transform 140ms ease;
}
.ctl-play:hover { transform: scale(1.04); }
.ctl-play[aria-pressed="true"] {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}
.ctl-play-icon {
  display: inline-block;
  line-height: 1;
  /* ⏵ triangle's visual centre-of-mass sits ~1px left of its geometric
     centre; this nudge makes play/pause feel truly centred in the circle. */
  transform: translate(0.5px, 0);
}
.ctl-play[aria-pressed="true"] .ctl-play-icon {
  /* Pause glyph is symmetric — undo the play-triangle nudge when paused. */
  transform: none;
}
.ctl-speed {
  display: inline-flex;
  gap: 4px;
}
.ctl-speed-chip {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.ctl-speed-chip.is-active {
  background: rgba(20,175,172,0.2);
  border-color: var(--teal-500);
  color: var(--teal-500);
}
.mode-toggle {
  display: inline-flex;
  gap: 4px;
}
.mode-btn {
  padding: 5px 10px;
  min-height: 28px;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-family: inherit;
}
.mode-btn:first-child {
  border-radius: 6px 2px 2px 6px;
}
.mode-btn:last-child {
  border-radius: 2px 6px 6px 2px;
}
.mode-btn-active {
  background: rgba(247,147,26,0.18);
  border-color: var(--amber-500);
  color: var(--amber-500);
}
.ctl-utc {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
}

/* Mobile */
@media (max-width: 640px) {
  #timeline-canvas { height: 72px; }
  .ctl-play { width: 32px; height: 32px; }
}

/* =========================================================================
   METHODOLOGY PAGE — academic typography pass
   ========================================================================= */

.methodology-doc {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 32px 96px;
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  line-height: 1.68;
}

.methodology-doc .methodology-header {
  padding-bottom: 28px;
  margin-bottom: 44px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.methodology-doc .methodology-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-400, #3fc1be);
  margin-bottom: 14px;
}

.methodology-doc h1 {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 18px;
  color: var(--white);
  border-bottom: none;
  padding-bottom: 0;
}

.methodology-doc .methodology-deck {
  font-size: 18px;
  line-height: 1.55;
  color: rgba(255,255,255,0.75);
  max-width: 680px;
  margin: 0 0 20px;
}

.methodology-doc .methodology-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 14px;
}
.methodology-doc .methodology-toc a {
  font-size: 12px;
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 140ms, color 140ms, border-color 140ms;
}
.methodology-doc .methodology-toc a:hover {
  background: rgba(20,175,172,0.08);
  color: var(--white);
  border-color: rgba(20,175,172,0.35);
}

.methodology-doc h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 56px 0 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: var(--white);
}

.methodology-doc h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 32px 0 8px;
  color: rgba(255,255,255,0.9);
}

.methodology-doc p {
  margin: 0 0 16px;
  color: rgba(255,255,255,0.82);
}

.methodology-doc strong {
  color: var(--white);
  font-weight: 600;
}

.methodology-doc a {
  color: var(--teal-400, #3fc1be);
  text-decoration: none;
  border-bottom: 1px solid rgba(63,193,190,0.35);
  transition: border-color 140ms, color 140ms;
}
.methodology-doc a:hover {
  color: var(--white);
  border-bottom-color: var(--teal-400, #3fc1be);
}

.methodology-doc ul,
.methodology-doc ol {
  padding-left: 24px;
  margin: 0 0 18px;
}
.methodology-doc li {
  margin-bottom: 8px;
  color: rgba(255,255,255,0.82);
}
.methodology-doc li::marker {
  color: rgba(255,255,255,0.4);
}

.methodology-doc code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}

.methodology-doc pre {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  margin: 16px 0 24px;
}
.methodology-doc pre code {
  background: none;
  padding: 0;
}

/* Tables */
.methodology-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 13px;
}
.methodology-doc th,
.methodology-doc td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}
.methodology-doc th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.methodology-doc td {
  color: rgba(255,255,255,0.78);
}
.methodology-doc tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* Callout boxes */
.methodology-doc .methodology-callout {
  padding: 20px 24px;
  margin: 20px 0 28px;
  border-left: 3px solid var(--teal-500);
  background: rgba(20,175,172,0.04);
  border-radius: 0 6px 6px 0;
}
.methodology-doc .methodology-callout p:last-child {
  margin-bottom: 0;
}
.methodology-doc .methodology-callout-abstract {
  font-size: 15.5px;
  line-height: 1.65;
}
.methodology-doc .methodology-callout-abstract p {
  color: rgba(255,255,255,0.88);
}

/* Horizontal rules */
.methodology-doc hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 40px 0;
}

/* References (§7) — compact list style */
.methodology-doc h2[id="references"] + ul {
  font-size: 13px;
  line-height: 1.55;
  padding-left: 0;
  list-style: none;
}
.methodology-doc h2[id="references"] + ul li {
  padding: 7px 0;
  border-bottom: 1px dotted rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.72);
}
.methodology-doc h2[id="references"] + ul li strong {
  color: rgba(255,255,255,0.92);
  font-weight: 500;
}

/* Trailing italic author note */
.methodology-doc p em:only-child {
  display: inline-block;
  font-size: 13px;
  color: rgba(255,255,255,0.52);
  font-style: italic;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .methodology-doc {
    padding: 16px 18px 64px;
    font-size: 14.5px;
  }
  .methodology-doc h1 { font-size: 32px; }
  .methodology-doc .methodology-deck { font-size: 16px; }
  .methodology-doc h2 { font-size: 20px; margin-top: 40px; }
}
