:root {
  color-scheme: light dark;
  --bg: #f4f1eb;
  --ink: #102020;
  --muted: #5f6a66;
  --line: rgba(16, 32, 32, 0.16);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: #ffffff;
  --accent: #0b6b64;
  --accent-strong: #0b3b3c;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #047857;
  --shadow: 0 26px 70px rgba(37, 45, 39, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #06100f;
    --ink: #eef7f2;
    --muted: #9fb3ab;
    --line: rgba(210, 232, 220, 0.16);
    --panel: rgba(10, 24, 22, 0.82);
    --panel-strong: #0d1f1d;
    --accent: #38c5b2;
    --accent-strong: #8ce7d8;
    --warn: #f0a63c;
    --danger: #fb7185;
    --ok: #34d399;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(244, 241, 235, 0.78), rgba(244, 241, 235, 0.98)),
    radial-gradient(circle at 18% 0%, rgba(11, 107, 100, 0.18), transparent 32rem),
    linear-gradient(135deg, #f4f1eb, #e8ede8);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      linear-gradient(180deg, rgba(6, 16, 15, 0.82), rgba(6, 16, 15, 0.98)),
      radial-gradient(circle at 18% 0%, rgba(56, 197, 178, 0.18), transparent 32rem),
      linear-gradient(135deg, #06100f, #081514);
  }
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 42px;
}

.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 42px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.kicker,
.section-heading p,
.status-strip span,
.reserve-number small,
.source-section,
.slider-scale,
.lab-result span,
.scenario-row span {
  color: var(--muted);
}

.kicker {
  margin: 0 0 18px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: 5.5rem;
  line-height: 0.9;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

button.secondary-action {
  font: inherit;
  cursor: pointer;
}

.primary-action {
  background: var(--accent-strong);
  color: #ffffff;
}

.secondary-action {
  min-width: 128px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
}

.secondary-action.is-copied {
  border-color: transparent;
  background: var(--ok);
  color: #ffffff;
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-2px);
}

.copy-status {
  min-height: 1.4rem;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.reserve-visual {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.reserve-visual svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(var(--shadow));
  transform: rotate(-90deg);
}

.gauge-track,
.gauge-fill,
.gauge-threshold {
  fill: none;
  stroke-width: 24;
}

.gauge-track {
  stroke: rgba(128, 128, 128, 0.16);
}

.gauge-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 704;
  stroke-dashoffset: 704;
  transition: stroke-dashoffset 0.8s ease, stroke 0.3s ease;
}

.gauge-threshold {
  stroke: var(--danger);
  stroke-width: 4;
  stroke-dasharray: 704;
  stroke-dashoffset: 704;
  opacity: 0.9;
}

.reserve-number {
  position: absolute;
  display: grid;
  place-items: center;
  line-height: 1;
}

.reserve-number span {
  font-size: 4rem;
  font-weight: 900;
}

.reserve-number small {
  margin-top: 8px;
  font-weight: 800;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.status-strip div {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  background: var(--panel-strong);
}

.status-strip strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.eu-trajectory-section {
  padding: 38px 0 18px;
  border-bottom: 1px solid var(--line);
}

.section-eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eu-trajectory-panel {
  overflow: hidden;
  border: 1px solid rgba(110, 123, 217, 0.35);
  border-radius: 18px;
  background:
    radial-gradient(circle at 78% 4%, rgba(110, 123, 217, 0.14), transparent 28rem),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.eu-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  padding: 28px 30px 18px;
}

.eu-metric {
  display: grid;
  gap: 7px;
  align-content: start;
}

.eu-metric > span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.eu-metric strong {
  color: #6e7bd9;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.eu-metric-target strong {
  color: var(--ok);
}

.eu-metric small {
  min-height: 1.25rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.eu-metric small[data-tone="ok"] {
  color: var(--ok);
}

.eu-metric small[data-tone="warn"] {
  color: var(--warn);
}

.metric-key {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 7px;
  border-radius: 3px;
  vertical-align: -1px;
}

.metric-key-actual {
  background: #6e7bd9;
}

.metric-key-norm {
  background: #66707e;
}

.metric-key-target {
  background: var(--ok);
}

.eu-chart-wrap {
  padding: 0 18px 8px;
}

#eu-chart,
#de-chart {
  display: block;
  width: 100%;
  min-height: 280px;
}

.eu-grid,
.eu-norm {
  stroke: rgba(128, 128, 128, 0.18);
  stroke-width: 1;
  stroke-dasharray: 3 6;
}

.eu-target {
  stroke: var(--ok);
  stroke-width: 2;
  stroke-dasharray: 8 7;
}

.eu-area {
  fill: url(#eu-area-fill);
}

.eu-line {
  fill: none;
  stroke: #6e7bd9;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eu-projection {
  fill: none;
  stroke: #6e7bd9;
  stroke-width: 3;
  stroke-dasharray: 9 8;
  stroke-linecap: round;
  animation: eu-projection-reveal 0.9s ease-out both;
}

.eu-current-dot,
.eu-norm-dot,
.eu-target-dot {
  fill: var(--panel-strong);
  stroke: #6e7bd9;
  stroke-width: 3;
}

.eu-norm-dot {
  fill: #66707e;
  stroke: var(--panel-strong);
  stroke-width: 3;
}

.eu-target-dot {
  stroke: var(--ok);
}

.eu-axis-label,
.eu-callout,
.eu-callout-muted,
.eu-projection-label {
  fill: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.eu-axis-target,
.eu-projection-label {
  fill: var(--ok);
}

.eu-callout {
  fill: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.eu-callout-muted {
  font-size: 12px;
  font-weight: 700;
}

.eu-projection-label {
  font-size: 16px;
}

.eu-trajectory-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.eu-trajectory-footer strong {
  color: var(--ink);
}

.eu-source-note {
  padding: 0 30px 24px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.eu-source-note a,
.target-footnote a,
.site-footer a {
  color: var(--accent-strong);
  font-weight: 800;
}

.target-footnote {
  max-width: 28rem;
  padding-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.target-footnote a {
  white-space: nowrap;
  text-decoration: none;
}

@keyframes eu-projection-reveal {
  from {
    opacity: 0;
    stroke-dashoffset: 44;
  }
  to {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

.trend-section,
.scenario-lab,
.scenario-section,
.source-section {
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

h2 {
  font-size: 2rem;
  line-height: 1.05;
}

.section-heading p {
  max-width: 440px;
  text-align: right;
  line-height: 1.45;
}

.trend-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

#trend-chart {
  width: 100%;
  min-height: 260px;
  display: block;
}

.trend-grid {
  stroke: rgba(128, 128, 128, 0.18);
  stroke-width: 1;
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-area {
  fill: rgba(11, 107, 100, 0.12);
}

.trend-threshold {
  stroke: var(--danger);
  stroke-width: 2;
  stroke-dasharray: 8 8;
}

.trend-label {
  fill: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.slider-block {
  display: grid;
  gap: 14px;
}

.slider-block label {
  font-size: 1.1rem;
  font-weight: 900;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.slider-track {
  position: relative;
  padding-top: 28px;
}

.slider-marker {
  position: absolute;
  top: 0;
  z-index: 1;
  width: 2px;
  height: 58px;
  background: var(--accent);
  pointer-events: none;
  transition: left 0.25s ease;
}

.slider-marker::before {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.slider-marker span {
  position: absolute;
  top: -24px;
  left: 50%;
  width: max-content;
  max-width: 170px;
  color: currentColor;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.1;
  transform: translateX(-50%);
}

.slider-marker-required {
  color: var(--accent-strong);
}

.slider-marker-technical {
  color: var(--muted);
  background: var(--muted);
}

.target-rate-detail {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.slider-scale strong {
  color: var(--ink);
}

.lab-result {
  display: grid;
  gap: 8px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.lab-result[data-tone="danger"] {
  border-left-color: var(--danger);
}

.lab-result[data-tone="ok"] {
  border-left-color: var(--ok);
}

.lab-result strong {
  font-size: 2rem;
  line-height: 1.05;
}

#custom-outcome[data-tone="danger"] {
  color: var(--danger);
}

#custom-outcome[data-tone="ok"] {
  color: var(--ok);
}

.lab-result p {
  color: var(--muted);
  line-height: 1.5;
}

.scenario-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.scenario-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.6fr) minmax(180px, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 86px;
  padding: 18px;
  background: var(--panel-strong);
}

.scenario-row strong {
  font-size: 1.2rem;
}

.scenario-row em {
  justify-self: end;
  color: var(--accent-strong);
  font-style: normal;
  font-weight: 900;
}

.source-section {
  display: grid;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(128, 128, 128, 0.14);
}

@media (max-width: 860px) {
  .hero,
  .lab-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 28px;
  }

  h1 {
    font-size: 3.4rem;
  }

  .reserve-visual {
    justify-self: center;
  }

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

  .eu-metrics {
    gap: 22px;
    padding: 24px 22px 14px;
  }

  .eu-trajectory-footer {
    display: grid;
    padding: 16px 22px;
  }

  .eu-source-note {
    padding: 0 22px 20px;
  }

  .section-heading {
    display: grid;
    align-items: start;
  }

  .section-heading p {
    text-align: left;
  }

  .lab-result {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }

  .scenario-row {
    grid-template-columns: 1fr;
  }

  .scenario-row em {
    justify-self: start;
  }

  .site-footer {
    display: grid;
  }
}

@media (max-width: 520px) {
  .page {
    width: min(100% - 22px, 1180px);
  }

  h1 {
    font-size: 2.8rem;
  }

  .lead {
    font-size: 1rem;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .eu-metrics {
    grid-template-columns: 1fr;
  }

  .eu-chart-wrap {
    padding: 0 8px 4px;
  }

  #eu-chart,
  #de-chart {
    min-height: 240px;
  }

  .reserve-number span {
    font-size: 3.1rem;
  }
}
