:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef4f8;
  --text: #10212f;
  --muted: #5c7180;
  --line: #dbe5ec;
  --primary: #0876a8;
  --primary-dark: #075b81;
  --primary-soft: #e4f3fa;
  --accent: #14a6a1;
  --danger: #ad2e38;
  --success: #16845b;
  --warning: #9d6400;
  --shadow: 0 14px 38px rgba(31, 62, 83, .09);
  --radius: 18px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c151c;
  --surface: #14212a;
  --surface-2: #1b2b36;
  --text: #edf5f9;
  --muted: #a2b5c2;
  --line: #2c3f4b;
  --primary: #45b8e8;
  --primary-dark: #70c9ee;
  --primary-soft: #153747;
  --accent: #4cd1c9;
  --danger: #ff8d95;
  --success: #66d7a9;
  --warning: #f2c66d;
  --shadow: 0 14px 38px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 0, rgba(8, 118, 168, .10), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.shell { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand strong { display: block; font-size: 1.02rem; letter-spacing: .01em; }
.brand small { display: block; color: var(--muted); font-size: .76rem; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg, var(--primary), var(--accent)); box-shadow: 0 8px 18px rgba(8, 118, 168, .25); }
.brand-mark svg { width: 31px; fill: white; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; font-size: .78rem; font-weight: 750; background: var(--surface-2); color: var(--muted); }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 16%, transparent); }
.status-ok { color: var(--success); }
.status-warning { color: var(--warning); }
.status-error { color: var(--danger); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); cursor: pointer; }

.page { padding-block: 44px 64px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: end; margin-bottom: 30px; }
.eyebrow { margin: 0 0 6px; color: var(--primary); font-size: .72rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; max-width: 780px; font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.04; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: clamp(1.25rem, 2vw, 1.65rem); letter-spacing: -.025em; }
.lead { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 1.06rem; }
.hero-meta { padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--muted); box-shadow: var(--shadow); font-size: .78rem; }
.hero-meta span, .hero-meta strong { display: block; }
.hero-meta strong { color: var(--text); font-size: .92rem; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { min-height: 154px; padding: 19px; overflow: hidden; }
.kpi-primary { position: relative; background: linear-gradient(145deg, var(--primary-dark), var(--primary)); color: white; border-color: transparent; }
.kpi-primary::after { content: ""; position: absolute; right: -35px; bottom: -55px; width: 150px; height: 150px; border-radius: 50%; border: 28px solid rgba(255,255,255,.10); }
.kpi-primary .kpi-label, .kpi-primary .kpi-foot { color: rgba(255,255,255,.75); }
.kpi-label { color: var(--muted); font-size: .78rem; font-weight: 700; }
.kpi-row { display: flex; align-items: baseline; gap: 7px; margin-top: 13px; }
.kpi-row strong { font-size: clamp(2rem, 4vw, 3rem); line-height: 1; letter-spacing: -.04em; }
.kpi-row span { color: inherit; font-size: .94rem; font-weight: 750; opacity: .75; }
.kpi-foot { margin-top: 13px; color: var(--muted); font-size: .78rem; }
.model-name { margin-top: 17px; font-size: 1.18rem; font-weight: 800; line-height: 1.25; }

.chart-card { padding: 22px; margin-bottom: 18px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-header.compact { margin-bottom: 18px; }
.range-switch { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.range-switch button { border: 0; padding: 8px 12px; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 750; font-size: .8rem; }
.range-switch button.active { background: var(--surface); color: var(--primary); box-shadow: 0 3px 10px rgba(20, 45, 61, .10); }
.chart-wrap { position: relative; width: 100%; height: 430px; }
.chart-legend-note { display: flex; flex-wrap: wrap; gap: 18px; padding-top: 14px; color: var(--muted); font-size: .76rem; }
.chart-legend-note span { display: inline-flex; align-items: center; gap: 7px; }
.legend-line { width: 24px; height: 3px; border-radius: 999px; background: var(--primary); }
.legend-line.forecast { background: var(--accent); border-top: 1px dashed var(--accent); }
.legend-area { width: 24px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 20%, transparent); }

.content-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: 18px; margin-bottom: 18px; }
.content-grid > .card, main > .card:not(.chart-card) { padding: 22px; }
.forecast-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.forecast-item { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.forecast-item .horizon { color: var(--muted); font-size: .74rem; font-weight: 750; }
.forecast-item strong { display: block; margin-top: 7px; font-size: 1.45rem; letter-spacing: -.025em; }
.forecast-item .interval { margin-top: 6px; color: var(--muted); font-size: .72rem; }
.forecast-item .time { margin-top: 9px; color: var(--muted); font-size: .7rem; }
.metrics-list { display: grid; gap: 10px; }
.metric-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; }
.metric-horizon { font-weight: 800; }
.metric-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.metric-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.metric-value { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.metric-bad .metric-bar span { background: var(--warning); }

.station-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.station-item { padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.station-item strong { display: block; font-size: .9rem; }
.station-item .station-value { margin-top: 7px; font-size: 1.25rem; font-weight: 800; }
.station-item small { display: block; margin-top: 5px; color: var(--muted); font-size: .68rem; }

.methodology { display: grid; grid-template-columns: 1.4fr .8fr; gap: 22px; margin-top: 18px; padding: 26px; border-radius: var(--radius); background: linear-gradient(145deg, var(--primary-soft), color-mix(in srgb, var(--surface) 80%, var(--accent) 20%)); }
.methodology p { margin-bottom: 0; color: var(--muted); }
.notice { padding: 17px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.notice strong { color: var(--warning); }
.notice p { margin-top: 6px; font-size: .82rem; }
.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; }
.alert-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--line)); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .78rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); font-size: .74rem; }

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .station-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .forecast-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1180px); }
  .page { padding-top: 30px; }
  .hero { grid-template-columns: 1fr; }
  .hero-meta { width: max-content; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 138px; padding: 16px; }
  .section-header { align-items: flex-start; flex-direction: column; }
  .chart-wrap { height: 360px; }
  .forecast-grid { grid-template-columns: 1fr 1fr; }
  .station-grid { grid-template-columns: 1fr 1fr; }
  .methodology { grid-template-columns: 1fr; padding: 20px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 18px; }
  .status-pill { display: none; }
}
@media (max-width: 430px) {
  .kpi-grid, .forecast-grid, .station-grid { grid-template-columns: 1fr; }
  .chart-card, .content-grid > .card, main > .card:not(.chart-card) { padding: 17px; }
}
