:root {
  color-scheme: light;
  --ink: #13272a;
  --muted: #607477;
  --paper: #f4f7f3;
  --surface: #ffffff;
  --line: #dce7e4;
  --teal: #087f72;
  --teal-dark: #075c54;
  --aqua: #cfeee8;
  --orange: #e27d4d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at top right, #d9f2ea 0, transparent 38%), var(--paper); }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 72px; }
.hero { max-width: 720px; padding: 28px 0 36px; }
.eyebrow { margin: 0 0 10px; color: var(--teal); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; }
h1, h2, p { margin: 0; }
h1 { max-width: 680px; font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: 0.98; letter-spacing: -0.06em; }
h2 { font-size: 1.2rem; letter-spacing: -0.02em; }
.lede { max-width: 620px; margin-top: 18px; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.controls, .chart-panel, .navigation-note { background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 18px 45px rgba(12, 58, 55, 0.07); }
.controls { display: grid; grid-template-columns: minmax(220px, 0.7fr) 1.6fr; gap: 28px; align-items: end; padding: 26px; }
form { display: grid; grid-template-columns: 1.35fr 1fr 0.75fr auto; gap: 12px; align-items: end; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
select, input, button { width: 100%; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); font: inherit; }
select, input { padding: 0 12px; color: var(--ink); background: var(--surface); }
button { padding: 0 18px; color: #fff; background: var(--teal); border-color: var(--teal); font-weight: 800; cursor: pointer; }
button:hover { background: var(--teal-dark); }
.status { min-height: 26px; padding: 18px 4px 8px; color: var(--muted); font-size: 0.9rem; }
.status.error { color: #a13d2c; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 12px 0; }
.metric { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.metric span { display: block; color: var(--muted); font-size: 0.76rem; }
.metric strong { display: block; margin-top: 10px; font-size: 1.1rem; }
.chart-panel { margin-top: 12px; padding: 26px; }
.panel-heading { display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.legend { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.legend i, .legend b { display: inline-block; width: 22px; height: 9px; margin: 0 4px 0 10px; border-radius: 5px; vertical-align: middle; background: var(--aqua); }
.legend b { height: 3px; background: var(--orange); }
.chart-wrap { min-height: 320px; margin-top: 20px; }
#forecast-chart { display: block; width: 100%; height: 320px; overflow: visible; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-label { fill: var(--muted); font-size: 12px; }
.band { fill: var(--aqua); opacity: 0.85; }
.median { fill: none; stroke: var(--orange); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart-note { margin-top: 12px; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.navigation-note { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 28px; margin-top: 12px; padding: 24px 26px; }
.navigation-note > p { color: var(--muted); line-height: 1.55; }
.evidence-note { display: block; margin-top: 12px; color: var(--teal-dark); line-height: 1.4; }
[hidden] { display: none; }
@media (max-width: 860px) {
  .controls, .navigation-note { grid-template-columns: 1fr; }
  form { grid-template-columns: repeat(2, 1fr); }
  form button { grid-column: span 2; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 22px, 1120px); padding-top: 24px; }
  .controls, .chart-panel, .navigation-note { padding: 18px; border-radius: 18px; }
  form, .summary-grid { grid-template-columns: 1fr; }
  form button { grid-column: auto; }
  .panel-heading { display: grid; }
  .chart-wrap { min-height: 240px; }
  #forecast-chart { height: 240px; }
}
