/* ===========================================================================
   Plug or Pump — design system
   Editorial / data-journalism look. Warm paper, hairline rules, serif body,
   grotesk display, mono numerals. No gradients, glassmorphism, or rounded
   tile soup. See plug-or-pump-design-system/project/colors_and_type.css for
   the canonical token reference.
   =========================================================================== */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/SpaceGrotesk-Variable.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/SourceSerif4-Variable.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/SourceSerif4-Italic-Variable.woff2") format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-Variable.woff2") format("woff2-variations");
}

:root {
  /* ---- Surfaces (light theme is the default; warm paper, not white) ---- */
  --bg:           #fafaf7;
  --bg-grad-1:    #fafaf7;
  --bg-grad-2:    #fafaf7;
  --bg-sunk:      #f4f3ec;
  --bg-raised:    #ffffff;

  /* ---- Foreground ---- */
  --fg-1:  #15171a;
  --fg-2:  #3a3d42;
  --fg-3:  #6b6f76;
  --fg-4:  #9aa0a8;

  /* ---- Borders & rules ---- */
  --border:        #d8d6cd;
  --border-strong: #b6b3a7;
  --rule:          #e8e6dd;

  /* ---- Brand series ---- */
  --series-petrol:      #b85c1a;
  --series-petrol-soft: #d99a6c;
  --series-petrol-deep: #8a4413;
  --series-ev:          #1f6b6e;
  --series-ev-soft:     #6ba6a8;
  --series-ev-deep:     #144749;
  --series-accent:      #c9a227;
  --series-accent-soft: #e6c878;
  --series-accent-deep: #8a6e15;

  /* ---- Interactive ---- */
  --link:        #1f6b6e;
  --link-hover:  #144749;
  --focus:       #c9a227;
  --selection:   #f1ead0;

  /* ---- Status ---- */
  --status-good: #2f7a4d;
  --status-warn: #b87a16;
  --status-bad:  #a23a2a;

  /* ---- Backwards-compatible aliases for the rest of the stylesheet.
         Existing rules keep using --panel / --text / --fuel / --ev etc.
         and now resolve to the new design-system values.            ---- */
  --panel:    var(--bg-raised);
  --panel-2:  var(--bg-sunk);
  --panel-3:  var(--bg-sunk);
  --border-2: var(--border-strong);
  --text:     var(--fg-1);
  --text-2:   var(--fg-2);
  --muted:    var(--fg-3);
  --accent:   var(--series-ev);
  --accent-2: var(--series-accent);
  --fuel:     var(--series-petrol);
  --fuel-2:   var(--series-petrol);
  --ev:       var(--series-ev);
  --ev-2:     var(--series-ev);
  --ratio:    var(--series-accent-deep);
  --warn:     var(--status-warn);
  --danger:   var(--status-bad);

  /* ---- Radii: tiny and intentional. No rounded-xl on every tile. ---- */
  --radius-input: 2px;
  --radius-card:  4px;
  --radius-pill:  999px;
  /* Backwards-compatible aliases for prior --radius / --radius-lg / --radius-sm. */
  --radius-sm: var(--radius-input);
  --radius:    var(--radius-card);
  --radius-lg: var(--radius-card);

  /* ---- Elevation: only sticky panels get a shadow; everything else is hairline. ---- */
  --shadow-sticky: 0 1px 0 var(--border), 0 8px 24px -16px rgba(21, 23, 26, 0.18);
  --shadow-1: none;
  --shadow-2: var(--shadow-sticky);
  --shadow-glow-ev:   none;
  --shadow-glow-fuel: none;

  /* ---- Motion ---- */
  --dur-instant: 0ms;
  --dur-quick:   120ms;
  --dur-base:    200ms;
  --dur-chart:   400ms;
  --easing:      cubic-bezier(0.2, 0, 0, 1);
  --ease-out:    var(--easing);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* ---- Type families ---- */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Source Serif 4", "Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  /* Body text uses serif for editorial feel; --sans alias points at display. */
  --sans: var(--font-display);
  --serif: var(--font-body);
  --mono: var(--font-mono);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0f1110;
    --bg-grad-1: #0f1110;
    --bg-grad-2: #0f1110;
    --bg-sunk:   #0a0c0b;
    --bg-raised: #16191a;

    --fg-1: #e8e6df;
    --fg-2: #b9b6ac;
    --fg-3: #888680;
    --fg-4: #5a5854;

    --border:        #2a2c2a;
    --border-strong: #424541;
    --rule:          #1f211f;

    --series-petrol:      #d99a6c;
    --series-petrol-soft: #b85c1a;
    --series-petrol-deep: #f1c39c;
    --series-ev:          #6ba6a8;
    --series-ev-soft:     #1f6b6e;
    --series-ev-deep:     #a4cfd0;
    --series-accent:      #e6c878;
    --series-accent-soft: #c9a227;
    --series-accent-deep: #f3deaa;

    --link:        #6ba6a8;
    --link-hover:  #a4cfd0;
    --focus:       #e6c878;
    --selection:   #2c2812;

    --status-good: #6ec48a;
    --status-warn: #e6c878;
    --status-bad:  #e58a76;

    --shadow-sticky: 0 1px 0 var(--border), 0 8px 24px -16px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-quick: 0ms;
    --dur-base: 0ms;
    --dur-chart: 0ms;
  }
}

/* ===========================================================================
   Reset & base
   =========================================================================== */

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

/* Glossary: <abbr data-abbr="KEY"> — titles filled from public/acronyms.js */
abbr[data-abbr] {
  text-decoration: underline dotted;
  text-underline-offset: 0.15em;
  cursor: help;
  touch-action: manipulation;
}

abbr[data-abbr]:is(:hover, :focus-visible) {
  text-decoration-style: solid;
}

.abbr-tooltip {
  position: fixed;
  z-index: 2000;
  padding: 9px 11px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
}

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

.abbr-tooltip.is-visible {
  display: block;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  /* Flat warm paper. No gradients, no glassmorphism. */
  background: var(--bg);
  min-height: 100vh;
}

::selection { background: var(--selection); }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: text-decoration-thickness var(--dur-quick) var(--easing),
              color var(--dur-quick) var(--easing);
}
a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-input);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* Top announcement strip (sister site / cross-promo).
   Hairline-rule on warm paper instead of a gradient strip. */
