/* ===========================================================================
   Plug or Pump — design system
   =========================================================================== */

:root {
  /* palette — dark default */
  --bg:        #07090f;
  --bg-grad-1: #0a0e1c;
  --bg-grad-2: #0e1424;
  --panel:     #10172a;
  --panel-2:   #161e36;
  --panel-3:   #1c2746;
  --border:    #232d4d;
  --border-2:  #2c3766;
  --text:      #eef1fa;
  --text-2:    #c2cae0;
  --muted:     #7c869f;
  --accent:    #38bdf8;
  --accent-2:  #818cf8;
  --fuel:      #f97316;
  --fuel-2:    #fb923c;
  --ev:        #34d399;
  --ev-2:      #6ee7b7;
  --ratio:     #a78bfa;
  --warn:      #fbbf24;
  --danger:    #f43f5e;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 18px;

  --shadow-1: 0 1px 2px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.02);
  --shadow-2: 0 8px 24px -8px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
  --shadow-glow-ev:   0 0 32px -8px rgba(52, 211, 153, 0.45);
  --shadow-glow-fuel: 0 0 32px -8px rgba(249, 115, 22, 0.35);

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #f7f8fc;
    --bg-grad-1: #f1f3fa;
    --bg-grad-2: #e9edf7;
    --panel:     #ffffff;
    --panel-2:   #f4f6fc;
    --panel-3:   #eaeefa;
    --border:    #dfe4f0;
    --border-2:  #c6cee0;
    --text:      #0d1426;
    --text-2:    #2a3552;
    --muted:     #5a6483;
    --accent:    #0284c7;
    --accent-2:  #4f46e5;
    --fuel:      #c2410c;
    --fuel-2:    #ea580c;
    --ev:        #059669;
    --ev-2:      #10b981;
    --ratio:     #7c3aed;
    --warn:      #b45309;
    --shadow-1: 0 1px 2px rgba(15, 25, 50, 0.06), 0 0 0 1px rgba(15, 25, 50, 0.04);
    --shadow-2: 0 12px 32px -12px rgba(15, 25, 50, 0.12), 0 0 0 1px rgba(15, 25, 50, 0.05);
  }
}

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

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

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

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(56, 189, 248, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(167, 139, 250, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2) 600px, var(--bg) 1200px);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color 150ms; }
a:hover { color: var(--ev-2); text-decoration: underline; text-underline-offset: 2px; }

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

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

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

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px 32px;
}
@media (max-width: 600px) {
  .hero { padding: 40px 14px 20px; }
  .hero h1 { margin-bottom: 12px; }
  .tagline { font-size: 14px; }
  .tagline-sub { font-size: 12.5px; }
}
.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--ev);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--ev);
  animation: pulse 2.4s var(--ease-in-out) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  /* Inter descenders (e.g. "g" in Plug) need room; 1.05 + background-clip:text clipped the tail. */
  line-height: 1.16;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 16px;
  background: linear-gradient(180deg, var(--text) 60%, var(--text-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subheading {
  color: var(--ratio);
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 500;
  font-style: italic;
  margin: 0 0 20px;
  max-width: 780px;
  line-height: 1.45;
}
.tagline    { color: var(--text-2); margin: 0 0 8px;  max-width: 780px; font-size: 15px; }
.tagline-sub{ color: var(--muted);  margin: 0;        max-width: 780px; font-size: 13px; }

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

.comparison-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: visible;
}
@media (max-width: 600px) {
  .comparison-card { padding: 20px 18px; border-radius: 14px; }
}
.comparison-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 70% -20%, rgba(52, 211, 153, 0.10), transparent 60%);
  pointer-events: none;
}
.comparison-card > * { position: relative; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.card-header h2 {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.01em;
  text-wrap: balance;
  flex: 1 1 240px;
  min-width: 0;
}
.card-header h2 strong { color: var(--text); font-weight: 700; }
@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: var(--panel-3);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: all 180ms var(--ease-out);
}
.share-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.06);
  transform: translateY(-1px);
}
.share-btn:active { transform: translateY(0); }
.share-btn svg { width: 14px; height: 14px; }
.share-btn.copied { color: var(--ev); border-color: var(--ev); background: rgba(52, 211, 153, 0.08); }

.share-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 220px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
/* 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: 9px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  transition: background 120ms var(--ease-out);
}
.share-menu-item:hover {
  background: var(--panel-3);
}
.share-menu-item:active {
  background: rgba(56, 189, 248, 0.08);
}

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

.share-menu-hint {
  margin: 4px 8px 10px;
  padding: 0;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 400;
  color: var(--muted);
}

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

/* race bars */

.race {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 8px 0 28px;
}

