:root {
  --paper: #f3f0e8;
  --paper-deep: #e8e2d5;
  --surface: #fbfaf6;
  --ink: #18201c;
  --muted: #68706a;
  --faint: #969b94;
  --line: rgba(24, 32, 28, 0.14);
  --green: #176b52;
  --green-bright: #2f9e71;
  --thermal: #a34a35;
  --night: #17201c;
  --shadow-card: 0 0 0 1px rgba(24, 32, 28, 0.07), 0 1px 2px -1px rgba(24, 32, 28, 0.08), 0 18px 50px -36px rgba(24, 32, 28, 0.34);
  --shadow-hover: 0 0 0 1px rgba(24, 32, 28, 0.11), 0 2px 4px -1px rgba(24, 32, 28, 0.1), 0 22px 56px -34px rgba(24, 32, 28, 0.4);
  --fuel-gas: #9d513d;
  --fuel-solar: #e5a72e;
  --fuel-battery: #6b57b4;
  --fuel-hydro: #3d82a5;
  --fuel-wind: #55a27f;
  --fuel-geo: #bb6c3e;
  --fuel-nuclear: #315e58;
  --fuel-bio: #758b45;
  --fuel-petroleum: #6e625b;
  --fuel-coal: #343936;
  --fuel-other: #9b9a8f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Manrope", sans-serif; font-size: 14px; line-height: 1.55; }
body.is-playing { cursor: default; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
.shell { width: min(1320px, calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-150%); background: var(--ink); color: white; padding: 10px 14px; border-radius: 8px; transition-property: transform; transition-duration: 150ms; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(243, 240, 232, 0.88); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(24, 32, 28, 0.08); }
.header-inner { height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand-lockup { display: flex; align-items: center; min-width: 0; gap: 13px; }
.site-name { color: var(--ink); font-family: "Newsreader", serif; font-size: 20px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-name:hover { color: var(--green); }
.brand-rule { width: 1px; height: 20px; background: var(--line); }
.app-name { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.app-name i { display: block; width: 8px; height: 8px; background: var(--green-bright); border-radius: 50%; box-shadow: 0 0 0 4px rgba(47, 158, 113, 0.12); }
.site-header nav { display: flex; align-items: center; gap: 22px; }
.site-header nav a { position: relative; display: inline-flex; min-height: 40px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; transition-property: color; transition-duration: 150ms; }
.site-header nav a:hover { color: var(--ink); }

.hero { padding-block: 78px 42px; border-bottom: 1px solid var(--line); }
.eyebrow, .section-number, .snapshot-kicker, .edition-label { color: var(--green); font-family: "DM Mono", monospace; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(220px, 0.35fr); align-items: end; gap: clamp(40px, 8vw, 120px); }
.hero h1 { margin: 16px 0 0; max-width: 920px; font-family: "Newsreader", serif; font-size: clamp(56px, 7.4vw, 108px); font-weight: 500; letter-spacing: -0.055em; line-height: 0.88; }
.hero h1 em { color: var(--green); font-weight: 400; }
.hero-dek { max-width: 720px; margin: 30px 0 0; color: var(--muted); font-size: clamp(16px, 1.55vw, 20px); line-height: 1.65; }
.hero-aside { padding: 20px 0 8px 22px; border-left: 1px solid var(--line); }
.hero-aside strong { display: block; margin-top: 10px; font-family: "Newsreader", serif; font-size: 58px; font-weight: 500; letter-spacing: -0.05em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.hero-aside > span:not(.edition-label) { display: block; margin-top: 6px; color: var(--ink); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.hero-aside p { max-width: 220px; margin: 18px 0 0; color: var(--muted); font-size: 13px; }
.hero-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 54px; border-top: 1px solid var(--line); }
.hero-facts > div { padding: 19px 20px 2px 0; }
.hero-facts > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.fact-label { display: block; color: var(--muted); font-family: "DM Mono", monospace; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.hero-facts strong { display: block; margin-top: 7px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.enter-item { opacity: 0; transform: translateY(12px); filter: blur(4px); animation: enter-up 500ms cubic-bezier(.2, 0, 0, 1) forwards; }
.hero .enter-item:nth-child(1) { animation-delay: 50ms; }
.hero-grid .enter-item:nth-child(1) { animation-delay: 130ms; }
.hero-grid .enter-item:nth-child(2) { animation-delay: 230ms; }
.hero-facts.enter-item { animation-delay: 330ms; }
@keyframes enter-up { to { opacity: 1; transform: translateY(0); filter: blur(0); } }

.census-section, .vitals-section, .method-section { padding-block: 88px; scroll-margin-top: 54px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 25px; }
.section-heading h2 { max-width: 780px; margin: 11px 0 0; font-family: "Newsreader", serif; font-size: clamp(38px, 4.4vw, 64px); font-weight: 500; letter-spacing: -0.038em; line-height: 0.98; }
.section-heading p { max-width: 720px; margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.wide-copy p { max-width: 800px; }
.view-switch { display: inline-flex; padding: 4px; background: rgba(24, 32, 28, 0.055); border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(24, 32, 28, 0.07); }
.switch-button { min-width: 92px; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; transition-property: color, background-color, box-shadow, scale; transition-duration: 150ms; }
.switch-button:active { scale: 0.96; }
.switch-button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(24, 32, 28, 0.12); }

.census-card { overflow: hidden; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-card); }
.timeline-bar { min-height: 86px; display: grid; grid-template-columns: 48px 150px minmax(220px, 1fr) 150px; align-items: center; gap: 18px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.play-button { position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--ink); color: white; cursor: pointer; transition-property: scale, background-color; transition-duration: 150ms; }
.play-button:hover { background: var(--green); }
.play-button:active { scale: 0.96; }
.icon-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.play-button svg { position: absolute; width: 20px; height: 20px; fill: currentColor; transition-property: opacity, filter, scale; transition-duration: 300ms; transition-timing-function: cubic-bezier(.2, 0, 0, 1); }
.play-icon { opacity: 1; filter: blur(0); scale: 1; margin-left: 2px; }
.pause-icon { opacity: 0; filter: blur(4px); scale: .25; }
.play-button.is-playing .play-icon { opacity: 0; filter: blur(4px); scale: .25; }
.play-button.is-playing .pause-icon { opacity: 1; filter: blur(0); scale: 1; }
.date-readout strong { display: block; font-family: "Newsreader", serif; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.date-readout span { display: block; color: var(--faint); font-family: "DM Mono", monospace; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.range-wrap { min-width: 0; }
input[type="range"] { width: 100%; height: 28px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--green) 0 var(--range-progress, 100%), var(--paper-deep) var(--range-progress, 100%) 100%); border-radius: 99px; }
input[type="range"]::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6.5px; appearance: none; background: var(--surface); border: 4px solid var(--green); border-radius: 50%; box-shadow: 0 1px 5px rgba(24, 32, 28, 0.25); }
input[type="range"]::-moz-range-track { height: 3px; background: var(--paper-deep); border-radius: 99px; }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--green); border-radius: 99px; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; background: var(--surface); border: 4px solid var(--green); border-radius: 50%; }
.range-labels { display: flex; justify-content: space-between; color: var(--faint); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.fuel-filter { display: grid; gap: 5px; }
.fuel-filter span { color: var(--faint); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.fuel-filter select { min-height: 40px; width: 100%; padding: 7px 32px 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; outline: none; }
.fuel-filter select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 82, .13); }

.chart-layout { display: grid; grid-template-columns: 175px minmax(0, 1fr) 180px; min-height: 650px; }
.snapshot, .legend-panel { padding: 31px 22px; background: rgba(232, 226, 213, 0.33); }
.snapshot { border-right: 1px solid var(--line); }
.legend-panel { border-left: 1px solid var(--line); }
.snapshot-year { margin-top: 20px; font-family: "Newsreader", serif; font-size: 50px; font-weight: 500; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.snapshot dl { margin: 30px 0 0; }
.snapshot dl div { padding: 13px 0; border-top: 1px solid var(--line); }
.snapshot dt { color: var(--muted); font-size: 12px; }
.snapshot dd { margin: 3px 0 0; font-family: "DM Mono", monospace; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.snapshot-note { display: grid; grid-template-columns: 14px 1fr; gap: 6px; margin-top: 24px; color: var(--green); }
.snapshot-note p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pyramid-wrap { position: relative; min-width: 0; padding: 24px 12px 4px; }
.pyramid-headings { display: grid; grid-template-columns: 1fr 54px 1fr; color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: 0.08em; text-align: center; text-transform: uppercase; }
#pyramid { display: block; width: 100%; height: 596px; overflow: visible; }
#pyramid .grid-line { stroke: rgba(24, 32, 28, 0.09); stroke-width: 1; vector-effect: non-scaling-stroke; }
#pyramid .center-line { stroke: rgba(24, 32, 28, 0.2); stroke-width: 1; vector-effect: non-scaling-stroke; }
#pyramid .axis-label { fill: var(--faint); font-family: "DM Mono", monospace; font-size: 12px; }
#pyramid .age-label { fill: var(--muted); font-family: "DM Mono", monospace; font-size: 12px; text-anchor: middle; }
#pyramid .bar-segment { cursor: crosshair; stroke: var(--surface); stroke-width: 1.5; transition-property: x, y, width, height, opacity; transition-duration: 320ms; transition-timing-function: cubic-bezier(.2, 0, 0, 1); }
#pyramid .bar-segment:hover, #pyramid .bar-segment:focus { opacity: .75; outline: none; }
.chart-tooltip { position: fixed; z-index: 70; width: max-content; max-width: 240px; padding: 10px 12px; border-radius: 10px; background: rgba(23, 32, 28, .96); color: white; box-shadow: 0 12px 34px rgba(0, 0, 0, .2); opacity: 0; transform: translateY(6px); pointer-events: none; transition-property: opacity, transform; transition-duration: 120ms; }
.chart-tooltip.is-visible { opacity: 1; transform: translateY(0); }
.chart-tooltip strong { display: block; font-size: 13px; }
.chart-tooltip span { display: block; margin-top: 3px; color: rgba(255,255,255,.68); font-family: "DM Mono", monospace; font-size: 12px; }
.fuel-legend { margin-top: 18px; }
.fuel-legend button { width: 100%; min-height: 34px; display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; padding: 3px 0; border: 0; background: none; color: var(--muted); cursor: pointer; text-align: left; transition-property: color, opacity; transition-duration: 150ms; }
.fuel-legend button:hover { color: var(--ink); }
.fuel-legend button.is-muted { opacity: .3; }
.fuel-legend i { width: 8px; height: 8px; border-radius: 2px; }
.fuel-legend span { font-size: 12px; }
.fuel-legend b { color: var(--ink); font-family: "DM Mono", monospace; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.legend-note { margin: 22px 0 0; color: var(--faint); font-size: 12px; line-height: 1.6; }
.era-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.era-strip button { min-height: 88px; padding: 16px 20px; border: 0; background: transparent; text-align: left; cursor: pointer; transition-property: background-color, color; transition-duration: 150ms; }
.era-strip button + button { border-left: 1px solid var(--line); }
.era-strip button:hover { background: rgba(23, 107, 82, 0.06); }
.era-strip button:active { background: rgba(23, 107, 82, 0.1); }
.era-strip span { color: var(--green); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.era-strip strong, .era-strip small { display: block; }
.era-strip strong { margin-top: 3px; font-family: "Newsreader", serif; font-size: 15px; font-weight: 600; }
.era-strip small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.data-disclosure { display: grid; grid-template-columns: 100px 1fr; gap: 20px; max-width: 900px; margin: 20px auto 0; }
.data-disclosure span { color: var(--green); font-family: "DM Mono", monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.data-disclosure p { margin: 0; color: var(--muted); font-size: 12px; }

.method-chip { min-width: 140px; padding: 15px 18px; border-radius: 12px; background: rgba(23, 107, 82, .08); box-shadow: inset 0 0 0 1px rgba(23, 107, 82, .12); }
.method-chip span { display: block; color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; text-transform: uppercase; }
.method-chip strong { display: block; margin-top: 3px; color: var(--green); font-family: "Newsreader", serif; font-size: 25px; font-weight: 600; }
.vitals-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); gap: 18px; }
.vital-feature, .watchlist-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-card); }
.vital-feature { padding: 28px; }
.vital-topline { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.stress-badge { padding: 5px 9px; border-radius: 999px; background: rgba(163, 74, 53, .1); color: var(--thermal); font-family: "DM Mono", monospace; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.stress-badge[data-band="Lower"] { background: rgba(23, 107, 82, .1); color: var(--green); }
.stress-badge[data-band="Elevated"] { background: rgba(229, 167, 46, .16); color: #895e06; }
.vital-feature h3 { margin: 20px 0 0; font-family: "Newsreader", serif; font-size: clamp(30px, 3vw, 44px); font-weight: 500; letter-spacing: -.035em; line-height: 1; }
#feature-meta { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.feature-metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 24px; border-block: 1px solid var(--line); }
.feature-metrics > div { min-width: 0; padding: 15px 12px 15px 0; }
.feature-metrics > div + div { padding-left: 15px; border-left: 1px solid var(--line); }
.feature-metrics span { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.feature-metrics strong { display: inline-block; margin-top: 4px; font-size: 19px; font-variant-numeric: tabular-nums; }
.feature-metrics small { color: var(--faint); font-size: 12px; }
.spark-chart { margin-top: 21px; }
.spark-heading { display: flex; justify-content: space-between; color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
#feature-spark { display: block; width: 100%; height: 190px; margin-top: 5px; overflow: visible; }
#feature-spark .spark-grid { stroke: var(--line); stroke-width: 1; }
#feature-spark .spark-area { fill: rgba(163, 74, 53, .1); }
#feature-spark .spark-line { fill: none; stroke: var(--thermal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#feature-spark .spark-dot { fill: var(--surface); stroke: var(--thermal); stroke-width: 2; }
#feature-spark text { fill: var(--faint); font-family: "DM Mono", monospace; font-size: 12px; }
.vital-caveat { margin: 12px 0 0; color: var(--faint); font-size: 12px; line-height: 1.55; }
.watchlist-card { overflow: hidden; display: flex; flex-direction: column; }
.watchlist-head { min-height: 89px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.watchlist-head h3 { margin: 3px 0 0; font-family: "Newsreader", serif; font-size: 24px; font-weight: 600; }
.search-control input { min-height: 40px; width: 155px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px; outline: none; }
.search-control input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 82, .12); }
/* flex-basis 0 so the row list never adds to the card's natural height: the
   left (charts) card decides the row height and this panel just fills it. */
.table-scroll { flex: 1 1 0; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(24,32,28,.22) transparent; }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; z-index: 2; padding: 10px 13px; background: var(--surface); color: var(--faint); font-family: "DM Mono", monospace; font-size: 11px; font-weight: 500; letter-spacing: .05em; text-align: right; text-transform: uppercase; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
td { padding: 11px 13px; color: var(--muted); font-size: 12px; text-align: right; border-bottom: 1px solid rgba(24,32,28,.07); font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; transition-property: background-color; transition-duration: 120ms; }
tbody tr:hover, tbody tr.is-selected { background: rgba(23, 107, 82, .055); }
tbody tr:focus { outline: 2px solid var(--green); outline-offset: -2px; }
td strong { display: block; max-width: 190px; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
td small { display: block; max-width: 190px; overflow: hidden; color: var(--faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.stress-cell { color: var(--thermal); font-weight: 700; }
.positive { color: var(--green); }
.negative { color: var(--thermal); }
.text-button { min-height: 44px; width: 100%; padding: 10px 18px; border: 0; background: rgba(232,226,213,.3); color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; transition-property: background-color, scale; transition-duration: 150ms; }
.text-button:hover { background: rgba(23,107,82,.08); }
.text-button:active { scale: .96; }

.next-section { padding-block: 88px; background: var(--night); color: #f4f2e9; scroll-margin-top: 54px; }
.section-heading.inverse .section-number { color: #77c7a6; }
.section-heading.inverse p { color: rgba(244,242,233,.6); }
.next-total { min-width: 200px; padding-left: 24px; border-left: 1px solid rgba(255,255,255,.14); }
.next-total span, .next-total small { display: block; color: rgba(244,242,233,.55); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.next-total strong { display: block; margin: 6px 0 3px; font-family: "Newsreader", serif; font-size: 38px; font-weight: 500; font-variant-numeric: tabular-nums; }
.next-grid { display: grid; grid-template-columns: minmax(360px, .7fr) minmax(0, 1.3fr); gap: 18px; }
.planned-mix-card, .arrivals-card { overflow: hidden; border-radius: 18px; background: rgba(255,255,255,.045); box-shadow: 0 0 0 1px rgba(255,255,255,.09); }
.dark-card-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 18px; color: rgba(244,242,233,.55); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,.09); }
.dark-card-head a { min-height: 40px; display: inline-flex; align-items: center; color: #77c7a6; text-decoration: none; }
.planned-bars { padding: 23px 20px; }
.planned-bar { display: grid; grid-template-columns: 82px minmax(80px, 1fr) 70px; align-items: center; gap: 12px; min-height: 35px; }
.planned-bar span { color: rgba(244,242,233,.72); font-size: 12px; }
.planned-bar-track { height: 8px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.07); }
.planned-bar-fill { height: 100%; border-radius: 4px; transform-origin: left; transition-property: transform; transition-duration: 400ms; transition-timing-function: cubic-bezier(.2,0,0,1); }
.planned-bar b { font-family: "DM Mono", monospace; font-size: 12px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.planned-list { display: grid; grid-template-columns: repeat(2, 1fr); }
.planned-item { min-height: 106px; padding: 17px 19px; border-bottom: 1px solid rgba(255,255,255,.08); }
.planned-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.08); }
.planned-item-top { display: flex; justify-content: space-between; gap: 12px; }
.planned-item strong { display: block; max-width: 290px; overflow: hidden; font-family: "Newsreader", serif; font-size: 17px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.planned-item b { font-family: "DM Mono", monospace; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.planned-item p { margin: 7px 0 0; color: rgba(244,242,233,.52); font-size: 12px; }
.planned-item span { display: inline-block; margin-top: 8px; color: #77c7a6; font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.method-grid article { padding: 25px 24px 25px 0; }
.method-grid article + article { padding-left: 24px; border-left: 1px solid var(--line); }
.method-grid article > span { color: var(--green); font-family: "DM Mono", monospace; font-size: 12px; }
.method-grid h3 { margin: 26px 0 8px; font-family: "Newsreader", serif; font-size: 23px; font-weight: 600; }
.method-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.source-row { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.source-row p { max-width: 850px; margin: 0; color: var(--muted); font-size: 12px; }
.source-row strong { color: var(--ink); }
.download-link { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(23,107,82,.22); font-size: 12px; font-weight: 700; text-decoration: none; transition-property: background-color, color, scale; transition-duration: 150ms; white-space: nowrap; }
.download-link:hover { background: var(--green); color: white; }
.download-link:active { scale: .96; }

footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 30px; color: var(--faint); font-size: 12px; }
.footer-inner p { margin: 0; }

.loading-screen { position: fixed; z-index: 100; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--paper); transition-property: opacity, transform; transition-duration: 180ms; }
.loading-screen.is-hidden { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.loader-mark { width: 28px; height: 28px; border: 2px solid rgba(23,107,82,.18); border-top-color: var(--green); border-radius: 50%; animation: spin 800ms linear infinite; }
.loading-screen p { color: var(--muted); font-family: "DM Mono", monospace; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { position: fixed; z-index: 110; inset: 50% auto auto 50%; width: min(430px, calc(100% - 40px)); transform: translate(-50%,-50%); padding: 22px; border-radius: 16px; background: var(--surface); box-shadow: 0 18px 60px rgba(24,32,28,.22); text-align: center; }
.error-state strong, .error-state span { display: block; }
.error-state span { margin-top: 7px; color: var(--muted); font-size: 13px; }

@media (max-width: 1080px) {
  .chart-layout { grid-template-columns: 150px minmax(0, 1fr); }
  .legend-panel { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 14px 20px; border-top: 1px solid var(--line); border-left: 0; }
  .fuel-legend { display: flex; flex-wrap: wrap; flex: 1; gap: 4px 14px; margin: 0; }
  .fuel-legend button { width: auto; grid-template-columns: 8px auto auto; }
  .legend-note { display: none; }
  .vitals-grid { grid-template-columns: 1fr; }
  /* Stacked: the card is not stretched, so size the list to content, capped. */
  .table-scroll { flex: none; max-height: 430px; }
  .method-grid { grid-template-columns: repeat(2, 1fr); }
  .method-grid article:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .method-grid article:nth-child(4) { border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1320px); }
  .site-header nav { display: none; }
  .header-inner { height: 56px; }
  .hero { padding-block: 52px 30px; }
  .hero-grid { grid-template-columns: 1fr; gap: 35px; }
  .hero h1 { font-size: clamp(50px, 16vw, 78px); }
  .hero-dek { margin-top: 22px; }
  .hero-aside { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 10px; padding: 17px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .hero-aside .edition-label, .hero-aside p { grid-column: 1 / -1; }
  .hero-aside strong { font-size: 45px; }
  .hero-aside p { max-width: none; }
  .hero-facts { grid-template-columns: repeat(2, 1fr); margin-top: 34px; }
  .hero-facts > div:nth-child(3) { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .hero-facts > div:nth-child(4) { border-top: 1px solid var(--line); }
  .census-section, .vitals-section, .method-section, .next-section { padding-block: 62px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading h2 { font-size: clamp(38px, 12vw, 54px); }
  .view-switch { width: 100%; }
  .switch-button { flex: 1; }
  .census-card { border-radius: 16px; }
  .timeline-bar { grid-template-columns: 44px 1fr; gap: 10px 14px; padding: 15px; }
  .range-wrap { grid-column: 1 / -1; }
  .fuel-filter { grid-column: 1 / -1; }
  .chart-layout { grid-template-columns: 1fr; }
  .snapshot { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 12px 20px; padding: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .snapshot .snapshot-kicker, .snapshot-note { grid-column: 1 / -1; }
  .snapshot-year { margin-top: 0; }
  .snapshot dl { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; }
  .snapshot dl div { padding: 7px 0; }
  .snapshot-note { margin-top: 0; }
  .pyramid-wrap { padding-inline: 2px; overflow-x: auto; }
  .pyramid-headings { min-width: 680px; }
  #pyramid { width: 680px; height: 520px; }
  .legend-panel { display: block; }
  .fuel-legend { margin-top: 10px; }
  .era-strip { grid-template-columns: repeat(2, 1fr); }
  .era-strip button:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .era-strip button:nth-child(4) { border-top: 1px solid var(--line); }
  .data-disclosure { grid-template-columns: 1fr; gap: 5px; }
  .method-chip { width: 100%; }
  .vital-feature { padding: 21px 18px; border-radius: 16px; }
  .feature-metrics { grid-template-columns: repeat(2, 1fr); }
  .feature-metrics > div:nth-child(3) { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .feature-metrics > div:nth-child(4) { border-top: 1px solid var(--line); }
  .watchlist-head { align-items: start; flex-direction: column; }
  .search-control, .search-control input { width: 100%; }
  .next-total { width: 100%; padding: 14px 0 0; border-top: 1px solid rgba(255,255,255,.14); border-left: 0; }
  .next-grid { grid-template-columns: 1fr; }
  .planned-list { grid-template-columns: 1fr; }
  .planned-item:nth-child(odd) { border-right: 0; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid article, .method-grid article + article { padding: 23px 0; border-top: 1px solid var(--line); border-left: 0; }
  .method-grid h3 { margin-top: 15px; }
  .source-row, .footer-inner { align-items: start; flex-direction: column; }
  .download-link { width: 100%; justify-content: center; }
  .footer-inner { justify-content: center; padding-block: 24px; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Watchlist tools, partial-year note, and CO2 strip */
.watchlist-tools { display: flex; align-items: center; gap: 13px; }
.floor-control { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; cursor: pointer; }
.floor-control input { width: 13px; height: 13px; accent-color: var(--green); cursor: pointer; }
.spark-note { margin: 6px 0 0; color: var(--faint); font-size: 12px; }
.co2-strip { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.co2-strip > span { color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.co2-strip strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.co2-strip small { color: var(--faint); font-size: 12px; }
@media (max-width: 720px) {
  .watchlist-tools { width: 100%; flex-direction: column; align-items: start; gap: 9px; }
}

/* Earning / spark-spread block */
.earning-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.earning-block.is-empty .earning-metrics,
.earning-block.is-empty #feature-econ-spark { opacity: .35; }
.earning-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.earning-head span:last-child { color: var(--faint); text-transform: none; letter-spacing: 0; }
.earning-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; border-block: 1px solid var(--line); }
.earning-metrics > div { min-width: 0; padding: 13px 12px 13px 0; }
.earning-metrics > div + div { padding-left: 15px; border-left: 1px solid var(--line); }
.earning-metrics > div > span { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.earning-metrics strong { display: inline-block; margin-top: 4px; font-size: 19px; font-variant-numeric: tabular-nums; }
.earning-metrics small { margin-left: 4px; color: var(--faint); font-size: 12px; }
.spark-heading-econ { margin-top: 16px; }
#feature-econ-spark { display: block; width: 100%; height: 168px; margin-top: 5px; overflow: visible; }
#feature-econ-spark text { fill: var(--faint); font-family: "DM Mono", monospace; font-size: 12px; }
#feature-econ-spark .spark-grid { stroke: var(--line); stroke-width: 1; }
#feature-econ-spark .econ-area { fill: rgba(23, 107, 82, .10); }
#feature-econ-spark .econ-line { fill: none; stroke: var(--green); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#feature-econ-spark .econ-dot { fill: var(--surface); stroke: var(--green); stroke-width: 2; }
.earning-caption { margin: 9px 0 0; color: var(--faint); font-size: 12px; line-height: 1.5; }
@media (max-width: 720px) {
  .earning-metrics { grid-template-columns: 1fr; }
  .earning-metrics > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* Cohort drill-down modal (click an age-pyramid band) */
body.modal-open { overflow: hidden; }
.cohort-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.cohort-modal[hidden] { display: none; }
.cohort-backdrop { position: absolute; inset: 0; background: rgba(24, 32, 28, .45); backdrop-filter: blur(2px); }
.cohort-dialog { position: relative; display: flex; flex-direction: column; width: min(560px, 100%); max-height: min(80vh, 720px); background: var(--surface); border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); overflow: hidden; }
.cohort-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.cohort-head h3 { margin: 6px 0 0; font-family: "Newsreader", serif; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.cohort-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.cohort-close { flex: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; transition-property: background-color, color; transition-duration: 150ms; }
.cohort-close:hover { background: rgba(24, 32, 28, .06); color: var(--ink); }
.cohort-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(24,32,28,.22) transparent; }
.cohort-table { width: 100%; border-collapse: collapse; }
.cohort-table th { position: sticky; top: 0; z-index: 1; padding: 10px 14px; background: var(--surface); color: var(--faint); font-family: "DM Mono", monospace; font-size: 11px; font-weight: 500; letter-spacing: .05em; text-align: right; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.cohort-table th:first-child, .cohort-table td:first-child { text-align: left; }
.cohort-table td { padding: 11px 14px; color: var(--muted); font-size: 12px; text-align: right; border-bottom: 1px solid rgba(24, 32, 28, .07); font-variant-numeric: tabular-nums; }
.cohort-table td strong { display: block; max-width: 260px; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.cohort-table td small { display: block; color: var(--faint); font-size: 11px; }
@media (max-width: 600px) {
  .cohort-dialog { max-height: 88vh; }
  .cohort-table td strong { max-width: 150px; }
}

/* Retired ("dead") pyramid row + diverging axis */
#pyramid .dead-separator { stroke: rgba(24, 32, 28, 0.28); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
#pyramid .dead-label { fill: var(--faint); font-style: italic; }
#pyramid .axis-caption { fill: var(--faint); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: 0.03em; }
.pyramid-headings b { color: var(--ink); font-weight: 700; }
