:root {
  color-scheme: light dark;
  --background: #f4f6fc;
  --surface: #fff;
  --ink: #192438;
  --muted: #56647d;
  --border: #d6deef;
  --primary: #305ed4;
  --tint: #edf2ff;
  --warning: #8b4513;
  --warning-background: #fff3e6;
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #101827;
    --surface: #172235;
    --ink: #f0f4ff;
    --muted: #bac7df;
    --border: #35435b;
    --primary: #96b5ff;
    --tint: #233452;
    --warning: #ffcc98;
    --warning-background: #402b22;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--background); }
a { color: var(--primary); text-underline-offset: .2em; }
button, select { font: inherit; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
button, select { color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; min-height: 44px; }
button { padding-inline: 15px; cursor: pointer; }
button:disabled { opacity: .65; cursor: progress; }
select { padding-inline: 9px; max-width: 100%; }

.wrap { width: min(1100px, calc(100% - 36px)); margin: 0 auto; padding: 22px 0 55px; }
.header, .title, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.logo { font-size: 1.7rem; font-weight: 850; letter-spacing: -.05em; text-decoration: none; }
.zone, .section-title label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.title { margin-top: 34px; align-items: end; }
.station { margin: 0; color: var(--primary); font-weight: 700; letter-spacing: .05em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.045em; margin: 4px 0 0; }
h2 { font-size: 1.33rem; margin: 0 0 12px; letter-spacing: -.015em; }
p { margin: 0; }
nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 20px 0 12px; border-block: 1px solid var(--border); }
nav a { display: flex; min-height: 44px; align-items: center; font-weight: 590; }
section { margin-top: 28px; scroll-margin-top: 15px; }
section#sources p { margin: 8px 0; color: var(--muted); }
.section-title { margin-bottom: 11px; }
.section-title h2 { margin: 0; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: clamp(16px, 3vw, 26px); }
.panel > * + * { margin-top: 14px; }
.status, .meta, .empty { color: var(--muted); font-size: .92rem; }
.status:empty { display: none; }
.warning { background: var(--warning-background); color: var(--warning); border-radius: 8px; padding: 8px 12px; }
.current-heading { display: flex; align-items: end; gap: 10px 20px; flex-wrap: wrap; }
.temperature { font-size: clamp(2.7rem, 6vw, 4rem); font-weight: 780; letter-spacing: -.055em; line-height: 1.08; }
.condition { font-size: 1.12rem; font-weight: 680; }
.conditions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); gap: 12px 22px; padding: 16px 0 0; border-top: 1px solid var(--border); }
dl { margin: 0; }
dt { color: var(--muted); font-size: .875rem; }
dd { margin: 2px 0 0; font-weight: 625; overflow-wrap: anywhere; }
.raw { padding: 13px; margin-bottom: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--tint); border-radius: 8px; font: .9rem/1.55 ui-monospace, "SF Mono", Consolas, monospace; }
.raw mark { background: var(--warning-background); color: var(--warning); font-weight: 750; }

.periods { display: grid; list-style: none; margin-bottom: 0; padding: 0; }
.period { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 2fr); gap: 5px 18px; padding: 12px 0; border-top: 1px solid var(--border); }
.period p + p { margin-top: 4px; }
.period-title { font-weight: 690; }
.panel summary { cursor: pointer; padding: 5px 0; color: var(--primary); font-weight: 620; }
.history-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.history-table th, .history-table td { border-bottom: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.history-table th:last-child, .history-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.grid-scroll { overflow-x: auto; }
.grid-scroll:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.grid-scroll table { min-width: 620px; }

@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .title { margin-top: 23px; }
  .period { grid-template-columns: 1fr; }
  .section-title label { flex-wrap: wrap; }
}