.race-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: center;
}
@media (max-width: 720px) {
  .race-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.race-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.race-name {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.race-icon {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--panel-3);
  border: 1px solid var(--border-2);
  font-size: 16px;
}
.fuel-row .race-icon { color: var(--fuel); }
.ev-row   .race-icon { color: var(--ev); }
.race-detail {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 42px;
  letter-spacing: -0.01em;
  line-height: 1.4;
  text-wrap: balance;
}
@media (max-width: 720px) {
  .race-detail { margin-left: 0; font-size: 12.5px; }
}

.race-track {
  position: relative;
  height: 56px;
  background: var(--panel-3);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.race-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  border-radius: 12px 0 0 12px;
  transition: width 700ms var(--ease-out);
}
.fuel-row .race-bar {
  background: linear-gradient(90deg, rgba(249,115,22,0.85), var(--fuel-2));
  box-shadow: var(--shadow-glow-fuel);
}
.ev-row .race-bar {
  background: linear-gradient(90deg, rgba(52,211,153,0.85), var(--ev-2));
  box-shadow: var(--shadow-glow-ev);
}

/* Value label rides the END of the bar (not the end of the track), so the
   number stays glued to the visual data point. JS sets `left` to match the
   bar's width %, and toggles `is-outside` when the bar is too narrow to fit
   the label inside.                                                          */
.race-value {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-100%, -50%);
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0a0e1c;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: left 700ms var(--ease-out), transform 200ms, color 200ms;
  z-index: 2;
  pointer-events: none;
}
.race-track.is-outside .race-value {
  transform: translate(0, -50%);
  color: var(--text);
}
.race-value .unit {
  font-size: 13px;
  color: rgba(10, 14, 28, 0.55);
  margin-left: 4px;
  font-weight: 500;
}
.race-track.is-outside .race-value .unit { color: var(--muted); }

/* ratio callout */

.ratio-callout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0 20px;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  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-size: clamp(56px, 14vw, 80px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ratio);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px rgba(167, 139, 250, 0.35);
}
.ratio-number .ratio-mult {
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: 0.55em;
  font-weight: 600;
  line-height: 1;
}
.ratio-label {
  font-size: 16px;
  line-height: 1.25;
  color: var(--text-2);
  font-weight: 500;
  max-width: 16ch;
  text-wrap: balance;
  text-align: left;
}
@media (max-width: 600px) {
  .ratio-callout {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 0;
  }
  .ratio-label { font-size: 15px; max-width: none; text-align: center; }
}

/* cost row */

.cost-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
@media (max-width: 720px) {
  .cost-row { grid-template-columns: 1fr; gap: 4px; }
}
.cost-cell {
  padding: 14px 18px;
  border-right: 1px solid var(--border);
}
.cost-cell:last-child { border-right: none; }
@media (max-width: 720px) { .cost-cell { border-right: none; border-bottom: 1px solid var(--border); } }
.cost-cell.highlight { background: rgba(52, 211, 153, 0.04); border-radius: 0 0 var(--radius) var(--radius); }
.cost-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.cost-value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cost-cell.highlight .cost-value { color: var(--ev); }

.cost-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.cost-cell.highlight .cost-sub { color: var(--ev-2); opacity: 0.85; }

/* Second-tier annual block: same grid, lower visual weight than the headline
   $/100km row above, so the page still leads with cost-per-km. */
.cost-row.annual-row {
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.015);
  border-radius: 0 0 var(--radius) var(--radius);
}
.cost-row.annual-row .cost-value {
  font-size: 20px;
  color: var(--text-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: 18px; }
}

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

.elitre-callout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), rgba(56, 189, 248, 0.04));
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
}
.callout-icon {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ratio);
  color: #1a1230;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 18px;
  font-family: var(--mono);
}
.callout-body {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
}
.callout-body strong { color: var(--text); }
.callout-body .compare-num {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ev);
  font-variant-numeric: tabular-nums;
}

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

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 860px) { .controls { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-1);
}
@media (max-width: 600px) {
  .panel { padding: 18px 16px; }
  .scenarios, .methodology { padding: 20px 16px; }
  .elitre-callout { padding: 16px 18px; gap: 12px; }
  .cost-cell { padding: 12px 16px; }
  .cost-value { font-size: 22px; }
}
.panel h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.panel h2::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
}
.panel:nth-of-type(1) h2::before { background: var(--fuel); }
.panel:nth-of-type(2) h2::before { background: var(--ev); }
.panel-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
}
.panel h3 {
  margin: 22px 0 10px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

label {
  display: block;
  margin-bottom: 16px;
}
label > span {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
label .hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  margin-top: 6px;
  line-height: 1.4;
  font-weight: 400;
}
label > span .hint {
  display: inline;
  margin: 0;
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}

input[type="number"], select {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms, background 150ms;
}
input[type="number"]:hover, select:hover { border-color: var(--border-2); }
input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel-3);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* slider */
input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 24px;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--panel-3);
  border-radius: 999px;
}
input[type="range"]::-moz-range-track {
  height: 6px;
  background: var(--panel-3);
  border-radius: 999px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: -6px;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18), var(--shadow-1);
  transition: transform 150ms;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

