/* TeslaPulse shared aesthetic
   Inspired by Tesla's Impact Report / investor materials:
   near-black canvas, massive typography, red used only for emphasis,
   thin separators instead of boxes, tabular numerals everywhere. */

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

:root {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #121212;
  --rule: #1a1a1a;
  --rule-bright: #2a2a2a;
  --text: #ffffff;
  --muted: #8a8f97;
  --muted-2: #5a5f67;
  --accent: #e31937;
  --accent-dim: rgba(227, 25, 55, 0.18);
  --positive: #4ade80;
  --negative: #f87171;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  letter-spacing: -0.005em;
  overflow-x: clip;     /* prevents any errant child from widening the page */
  max-width: 100vw;
}
/* Belt-and-suspenders against any errant element that widens the page.
   overflow-x: clip clips overflow without creating a new scroll container
   (doesn't interfere with position: sticky). */
.section, .hero, .cinematic-hero {
  overflow-x: clip;
}
svg, img, iframe, video {
  max-width: 100%;
}
::selection { background: var(--accent); color: #fff; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}

/* Nav */
.nav-top {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 18px 48px;
  border-bottom: 1px solid transparent;
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  height: 60px;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.nav-top .brand { flex: 0 0 auto; }
.nav-top .nav-links { flex: 1 1 auto; }
.nav-top .nav-buttons { flex: 0 0 auto; }
.nav-top.scrolled {
  background: rgba(0, 0, 0, 0.9);
  border-bottom-color: var(--rule);
}
.nav-top .brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: var(--text);
}
.nav-top .brand .mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-1px);
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-dim);
}
.nav-top .brand-text {
  font-weight: 700;
  letter-spacing: -0.015em;
}
.nav-top .brand-sub {
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-left: 12px;
  margin-left: 2px;
  border-left: 1px solid var(--rule-bright);
}
.nav-top .nav-links {
  display: flex;
  gap: 28px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
  min-width: 0;
  padding: 4px 0;
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 16px), transparent 100%);
}
.nav-top .nav-links::-webkit-scrollbar { display: none; }
.nav-top .nav-links a {
  color: var(--muted);
  transition: color 0.15s;
  padding: 8px 0;
  position: relative;
  flex: 0 0 auto;
}
.nav-top .nav-links a:hover { color: var(--text); }
.nav-top .nav-links a.active { color: var(--text); }
.nav-top .nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 1px;
  background: var(--accent);
}

/* External-link buttons (GitHub, etc.) — visibly distinct pill */
.nav-top .nav-buttons {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}
.nav-top .nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--rule-bright);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-top .nav-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.nav-top .nav-btn span { font-size: 10px; opacity: 0.7; }
@media (max-width: 900px) {
  .nav-top {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px 12px;
    padding: 12px 16px 10px;
    height: auto;
  }
  .nav-top .brand {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
    font-size: 14px;
  }
  .nav-top .nav-buttons {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }
  .nav-top .nav-btn { padding: 8px 12px; font-size: 10px; letter-spacing: 0.1em; }
  .nav-top .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 10px;
    letter-spacing: 0.12em;
    margin: 0;
    padding: 4px 0 2px;
    width: 100%;
    white-space: normal;
    overflow: visible;
    mask-image: none;
    justify-content: space-between;
  }
  .nav-top .brand-text { font-size: 14px; }
  .nav-top .brand-sub {
    display: inline;
    padding-left: 10px;
    margin-left: 0;
    border-left: 1px solid var(--rule-bright);
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .nav-top .nav-links a { padding: 6px 0; }
  .nav-top .nav-links a.active::after { bottom: -4px; }
}
@media (max-width: 420px) {
  .nav-top .nav-links { gap: 6px 10px; font-size: 9.5px; letter-spacing: 0.1em; }
}

