:root {
  --bg: #f6f8fa; --surface: #ffffff; --ink: #1d2125; --muted: #5e6770; --grid: #e3e7eb;
  --line: #c9ced3; --up: #1a7f37; --down: #c62828; --flat: #5e6770;
  /* Okabe-Ito, colourblind-safe: BEV blue, PHEV purple, petrol orange, diesel grey */
  --BEV: #0072B2; --PHEV: #CC79A7; --petrol: #E69F00; --diesel: #6b6b6b; --other: #D55E00; --fan: rgba(0,114,178,.18);
  --fleetshare: #0072B2; --salesshare: #009E73; --tax-reg: #D55E00; --tax-run: #009E73;
  --band1: #063f63; --band2: #0b6b8a; --band-ink: #ffffff; --band-muted: #cfe6f2;
  --hero1: #eaf4fb; --hero2: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111417; --surface: #1b1f23; --ink: #eceef0; --muted: #a4adb6; --grid: #2c3237;
    --line: #48515a; --up: #4cc26b; --down: #ff6b6b; --flat: #a4adb6;
    --BEV: #56B4E9; --PHEV: #E3A0C8; --petrol: #F0B33A; --diesel: #9a9a9a; --other: #F07F3C; --fan: rgba(86,180,233,.22);
    --fleetshare: #56B4E9; --salesshare: #3cc79c; --tax-reg: #F07F3C; --tax-run: #3cc79c;
    --band1: #082a40; --band2: #0b4a60; --band-ink: #f2f7fa; --band-muted: #a9cde0;
    --hero1: #16293a; --hero2: #1b1f23;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* header band */
.band { background: linear-gradient(120deg, var(--band1), var(--band2)); color: var(--band-ink); }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  max-width: 1080px; margin: 0 auto; padding: 1.4rem 1rem 3.2rem; }
.kicker { margin: 0; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--band-muted); font-weight: 600; }
h1 { font-size: 1.8rem; margin: .1rem 0 0; letter-spacing: -.01em; }
.band .sub { color: var(--band-muted); margin: .25rem 0 0; }
.band strong { color: var(--band-ink); }
button#lang { border: 1px solid rgba(255,255,255,.45); background: transparent; color: var(--band-ink);
  border-radius: 999px; padding: .35rem .9rem; cursor: pointer; font: inherit; font-size: .9rem; }
button#lang:hover { background: rgba(255,255,255,.12); }

/* vehicle-class tabs */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.tabs a { color: var(--band-ink); text-decoration: none; font-size: .92rem; font-weight: 600; padding: .35rem .9rem;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.35); }
.tabs a:hover { background: rgba(255,255,255,.12); }
.tabs a[aria-current="page"] { background: var(--band-ink); color: var(--band1); border-color: var(--band-ink); }
.tabs a:focus-visible { outline: 2px solid var(--band-ink); outline-offset: 2px; }
.loaderr { color: var(--down); }
main.is-loading > section { display: none; }

h2 { font-size: 1.1rem; margin: 0 0 .25rem; }
section > h2::before, .card > h2::before { content: ""; display: inline-block; width: .35rem; height: 1rem;
  background: var(--BEV); border-radius: 2px; margin-right: .5rem; vertical-align: -2px; }
.muted { color: var(--muted); margin: .2rem 0; font-size: .9rem; }
main { max-width: 1080px; margin: -2.2rem auto 0; padding: 0 1rem 3rem; display: grid; gap: 1rem; }
a { color: var(--BEV); }

/* cards */
.hero, .card, .kpi, .tile { background: var(--surface); border: 1px solid var(--grid); border-radius: 12px; padding: 1rem 1.1rem; }
.hero, .card { box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(6,63,99,.06); }

/* hero */
.hero { background: linear-gradient(160deg, var(--hero1), var(--hero2) 70%); padding: 1.2rem 1.3rem 1.1rem; }
.hero-row { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: flex-end; }
.label { font-size: .9rem; color: var(--muted); margin: 0; }
.hero-num { font-size: 3.4rem; font-weight: 750; margin: 0; line-height: 1.05; font-variant-numeric: tabular-nums;
  letter-spacing: -.03em; color: var(--BEV); }
.delta-line { margin: .3rem 0 0; }
.hero-goal { text-align: right; }
.goal-date { font-size: 1.6rem; font-weight: 700; margin: 0; }
.goal-date .prev-fc { font-size: .95rem; font-weight: 600; white-space: normal; }
.progress { margin-top: 1rem; }
.bar { height: .7rem; background: var(--grid); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--salesshare), var(--BEV)); transition: width .8s ease; }
.progress-labels { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-top: .3rem; font-variant-numeric: tabular-nums; }

/* key figures */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
@media (max-width: 820px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { border-top: 3px solid var(--c, var(--BEV)); }
.kpi .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: .1rem 0 0; }
.kpi svg.spark { display: block; width: 100%; height: 34px; margin: .35rem 0 .1rem; }

/* milestones */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin-top: .5rem; }
.tile { border-left: 4px solid var(--c, var(--BEV)); }
.tile .v { font-size: 1.3rem; font-weight: 700; margin: .15rem 0; }

.delta { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); } .delta.flat { color: var(--flat); }

/* charts */
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .5rem 0; font-size: .9rem; }
.legend span::before { content: ""; display: inline-block; width: .8rem; height: .8rem; border-radius: 3px;
  margin-right: .35rem; vertical-align: -1px; background: var(--c); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 12px; }
.chart .grid line { stroke: var(--grid); }
.chart .axis line, .chart .axis path { stroke: var(--line); }
.tip { position: fixed; pointer-events: none; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; font-size: .85rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.12); z-index: 10; font-variant-numeric: tabular-nums; }
.tip .sw { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: .35rem; }

/* fiscal */
.ftiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: .75rem 0 .25rem; }
@media (max-width: 820px) { .ftiles { grid-template-columns: repeat(2, 1fr); } }
.ftile { border: 1px solid var(--grid); border-radius: 10px; padding: .7rem .8rem; }
.ftile.scn { border-style: dashed; }
.ftile .v { font-size: 1.3rem; font-weight: 700; margin: .1rem 0; font-variant-numeric: tabular-nums; }
.params summary { margin-top: .75rem; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem 1rem; margin-top: .6rem; }
.pgrid label { display: grid; gap: .15rem; font-size: .88rem; color: var(--muted); }
.pgrid input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: .3rem .45rem; width: 100%; font-variant-numeric: tabular-nums; }
.pgrid input:focus { outline: 2px solid var(--BEV); outline-offset: 1px; }
#freset, #vreset { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; padding: .3rem .8rem; cursor: pointer; }

table { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; margin-top: .5rem; }
th, td { text-align: right; padding: .25rem .5rem; border-bottom: 1px solid var(--grid); }
th:first-child, td:first-child { text-align: left; }
summary { cursor: pointer; font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 680px) { .hero-num { font-size: 2.6rem; } .hero-goal { text-align: left; } h1 { font-size: 1.45rem; } }

/* footer */
.foot { max-width: 1080px; margin: 0 auto; padding: .5rem 1rem 2.5rem; color: var(--muted); font-size: .88rem; text-align: center; }
.foot p { margin: .2rem 0; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--BEV); }
.beta { display: inline-block; vertical-align: middle; font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: .15rem .55rem; border-radius: 999px; margin-left: .4rem;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.5); color: var(--band-ink); }