/* preset pills */

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
}
.preset-row button {
  background: var(--panel-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  transition: all 150ms var(--ease-out);
}
.preset-row button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(56, 189, 248, 0.06);
  transform: translateY(-1px);
}
.preset-row button.active {
  background: var(--accent);
  color: #051022;
  border-color: var(--accent);
  font-weight: 700;
}

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

.scenarios {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-1);
}
.scenarios h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.scenarios-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px;
}

.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: 28px;
  background: var(--panel-2);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.scenario-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(52,211,153,0.7), var(--ev-2));
  border-radius: 8px 0 0 8px;
  transition: width 600ms var(--ease-out);
}
.scenario-row.featured .scenario-bar {
  background: linear-gradient(90deg, rgba(167,139,250,0.7), var(--ratio));
  box-shadow: 0 0 16px -4px rgba(167, 139, 250, 0.4);
}
.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);
}

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

.methodology {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-1);
}
.methodology h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
details {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
details:first-of-type { border-top: none; padding-top: 0; }
details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 0;
  font-size: 15px;
  color: var(--text);
  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: var(--panel-3);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  text-align: center;
  line-height: 16px;
  font-weight: 600;
  color: var(--accent);
  transition: transform 200ms;
}
details[open] summary::before { content: "−"; transform: rotate(180deg); }
details p, details ul, details li { color: var(--text-2); font-size: 14px; }
details ul { padding-left: 20px; }
details li { margin: 4px 0; }

table.src-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 13px;
}
table.src-table th, table.src-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.src-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
table.src-table td:nth-child(2) {
  font-family: var(--mono);
  color: var(--ev);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

footer {
  text-align: center;
  padding: 32px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.muted { color: var(--muted); font-size: 13px; }

/* counter flash effect on change */
.counter-changed {
  animation: flash 600ms var(--ease-out);
}
@keyframes flash {
  0%   { color: var(--accent); transform: scale(1.04); }
  100% { color: inherit;       transform: scale(1); }
}

/* ---------------------------------------------------------------------------
   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 220ms var(--ease-out, ease-out);
  background: rgba(10, 14, 28, 0.88);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  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: 1100px;
  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-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.sticky-value {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.sticky-unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}
.sticky-fuel  .sticky-value > span:first-child { color: var(--fuel-2); }
.sticky-ev    .sticky-value > span:first-child { color: var(--ev-2); }
.sticky-ratio .sticky-value > span:first-child { color: var(--accent); }

@media (prefers-color-scheme: light) {
  .sticky-totals {
    background: rgba(247, 248, 252, 0.92);
    box-shadow: 0 6px 24px rgba(40, 50, 90, 0.12);
  }
}

@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: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-1);
}
.page-nav-link {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: color 150ms, background 150ms;
}
.page-nav-link:hover {
  color: var(--accent);
  text-decoration: none;
}
.page-nav-link.is-active {
  background: var(--accent);
  color: #051022;
}
.page-nav-link.is-active:hover { color: #051022; }
@media (max-width: 600px) {
  .page-nav { margin-bottom: 18px; }
  .page-nav-link { font-size: 12px; padding: 5px 12px; }
}

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

.battery-headline-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
@media (max-width: 720px) {
  .battery-headline-row { grid-template-columns: 1fr; gap: 4px; }
}
.battery-headline-cell {
  padding: 18px 22px;
  border-right: 1px solid var(--border);
}
.battery-headline-cell:last-child { border-right: none; }
@media (max-width: 720px) {
  .battery-headline-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .battery-headline-cell:last-child { border-bottom: none; }
}
.battery-cell-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.battery-cell-value {
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.battery-cell-unit {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
  letter-spacing: 0;
}
.battery-cell-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.battery-cell-nmc   .battery-cell-value { color: var(--fuel-2); }
.battery-cell-lfp   .battery-cell-value { color: var(--ev-2); }
.battery-cell-delta .battery-cell-value { color: var(--ratio); }

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

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

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

/* SVG class hooks live on the SVG primitives we generate in battery.js. */
.bc-grid {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  opacity: 0.6;
}
.bc-grid-vert { opacity: 0.35; }
.bc-axis-line {
  stroke: var(--border-2);
  stroke-width: 1.2;
}
.bc-axis {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--muted);
}
.bc-axis-title {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  fill: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bc-curve {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.3));
}
.bc-nmc { stroke: var(--fuel-2); }
.bc-lfp { stroke: var(--ev-2); }
.bc-dot {
  filter: drop-shadow(0 0 6px currentColor);
}
.bc-nmc-dot { fill: var(--fuel-2); }
.bc-lfp-dot { fill: var(--ev-2); }
.bc-eol {
  stroke: var(--ratio);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  opacity: 0.7;
}
.bc-eol-label {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--ratio);
  font-weight: 600;
}