/* Cinematic hero — full viewport globe with overlay */
.cinematic-hero {
  position: relative;
  height: calc(100dvh - 60px);  /* dvh accounts for mobile browser chrome */
  min-height: 520px;
  width: 100%;
  overflow: hidden;
  background: #000;
}
@media (max-width: 900px) {
  .cinematic-hero {
    /* mobile nav stacks to ~104px (brand row + links row) */
    height: calc(100dvh - 112px);
    min-height: 460px;
  }
}
.cinematic-hero #hero-globe {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.cinematic-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% 100%, rgba(0,0,0,0.85) 0%, transparent 65%),
    linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.55) 100%);
}
.cinematic-hero .hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px 48px 72px;
  max-width: 1280px;
  margin: 0 auto;
  animation: fadeUp 0.9s ease-out;
}
.cinematic-hero .kicker {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cinematic-hero .kicker .dot {
  color: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
.cinematic-hero h1 {
  font-size: clamp(44px, 6.5vw, 84px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0;
  max-width: 1040px;
  pointer-events: auto;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.6);
}
.cinematic-hero h1 em {
  color: var(--accent);
  font-style: normal;
}
.cinematic-hero .lead {
  font-size: 16px;
  color: var(--muted);
  max-width: 540px;
  line-height: 1.55;
  margin-top: 20px;
  pointer-events: auto;
}
.scroll-cue {
  position: absolute;
  bottom: calc(32px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  text-align: center;
  pointer-events: none;
  animation: bounce 2.4s ease-in-out infinite;
  white-space: nowrap;
}
.scroll-cue::after {
  content: '';
  display: block;
  width: 1px;
  height: 20px;
  margin: 10px auto 0;
  background: linear-gradient(to bottom, var(--muted) 0%, transparent 100%);
}
@media (max-width: 600px) {
  .scroll-cue {
    bottom: calc(48px + env(safe-area-inset-bottom, 0));
    font-size: 9px;
    letter-spacing: 0.22em;
  }
  .scroll-cue::after { height: 16px; margin-top: 8px; }
  /* keep hero overlay from pushing down into the scroll cue */
  .cinematic-hero .hero-overlay { padding-bottom: 110px; }
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
  50% { transform: translate(-50%, 6px); opacity: 1; }
}

/* Legacy hero (kept for any pages that still use it) */
.hero {
  padding: 120px 48px 96px;
  border-bottom: 1px solid var(--rule);
  max-width: 1280px;
  margin: 0 auto;
  animation: fadeUp 0.6s ease-out;
}
.hero .kicker {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero .kicker .dot {
  color: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
.hero h1 {
  font-size: clamp(48px, 7.5vw, 96px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0 0 32px;
  max-width: 1020px;
}
.hero h1 em {
  color: var(--accent);
  font-style: normal;
}
.hero .lead {
  font-size: 17px;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.55;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Section */
.section {
  padding: 96px 48px;
  border-bottom: 1px solid var(--rule);
  max-width: 1280px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  scroll-margin-top: 80px;
}
.section.in-view {
  opacity: 1;
  transform: translateY(0);
}
@media (max-width: 900px) {
  .section { scroll-margin-top: 120px; }  /* nav is ~104px on mobile */
}
/* If JS is off or the user navigates directly to an anchor, don't hide content */
:target, :target ~ .section { opacity: 1 !important; transform: none !important; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.section-head::before {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  background: var(--accent);
  flex-basis: 100%;
  margin-bottom: 18px;
}
.section-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-transform: uppercase;
}
.section-head .meta {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
}
@media (max-width: 600px) {
  .section-head::before { width: 28px; margin-bottom: 14px; }
}

/* Metric grid */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.metric {
  background: var(--bg);
  padding: 32px 28px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 0.2s;
}
.metric:hover { background: var(--surface); }
.metric .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 600;
}
.metric .value {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  margin-top: 16px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: normal;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}
.metric .value .unit,
.metric .value small {
  font-size: 0.45em;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}
.metric .delta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.45;
}
@media (max-width: 600px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 24px 20px; min-height: 130px; }
  .metric .label { font-size: 10px; letter-spacing: 0.14em; }
  .metric .value { font-size: clamp(28px, 9vw, 40px); margin-top: 10px; }
  .metric .delta { font-size: 12px; margin-top: 8px; }
}
@media (max-width: 400px) {
  .metrics { grid-template-columns: 1fr; }
}
.metric .delta.positive { color: var(--positive); }
.metric .delta.negative { color: var(--negative); }
.metric .delta .accent { color: var(--accent); }

/* Two-column layouts */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .hero, .section { padding-left: 24px; padding-right: 24px; }
  .nav-top { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 600px) {
  .hero, .section { padding: 56px 20px; }
  .section-head { margin-bottom: 28px; padding-bottom: 12px; }
  .section-head h2 { font-size: 20px; }
  .cinematic-hero .hero-overlay { padding: 20px 20px 56px; }
  .scroll-cue { bottom: 16px; font-size: 9px; letter-spacing: 0.2em; }
}

/* Lists */
.list {
  border-top: 1px solid var(--rule);
}
.list .row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, max-content);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  align-items: center;
}
.list .row:hover { background: var(--surface); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.list .row .primary {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list .row .secondary {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  max-height: 2.8em;
}
.list .row .value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 15px;
  white-space: nowrap;
}
.list .row .value .unit {
  color: var(--muted);
  font-weight: 400;
  margin-left: 5px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 600px) {
  .list .row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px 0;
  }
  .list .row .primary {
    white-space: normal;
  }
  .list .row .secondary {
    -webkit-line-clamp: unset;
    max-height: none;
    margin-top: 4px;
  }
  .list .row .value {
    text-align: left;
    font-size: 14px;
    white-space: normal;
  }
  .list .row .value .secondary { text-align: left !important; }
}

/* VIN decoder widget */
.vin-widget {
  border: 1px solid var(--rule);
  padding: 32px;
}
.vin-form {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}
.vin-form input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--text);
  font: 600 18px/1 'Inter', monospace;
  letter-spacing: 0.1em;
  padding: 16px 20px;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}