.announcement-banner {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 16px;
  text-align: center;
  background: var(--bg-sunk);
  border-bottom: 1px solid var(--border);
}
.announcement-banner-inner {
  max-width: 1180px;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-2);
}
.announcement-banner a {
  font-weight: 500;
  color: var(--link);
}
.announcement-banner a:hover { color: var(--link-hover); }
@media (max-width: 600px) {
  .announcement-banner { padding: 8px 12px; }
  .announcement-banner-inner { font-size: 12.5px; }
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 96px;
}
@media (max-width: 600px) {
  main { padding: 0 16px 64px; }
}

/* ===========================================================================
   Hero
   =========================================================================== */

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px 40px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 600px) {
  .hero { padding: 32px 16px 28px; }
  .hero h1 { margin-bottom: 12px; }
  .tagline { font-size: 14px; }
  .tagline-sub { font-size: 12.5px; }
}
.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 16px;
  display: inline-block;
}

/* Wordmark-style hero h1: Space Grotesk Medium, with the "or" rendered in
   Source Serif 4 italic. Set "Plug or Pump" as text in HTML; we restyle the
   <strong>or</strong> if/when it's marked up; otherwise leave it. */
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 2rem + 2vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--fg-1);
  text-wrap: balance;
}
.hero h1 em,
.hero h1 .wordmark-or {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.subheading {
  font-family: var(--font-body);
  color: var(--fg-2);
  font-size: clamp(16px, 1.05rem + 0.2vw, 19px);
  font-weight: 400;
  font-style: normal;
  margin: 0 0 18px;
  max-width: 60ch;
  line-height: 1.5;
}
.tagline {
  font-family: var(--font-body);
  color: var(--fg-2);
  margin: 0 0 8px;
  max-width: 64ch;
  font-size: 15px;
  line-height: 1.55;
}
.tagline-sub {
  font-family: var(--font-body);
  color: var(--fg-3);
  margin: 0;
  max-width: 64ch;
  font-size: 13px;
}

/* ===========================================================================
   Comparison card (the hero result)
   =========================================================================== */

.comparison-card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--fg-1);
  border-bottom: 1px solid var(--fg-1);
  border-radius: 0;
  padding: 28px 0 24px;
  margin-bottom: 32px;
  box-shadow: none;
  position: relative;
  overflow: visible;
}
@media (max-width: 600px) {
  .comparison-card { padding: 22px 0 18px; }
}
.comparison-card::before { content: none; }
.comparison-card > * { position: relative; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.card-header h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 1.2rem + 0.8vw, 28px);
  margin: 0;
  font-weight: 500;
  color: var(--fg-1);
  letter-spacing: -0.012em;
  line-height: 1.2;
  text-wrap: balance;
  flex: 1 1 240px;
  min-width: 0;
}
.card-header h2 strong {
  color: var(--series-ev);
  font-weight: 500;
}
@media (max-width: 600px) {
  .card-header { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 18px; }
  .card-header h2 { font-size: 18px; flex: 0 0 auto; }
  .share-dropdown { align-self: flex-start; }
}

.share-dropdown {
  position: relative;
}
.share-dropdown > summary.share-btn {
  list-style: none;
  cursor: pointer;
}
.share-dropdown > summary.share-btn::-webkit-details-marker {
  display: none;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--fg-2);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-input);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--dur-quick) var(--easing),
              border-color var(--dur-quick) var(--easing);
}
.share-btn:hover {
  color: var(--fg-1);
  border-color: var(--fg-1);
  background: transparent;
}
.share-btn svg { width: 14px; height: 14px; }
.share-btn.copied { color: var(--series-ev); border-color: var(--series-ev); background: transparent; }

.share-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 240px;
  padding: 6px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sticky);
}
/* Stacked header: share control shrink-wraps left; right:0 on the menu would
   grow the panel left and clip past the viewport. Anchor start + cap width. */
@media (max-width: 600px) {
  .share-menu {
    left: 0;
    right: auto;
    min-width: 0;
    width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }
}
.share-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-input);
  background: transparent;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  transition: background var(--dur-quick) var(--easing);
}
.share-menu-item:hover {
  background: var(--bg-sunk);
}
.share-menu-item:active {
  background: var(--bg-sunk);
}

.share-menu-divider {
  height: 1px;
  margin: 8px 4px;
  background: var(--border);
  border: none;
}

.share-menu-hint {
  margin: 4px 8px 10px;
  padding: 0;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  color: var(--fg-3);
}

.share-menu-item.share-menu-social {
  font-size: 12px;
}

/* race bars */

.race {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 8px 0 24px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.race-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.race-row:last-child { border-bottom: 0; }
@media (max-width: 720px) {
  .race-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 0;
  }
}

.race-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.race-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.race-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  font-size: 16px;
  line-height: 1;
}
.race-icon img,
.race-icon svg { width: 22px; height: 22px; display: block; }
.fuel-row .race-icon { color: var(--series-petrol); }
.ev-row   .race-icon { color: var(--series-ev); }
.race-detail {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-3);
  font-weight: 400;
  margin-left: 32px;
  letter-spacing: 0;
  line-height: 1.5;
  text-wrap: balance;
}
@media (max-width: 720px) {
  .race-detail { margin-left: 0; font-size: 13px; }
}

.race-track {
  position: relative;
  height: 36px;
  background: var(--bg-sunk);
  border-radius: 0;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--rule);
}
.race-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  border-radius: 0;
  transition: width 700ms var(--easing);
}
.fuel-row .race-bar {
  background: var(--series-petrol);
  box-shadow: none;
}
.ev-row .race-bar {
  background: var(--series-ev);
  box-shadow: none;
}

/* Value label rides the END of the bar. The JS keeps positioning it via
   inline `left:` plus `is-outside`. */
.race-value {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-100%, -50%);
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--bg-raised);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  white-space: nowrap;
  transition: left 700ms var(--easing), transform var(--dur-base), color var(--dur-base);
  z-index: 2;
  pointer-events: none;
}
.race-track.is-outside .race-value {
  transform: translate(0, -50%);
  color: var(--fg-1);
}
.race-value .unit {
  font-family: var(--font-display);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 4px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.race-track.is-outside .race-value .unit { color: var(--fg-3); }

/* ratio callout */

.ratio-callout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
  text-align: center;
}
/* × is absolutely positioned so it sits on the numeral baseline band instead of
   flex/line-box "baseline", which vertically centers small text next to huge figures. */
