/* Layout: the 3D map sticks behind the intro and the game; the intro card and the game panels sit over it.
   On phones the map sticks to the top and the cards scroll below it. Later sections are ordinary pages.
   Look: near-black, 1px white hairlines, square corners, monospaced data. Prices run cold (cheap) to hot
   (dear); red is reserved for full lines, lime for what the player builds. */
:root {
  --bg: #050607;
  --bg-raise: #0b0d0f;
  --panel: rgba(5, 6, 7, 0.82);
  --ink: #f4f6f7;
  --ink-mid: #c9cfd3;
  --ink-soft: #8d969c;
  --edge: rgba(255, 255, 255, 0.92);
  --hair: rgba(255, 255, 255, 0.16);
  --congest: #ff3355;
  --build: #c8ff5a;
  --proto: #e0102f;
  --france: #6eaaff;

  --f-body: "Geist", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --banner-h: 0px;
  --map-h: 100svh;
  color-scheme: dark;
}
body.is-proto { --banner-h: 2.25rem; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
strong { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

.label, .kicker {
  display: block;
  margin: 0;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.kicker { font-size: 0.75rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.6rem 0.9rem; border: 1px solid var(--edge); border-radius: 0; cursor: pointer; text-decoration: none;
  min-height: 2.5rem; white-space: nowrap;
}
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--build); border-color: var(--build); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* ---- Prototype banner ---- */
.proto {
  position: sticky; top: 0; z-index: 50;
  height: var(--banner-h);
  display: flex; align-items: center; gap: 1rem; overflow: hidden;
  padding: 0 var(--gutter-r) 0 var(--gutter);
  background: var(--proto); color: #fff;
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.06em; white-space: nowrap;
}
.proto strong { color: #fff; letter-spacing: 0.1em; }
.proto span { overflow: hidden; text-overflow: ellipsis; opacity: 0.9; }
.proto[hidden] { display: none; }

/* ---- Stage: sticky map with the intro and the game over it ---- */
.stage { position: relative; }
.map-wrap {
  position: sticky; top: var(--banner-h); z-index: 0;
  height: calc(var(--map-h) - var(--banner-h));
  overflow: hidden; background: var(--bg);
}
.deck-host { position: absolute; inset: 0; }
.deck-host canvas { outline: none; }
/* The press name of a step just added: HTML over both canvases, so the 3D models never cover it. */
.press-label { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; white-space: pre;
  transform: translate(-50%, -100%); padding: 0.25rem 0.5rem; background: var(--build); color: var(--bg);
  font-family: var(--f-mono); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.04em; }
.deck-tooltip { font-family: var(--f-mono) !important; font-size: 0.75rem !important; line-height: 1.5 !important;
  background: var(--bg) !important; color: var(--ink) !important; border: 1px solid var(--edge); border-radius: 0 !important;
  padding: 0.45rem 0.6rem !important; white-space: pre; }

.stage-content {
  position: relative; z-index: 1;
  margin-top: calc(var(--banner-h) - var(--map-h));
  pointer-events: none;
}
.stage-content > * > * { pointer-events: auto; }

/* Intro */
.intro {
  min-height: calc(100svh - var(--banner-h));
  display: flex; align-items: center;
  padding: 5rem var(--gutter-r) 5rem var(--gutter);
  max-width: 82rem; margin-inline: auto;
}
.intro-card {
  max-width: 34rem;
  background: var(--panel); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--edge);
  padding: 1.6rem 1.7rem 1.7rem;
  display: grid; gap: 1.1rem; justify-items: start;
}
.intro h1 {
  margin: 0; font-weight: 300; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.04;
  letter-spacing: -0.035em; text-wrap: balance;
}
.lede { margin: 0; font-size: 1.125rem; font-weight: 300; color: var(--ink-mid); }

/* Game: panels over the map */
.game {
  scroll-margin-top: var(--banner-h);
  height: calc(100svh - var(--banner-h));
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr) minmax(0, 19rem);
  grid-template-areas: "plan . result";
  gap: 1rem;
  padding: 3.4rem var(--gutter-r) 3.4rem var(--gutter);
}
.panel {
  background: var(--panel); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--edge);
  min-height: 0;
}
.panel-plan { grid-area: plan; display: flex; flex-direction: column; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--hair) transparent; }
.panel-result { grid-area: result; align-self: start; max-height: 100%; overflow: auto; scrollbar-width: thin; padding: 1.1rem 1.2rem 1.2rem; display: grid; gap: 0.6rem; }

