@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --color-bg: #171827;
  --color-text: #e5e7eb;
  --color-heading: #f8fafc;
  --color-muted: #9ca3af;
  --color-subtle: #6b7280;
  --surface: #020617;
  --surface-raised: #0b1120;
  --surface-overlay: rgba(2, 6, 23, 0.94);
  --border: #1f2937;
  --border-strong: #374151;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.16);
  --probabilistic: #2dd4bf;
  --probabilistic-soft: rgba(45, 212, 191, 0.12);
  --focus: #38bdf8;
  --actual: #f8fafc;
  --forecast: #60a5fa;
  --negative: #fb7185;
  --positive: #34d399;
  --map-land: #3f4654;
  --map-land-hover: #515a6a;
  --map-border: #737b8a;
  --map-water: #10121e;
  --shadow-nav: 0 18px 44px rgba(0, 0, 0, 0.42);
  --shadow-panel: 0 24px 70px rgba(0, 0, 0, 0.24);
  --font-sans: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
  --page-max: 1200px;
  --content-max: 1120px;
  --radius: 8px;
}

:root[data-theme="light"] {
  --color-bg: #f5f5f8;
  --color-text: #172033;
  --color-heading: #020617;
  --color-muted: #5f6877;
  --color-subtle: #89919f;
  --surface: #ffffff;
  --surface-raised: #f8fafc;
  --surface-overlay: rgba(255, 255, 255, 0.95);
  --border: #dde2e9;
  --border-strong: #c8ced8;
  --primary: #ef4444;
  --primary-strong: #b91c1c;
  --primary-soft: rgba(239, 68, 68, 0.1);
  --probabilistic: #0f766e;
  --probabilistic-soft: rgba(15, 118, 110, 0.1);
  --focus: #0284c7;
  --actual: #111827;
  --forecast: #dc2626;
  --negative: #be123c;
  --positive: #047857;
  --map-land: #d7dbe2;
  --map-land-hover: #c9ced7;
  --map-border: #aab1bd;
  --map-water: #eef0f4;
  --shadow-nav: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-panel: 0 22px 55px rgba(15, 23, 42, 0.09);
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--color-bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2,
strong {
  letter-spacing: 0;
}

h1,
h2 {
  color: var(--color-heading);
  line-height: 1.12;
}

h1 {
  margin-bottom: 16px;
  font-size: 46px;
  font-weight: 800;
}

h2 {
  margin-bottom: 0;
  font-size: 26px;
  font-weight: 750;
}

.site-shell {
  width: min(calc(100% - 32px), var(--page-max));
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 0 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 5000;
  padding: 9px 13px;
  border-radius: 6px;
  background: var(--color-heading);
  color: var(--color-bg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.navbar {
  position: sticky;
  top: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-overlay);
  box-shadow: var(--shadow-nav);
  backdrop-filter: blur(18px);
}

.nav-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--color-heading);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: contain;
}

.nav-actions,
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
  background: var(--surface-raised);
  color: var(--color-heading);
}

.nav-link.is-active {
  background: var(--primary-strong);
  color: #ffffff;
}

.icon-button {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  color: var(--color-heading);
}