.ratio-number {
  position: relative;
  display: inline-block;
  padding-inline-end: 0.42em;
  font-family: var(--font-mono);
  font-size: clamp(48px, 6.6vw, 64px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  text-shadow: none;
}
.ratio-number .ratio-mult {
  position: absolute;
  right: 0;
  bottom: 0;
  font-family: var(--font-display);
  font-size: 0.5em;
  font-weight: 500;
  line-height: 1;
  color: var(--fg-2);
}
.ratio-label {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--fg-2);
  font-weight: 400;
  max-width: 18ch;
  text-wrap: balance;
  text-align: left;
}
@media (max-width: 600px) {
  .ratio-callout {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 0;
  }
  .ratio-label { font-size: 14px; max-width: none; text-align: center; }
}

/* cost row */

.cost-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}
@media (max-width: 720px) {
  .cost-row { grid-template-columns: 1fr; gap: 0; }
}
.cost-cell {
  padding: 16px 18px;
  border-right: 1px solid var(--rule);
}
.cost-cell:last-child { border-right: none; }
@media (max-width: 720px) { .cost-cell { border-right: none; border-bottom: 1px solid var(--rule); } }
.cost-cell.highlight {
  background: transparent;
  border-radius: 0;
}
.cost-label {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  margin-bottom: 8px;
  font-weight: 500;
}
.cost-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
}
.cost-cell.highlight .cost-value { color: var(--series-ev); }

.cost-sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 6px;
  letter-spacing: 0;
}
.cost-cell.highlight .cost-sub { color: var(--fg-3); opacity: 1; }

/* Second-tier annual block: lower visual weight than the headline row. */
.cost-row.annual-row {
  margin-top: 0;
  border-top: 1px solid var(--rule);
  background: transparent;
  border-radius: 0;
}
.cost-row.annual-row .cost-value {
  font-size: 18px;
  color: var(--fg-2);
}
.cost-row.annual-row .cost-cell { padding: 12px 18px; }
@media (max-width: 600px) {
  .cost-row.annual-row .cost-cell { padding: 10px 16px; }
  .cost-row.annual-row .cost-value { font-size: 16px; }
}

/* ===========================================================================
   Elitre callout
   =========================================================================== */

.elitre-callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-sunk);
  border: 0;
  border-left: 2px solid var(--series-accent);
  border-radius: 0;
  padding: 16px 20px;
  margin-bottom: 32px;
}
.callout-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--series-accent);
  color: var(--fg-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-display);
  margin-top: 2px;
}
.callout-body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.55;
  max-width: 68ch;
}
.callout-body strong { color: var(--fg-1); font-weight: 600; }
.callout-body .compare-num {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--series-ev);
  font-variant-numeric: tabular-nums slashed-zero;
}

/* ===========================================================================
   Controls panels
   =========================================================================== */

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 48px;
  margin-bottom: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 860px) { .controls { grid-template-columns: 1fr; gap: 24px; } }

.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
@media (max-width: 600px) {
  .panel { padding: 0; }
  .scenarios, .methodology { padding: 24px 0; }
  .elitre-callout { padding: 14px 16px; gap: 12px; }
  .cost-cell { padding: 12px 14px; }
  .cost-value { font-size: 20px; }
}
.panel h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--fg-1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel h2::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 0;
  background: var(--series-ev);
}
.panel:nth-of-type(1) h2::before { background: var(--series-petrol); }
.panel:nth-of-type(2) h2::before { background: var(--series-ev); }
.panel-sub {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-3);
  margin: 0 0 20px;
  line-height: 1.5;
}
.panel h3 {
  margin: 28px 0 12px;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
}

label {
  display: block;
  margin-bottom: 18px;
}
label > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--fg-1);
  font-weight: 500;
}
label .hint {
  display: block;
  font-family: var(--font-body);
  color: var(--fg-3);
  font-size: 12.5px;
  font-style: normal;
  margin-top: 6px;
  line-height: 1.5;
  font-weight: 400;
}
label > span .hint {
  display: inline;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  font-weight: 400;
  letter-spacing: 0;
}

input[type="number"], select {
  width: 100%;
  background: var(--bg-raised);
  color: var(--fg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  transition: border-color var(--dur-quick) var(--easing);
}
input[type="number"]:hover, select:hover { border-color: var(--fg-1); }
input[type="number"]:focus, select:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--fg-1);
  background: var(--bg-raised);
  box-shadow: none;
}

/* slider — minimal hairline track with a solid mark thumb */
input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 44px; /* 44px tap target */
  outline: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--border);
  border-radius: 0;
}
input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--border);
  border-radius: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--fg-1);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--fg-1);
  border-radius: 50%;
  margin-top: -8px;
  cursor: pointer;
  transition: none;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: none; }
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--fg-1);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--fg-1);
  border-radius: 50%;
  cursor: pointer;
}
input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px var(--fg-1), 0 0 0 4px var(--focus);
}

/* preset chips — pill outline by default, solid fg-1 when active */

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
}
.preset-row button {
  background: var(--bg);
  color: var(--fg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--dur-quick) var(--easing),
              border-color var(--dur-quick) var(--easing),
              background var(--dur-quick) var(--easing);
}
.preset-row button:hover {
  border-color: var(--fg-1);
  color: var(--fg-1);
  background: var(--bg);
  transform: none;
}
.preset-row button.active {
  background: var(--fg-1);
  color: var(--bg);
  border-color: var(--fg-1);
  font-weight: 500;
}

/* ===========================================================================
   Scenarios chart
   =========================================================================== */

.scenarios {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 32px 0;
  margin-bottom: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--border);
}
.scenarios h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--fg-1);
}
.scenarios-sub {
  font-family: var(--font-body);
  color: var(--fg-3);
  font-size: 13px;
  margin: 0 0 24px;
  line-height: 1.55;
  max-width: 68ch;
}

.chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.chart-baseline {
  position: relative;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-baseline-dot {
  width: 12px; height: 12px;
  border: 2px dashed var(--fuel);
  border-radius: 50%;
}

.scenario-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 3fr auto;
  gap: 16px;
  align-items: center;
}
@media (max-width: 720px) {
  .scenario-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
.scenario-name {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  line-height: 1.3;
}
.scenario-name .scenario-rate {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.scenario-row.featured .scenario-name { color: var(--text); font-weight: 700; }
.scenario-row.featured .scenario-name::before {
  content: "→ ";
  color: var(--accent);
  font-weight: 700;
}

.scenario-bar-wrap {
  height: 24px;
  background: var(--bg-sunk);
  border-radius: 0;
  position: relative;
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.scenario-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--series-ev);
  border-radius: 0;
  transition: width 600ms var(--easing);
}
.scenario-row.featured .scenario-bar {
  background: var(--series-accent);
  box-shadow: none;
}
.scenario-baseline {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--fuel);
  opacity: 0.8;
  pointer-events: none;
}
.scenario-baseline::before {
  content: "petrol";
  position: absolute;
  top: -16px; left: -22px;
  font-size: 10px;
  color: var(--fuel);
  font-family: var(--mono);
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scenario-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.scenario-multiplier {
  font-size: 16px;
  font-weight: 700;
  color: var(--ev);
}
.scenario-row.featured .scenario-multiplier { color: var(--ratio); }
.scenario-cost {
  font-size: 11px;
  color: var(--muted);
}

/* ===========================================================================
   History chart (30-day fuel price trend)
   =========================================================================== */

.history-chart {
  width: 100%;
  position: relative;
  min-height: 220px;
}
.history-chart svg {
  width: 100%;
  height: auto;
  display: block;
  font-family: inherit;
}
.history-chart .axis-line {
  stroke: var(--border);
  stroke-width: 1;
}
.history-chart .grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  opacity: 0.5;
}
.history-chart .tick-label {
  fill: var(--muted);
  font-size: 11px;
}
.history-chart .price-line {
  fill: none;
  stroke: var(--fuel-2);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.history-chart .price-area {
  fill: var(--fuel);
  opacity: 0.08;
}
.history-chart .endpoint-dot {
  fill: var(--fuel-2);
}
.history-chart .endpoint-label {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.history-chart .empty-msg {
  fill: var(--muted);
  font-size: 14px;
  text-anchor: middle;
}

/* ===========================================================================
   Methodology
   =========================================================================== */

.methodology {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 48px 0 24px;
  margin-bottom: 0;
  box-shadow: none;
}
.methodology h2 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(24px, 1.3rem + 0.7vw, 28px);
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--fg-1);
}
details {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
details:first-of-type { border-top: 1px solid var(--border); padding-top: 14px; }
details summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 500;
  padding: 6px 0;
  font-size: 15px;
  color: var(--fg-1);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "+";
  display: inline-block;
  width: 18px;
  height: 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  text-align: center;
  line-height: 16px;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--fg-2);
  transition: transform var(--dur-base) var(--easing);
}
details[open] summary::before { content: "−"; transform: rotate(180deg); }
details p, details ul, details li {
  font-family: var(--font-body);
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.6;
}
details p { max-width: 64ch; margin: 12px 0; text-wrap: pretty; }
details ul { padding-left: 20px; }
details li { margin: 6px 0; }

table.src-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-family: var(--font-body);
  font-size: 14px;
}
table.src-table th, table.src-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
table.src-table thead tr {
  border-top: 1px solid var(--fg-1);
  border-bottom: 1px solid var(--border);
}
table.src-table th {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  font-weight: 500;
  border-bottom: 0;
}
table.src-table tbody tr:last-child { border-bottom: 1px solid var(--fg-1); }
table.src-table td:nth-child(2) {
  font-family: var(--font-mono);
  color: var(--fg-1);
  font-weight: 500;
  font-variant-numeric: tabular-nums slashed-zero;
}

footer {
  text-align: left;
  padding: 32px 0 16px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  color: var(--fg-3);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
}
footer p { max-width: 68ch; margin: 0 0 10px; }

.muted {
  color: var(--fg-3);
  font-family: var(--font-body);
  font-size: 13px;
}

/* counter flash effect on change — subtle, not the previous scale-pop */
.counter-changed {
  animation: flash 400ms var(--easing);
}
@keyframes flash {
  0%   { color: var(--series-accent); }
  100% { color: inherit; }
}

/* ---------------------------------------------------------------------------
   Sticky totals bar — appears once the main comparison card scrolls off-screen,
   so the three headline numbers stay visible while the user is tweaking inputs
   further down the page.
   --------------------------------------------------------------------------- */
.sticky-totals {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transform: translateY(-110%);
  transition: transform var(--dur-base) var(--easing);
  /* Solid background + hairline rule. No backdrop blur (design system rule). */
  background: var(--bg-raised);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sticky);
  padding: 10px 16px;
  pointer-events: none;
}
.sticky-totals.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}
.sticky-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
}
.sticky-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 0;
}
.sticky-label {
  font-family: var(--font-display);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  font-weight: 500;
}
.sticky-value {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 17px;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--fg-1);
}
.sticky-unit {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sticky-fuel  .sticky-value > span:first-child { color: var(--series-petrol); }
.sticky-ev    .sticky-value > span:first-child { color: var(--series-ev); }
.sticky-ratio .sticky-value > span:first-child { color: var(--fg-1); }

@media (max-width: 520px) {
  .sticky-totals { padding: 8px 10px; }
  .sticky-row    { gap: 8px; }
  .sticky-value  { font-size: 15px; }
  .sticky-unit   { font-size: 10px; }
  .sticky-label  { font-size: 9px; letter-spacing: 0.06em; }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-totals { transition: none; }
}

/* ===========================================================================
   Page nav (top of hero — Cost per km / Battery degradation)
   =========================================================================== */

.page-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 28px;
  box-shadow: none;
}
.page-nav-link {
  display: inline-block;
  padding: 10px 14px 12px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-3);
  text-decoration: none;
  transition: color var(--dur-quick) var(--easing),
              border-color var(--dur-quick) var(--easing);
}
.page-nav-link:hover {
  color: var(--fg-1);
  text-decoration: none;
  border-bottom-color: transparent;
}
.page-nav-link.is-active {
  background: transparent;
  color: var(--fg-1);
  border-bottom-color: var(--fg-1);
}
.page-nav-link.is-active:hover { color: var(--fg-1); }
@media (max-width: 600px) {
  .page-nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin-bottom: 18px;
    box-sizing: border-box;
    gap: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }
  .page-nav::-webkit-scrollbar {
    height: 4px;
  }
  .page-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 0;
  }
  .page-nav-link {
    font-size: 13px;
    padding: 8px 12px 10px;
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: center;
  }
}

/* ===========================================================================
   Battery page — headline card
   =========================================================================== */

