:root {
  color-scheme: light;
  --navy: #1a365d;
  --blue: #2b6cb0;
  --blue-dark: #234e7d;
  --blue-soft: #ebf4ff;
  --page: #f0f4f8;
  --surface: #ffffff;
  --text: #1a202c;
  --muted: #5f6f82;
  --border: #dce4ed;
  --border-light: #edf2f7;
  --success: #2f855a;
  --danger: #c53030;
  --shadow: 0 1px 3px rgba(26, 54, 93, 0.12);
  --radius: 12px;
  --container: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}

button, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }

.container {
  width: min(calc(100% - 32px), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 0.6rem 0.85rem;
  border-radius: 7px;
  background: var(--surface);
  color: var(--navy);
  box-shadow: var(--shadow);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  padding: 2rem 1rem 1.6rem;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #ffffff;
  text-align: center;
}
.header-content { display: grid; justify-items: center; }
.header-kicker {
  margin: 0 0 0.35rem;
  color: #c8def5;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-header h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.header-description {
  max-width: 720px;
  margin: 0.5rem 0 0;
  color: #e1edf8;
  font-size: 0.92rem;
}
.release-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.8rem;
  color: #d7e7f6;
  font-size: 0.78rem;
}
.release-line strong { color: #ffffff; }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #68d391;
  box-shadow: 0 0 0 3px rgba(104, 211, 145, 0.18);
}

.main-layout {
  display: grid;
  gap: 18px;
  padding: 1.5rem 0 2.5rem;
}

.panel {
  min-width: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel { padding: 1.25rem 1.5rem; }

.controls {
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(390px, 1.6fr) auto;
  gap: 1.2rem;
  align-items: start;
}
.control-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.control-group > span,
.control-group legend {
  display: block;
  margin: 0 0 0.45rem;
  color: #4a5568;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
select {
  width: 100%;
  min-height: 42px;
  padding: 0 2.3rem 0 0.8rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
}
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(49, 130, 206, 0.3);
  outline-offset: 2px;
}
.vintage-toggles { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.vintage-button {
  min-height: 32px;
  padding: 0.34rem 0.72rem;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.vintage-button:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(26, 54, 93, 0.14); }

.toolbar-actions {
  display: flex;
  max-width: 215px;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-content: start;
  justify-content: flex-end;
  padding-top: 1.15rem;
}
.action-button {
  min-height: 32px;
  padding: 0.35rem 0.65rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: #edf2f7;
  color: #4a5568;
  font-size: 0.74rem;
  font-weight: 600;
}
.action-button:hover { background: #e2e8f0; color: var(--navy); }
.action-button--primary { border-color: var(--blue); background: var(--blue); color: #ffffff; }
.action-button--primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); color: #ffffff; }

.chart-heading,
.compact-heading {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.chart-heading h2,
.compact-heading h2,
.information-grid h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.chart-heading p,
.compact-heading span {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.chart-wrap { position: relative; width: 100%; height: 480px; }
.legend-note {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  justify-content: center;
  margin: 0.7rem 0 0;
  color: #718096;
  font-size: 0.75rem;
  font-style: italic;
}
.legend-note span { display: inline-flex; gap: 0.4rem; align-items: center; }
.line-sample { display: inline-block; width: 24px; border-top: 3px solid #071b2a; }
.line-sample--forecast { border-top: 2px dashed var(--blue); }
.zone-sample { width: 22px; height: 11px; border: 1px solid #cbdbea; background: var(--blue-soft); }

.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
th, td {
  padding: 0.45rem 0.58rem;
  border-bottom: 1px solid var(--border-light);
  text-align: right;
  white-space: nowrap;
}
th {
  background: #f7fafc;
  color: #4a5568;
  font-size: 0.7rem;
  font-weight: 700;
}
th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  text-align: left;
  font-weight: 700;
}
th:first-child { z-index: 2; background: #f7fafc; }
tbody tr:hover td { background: #f8fbff; }
tbody tr:hover td:first-child { background: #f8fbff; }
.actual-row td { font-weight: 700; }
.forecast-zone-cell { background: #f4f8fc; }
.empty-cell { margin: 0; padding: 1rem 0; color: var(--muted); }

.information-grid { display: grid; grid-template-columns: 0.95fr 1.55fr; gap: 18px; }
.methodology p,
.sources p { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.8rem; }
.method-note { padding-top: 0.7rem; border-top: 1px solid var(--border-light); }
.method-note strong { color: var(--navy); }
.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.source-item {
  display: inline-flex;
  gap: 0.25rem;
  align-items: baseline;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--navy);
  text-decoration: none;
}
.source-item:hover { border-color: #90b4d5; background: #f8fbff; }
.source-item strong { font-size: 0.72rem; }
.source-item span { color: #718096; font-size: 0.68rem; }
.source-note { padding-top: 0.65rem; border-top: 1px solid var(--border-light); }
code { padding: 0.1rem 0.3rem; border-radius: 4px; background: #edf2f7; color: var(--navy); }

.footer { padding: 1.2rem 0; background: var(--navy); color: #cbdced; }
.footer-inner { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.footer p { margin: 0; font-size: 0.78rem; }
.footer a { color: #ffffff; font-size: 0.78rem; }

.toast {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  max-width: min(340px, calc(100vw - 36px));
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: var(--navy);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(26, 54, 93, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 150ms ease, transform 150ms ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.fatal-error { max-width: 760px; margin: 2rem auto; padding: 1.2rem; border: 1px solid #feb2b2; border-radius: 8px; background: #fff5f5; color: var(--danger); }

@media (max-width: 930px) {
  .controls { grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.4fr); }
  .toolbar-actions { grid-column: 1 / -1; max-width: none; justify-content: flex-start; padding-top: 0; }
}

@media (max-width: 700px) {
  .container { width: min(calc(100% - 22px), var(--container)); }
  .site-header { padding: 1.65rem 0.7rem 1.35rem; }
  .controls { grid-template-columns: 1fr; }
  .toolbar-actions { grid-column: auto; }
  .panel { padding: 1rem; }
  .chart-wrap { height: 360px; }
  .compact-heading { display: block; }
  .information-grid { grid-template-columns: 1fr; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .toolbar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-button { width: 100%; }
  .release-line > span[aria-hidden="true"] { display: none; }
  .release-line { flex-direction: column; }
}

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