.vin-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.vin-form button {
  background: var(--accent);
  color: #fff;
  border: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  padding: 0 28px;
  cursor: pointer;
  min-height: 48px;
  flex: 0 0 auto;
}
@media (max-width: 520px) {
  .vin-widget { padding: 20px; }
  .vin-form { flex-direction: column; }
  .vin-form button { padding: 14px 28px; }
  .vin-form input { font-size: 16px; padding: 14px 16px; }
}

/* Charts */
svg.chart { width: 100%; height: auto; display: block; }
/* Chart text sizes are in SVG units, scaled by viewBox. 1180-wide viewBoxes
   render ~12-14px actual text on desktop at this setting; mobile bumps up
   to compensate for the ~3x SVG downscaling. */
svg.chart text { font-family: inherit; fill: var(--muted); font-size: 14px; }
svg.chart .value-label { font-size: 14px; fill: var(--text); font-weight: 500; }
svg.chart .label { font-size: 13px; }
@media (max-width: 700px) {
  svg.chart text, svg.chart .label, svg.chart .value-label { font-size: 28px; }
}
svg.chart .grid-line { stroke: var(--rule); stroke-width: 1; }

/* Shared chart legend (below the SVG) */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.chart-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.chart-legend-name { color: var(--text); font-weight: 500; letter-spacing: 0.02em; }
.chart-legend-val  { color: var(--muted); font-weight: 600; }
@media (max-width: 600px) {
  .chart-legend { gap: 8px 14px; font-size: 11px; }
}
svg.chart .bar { fill: var(--text); transition: fill 0.15s; }
svg.chart .bar.accent { fill: var(--accent); }
svg.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
svg.chart .dot { fill: var(--text); }
svg.chart .label { fill: var(--muted); font-size: 11px; }
svg.chart .value-label { fill: var(--text); font-size: 11px; font-weight: 500; }