.battery-headline-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}
@media (max-width: 720px) {
  .battery-headline-row { grid-template-columns: 1fr; gap: 0; }
}
.battery-headline-cell {
  padding: 18px 20px;
  border-right: 1px solid var(--rule);
}
.battery-headline-cell:last-child { border-right: none; }
@media (max-width: 720px) {
  .battery-headline-cell { border-right: none; border-bottom: 1px solid var(--rule); }
  .battery-headline-cell:last-child { border-bottom: none; }
}
.battery-cell-label {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  margin-bottom: 10px;
  font-weight: 500;
}
.battery-cell-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  line-height: 1;
}
.battery-cell-unit {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--fg-3);
  font-weight: 500;
  margin-left: 6px;
  letter-spacing: 0;
}
.battery-cell-sub {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 8px;
  line-height: 1.45;
}
.battery-cell-nmc   .battery-cell-value { color: var(--series-petrol); }
.battery-cell-lfp   .battery-cell-value { color: var(--series-ev); }
.battery-cell-delta .battery-cell-value { color: var(--series-accent-deep); }

/* ===========================================================================
   Battery page — chart
   =========================================================================== */

.battery-chart-section { padding-bottom: 24px; }

.battery-chart-wrap {
  width: 100%;
  margin: 8px 0 18px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 16px 0 8px;
}
.battery-chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* SVG class hooks for primitives generated in battery.js. */
.bc-grid {
  stroke: var(--rule);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  opacity: 1;
}
.bc-grid-vert { opacity: 0.6; }
.bc-axis-line {
  stroke: var(--border);
  stroke-width: 1;
}
.bc-axis {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--fg-3);
}
.bc-axis-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  fill: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.bc-curve {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
}
.bc-nmc { stroke: var(--series-petrol); }
.bc-lfp { stroke: var(--series-ev); }
.bc-dot { filter: none; }
.bc-nmc-dot { fill: var(--series-petrol); }
.bc-lfp-dot { fill: var(--series-ev); }
.bc-eol {
  stroke: var(--series-accent);
  stroke-width: 1;
  stroke-dasharray: 6 4;
  opacity: 0.85;
}
.bc-eol-label {
  font-family: var(--font-display);
  font-size: 11px;
  fill: var(--series-accent-deep);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.battery-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-2);
  margin: 4px 0 22px;
  padding: 0;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 2px;
  border-radius: 0;
}
.legend-nmc .legend-swatch { background: var(--series-petrol); box-shadow: none; }
.legend-lfp .legend-swatch { background: var(--series-ev);     box-shadow: none; }
.legend-eol .legend-swatch {
  background: transparent;
  border-top: 1px dashed var(--series-accent);
  height: 0;
  width: 18px;
}

.battery-soh-table { margin-top: 4px; }
.battery-soh-table td:nth-child(2) { color: var(--series-petrol); }
.battery-soh-table td:nth-child(3) { color: var(--series-ev); }
.battery-soh-table td:nth-child(4),
.battery-soh-table td:nth-child(5) { color: var(--fg-2); }

.battery-controls .panel:nth-of-type(1) h2::before { background: var(--series-ev); }
.battery-controls .panel:nth-of-type(2) h2::before { background: var(--series-accent); }

/* ===========================================================================
   Lifecycle CO2e page
   =========================================================================== */

.lifecycle-headline .card-header h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.2rem + 0.6vw, 24px);
  font-weight: 500;
  letter-spacing: -0.005em;
}

.lifecycle-embodied-block {
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
}
.lifecycle-embodied-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 640px) {
  .lifecycle-embodied-cols { grid-template-columns: 1fr; gap: 16px; }
}
.lifecycle-embodied-title {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  font-weight: 500;
  margin-bottom: 8px;
}
.lifecycle-bar-track {
  height: 6px;
  border-radius: 0;
  background: var(--bg-sunk);
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.lifecycle-bar {
  height: 100%;
  border-radius: 0;
  min-width: 4px;
  transition: width var(--dur-base) var(--easing);
}
.lifecycle-bar-ev  { background: var(--series-ev); }
.lifecycle-bar-ice { background: var(--series-petrol); }
.lifecycle-embodied-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-top: 10px;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
}
.lifecycle-embodied-note {
  font-family: var(--font-body);
  font-size: 13px;
  margin: 12px 0 0;
  color: var(--fg-3);
  line-height: 1.5;
}

.lifecycle-lifetime-row {
  padding: 16px 0 20px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--fg-2);
  line-height: 1.55;
  max-width: 68ch;
}
.lifecycle-ton-ice { color: var(--series-petrol); font-weight: 600; }
.lifecycle-ton-ev  { color: var(--series-ev);     font-weight: 600; }

.lifecycle-headline-row { margin-top: 4px; }

.lifecycle-table td:nth-child(2) { color: var(--series-ev); }
.lifecycle-table td:nth-child(3) { color: var(--series-petrol); }

.lifecycle-controls .panel:nth-of-type(1) h2::before { background: var(--series-ev); }
.lifecycle-controls .panel:nth-of-type(2) h2::before { background: var(--series-petrol); }

.lifecycle-headline-row .battery-cell-lfp .battery-cell-sub {
  font-size: 12px;
  line-height: 1.45;
  max-width: 42ch;
}

.lc-grid {
  stroke: var(--rule);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  opacity: 1;
}
.lc-grid-vert { opacity: 0.6; }
.lc-axis-line {
  stroke: var(--border);
  stroke-width: 1;
}
.lc-axis {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--fg-3);
}
.lc-axis-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  fill: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.lc-curve {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
}
.lc-ice { stroke: var(--series-petrol); }
.lc-ev  { stroke: var(--series-ev); }
.lc-cross {
  stroke: var(--series-accent);
  stroke-width: 1;
  stroke-dasharray: 6 4;
  opacity: 0.85;
}
.lc-cross-label {
  font-family: var(--font-display);
  font-size: 11px;
  fill: var(--series-accent-deep);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ===========================================================================
   Efficiency (tank / battery to wheels)
   =========================================================================== */

.efficiency-headline .card-header h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.2rem + 0.6vw, 24px);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.efficiency-headline .card-header {
  margin-bottom: 16px;
}
.efficiency-headline .efficiency-headline-note {
  margin: 0 0 24px;
}
.efficiency-headline-note {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 68ch;
}

.efficiency-dollar-band {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.efficiency-dollar-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
  color: var(--fg-3);
}
.efficiency-dollar-note {
  margin: 0 0 16px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 68ch;
}
.efficiency-dollar-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 520px) {
  .efficiency-dollar-row {
    grid-template-columns: 1fr;
  }
}
.efficiency-dollar-cell {
  padding: 14px 18px;
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--rule);
  background: transparent;
}
.efficiency-dollar-cell:last-child { border-right: 0; }
@media (max-width: 520px) {
  .efficiency-dollar-cell { border-right: 0; border-bottom: 1px solid var(--rule); }
  .efficiency-dollar-cell:last-child { border-bottom: 0; }
}
.efficiency-dollar-ice .efficiency-dollar-value { color: var(--series-petrol); }
.efficiency-dollar-ev  .efficiency-dollar-value { color: var(--series-ev); }
.efficiency-dollar-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  margin-bottom: 8px;
}
.efficiency-dollar-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg-1);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  line-height: 1.2;
}
.efficiency-dollar-unit,
.efficiency-dollar-per {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.6em;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 2px;
}
.efficiency-dollar-sub {
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-3);
}

