:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-context: #898781;
  --hot: #d1341f;
  --seq-1: #174a8f;
  --seq-2: #2a78d6;
  --seq-3: #7fb0ea;
  --seq-4: #b4d0f2;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.1);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --hot: #ff6a52;
    --seq-1: #a9cdf7;
    --seq-2: #5a9cec;
    --seq-3: #3a71bd;
    --seq-4: #2b5591;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.1);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --hot: #ff6a52;
  --seq-1: #a9cdf7;
  --seq-2: #5a9cec;
  --seq-3: #3a71bd;
  --seq-4: #2b5591;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 { font-size: 1.5rem; margin: 0 0 4px; font-weight: 600; }
h2.group-title { font-size: 1.25rem; margin: 0 0 12px; font-weight: 600; }
.group { scroll-margin-top: 16px; }
.card h3 { font-size: 1.125rem; margin: 0 0 4px; font-weight: 600; }
.group + .group { margin-top: 40px; }
p { margin: 0 0 12px; }
.muted { color: var(--text-secondary); }
.small { font-size: 0.8125rem; }
.page-head { margin-bottom: 20px; }

.card + .card { margin-top: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.summary { font-size: 1rem; margin: 8px 0 12px; }
.summary strong { font-weight: 600; }

.chart-frame { position: relative; min-height: 420px; transition: opacity 0.2s; }
.chart-frame.reloading, #cc-body.reloading { opacity: 0.5; }
#wb-chart, #mo-chart, #rn-chart, #lt-chart, #rw-chart { width: 100%; height: 420px; }
.status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; color: var(--text-secondary); text-align: center; padding: 0 16px; }
.status:empty { display: none; }
.status button { margin-left: 8px; font: inherit; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 8px 0 0; padding: 0; color: var(--text-secondary); font-size: 0.875rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .key { width: 18px; height: 2px; border-radius: 1px; }
.legend .key.rect { width: 10px; height: 10px; border-radius: 2px; }

.table-view { margin-top: 12px; }
.table-view summary { cursor: pointer; color: var(--text-secondary); font-size: 0.875rem; }
.table-scroll { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
th, td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--text-secondary); font-weight: 600; }

@media (max-width: 600px) {
  .card { padding: 14px; }
  .chart-frame { min-height: 340px; }
  #wb-chart, #mo-chart, #rn-chart, #lt-chart, #rw-chart, #td-chart, #th-chart, #wh-chart, #wd-chart, #ds-chart, #bm-chart, #by-chart, #wk-chart { height: 340px; }
}

.cc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 8px; }
.cc-head p { margin: 0; }
.stale { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--baseline); border-left: 4px solid #fab219; border-radius: 6px; font-size: 0.875rem; }
.stale::before { content: "Stale data \2014  "; font-weight: 600; }
.cc-hero { margin-bottom: 16px; }
.hero-value { font-size: 3.5rem; line-height: 1.1; font-weight: 600; }
.hero-unit { font-size: 1.5rem; font-weight: 400; margin-left: 4px; color: var(--text-secondary); }
.cc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tile-label { font-size: 0.8125rem; color: var(--text-secondary); }
.tile-value { font-size: 1.75rem; font-weight: 600; line-height: 1.25; }
.tile-unit { font-size: 0.875rem; font-weight: 400; color: var(--text-secondary); }
.tile-sub { font-size: 0.8125rem; color: var(--text-secondary); }
@media (max-width: 600px) { .hero-value { font-size: 3rem; } .cc-grid { grid-template-columns: repeat(2, 1fr); } }

.table-scroll.tall { max-height: 320px; overflow-y: auto; }

.wind-rose { max-width: 460px; margin: 0 auto; }
.wind-rose svg { display: block; width: 100%; height: auto; }

/* Section menu: a sticky sidebar on wide screens, a scrolling bar across the top on narrow ones. */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

.layout { display: grid; grid-template-columns: 180px minmax(0, 960px); gap: 0 24px; justify-content: center; padding: 0 16px; }
.layout main { max-width: none; margin: 0; padding: 24px 0 48px; }
.side-nav { position: sticky; top: 0; align-self: start; padding-top: 24px; }
.side-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: block; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--text-secondary); text-decoration: none; font-size: 0.9375rem; }
.side-nav a:hover { color: var(--text-primary); background: var(--surface); }
.side-nav a[aria-current="true"] { color: var(--text-primary); background: var(--surface); border-color: var(--border); font-weight: 600; }
.side-nav a:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }

@media (max-width: 1099px) {
  .layout { grid-template-columns: minmax(0, 960px); padding: 0; }
  .layout main { padding: 16px 16px 48px; }
  .side-nav { z-index: 10; padding: 0; background: var(--page); border-bottom: 1px solid var(--border); }
  .side-nav ul { flex-direction: row; gap: 8px; padding: 8px 16px; overflow-x: auto; scrollbar-width: none; }
  .side-nav a { white-space: nowrap; }
  .group { scroll-margin-top: 64px; }
}