.theme-toggle {
  margin-left: 4px;
}

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.icon-sun { mask-image: url("../vendor/lucide/sun.svg"); -webkit-mask-image: url("../vendor/lucide/sun.svg"); }
.icon-moon { mask-image: url("../vendor/lucide/moon.svg"); -webkit-mask-image: url("../vendor/lucide/moon.svg"); }
.icon-arrow-left { mask-image: url("../vendor/lucide/arrow-left.svg"); -webkit-mask-image: url("../vendor/lucide/arrow-left.svg"); }
.icon-rotate { mask-image: url("../vendor/lucide/rotate-ccw.svg"); -webkit-mask-image: url("../vendor/lucide/rotate-ccw.svg"); }
.icon-network { mask-image: url("../vendor/lucide/network.svg"); -webkit-mask-image: url("../vendor/lucide/network.svg"); }
.icon-activity { mask-image: url("../vendor/lucide/activity.svg"); -webkit-mask-image: url("../vendor/lucide/activity.svg"); }
.icon-landmark { mask-image: url("../vendor/lucide/landmark.svg"); -webkit-mask-image: url("../vendor/lucide/landmark.svg"); }
.icon-arrow-up-right { mask-image: url("../vendor/lucide/arrow-up-right.svg"); -webkit-mask-image: url("../vendor/lucide/arrow-up-right.svg"); }
.icon-circle-alert { mask-image: url("../vendor/lucide/circle-alert.svg"); -webkit-mask-image: url("../vendor/lucide/circle-alert.svg"); }
.icon-map { mask-image: url("../vendor/lucide/map.svg"); -webkit-mask-image: url("../vendor/lucide/map.svg"); }

:root[data-theme="light"] .theme-icon-light,
:root:not([data-theme="light"]) .theme-icon-dark {
  display: none;
}

.home-heading {
  display: flex;
  max-width: 940px;
  min-height: 0;
  margin: 0 auto;
  padding: 28px 24px 12px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-logo {
  width: 218px;
  height: 178px;
  margin-bottom: 2px;
  object-fit: contain;
}

.hero-author {
  margin: -7px 0 14px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

.eyebrow,
.section-kicker {
  margin-bottom: 9px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-heading h1 {
  max-width: 880px;
  margin-bottom: 16px;
  font-weight: 700;
}

.home-introduction {
  max-width: 760px;
  margin: 0 auto;
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1.65;
}

.home-introduction p {
  margin-bottom: 0;
}

.map-instruction {
  margin: 18px 0 0;
  color: var(--color-heading);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
}

.text-link {
  color: var(--color-heading);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--primary);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.secondary-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--color-heading);
  font-size: 13px;
  font-weight: 700;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.secondary-action:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.heading-meta,
.section-meta {
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 14px;
}

.heading-meta span {
  padding: 0 8px;
  color: var(--color-subtle);
}

.map-section,
.prediction-main,
.placeholder-main {
  width: min(100%, var(--content-max));
  margin: 0 auto;
}

.map-section {
  padding-bottom: 70px;
}

.section-heading,
.chart-toolbar,
.market-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading {
  margin-bottom: 18px;
}

.map-frame {
  position: relative;
  height: 620px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--map-water);
  box-shadow: var(--shadow-panel);
}

.europe-map {
  position: absolute;
  inset: 0;
}

.map-loading,
.chart-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.map-loading.is-error,
.chart-loading.is-error {
  color: var(--negative);
}

.map-tooltip {
  position: absolute;
  z-index: 30;
  min-width: 190px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-overlay);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
  pointer-events: none;
  transform: translate(14px, -50%);
  backdrop-filter: blur(14px);
}

.map-tooltip strong,
.map-tooltip span {
  display: block;
}

.map-tooltip strong {
  margin-bottom: 3px;
  color: var(--color-heading);
  font-size: 14px;
}