.eff-chart-tooltip {
  pointer-events: none;
  box-sizing: border-box;
  max-width: min(22rem, calc(100vw - 24px));
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-1);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sticky);
}

#efficiencyChart .eff-chart-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  fill: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
#efficiencyChart .eff-chart-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  fill: var(--fg-2);
}
#efficiencyChart .eff-bar-ticks {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--fg-3);
}
#efficiencyChart .eff-axis-line {
  stroke: var(--border);
  stroke-width: 1;
}

#efficiencyChart rect[class*='eff-seg'] {
  cursor: pointer;
}

/* Petrol-side losses use the petrol palette (deep → soft). EV-side use the EV
   palette. Useful energy is the ochre accent in both cases. */
#efficiencyChart .eff-seg-heat { fill: var(--series-petrol-deep); }
#efficiencyChart .eff-seg-dt   { fill: var(--series-petrol); }
#efficiencyChart .eff-seg-br   { fill: var(--series-petrol-soft); opacity: 1; }
#efficiencyChart .eff-seg-pk   { fill: var(--series-ev-deep); }
#efficiencyChart .eff-seg-mot  { fill: var(--series-ev); }
#efficiencyChart .eff-seg-fb   { fill: var(--series-ev-soft); opacity: 1; }
#efficiencyChart .eff-seg-use  { fill: var(--series-accent); }

.efficiency-chart-legend .eff-swatch-dt  { background: var(--series-petrol);      box-shadow: none; }
.efficiency-chart-legend .eff-swatch-br  { background: var(--series-petrol-soft); box-shadow: none; }
.efficiency-chart-legend .eff-swatch-pk  { background: var(--series-ev-deep);     box-shadow: none; }
.efficiency-chart-legend .eff-swatch-fb  { background: var(--series-ev-soft);     box-shadow: none; }
.efficiency-chart-legend .eff-swatch-use { background: var(--series-accent);      box-shadow: none; }

.efficiency-controls .panel:nth-of-type(1) h2::before { background: var(--series-petrol); }
.efficiency-controls .panel:nth-of-type(2) h2::before { background: var(--series-ev); }

/* ===========================================================================
   Fires page (/fires)
   =========================================================================== */

.fires-lead .fires-lead-period {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-3);
  margin: 0 0 16px;
}

.fires-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 16px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 640px) {
  .fires-stat-grid { grid-template-columns: 1fr; }
}

.fires-stat {
  padding: 18px 20px;
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--rule);
  background: transparent;
}
.fires-stat:last-child { border-right: 0; }
@media (max-width: 640px) {
  .fires-stat { border-right: 0; border-bottom: 1px solid var(--rule); }
  .fires-stat:last-child { border-bottom: 0; }
}

.fires-stat-ev,
.fires-stat-ice { box-shadow: none; }

.fires-stat-label {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  margin-bottom: 10px;
}

.fires-stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
}

.fires-stat-ev  .fires-stat-value { color: var(--series-ev); }
.fires-stat-ice .fires-stat-value { color: var(--series-petrol); }

.fires-stat-sub {
  display: block;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.5;
}

.fires-lead-source,
.fires-inline-source {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-3);
  margin: 0;
  line-height: 1.5;
}

.fires-summary .fires-dl {
  display: grid;
  gap: 0;
  margin: 16px 0;
  border-top: 1px solid var(--fg-1);
}

.fires-summary .fires-dl > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.fires-summary .fires-dl > div:last-child { border-bottom: 1px solid var(--fg-1); }

.fires-summary .fires-dl dt {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-2);
}

.fires-summary .fires-dl dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-1);
  text-align: right;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
}

.fires-caveats .fires-caveat-list {
  margin: 0;
  padding-left: 1.2rem;
  font-family: var(--font-body);
  color: var(--fg-2);
}

.fires-caveats .fires-caveat-list li {
  margin-bottom: 12px;
  line-height: 1.55;
}

.fires-caveats .fires-caveat-list li:last-child {
  margin-bottom: 0;
}

.fires-chart-card .fires-chart-intro,
.fires-chart-card .fires-chart-foot {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-2);
  margin: 0 0 14px;
  max-width: 68ch;
  line-height: 1.55;
}

.fires-chart-card .fires-chart-foot {
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 13px;
  color: var(--fg-3);
}

.fires-chart-mount {
  overflow-x: auto;
  margin: 8px 0 4px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
}

.fires-chart-mount svg {
  display: block;
}

.fires-methodology {
  margin-top: 8px;
}

/* ===========================================================================
   Timelines page (/timelines)
   =========================================================================== */

.timelines-lead .timelines-lead-intro {
  max-width: 68ch;
  font-family: var(--font-body);
  color: var(--fg-2);
  line-height: 1.55;
}

.timelines-chart-mount {
  overflow-x: auto;
  margin: 12px 0 8px;
}

.timelines-chart-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 12px 0 8px;
}

.timelines-chart-row .timelines-chart-mount {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.timelines-chart-mount--linear-years {
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
}

.timelines-chart-jump-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.timelines-chart-jump {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  color: var(--fg-1);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  transition: color var(--dur-quick) var(--easing),
              border-color var(--dur-quick) var(--easing);
}

.timelines-chart-jump:hover {
  color: var(--fg-1);
  border-color: var(--fg-1);
}

.timelines-chart-jump:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.timelines-jump-kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-style: normal;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--bg-sunk);
  color: var(--fg-2);
}

.timelines-chart-mount svg {
  display: block;
}

.timelines-scroll-hint {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-3);
  font-style: italic;
  max-width: 68ch;
}

.timelines-chart-foot,
.timelines-chart-intro {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-2);
  margin: 0 0 14px;
  max-width: 68ch;
  line-height: 1.55;
}

.timelines-chart-foot {
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 13px;
  color: var(--fg-3);
}

.timelines-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 10px 2px 4px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-2);
}

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

.timelines-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 0;
  display: inline-block;
}