.battery-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12px;
  color: var(--text-2);
  margin: 4px 0 22px;
  padding: 0 4px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}
.legend-nmc .legend-swatch { background: var(--fuel-2); box-shadow: 0 0 8px var(--fuel); }
.legend-lfp .legend-swatch { background: var(--ev-2);   box-shadow: 0 0 8px var(--ev); }
.legend-eol .legend-swatch {
  background: transparent;
  border-top: 2px dashed var(--ratio);
  height: 0;
  width: 18px;
}

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

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

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

.lifecycle-headline .card-header h2 {
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
}

.lifecycle-embodied-block {
  padding: 8px 4px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.lifecycle-embodied-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 640px) {
  .lifecycle-embodied-cols { grid-template-columns: 1fr; }
}
.lifecycle-embodied-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.lifecycle-bar-track {
  height: 10px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.lifecycle-bar {
  height: 100%;
  border-radius: 6px;
  min-width: 4px;
  transition: width 180ms ease-out;
}
.lifecycle-bar-ev { background: linear-gradient(90deg, var(--ev-2), var(--ev)); }
.lifecycle-bar-ice { background: linear-gradient(90deg, var(--fuel-2), var(--fuel)); }
.lifecycle-embodied-val {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  margin-top: 8px;
  color: var(--text);
}
.lifecycle-embodied-note {
  font-size: 12px;
  margin: 12px 0 0;
}

.lifecycle-lifetime-row {
  padding: 16px 22px 20px;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.5;
}
.lifecycle-ton-ice { color: var(--fuel-2); }
.lifecycle-ton-ev { color: var(--ev-2); }

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

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

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

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

.lc-grid {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  opacity: 0.6;
}
.lc-grid-vert { opacity: 0.35; }
.lc-axis-line {
  stroke: var(--border-2);
  stroke-width: 1.2;
}
.lc-axis {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--muted);
}
.lc-axis-title {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  fill: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lc-curve {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.3));
}
.lc-ice { stroke: var(--fuel-2); }
.lc-ev { stroke: var(--ev-2); }
.lc-cross {
  stroke: var(--ratio);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  opacity: 0.85;
}
.lc-cross-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--ratio);
  font-weight: 600;
}

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

.efficiency-headline .card-header h2 {
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
}
.efficiency-headline .card-header {
  margin-bottom: 16px;
}
.efficiency-headline .efficiency-headline-note {
  margin: 0 0 24px;
}
.efficiency-headline-note {
  font-size: 13px;
  line-height: 1.45;
  max-width: 72ch;
}

.eff-chart-tooltip {
  pointer-events: none;
  box-sizing: border-box;
  max-width: min(22rem, calc(100vw - 24px));
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}

#efficiencyChart .eff-chart-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  fill: var(--text-2);
}
#efficiencyChart .eff-chart-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  fill: var(--muted);
}
#efficiencyChart .eff-bar-ticks {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--muted);
}
#efficiencyChart .eff-axis-line {
  stroke: var(--border-2);
  stroke-width: 1;
}

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

#efficiencyChart .eff-seg-heat {
  fill: #9a3412;
}
#efficiencyChart .eff-seg-dt {
  fill: var(--fuel-2);
}
#efficiencyChart .eff-seg-br {
  fill: var(--fuel);
  opacity: 0.92;
}
#efficiencyChart .eff-seg-pk {
  fill: #047857;
}
#efficiencyChart .eff-seg-mot {
  fill: var(--ev-2);
}
#efficiencyChart .eff-seg-fb {
  fill: #14b8a6;
  opacity: 0.85;
}
#efficiencyChart .eff-seg-use {
  fill: var(--accent);
}

.efficiency-chart-legend .eff-swatch-dt {
  background: var(--fuel-2);
  box-shadow: 0 0 8px var(--fuel);
}
.efficiency-chart-legend .eff-swatch-br {
  background: var(--fuel);
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.45);
}
.efficiency-chart-legend .eff-swatch-pk {
  background: #047857;
  box-shadow: 0 0 6px rgba(4, 120, 87, 0.35);
}
.efficiency-chart-legend .eff-swatch-fb {
  background: #14b8a6;
}
.efficiency-chart-legend .eff-swatch-use {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

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

@media (prefers-color-scheme: light) {
  #efficiencyChart .eff-seg-heat {
    fill: #c2410c;
  }
  #efficiencyChart .eff-seg-pk {
    fill: #059669;
  }
}