.map-tooltip span {
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.map-tooltip .tooltip-action {
  margin-top: 8px;
  color: var(--color-heading);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
}

.map-label {
  display: inline-flex;
  min-width: 36px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 5px;
  background: var(--zone-color, #2563eb);
  box-shadow: 0 7px 17px rgba(0, 0, 0, 0.28);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.map-label:hover,
.map-label:focus-visible,
.map-label.is-active {
  transform: translateY(-5px);
  box-shadow: 0 13px 26px rgba(0, 0, 0, 0.38);
}

.map-reset-control {
  display: flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--surface-overlay);
  color: var(--color-text);
  cursor: pointer;
}

.map-reset-control:hover {
  color: var(--color-heading);
}

.maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  background: var(--surface-overlay) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

.maplibregl-ctrl-group button {
  background-color: var(--surface-overlay) !important;
}

.maplibregl-ctrl-group button + button {
  border-top-color: var(--border) !important;
}

:root:not([data-theme="light"]) .maplibregl-ctrl-icon {
  filter: invert(1);
}

.maplibregl-ctrl-attrib {
  border-radius: 4px 0 0 0 !important;
  background: var(--surface-overlay) !important;
  color: var(--color-muted) !important;
  font-size: 10px !important;
}

.maplibregl-ctrl-attrib a {
  color: var(--color-muted) !important;
}

.zone-legend {
  display: grid;
  margin-top: 16px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.zone-legend-link {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.zone-legend-link:hover,
.zone-legend-link:focus-visible,
.zone-legend-link.is-active {
  border-color: var(--zone-color, var(--border-strong));
  color: var(--color-heading);
  transform: translateY(-2px);
}

.zone-legend-link i,
.market-swatch {
  display: block;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 2px;
  background: var(--zone-color, var(--primary));
}

.zone-legend-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prediction-main {
  padding: 44px 0 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 24px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.back-link:hover {
  color: var(--color-heading);
}

.market-heading {
  margin-bottom: 34px;
}

.market-heading h1 {
  margin-bottom: 12px;
}

.market-swatch {
  width: 56px;
  height: 10px;
  flex-basis: 56px;
  margin-bottom: 12px;
  border-radius: 3px;
}

html[data-theme="dark"] #prediction-content[data-zone="de-lu"] { --chart-forecast: #60a5fa; --zone-color: #60a5fa; }
html[data-theme="light"] #prediction-content[data-zone="de-lu"] { --chart-forecast: #2563eb; --zone-color: #2563eb; }
html[data-theme="dark"] #prediction-content[data-zone="fr"] { --chart-forecast: #fb7185; --zone-color: #fb7185; }
html[data-theme="light"] #prediction-content[data-zone="fr"] { --chart-forecast: #e11d48; --zone-color: #e11d48; }
html[data-theme="dark"] #prediction-content[data-zone="nl"] { --chart-forecast: #22d3ee; --zone-color: #22d3ee; }
html[data-theme="light"] #prediction-content[data-zone="nl"] { --chart-forecast: #0891b2; --zone-color: #0891b2; }
html[data-theme="dark"] #prediction-content[data-zone="be"] { --chart-forecast: #facc15; --zone-color: #facc15; }
html[data-theme="light"] #prediction-content[data-zone="be"] { --chart-forecast: #a16207; --zone-color: #a16207; }
html[data-theme="dark"] #prediction-content[data-zone="at"] { --chart-forecast: #fb923c; --zone-color: #fb923c; }
html[data-theme="light"] #prediction-content[data-zone="at"] { --chart-forecast: #ea580c; --zone-color: #ea580c; }
html[data-theme="dark"] #prediction-content[data-zone="cz"] { --chart-forecast: #c4b5fd; --zone-color: #c4b5fd; }
html[data-theme="light"] #prediction-content[data-zone="cz"] { --chart-forecast: #7c3aed; --zone-color: #7c3aed; }
html[data-theme="dark"] #prediction-content[data-zone="pl"] { --chart-forecast: #f472b6; --zone-color: #f472b6; }
html[data-theme="light"] #prediction-content[data-zone="pl"] { --chart-forecast: #db2777; --zone-color: #db2777; }
html[data-theme="dark"] #prediction-content[data-zone="dk-1"] { --chart-forecast: #2dd4bf; --zone-color: #2dd4bf; }
html[data-theme="light"] #prediction-content[data-zone="dk-1"] { --chart-forecast: #0f766e; --zone-color: #0f766e; }
html[data-theme="dark"] #prediction-content[data-zone="it-nord"] { --chart-forecast: #4ade80; --zone-color: #4ade80; }
html[data-theme="light"] #prediction-content[data-zone="it-nord"] { --chart-forecast: #15803d; --zone-color: #15803d; }
html[data-theme="dark"] #prediction-content[data-zone="es"] { --chart-forecast: #818cf8; --zone-color: #818cf8; }
html[data-theme="light"] #prediction-content[data-zone="es"] { --chart-forecast: #4f46e5; --zone-color: #4f46e5; }

.metric-strip {
  display: grid;
  margin: 0 0 52px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  grid-template-columns: 1.25fr repeat(3, 1fr);
}

.metric {
  min-width: 0;
  padding: 24px 20px;
  border-left: 1px solid var(--border);
}

.metric:first-child {
  padding-left: 0;
  border-left: 0;
}

.metric-label,
.metric-unit {
  display: block;
}

.metric-label {
  margin-bottom: 7px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  overflow: hidden;
  margin-bottom: 3px;
  color: var(--color-heading);
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-primary strong {
  color: var(--zone-color, var(--forecast));
  font-size: 42px;
}

.metric-unit {
  color: var(--color-subtle);
  font-size: 10px;
  white-space: nowrap;
}

.chart-section {
  margin-bottom: 42px;
}

.chart-toolbar {
  margin-bottom: 16px;
}

.chart-controls {
  display: flex;
  min-width: min(100%, 460px);
  align-items: flex-end;
  flex-direction: column;
  gap: 9px;
}

.interval-controls {
  display: flex;
  min-height: 24px;
  align-items: center;
  gap: 13px;
}

.control-label {
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.interval-toggle {
  position: relative;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  color: var(--color-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  touch-action: manipulation;
  user-select: none;
}

.interval-toggle:hover {
  color: var(--color-heading);
}

.interval-toggle input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.toggle-track {
  position: relative;
  display: inline-flex;
  width: 30px;
  height: 16px;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.toggle-track span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-subtle);
  transition: transform 150ms ease, background-color 150ms ease;
}

.interval-toggle input:checked + .toggle-track {
  border-color: var(--primary-strong);
  background: var(--primary-soft);
}

.interval-toggle input:checked + .toggle-track span {
  background: var(--primary-strong);
  transform: translateX(14px);
}

.interval-toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--primary-strong);
  outline-offset: 2px;
}

.range-controls-row {
  display: grid;
  width: 100%;
  align-items: stretch;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.range-date-control {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.range-date-control:focus-within {
  border-color: var(--primary-strong);
  outline: 2px solid var(--primary-soft);
}

.range-date-control input {
  width: 112px;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-heading);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

html[data-theme="dark"] .range-date-control input {
  color-scheme: dark;
}

html[data-theme="light"] .range-date-control input {
  color-scheme: light;
}

.range-date-control input:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.range-control {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.range-control {
  grid-template-columns: repeat(5, minmax(42px, 1fr));
}

.range-control button {
  min-width: 48px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.range-control button:first-child {
  border-left: 0;
}

.range-control button:hover {
  color: var(--color-heading);
}

.range-control button.is-active {
  background: var(--primary-strong);
  color: #ffffff;
}

.chart-frame {
  position: relative;
  height: 570px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.forecast-chart {
  width: 100%;
  height: 100%;
}

.chart-footnote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 13px;
  color: var(--color-subtle);
  font-size: 11px;
}

.chart-footnote span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-footnote span:last-child {
  margin-left: auto;
}

.axis-clipping-note {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.chart-tooltip-time {
  margin-bottom: 9px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.chart-tooltip-row,
.chart-tooltip-error {
  display: flex;
  min-width: 190px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 3px 0;
}

.chart-tooltip-row span,
.chart-tooltip-error span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-muted);
}

.chart-tooltip-row i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.chart-tooltip-row i.is-actual {
  background: var(--actual);
}

.chart-tooltip-row i.is-forecast {
  background: var(--chart-forecast, var(--forecast));
}

.chart-tooltip-row i.is-interval-50 {
  border: 1px solid var(--chart-forecast, var(--forecast));
  background: color-mix(in srgb, var(--chart-forecast, var(--forecast)) 42%, transparent);
}

.chart-tooltip-row i.is-interval-80 {
  border: 1px solid var(--chart-forecast, var(--forecast));
  background: color-mix(in srgb, var(--chart-forecast, var(--forecast)) 20%, transparent);
}

.chart-tooltip-row strong,
.chart-tooltip-error strong {
  color: var(--color-heading);
  font-family: var(--font-mono);
  font-size: 11px;
}

.chart-tooltip-error {
  margin-top: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.series-key {
  display: inline-block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: var(--actual);
}

.forecast-key {
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--chart-forecast, var(--forecast)) 0 5px, transparent 5px 8px);
}

.interval-key {
  width: 22px;
  height: 9px;
  border: 1px solid var(--chart-forecast, var(--forecast));
  background: color-mix(in srgb, var(--chart-forecast, var(--forecast)) 28%, transparent);
}

.interval-key-50 {
  opacity: 0.78;
}

.interval-key-80 {
  opacity: 0.42;
}

.insight-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.insight-link {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  transition: border-color 170ms ease, transform 170ms ease, box-shadow 170ms ease;
}

.insight-link:hover,
.insight-link:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
  transform: translateY(-3px);
}

.insight-icon,
.state-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--primary);
}

.insight-link strong,
.insight-link small {
  display: block;
}

.insight-link strong {
  margin-bottom: 0;
  color: var(--color-heading);
  font-size: 15px;
  line-height: 1.3;
}

.insight-link small {
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.4;
}

.insight-link > .icon {
  color: var(--color-subtle);
}

.state-panel {
  max-width: 620px;
  margin: 70px auto;
  text-align: center;
}

.state-panel .state-icon {
  margin: 0 auto 24px;
}

.state-panel h1 {
  font-size: 36px;
}

.state-panel > p:not(.eyebrow) {
  max-width: 520px;
  margin: 0 auto 28px;
  color: var(--color-muted);
}

.primary-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--primary-strong);
  border-radius: 6px;
  background: var(--primary-strong);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.article-main {
  width: min(100%, var(--page-max));
  margin: 0 auto;
  padding: 26px 0 92px;
}

.article-hero {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 0 32px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.article-hero h1 {
  max-width: 1000px;
  margin-bottom: 0;
  font-size: 52px;
  font-weight: 700;
}

.article-lede {
  max-width: 720px;
  margin: 0 auto;
  color: var(--color-muted);
  font-size: 18px;
  line-height: 1.6;
}

.article-layout {
  display: block;
  width: min(100%, 1000px);
  margin: 0 auto;
  padding-top: 30px;
}

.article-toc-band {
  width: 100%;
  margin-bottom: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-toc {
  position: static;
  display: grid;
  width: min(100%, 460px);
  min-width: 0;
  margin: 0 auto;
  align-items: center;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 17px 8px;
  text-align: left;
}

.article-toc > span {
  grid-column: 1 / -1;
  margin-bottom: 5px;
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: left;
}

.article-toc a {
  width: 100%;
  padding: 9px 2px;
  color: var(--color-muted);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
}

.article-toc-three {
  grid-template-columns: 1fr;
}

.article-toc a:hover {
  color: var(--color-heading);
}

.article-body {
  width: 100%;
  min-width: 0;
}

.overview-index {
  margin-bottom: 72px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.overview-index p {
  margin-bottom: 12px;
  color: var(--color-muted);
}

.overview-index ol {
  margin-bottom: 0;
}

.article-section {
  scroll-margin-top: 118px;
  margin-bottom: 70px;
  padding-bottom: 70px;
  border-bottom: 1px solid var(--border);
}

.article-section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.article-section-short {
  min-height: 230px;
}

.section-number {
  margin-bottom: 10px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.article-section h2 {
  margin-bottom: 30px;
  font-size: 34px;
}

.article-section h3 {
  margin: 42px 0 14px;
  color: var(--color-heading);
  font-size: 19px;
  font-weight: 750;
  line-height: 1.35;
}

.article-section p,
.article-section li,
.overview-index li {
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.75;
}

.article-section p {
  margin-bottom: 18px;
}

.article-section p.article-cushion {
  margin-top: 32px;
}

.article-section ul,
.article-section ol,
.overview-index ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

.article-section li,
.overview-index li {
  padding-left: 4px;
  margin-bottom: 8px;
}

.article-section ul ul {
  margin-top: 8px;
  margin-bottom: 8px;
}

.article-section li > p.nested-list-note {
  margin: 8px 0;
}

.definition-list {
  padding-left: 20px;
}

.definition-list strong {
  color: var(--color-heading);
}

.definition-line {
  padding: 13px 16px;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  color: var(--color-heading) !important;
  font-family: var(--font-mono);
  font-size: 12px !important;
  font-weight: 650;
}

.draft-note {
  padding: 13px 16px;
  border-left: 3px solid var(--color-subtle);
  background: var(--surface-raised);
  color: var(--color-muted) !important;
  font-family: var(--font-mono);
  font-size: 12px !important;
}

.methodology-page .result-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin: 26px 0 34px;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.methodology-page .result-period {
  position: relative;
  min-width: 0;
  padding: 22px 24px 24px;
}

.methodology-page .result-period + .result-period {
  border-left: 1px solid var(--border);
}

.methodology-page .result-period.is-final::before {
  position: absolute;
  top: -1px;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  content: "";
}

.methodology-page .result-period-label {
  margin-bottom: 18px;
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  text-transform: uppercase;
}

.methodology-page .result-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.methodology-page .result-stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.methodology-page .result-stat span,
.methodology-page .result-stat small {
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.45;
  text-transform: uppercase;
}

.methodology-page .result-stat strong {
  margin: 5px 0 2px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 650;
  line-height: 1.15;
}

.methodology-page .result-comparison.is-probabilistic .result-period.is-final::before {
  background: var(--probabilistic);
}

.methodology-page .result-comparison.is-probabilistic .result-stat strong {
  color: var(--probabilistic);
}

.methodology-page .result-table {
  margin-top: 20px;
}

.methodology-page .result-table table {
  min-width: 730px;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.methodology-page .result-table .market-column {
  width: 13%;
}

.methodology-page .result-table .development-first-column {
  width: 12%;
}

.methodology-page .result-table .development-second-column {
  width: 25%;
}

.methodology-page .result-table .final-column {
  width: 25%;
}

.methodology-page .result-table td:not(:first-child),
.methodology-page .result-table th:not(:first-child) {
  text-align: right;
}

.methodology-page .result-table .result-year-row th {
  padding-top: 14px;
  padding-bottom: 9px;
  vertical-align: middle;
}

.methodology-page .result-table .result-year-row .year-group {
  border-bottom: 0;
  text-align: center;
  letter-spacing: 0;
}

.methodology-page .result-table .result-metric-row th {
  padding-top: 7px;
  padding-bottom: 13px;
  text-align: right;
}

.methodology-page .result-table .result-metric-row th:first-child {
  text-align: left;
}

.methodology-page .result-table .result-year-row .year-group + .year-group,
.methodology-page .result-table .result-metric-row th:nth-child(4),
.methodology-page .result-table tbody td:nth-child(4) {
  border-left: 1px solid var(--border);
}

.methodology-page .result-table .is-final-column {
  background: var(--primary-soft);
}

.methodology-page .result-table th.is-final-column {
  color: var(--primary);
}

.methodology-page .result-table.is-probabilistic .is-final-column {
  background: var(--probabilistic-soft);
}

.methodology-page .result-table.is-probabilistic th.is-final-column {
  color: var(--probabilistic);
}

.methodology-page #main-results .equation {
  font-size: 16px;
}

.code-list code,
.article-section code {
  color: var(--color-heading);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.table-scroll {
  width: 100%;
  margin: 26px 0 30px;
  overflow-x: auto;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.table-scroll table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.table-scroll th,
.table-scroll td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table-scroll th {
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.table-scroll td {
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.5;
}

.table-scroll tbody tr:last-child td {
  border-bottom: 0;
}

.equation,
.equation-stack {
  width: 100%;
}

.equation {
  margin: 22px 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 0;
  color: var(--color-heading);
  font-size: clamp(18px, 3vw, 26px);
  text-align: center;
}

.equation .katex-display {
  margin: 0;
  padding: 4px 0;
}

.equation .katex {
  font-size: 1em;
}

.methodology-page .equation {
  font-size: 18px;
}

.equation-stack {
  margin: 24px 0 28px;
}

.equation-stack .equation {
  margin: 0;
  font-size: 18px;
}

.equation-stack .equation + .equation {
  border-top: 0;
}

.article-chart-placeholder,
.example-placeholder {
  width: 100%;
  margin: 26px 0 38px;
  border: 1px dashed var(--border-strong);
  background: var(--surface-raised);
}

.article-chart-placeholder {
  aspect-ratio: 16 / 6;
  min-height: 220px;
}

.article-data-figure {
  width: 100%;
  margin: 24px 0 38px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.article-chart-header {
  display: flex;
  min-height: 70px;
  padding: 15px 18px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.article-chart-kicker {
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
}

.article-chart-header h4 {
  margin: 0;
  color: var(--color-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.article-data-chart {
  width: 100%;
  height: 360px;
  min-height: 360px;
  background: var(--surface);
}

.article-data-chart.is-error {
  display: flex;
  padding: 24px;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 13px;
  text-align: center;
}

.article-data-figure figcaption {
  display: grid;
  padding: 14px 18px 16px;
  gap: 6px;
  border-top: 1px solid var(--border);
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.65;
}

.article-data-figure figcaption em {
  color: var(--color-text);
  font-style: italic;
}

.article-data-figure figcaption span {
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.example-placeholder {
  min-height: 150px;
}

.placeholder-main {
  min-height: calc(100vh - 170px);
  padding: 44px 0 80px;
}

.placeholder-heading {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.placeholder-heading h1 {
  max-width: 820px;
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 4px;
  border-top: 1px solid var(--border);
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .article-body {
    grid-column: 1;
  }

  .article-toc {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px 18px;
    padding: 15px 0;
  }

  .article-toc > span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  h1 {
    font-size: 40px;
  }

  .map-frame {
    height: 550px;
  }

  .zone-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-primary {
    grid-row: auto;
  }

  .metric:nth-child(3) {
    border-left: 0;
  }

  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .insight-links {
    grid-template-columns: 1fr;
  }

  .insight-link {
    min-height: 92px;
  }

  .article-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .article-body {
    grid-column: 1;
  }

  .article-toc {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px 18px;
    padding: 15px 0;
    border-left: 0;
  }

  .article-toc > span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .site-shell {
    width: min(calc(100% - 20px), var(--page-max));
    padding-top: 10px;
  }

  .navbar {
    top: 10px;
    min-height: 58px;
    padding: 6px 7px 6px 10px;
  }

  .nav-brand {
    max-width: 190px;
    font-size: 12px;
  }

  .nav-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .nav-link-wide {
    display: none;
  }

  .nav-link {
    min-height: 38px;
    padding: 0 11px;
    font-size: 11px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 22px;
  }

  .home-heading {
    min-height: 0;
    padding: 22px 12px 12px;
  }

  .hero-logo {
    width: 158px;
    height: 126px;
    margin-bottom: 2px;
  }

  .hero-author {
    margin-top: -4px;
    font-size: 9px;
  }

  .home-heading h1 {
    font-size: 30px;
  }

  .home-introduction {
    font-size: 14px;
    line-height: 1.6;
  }

  .map-instruction {
    margin-top: 15px;
    font-size: 17px;
  }

  .hero-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    margin-top: 16px;
  }

  .hero-actions a {
    width: 100%;
  }

  .heading-meta {
    font-size: 12px;
  }

  .section-heading,
  .market-heading {
    align-items: flex-start;
  }

  .section-meta {
    display: none;
  }

  .map-frame {
    height: 465px;
  }

  .zone-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prediction-main,
  .placeholder-main,
  .article-main {
    padding-top: 32px;
  }

  .article-main {
    padding-top: 20px;
  }

  .article-hero {
    padding: 0 0 24px;
  }

  .article-hero h1 {
    font-size: 34px;
  }

  .article-lede {
    font-size: 16px;
  }

  .article-layout {
    padding-top: 24px;
  }

  .article-toc {
    grid-template-columns: 1fr;
  }

  .article-section {
    margin-bottom: 50px;
    padding-bottom: 50px;
  }

  .article-section h2 {
    font-size: 27px;
  }

  .article-section h3 {
    margin-top: 34px;
    font-size: 18px;
  }

  .article-section p,
  .article-section li,
  .overview-index li {
    font-size: 14px;
  }

  .table-scroll {
    width: calc(100vw - 20px);
    max-width: 100%;
  }

  .methodology-page .result-comparison {
    grid-template-columns: 1fr;
  }

  .methodology-page .result-period {
    padding: 19px 14px 21px;
  }

  .methodology-page .result-period + .result-period {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .methodology-page .result-stat-grid {
    gap: 14px;
  }

  .methodology-page .result-stat strong {
    font-size: 23px;
  }

  .methodology-page #main-results .equation {
    font-size: 14px;
  }

  .article-chart-placeholder {
    min-height: 180px;
    aspect-ratio: 4 / 3;
  }

  .article-chart-header {
    min-height: 64px;
    padding: 13px 14px;
  }

  .article-data-chart {
    height: 320px;
    min-height: 320px;
  }

  .article-data-figure figcaption {
    padding: 13px 14px 15px;
    font-size: 11px;
  }

  .back-link {
    margin-bottom: 22px;
  }

  .market-heading {
    margin-bottom: 26px;
  }

  .market-swatch {
    width: 38px;
    flex-basis: 38px;
  }

  .metric-strip {
    margin-bottom: 42px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 118px;
    padding: 18px 14px;
  }

  .metric:first-child {
    padding-left: 14px;
  }

  .metric-primary {
    grid-column: auto;
    grid-row: auto;
  }

  .metric:nth-child(2),
  .metric:nth-child(4) {
    border-left: 1px solid var(--border);
  }

  .metric:nth-child(3) {
    border-left: 0;
  }

  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .metric-primary strong {
    font-size: 38px;
  }

  .chart-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-controls {
    width: 100%;
    min-width: 0;
    align-items: stretch;
  }

  .interval-controls {
    justify-content: flex-end;
  }

  .range-control {
    width: 100%;
  }

  .range-control button {
    min-width: 0;
    padding: 0 5px;
  }

  .chart-frame {
    height: 470px;
  }

  .chart-footnote {
    gap: 12px;
  }

  .chart-footnote span:last-child {
    width: 100%;
    margin-left: 0;
  }

  .insight-link {
    padding: 16px;
  }

  .placeholder-heading {
    min-height: 330px;
  }

  .placeholder-heading h1,
  .state-panel h1 {
    font-size: 32px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
}

@media (max-width: 390px) {
  .nav-brand > span {
    display: none;
  }

  .zone-legend-link {
    padding: 7px 8px;
    font-size: 10px;
  }

  .map-frame {
    height: 430px;
  }

  .range-controls-row {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 6px;
  }

  .range-date-control {
    padding: 0 6px;
  }

  .range-date-control > span {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
  }

  .range-date-control input {
    width: 100%;
  }
}

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