.timelines-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 12px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 820px) {
  .timelines-category-grid {
    grid-template-columns: 1fr;
    border-bottom: 0;
  }
}

.timelines-category {
  padding: 18px 20px 16px;
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--rule);
  background: transparent;
}
.timelines-category:last-child { border-right: 0; }
@media (max-width: 820px) {
  .timelines-category { border-right: 0; border-bottom: 1px solid var(--rule); }
  .timelines-category:last-child { border-bottom: 0; }
}

.timelines-category-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0;
  border-radius: 0;
  background: transparent !important;
  margin-bottom: 10px;
}

.timelines-cat-fossil .timelines-category-label { color: var(--series-petrol); }
.timelines-cat-metal  .timelines-category-label { color: var(--series-accent-deep); }
.timelines-cat-flow   .timelines-category-label { color: var(--series-ev); }

.timelines-category p {
  margin: 0 0 10px;
  font-family: var(--font-body);
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.55;
}

.timelines-category-ex {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--fg-3);
  font-style: italic;
}

.timelines-lithium {
  box-shadow: none;
}

.timelines-lithium-headline {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--fg-1);
  margin: 0 0 12px;
}

.timelines-li-dl {
  display: grid;
  gap: 0;
  margin: 16px 0;
  border-top: 1px solid var(--fg-1);
}

.timelines-li-dl > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.timelines-li-dl > div:last-child { border-bottom: 1px solid var(--fg-1); }

.timelines-li-dl dt {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-2);
}

.timelines-li-dl dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-1);
  text-align: right;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
}

.timelines-inline-source {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--fg-3);
  margin: 0 0 8px;
  line-height: 1.5;
}

.timelines-methodology {
  margin-top: 8px;
}

/* ===========================================================================
   Grid / grid-emissions / roadtrip shared primitives
   =========================================================================== */

.grid-chart-mount {
  margin: 12px 0 4px;
}
.grid-chart-mount--annual,
.grid-chart-mount--states,
.grid-chart-mount--hist,
.grid-chart-mount--route {
  margin: 18px 0 8px;
}

.grid-chart-intro {
  font-family: var(--font-body);
  color: var(--fg-2);
  font-size: 14px;
  margin: 4px 0 12px;
  line-height: 1.55;
  max-width: 68ch;
}

.grid-chart-foot {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-3);
  margin: 10px 0 0;
  line-height: 1.5;
  max-width: 68ch;
}

@media (max-width: 720px) {
  .grid-chart-mount,
  .history-chart,
  .battery-chart-wrap,
  .fires-chart-mount,
  .timelines-chart-mount {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .grid-chart-mount svg {
    min-width: 680px;
  }

  .history-chart svg {
    min-width: 640px;
  }

  .battery-chart-wrap svg,
  .efficiency-chart-wrap svg {
    min-width: 720px;
  }

  .fires-chart-mount svg {
    min-width: 680px;
  }

  .timelines-chart-mount svg {
    min-width: 720px;
  }
}

.grid-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 6px 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-2);
}
.grid-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.grid-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 0;
}
.grid-legend-line {
  width: 18px;
  height: 2px;
  border-radius: 0;
}

.grid-methodology {
  margin-top: 8px;
}

.grid-controls {
  margin-bottom: 28px;
}

/* ---------------------------------------------------------------------------
   /grid headline row
   --------------------------------------------------------------------------- */

.grid-headline-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 14px 0 10px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 720px) {
  .grid-headline-row { grid-template-columns: 1fr; }
}
.grid-headline-stat {
  padding: 16px 20px;
  border-right: 1px solid var(--rule);
}
.grid-headline-stat:last-child { border-right: none; }
@media (max-width: 720px) {
  .grid-headline-stat { border-right: none; border-bottom: 1px solid var(--rule); }
  .grid-headline-stat:last-child { border-bottom: none; }
}
.grid-headline-label {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  margin-bottom: 8px;
  font-weight: 500;
}
.grid-headline-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  line-height: 1.05;
}
.grid-headline-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 6px;
  line-height: 1.45;
}

/* Charging pattern toggle */
.grid-pattern-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 12px;
}
.grid-pattern-btn {
  background: var(--bg);
  color: var(--fg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--dur-quick) var(--easing),
              border-color var(--dur-quick) var(--easing),
              background var(--dur-quick) var(--easing);
}
.grid-pattern-btn:hover {
  border-color: var(--fg-1);
  color: var(--fg-1);
}
.grid-pattern-btn.active {
  background: var(--fg-1);
  color: var(--bg);
  border-color: var(--fg-1);
  font-weight: 500;
}

/* ---------------------------------------------------------------------------
   /grid-emissions table
   --------------------------------------------------------------------------- */

.ge-table-wrap { overflow-x: auto; }
.ge-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 14px;
  margin: 4px 0 8px;
}
.ge-table thead tr {
  border-top: 1px solid var(--fg-1);
  border-bottom: 1px solid var(--border);
}
.ge-table th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  padding: 10px 12px;
  border-bottom: 0;
  font-weight: 500;
}
.ge-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--fg-2);
  vertical-align: top;
}
.ge-table tbody tr:last-child td { border-bottom: 1px solid var(--fg-1); }
.ge-table-state-name {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 2px;
}
.ge-table-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  color: var(--fg-1);
  text-align: right;
  white-space: nowrap;
}
.ge-table-ev { color: var(--series-ev); font-weight: 500; }
.ge-table-mix {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--fg-3);
}

/* ---------------------------------------------------------------------------
   /roadtrip controls + result row
   --------------------------------------------------------------------------- */

.rt-car-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
@media (max-width: 540px) { .rt-car-row { grid-template-columns: 1fr; } }

.rt-car-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-quick) var(--easing),
              background var(--dur-quick) var(--easing);
}
.rt-car-btn:hover { border-color: var(--fg-1); }
.rt-car-btn.active {
  border-color: var(--fg-1);
  background: var(--bg-sunk);
  box-shadow: none;
}
.rt-car-label {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-1);
  margin-bottom: 4px;
}
.rt-car-ex {
  display: block;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--fg-3);
}

.rt-result-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 14px 0 4px;
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  overflow: hidden;
}
@media (max-width: 900px) {
  .rt-result-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .rt-result-row { grid-template-columns: 1fr; }
}
.rt-result-stat {
  padding: 14px 16px;
  border-right: 1px solid var(--rule);
  background: transparent;
}
.rt-result-stat:last-child { border-right: none; background: transparent; }
@media (max-width: 900px) {
  .rt-result-stat:nth-child(even) { border-right: none; }
  .rt-result-stat { border-bottom: 1px solid var(--rule); }
}
.rt-result-label {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  font-weight: 500;
  margin-bottom: 8px;
}
.rt-result-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg-1);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
}
.rt-result-ev .rt-result-value { color: var(--series-ev); }
.rt-result-ice .rt-result-value { color: var(--series-petrol); }
.rt-result-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--fg-3);
  margin-top: 6px;
  line-height: 1.45;
}