/* Footer */
footer {
  padding: 56px 48px 64px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}
.footer-line {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  display: inline-flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.footer-brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 14px;
}
.footer-sep { opacity: 0.5; }
.footer-sources {
  font-size: 11px;
  line-height: 1.7;
  max-width: 780px;
  margin: 0 auto;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.02em;
}
.footer-disclaimer {
  font-size: 10px;
  line-height: 1.6;
  max-width: 780px;
  margin: 0 auto;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.02em;
}
@media (max-width: 600px) {
  footer { padding: 40px 20px 48px; }
  .footer-inner { gap: 14px; }
  .footer-sources { font-size: 10px; }
  .footer-disclaimer { font-size: 9.5px; }
}

/* Table */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}
.table th, .table td {
  padding: 14px 16px 14px 0;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.table th:last-child, .table td:last-child { padding-right: 0; }
.table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 600;
  padding-top: 0;
  padding-bottom: 12px;
  border-bottom-color: var(--rule-bright);
}
.table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.table th.num { text-align: right; }
@media (max-width: 600px) {
  .table { font-size: 13px; }
  .table th, .table td { padding: 10px 10px 10px 0; }
}

/* Pills */
.pill {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  border: 1px solid var(--rule-bright);
  color: var(--muted);
  white-space: nowrap;
}
.pill.red { color: var(--accent); border-color: var(--accent-dim); }
.pill.green { color: var(--positive); border-color: rgba(74, 222, 128, 0.25); }

/* Utilities */
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

/* Hero Elon-mode toggle (floats top-right over the cinematic hero globe) */
.hero-elon-btn {
  position: absolute;
  right: 20px;
  top: 20px;
  z-index: 50;
  background: rgba(227, 25, 55, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 11px 18px;
  font: 700 11px/1 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 24px rgba(227, 25, 55, 0.28), inset 0 0 10px rgba(227, 25, 55, 0.06);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
              box-shadow 0.2s ease, transform 0.2s ease;
}
@media (max-width: 600px) {
  .hero-elon-btn { right: 14px; top: 14px; padding: 9px 14px; font-size: 10px; letter-spacing: 0.18em; }
}

/* Timelapse HUD on /map.html */
.tl-hud {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 450;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--rule);
  padding: 16px 28px;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  min-width: 280px;
  max-width: calc(100vw - 32px);
}
.tl-hud .tl-kicker {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tl-hud .tl-date { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.tl-hud .tl-count { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tl-hud .tl-bar {
  margin-top: 12px;
  height: 2px;
  background: var(--rule);
  overflow: hidden;
}
.tl-hud .tl-progress {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
}
@media (max-width: 600px) {
  .tl-hud {
    min-width: 0;
    width: calc(100vw - 24px);
    left: 12px;
    right: 12px;
    transform: none;
    padding: 14px 20px;
  }
  .tl-hud .tl-date { font-size: 22px; }
}

/* Master Plan — stacked plan cards with progress + per-item status */
.master-plan {
  margin-bottom: 40px;
  border: 1px solid var(--rule);
  padding: 24px 28px;
}
.master-plan-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}
.master-plan .list { border-top: none; }
.master-plan .list .row:last-child { border-bottom: none; }
@media (max-width: 600px) {
  .master-plan { padding: 20px 18px; }
  .master-plan-head { padding-bottom: 12px; }
}

/* Velocity Index — big score + breakdown grid */
.velocity-block {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 780px) {
  .velocity-block { grid-template-columns: 1fr; gap: 24px; }
  .velocity-score-tile { padding: 28px 20px !important; }
  .velocity-score-tile .score-num { font-size: 80px !important; }
}

/* Map legend chip dots — colored via status class */
.map-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-legend-dot.open { background: #ffffff; }
.map-legend-dot.construction { background: var(--accent); }
.map-legend-dot.planned { background: #5e94e2; }
.map-legend-dot.closed { background: #555; }
.map-legend-dot.desert { background: #f59e0b; }