.budget { padding: 0.7rem 0.9rem 0.65rem; border-bottom: 1px solid var(--edge); position: sticky; top: 0; z-index: 2; background: var(--bg); }
.budget { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 1rem; }
.budget-total { font-family: var(--f-mono); font-size: 1.35rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.cards { list-style: none; margin: 0; padding: 0; }
.card {
  padding: 0.6rem 0.9rem 0.6rem; border-bottom: 1px solid var(--hair);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 0.8rem;
  transition: background 200ms ease;
  cursor: default;
}
.card:hover, .card.is-focus { background: rgba(255, 255, 255, 0.05); }
.card.is-on { box-shadow: inset 2px 0 0 var(--build); }
.card h3 { margin: 0; font-size: 0.925rem; font-weight: 400; line-height: 1.25; letter-spacing: -0.01em; }
.card .short { grid-column: 1 / -1; margin: 0.1rem 0 0.15rem; font-size: 0.8125rem; color: var(--ink-mid); font-weight: 300; line-height: 1.45; }
.card .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.1rem 0.9rem; font-family: var(--f-mono); font-size: 0.6875rem; color: var(--ink-soft); }
.card .meta b { font-weight: 400; color: var(--ink); }
.stepper { display: inline-grid; grid-template-columns: 2rem auto 2rem; align-items: stretch; border: 1px solid var(--edge); align-self: start; }
.stepper button {
  border: 0; background: transparent; cursor: pointer; border-radius: 0; font-family: var(--f-mono); font-size: 1rem; line-height: 1;
  min-height: 2rem; color: var(--ink);
}
.stepper button:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.stepper button:disabled { color: rgba(255, 255, 255, 0.25); cursor: not-allowed; }
.pips { display: inline-flex; align-items: center; gap: 3px; padding: 0 0.45rem; border-left: 1px solid var(--hair); border-right: 1px solid var(--hair); }
.pips i { width: 8px; height: 8px; border: 1px solid var(--ink-soft); display: block; }
.pips i.on { background: var(--build); border-color: var(--build); }
.card .why { grid-column: 1 / -1; margin: 0.2rem 0 0; font-family: var(--f-mono); font-size: 0.6875rem; color: var(--congest); min-height: 0; }
.card .why:empty { display: none; }