.rt-stop-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 14px 0 6px;
  border-top: 1px solid var(--rule);
}
.rt-stop-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 12px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  align-items: center;
}
.rt-stop-row--empty {
  color: var(--fg-3);
  font-style: italic;
  grid-template-columns: 1fr;
  font-family: var(--font-body);
}
.rt-stop-name { font-family: var(--font-body); font-size: 14px; color: var(--fg-1); }
.rt-stop-km {
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums slashed-zero;
}
.rt-stop-meta {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums slashed-zero;
}
.rt-stop-meta-item { white-space: nowrap; }
.rt-stop-operator {
  grid-column: 1 / -1;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-3);
}

.rt-hist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 12px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
}

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

.rt-hist-legend-line {
  width: 18px;
  height: 0;
  border-top: 1px dashed var(--legend-color);
}

.rt-infra-card {
  overflow: hidden;
}

.rt-infra-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 14px;
  flex-wrap: wrap;
}

.rt-infra-filters {
  display: inline-flex;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.rt-infra-filter {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--dur-quick) var(--easing),
              border-color var(--dur-quick) var(--easing),
              background var(--dur-quick) var(--easing);
}

.rt-infra-filter:hover {
  color: var(--fg-1);
  border-color: var(--fg-1);
  background: var(--bg);
}

.rt-infra-filter.active {
  color: var(--bg);
  background: var(--fg-1);
  border-color: var(--fg-1);
  box-shadow: none;
}

.rt-infra-summary {
  margin: 0;
  color: var(--fg-3);
  font-family: var(--font-body);
  font-size: 13px;
}

.rt-infra-tier-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 12px;
  color: var(--fg-2);
  font-family: var(--font-body);
  font-size: 13px;
}

.rt-infra-tier-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rt-tier-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.rt-tier-dot--fast  { background: var(--series-ev-soft); }
.rt-tier-dot--rapid { background: var(--series-ev); }
.rt-tier-dot--ultra { background: var(--series-accent); }

.rt-infra-credit {
  margin: 0 0 12px;
  color: var(--fg-3);
  font-family: var(--font-body);
  font-size: 12.5px;
}

.rt-infra-map {
  height: min(68vh, 560px);
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-sunk);
  display: grid;
  place-items: center;
  color: var(--fg-3);
  box-shadow: none;
}

.rt-infra-search {
  display: grid;
  gap: 7px;
  margin: 14px 0 12px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.rt-infra-search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--bg-raised);
  color: var(--fg-1);
  padding: 9px 12px;
  font: 14px var(--font-body);
}

.rt-infra-search input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.rt-infra-map .leaflet-container,
.rt-infra-map.leaflet-container {
  display: block;
  font-family: var(--font-display);
}

/* Local Leaflet layout fallback. Without these, blocked CSS turns tiles into normal document-flow images. */
.rt-infra-map .leaflet-pane,
.rt-infra-map .leaflet-tile,
.rt-infra-map .leaflet-marker-icon,
.rt-infra-map .leaflet-marker-shadow,
.rt-infra-map .leaflet-tile-container,
.rt-infra-map .leaflet-pane > svg,
.rt-infra-map .leaflet-pane > canvas,
.rt-infra-map .leaflet-zoom-box,
.rt-infra-map .leaflet-image-layer,
.rt-infra-map .leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.rt-infra-map .leaflet-container {
  overflow: hidden;
}

.rt-infra-map .leaflet-map-pane,
.rt-infra-map .leaflet-control-container {
  position: absolute;
  inset: 0;
}

.rt-infra-map .leaflet-tile {
  border: 0;
  user-select: none;
  -webkit-user-drag: none;
}

.rt-infra-map .leaflet-tile-loaded {
  visibility: inherit;
}

.rt-infra-map .leaflet-pane { z-index: 400; }
.rt-infra-map .leaflet-tile-pane { z-index: 200; }
.rt-infra-map .leaflet-overlay-pane { z-index: 400; }
.rt-infra-map .leaflet-shadow-pane { z-index: 500; }
.rt-infra-map .leaflet-marker-pane { z-index: 600; }
.rt-infra-map .leaflet-tooltip-pane { z-index: 650; }
.rt-infra-map .leaflet-popup-pane { z-index: 700; }

.rt-infra-map .leaflet-top,
.rt-infra-map .leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.rt-infra-map .leaflet-top { top: 0; }
.rt-infra-map .leaflet-right { right: 0; }
.rt-infra-map .leaflet-bottom { bottom: 0; }
.rt-infra-map .leaflet-left { left: 0; }

.rt-infra-map .leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
  float: left;
  clear: both;
  margin: 10px;
}

.rt-infra-map .leaflet-right .leaflet-control { float: right; }

.rt-infra-map .leaflet-control-zoom a {
  display: block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
}

.rt-infra-map .leaflet-control-attribution,
.rt-infra-map .leaflet-control-zoom a {
  background: rgba(16, 23, 42, 0.88);
  color: var(--text-2);
  border-color: var(--border);
}

.rt-infra-map .leaflet-control-attribution a,
.rt-infra-map .leaflet-popup-content a {
  color: var(--accent);
}

.rt-infra-map .leaflet-popup-content-wrapper,
.rt-infra-map .leaflet-popup-tip {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}

.rt-infra-map .leaflet-popup-content {
  margin: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
}

.rt-infra-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 6px;
}

.rt-infra-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: inherit;
}

.rt-infra-item:hover {
  border-color: var(--border-2);
  color: inherit;
  text-decoration: none;
}

.rt-infra-item-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.rt-infra-item-main strong {
  color: var(--text);
  font-size: 13px;
}

.rt-infra-item-main span,
.rt-infra-item-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.rt-infra-item-meta {
  white-space: nowrap;
}

.rt-infra-list-more {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.rt-infra-list-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--panel);
}

@media (max-width: 720px) {
  .rt-infra-map {
    min-height: 360px;
  }

  .rt-infra-list {
    grid-template-columns: 1fr;
  }

  .rt-infra-item {
    grid-template-columns: 1fr;
  }
}