.big { font-family: var(--f-mono); font-size: 2.6rem; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.big small { font-size: 0.875rem; color: var(--ink-soft); margin-left: 0.3rem; letter-spacing: 0; }
.delta { margin: 0; font-family: var(--f-mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; color: var(--ink-mid); }
.delta.is-down { color: var(--build); }
.delta.is-up { color: var(--congest); }
.kv { margin: 0.2rem 0 0.2rem; border-top: 1px solid var(--hair); }
.kv div { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; padding: 0.45rem 0; border-bottom: 1px solid var(--hair); }
.kv dt { font-size: 0.8125rem; color: var(--ink-soft); font-weight: 300; }
.kv dd { margin: 0; font-family: var(--f-mono); font-size: 0.8125rem; text-align: right; font-variant-numeric: tabular-nums; }
.kv dd small { display: block; color: var(--ink-soft); font-size: 0.6875rem; }

/* ---- Sheets after the game ---- */
.sheet { scroll-margin-top: var(--banner-h); position: relative; z-index: 2; background: var(--bg); border-top: 1px solid var(--hair); }
.sheet-inner { max-width: 72rem; margin-inline: auto; padding: 4rem var(--gutter-r) 4rem var(--gutter); }
.sheet h2 { margin: 0.5rem 0 0.6rem; font-weight: 300; font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
.sheet h3 { margin: 3rem 0 0.4rem; font-weight: 400; font-size: 1.15rem; letter-spacing: -0.01em; }
.sheet-lede { margin: 0 0 1.4rem; max-width: 62ch; color: var(--ink-soft); font-weight: 300; }

.result-card { position: relative; margin-top: 1rem; border: 1px solid var(--edge); padding: 1.6rem 1.6rem 1.4rem; max-width: 52rem; }
.result-card h2 { margin: 0 0 1rem; max-width: 26ch; }
.stamp {
  position: absolute; top: -1px; right: -1px; background: var(--proto); color: #fff;
  font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.3rem 0.6rem;
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.2rem; padding: 0; }
.chips li { border: 1px solid var(--hair); padding: 0.2rem 0.55rem; font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-mid); }
.chips li b { color: var(--build); font-weight: 400; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--hair); }
.stats div { padding: 0.8rem 0.9rem 0.2rem; border-left: 1px solid var(--hair); min-width: 0; }
.stats div:first-child { border-left: 0; padding-left: 0; }
.stats dt { font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.stats dd { margin: 0.3rem 0 0; font-family: var(--f-mono); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.stats dd small { display: block; font-size: 0.75rem; color: var(--ink-soft); }
.share { margin-top: 1.6rem; max-width: 52rem; display: grid; gap: 0.6rem; }
.share-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share-note { margin: 0; font-family: var(--f-mono); font-size: 0.75rem; color: var(--build); min-height: 1.2em; }

.table-wrap { overflow-x: auto; border: 1px solid var(--edge); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
th { font-family: var(--f-mono); font-size: 0.6875rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
td .chips { margin: 0; }
td .btn { min-height: 2rem; padding: 0.35rem 0.6rem; font-size: 0.6875rem; }
tr.is-elia td { background: rgba(255, 255, 255, 0.04); }


.how-grid { display: grid; gap: 2.4rem; margin-top: 1.6rem; font-size: 0.9rem; color: var(--ink-mid); font-weight: 300; }
.how-grid section { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 0.6rem 2.5rem; border-top: 1px solid var(--hair); padding-top: 1rem; }
.how-grid h3 { margin: 0; font-family: var(--f-mono); font-weight: 400; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
.how-grid p { margin: 0 0 0.8rem; max-width: 70ch; }
.how-grid ul { margin: 0 0 0.8rem; padding-left: 1.1rem; max-width: 70ch; }
.how-grid li { margin-bottom: 0.3rem; }
.how-grid table { font-size: 0.8125rem; }
.how-grid .table-wrap { margin-bottom: 0.8rem; }
.src { font-size: 0.75rem; color: var(--ink-soft); }
.warn { color: var(--congest); }


/* ---- Phones and narrow screens: map on top, one column below ---- */
@media (max-width: 860px) {
  :root { --map-h: 46svh; }
  .map-wrap { z-index: 5; border-bottom: 1px solid var(--edge); }
  .game { scroll-margin-top: var(--map-h); }
  .stage-content { margin-top: 0; pointer-events: auto; }
  .intro { min-height: 0; padding: 1.5rem var(--gutter-r) 2rem var(--gutter); }
  .intro-card { max-width: none; border: 0; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .game { height: auto; display: block; padding: 0; }
  .panel { border: 0; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .panel-plan { overflow: visible; border-top: 1px solid var(--hair); }
  .budget { top: calc(var(--map-h)); padding-inline: var(--gutter) var(--gutter-r); }
  .card { padding-inline: var(--gutter) var(--gutter-r); }
  .panel-result { padding: 1.4rem var(--gutter-r) 2rem var(--gutter); border-top: 1px solid var(--edge); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats dd { font-size: 1.1rem; }
  .stats div:nth-child(3) { border-left: 0; padding-left: 0; }
  .result-card { padding: 1.2rem; }
  .how-grid section { grid-template-columns: minmax(0, 1fr); }
  .best-table thead { display: none; }
  .best-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 0.8rem; padding: 0.9rem; border-bottom: 1px solid var(--hair); }
  .best-table tr:last-child { border-bottom: 0; }
  .best-table td { display: block; border: 0; padding: 0; }
  .best-table td::before { content: attr(data-label); display: block; font-family: var(--f-mono); font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.15rem; }
  .best-table .cell-budget { grid-column: 1 / -1; font-size: 1.1rem; }
  .best-table .cell-budget::before, .best-table .cell-act::before { display: none; }
  .best-table .cell-plan { grid-column: 1 / -1; }
  .best-table .cell-act { grid-column: 1 / -1; }
  .sheet-inner { padding-block: 3rem; }
}

/* What the model finds: plain-words summary above the best-plans table */

/* Upgrade groups: one folding block per category */
:root { --budget-h: 6.5rem; --cat-h: 2.6rem; }
.cat { border-bottom: 1px solid var(--edge); }
.cat:last-of-type { border-bottom: 0; }
.cat summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1rem; height: var(--cat-h); font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  box-sizing: border-box;
  background: #101213; border-bottom: 1px solid var(--hair);
  position: sticky; top: var(--budget-h); z-index: 1;
}
/* Anything scrolled or focused into view lands below the sticky budget bar and group header. */
.cat summary { scroll-margin-top: var(--budget-h); }
.card { scroll-margin-top: calc(var(--budget-h) + var(--cat-h)); }
.cat summary::-webkit-details-marker { display: none; }
.cat summary::before { content: "+"; width: 1ch; color: var(--ink-soft); margin-right: -0.4rem; }
.cat[open] summary::before { content: "−"; }
.cat summary:hover { background: #1a1d1f; }
.cat-name { flex: 1; color: var(--ink); }
.cat-info { color: var(--ink-soft); letter-spacing: 0.02em; text-transform: none; font-variant-numeric: tabular-nums; }
.cat.has-on .cat-info { color: var(--build); }
.cat:not([open]) summary { border-bottom: 0; }


@media (max-width: 860px) {
  .cat summary { padding-inline: var(--gutter) var(--gutter-r); top: calc(var(--map-h) + var(--budget-h)); scroll-margin-top: calc(var(--map-h) + var(--budget-h)); }
  .card { scroll-margin-top: calc(var(--map-h) + var(--budget-h) + var(--cat-h)); }
  .budget { padding-block: 0.6rem 0.55rem; }
  .panel-result { max-height: none; overflow: visible; }
}

/* Pinned price panel (replaces the price columns): four prices and the change under the player's plan */
.price-panel {
  /* Centred in the gap between the plan panel (21rem) and the result panel (19rem). */
  position: absolute; z-index: 2; bottom: 2.75rem; left: calc(var(--gutter) + 22rem); right: calc(var(--gutter-r) + 20rem);
  width: max-content; max-width: calc(100% - var(--gutter) - var(--gutter-r) - 42rem); margin-inline: auto; overflow: hidden;
  display: flex; align-items: stretch; white-space: nowrap;
  background: rgba(5, 6, 7, 0.9); border: 1px solid var(--hair);
  font-family: var(--f-mono); font-variant-numeric: tabular-nums; pointer-events: none;
}
.pp-cap { margin: 0; padding: 0.45rem 0.7rem; align-self: center; font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.pp-cell { display: flex; align-items: baseline; gap: 0.4rem; padding: 0.45rem 0.7rem; border-left: 1px solid var(--hair); }
.pp-z { font-size: 0.625rem; letter-spacing: 0.08em; color: var(--ink-soft); }
.pp-v { font-size: 0.875rem; color: var(--ink-mid); }
.pp-cell.is-be .pp-v { color: var(--ink); }
.pp-d { font-size: 0.6875rem; color: var(--ink-soft); min-width: 2.2rem; }
.pp-d:empty { display: none; }
.pp-d.is-down { color: var(--build); }
.pp-d.is-up { color: var(--congest); }
/* Narrow desktops: the side panels leave no room in the middle, so the prices go along the bottom. */
@media (min-width: 861px) and (max-width: 1359px) {
  .price-panel { left: 0; right: 0; bottom: 0; width: auto; max-width: none; justify-content: center; border-width: 1px 0 0; }
}

/* Policy status on each card, and the plan's status and earliest year in the result */
.card .status { grid-column: 1 / -1; margin: 0.15rem 0 0.1rem; display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--f-mono); font-size: 0.625rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.chips li small { color: var(--ink-soft); font-size: 0.6875rem; }

@media (max-width: 860px) {
  .price-panel { left: 0; right: 0; bottom: 0; width: auto; max-width: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-width: 1px 0 0; }
  .pp-cap { display: none; }
  .pp-cell { display: grid; gap: 0; padding: 0.3rem 0.5rem 0.35rem; }
  .pp-cell:nth-child(2) { border-left: 0; padding-left: var(--gutter); }
}

/* The 3D models' canvas sits over the deck.gl map; clicks go through to the map. */
.models-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* Compact cards: one line of status, year and cost; the description opens when the card's name is clicked. */
.card .more { grid-column: 1 / -1; display: none; }
.card.is-open .more { display: block; }
.card h3 { cursor: pointer; }
.card h3::after { content: " ▸"; color: var(--ink-soft); font-size: 0.7rem; }
.card.is-open h3::after { content: " ▾"; }
.card .more .short { margin: 0.35rem 0 0.15rem; }
.card .more .meta { display: block; }
.card .status .cost { margin-left: auto; color: var(--ink); text-transform: none; letter-spacing: 0; }

/* "How we know" folds away: it is there to check, not to read through. */
.how summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 0.8rem; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: "+"; font-family: var(--f-mono); color: var(--ink-soft); }
.how details[open] summary::after { content: "−"; }
.how summary h2 { margin: 0; }
/* An option the model is re-running: shown, but it can't be picked until its numbers are back. */
.card.is-pending h3, .card.is-pending .status { opacity: 0.55; }
.card .pending { grid-column: 1 / -1; margin: 0.2rem 0 0; font-size: 0.75rem; color: var(--ink-soft); }
/* Who pays: one colour per payer, the same in the bar and the key. */
.pay-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 5px; margin: 0.3rem 0 0.1rem; border-radius: 3px; overflow: hidden; }
.pay-bar[hidden], .pay-key[hidden] { display: none; }
.pay-bar i { display: block; min-width: 3px; height: 100%; }
[data-payer] { background: var(--ink-soft); }
[data-payer="elia"] { background: #3ad6c4; }
[data-payer="foreign_tso"] { background: var(--france); }
[data-payer="private"] { background: #f0b44c; }
[data-payer="state"] { background: #b48cff; }
[data-payer="consumers_levy"] { background: #ff8fb3; }
[data-payer="eu"] { background: #ffe066; }
[data-payer="unknown"] { background: transparent; box-shadow: inset 0 0 0 1px var(--hair); }
.pay-key { margin: 0.5rem 0 0.2rem; display: grid; gap: 0.3rem; font-size: 0.75rem; }
.pay-head { color: var(--ink-soft); font-family: var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; }
.pay-row { display: grid; grid-template-columns: 0.6rem 1fr auto; column-gap: 0.45rem; align-items: center; }
.pay-row > i { width: 0.6rem; height: 0.6rem; border-radius: 2px; }
.pay-eur { color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.pay-note { grid-column: 2 / -1; color: var(--ink-soft); }
.pay-foot { margin: 0.1rem 0 0; color: var(--ink-soft); font-size: 0.7rem; }
/* The plan's total by payer, under "Your plan costs". */
.budget .pay-total { grid-column: 1 / -1; margin-top: 0.45rem; }
.pay-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.15rem 0.7rem; margin-top: 0.35rem; font-size: 0.7rem; color: var(--ink-mid); }
.pay-legend[hidden] { display: none; }
.pay-item { display: inline-flex; align-items: center; gap: 0.3rem; font-variant-numeric: tabular-nums; }
.pay-item > i { width: 0.55rem; height: 0.55rem; border-radius: 2px; }
.card .more .pay-bar { margin-top: 0.5rem; }
/* With cheap / expensive gas: the plan's change in both cases, under the main numbers. */
.fuel-band { margin: 0.2rem 0 0.6rem; font-size: 0.75rem; color: var(--ink-soft); }
/* Labels over built upgrades: above the 3D models, below the press label. */
.build-labels { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.build-label { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); white-space: pre;
  padding: 2px 5px; background: rgba(5, 6, 7, 0.88); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.8);
  font-family: var(--f-mono); font-size: 10.5px; line-height: 1.2; }
.build-label.is-on { border-color: var(--build); }
.build-label[hidden] { display: none; }
@media (max-width: 860px) { .build-label { font-size: 8.5px; } }
