:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-sunk: #eef1f5;
  --fg: #16181d;
  --fg-soft: #5a6472;
  --line: #dfe3ea;
  --accent: #1f5fa9;
  --accent-soft: #e8f0fa;
  --past: #1f5fa9;
  --fcst: #c2410c;
  --low: #2f9e5f;
  --elev: #d99500;
  --high: #cf3b2f;
  --maxw: 44rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.1rem; }
.wrap-wide { max-width: 62rem; margin: 0 auto; padding: 0 1.1rem; }
.intro { max-width: var(--maxw); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- chrome ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-head .wrap-wide {
  display: flex; align-items: baseline; gap: 1.2rem;
  padding-top: .85rem; padding-bottom: .85rem;
}
.brand { font-weight: 650; color: var(--fg); letter-spacing: -.01em; }
.site-head nav { margin-left: auto; display: flex; gap: 1.1rem; font-size: .92rem; }

.site-foot {
  margin-top: 4rem; padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--fg-soft); font-size: .88rem;
}
.site-foot a { color: var(--fg-soft); text-decoration: underline; }

/* ---------- typography ---------- */
h1 {
  font-size: 2.05rem; line-height: 1.18; letter-spacing: -.02em;
  margin: 2.2rem 0 .5rem; font-weight: 680;
}
h2 {
  font-size: 1.32rem; line-height: 1.3; letter-spacing: -.01em;
  margin: 2.6rem 0 .7rem; font-weight: 660;
}
h3 { font-size: 1.05rem; margin: 1.6rem 0 .4rem; font-weight: 640; }
p { margin: 0 0 1.05rem; }
.lede { color: var(--fg-soft); font-size: 1.06rem; margin-top: 0; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .09em; font-size: .72rem;
  color: var(--fg-soft); font-weight: 600; margin: 0;
}
.muted { color: var(--fg-soft); }
small, .small { font-size: .86rem; }

/* ---------- key figures ---------- */
.keyfacts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: .6rem; margin: 1.4rem 0 2rem; padding: 0; list-style: none;
}
.keyfacts li {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: .6rem .75rem;
}
.keyfacts b { display: block; font-size: 1.28rem; font-weight: 660; letter-spacing: -.01em; }
.keyfacts span { display: block; font-size: .78rem; color: var(--fg-soft); line-height: 1.35; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; margin: 1.2rem 0 1.6rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: right; padding: .42rem .55rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-weight: 620; color: var(--fg-soft); border-bottom: 1px solid var(--fg-soft); }
tbody tr:hover { background: var(--bg-soft); }
td.num, th.num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .84rem; }

/* ---------- chart ---------- */
.panel {
  border: 1px solid var(--line); border-radius: 10px;
  padding: .9rem 1rem 1rem; margin: 1.2rem 0 1.6rem; background: var(--bg);
}
.panel-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin-bottom: .7rem;
}
.panel-head h2, .panel-head h3 { margin: 0; }
.toggle { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.toggle button {
  font: inherit; font-size: .8rem; padding: .22rem .7rem; border: 0;
  background: var(--bg); color: var(--fg-soft); cursor: pointer;
}
.toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; }
#chart { width: 100%; height: 290px; display: block; }
@media (max-width: 30rem) { #chart { height: 230px; } }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; color: var(--fg-soft); margin-top: .5rem; }
.chart-legend i { display: inline-block; width: 1.1rem; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: .35rem; }
.swatch-past { color: var(--past); }
.swatch-fcst { color: var(--fcst); border-top-style: dashed !important; }
.status { color: var(--fg-soft); font-size: .88rem; }

/* ---------- pressure zone key ---------- */
.zone-key {
  list-style: none; padding: 0; margin: .5rem 0 0;
  display: flex; flex-wrap: wrap; gap: .25rem .9rem;
  font-size: .76rem; color: var(--fg-soft);
}
.zone-key i {
  display: inline-block; width: .7rem; height: .7rem; border-radius: 3px;
  vertical-align: -1px; margin-right: .3rem; border: 1px solid var(--line);
}
.zone-key .zn { font-weight: 600; color: var(--fg); }
.zone-key .zv { font-family: var(--mono); font-size: .72rem; }
.zone-key .zu { font-size: .7rem; font-style: italic; opacity: .8; }
.zone-key .zone-very-low i  { background: rgba(207,59,47,0.28); border-color: #cf3b2f; }
.zone-key .zone-low i       { background: rgba(217,149,0,0.26); border-color: #c78a00; }
/* normal is the unpainted baseline on the chart — the swatch says so */
.zone-key .zone-normal i    { background: #fff; border: 1px dashed #2f9e5f; }
.zone-key .zone-high i      { background: rgba(31,95,169,0.24); border-color: #1f5fa9; }
.zone-key .zone-very-high i { background: rgba(101,74,168,0.28); border-color: #654aa8; }

/* ---------- seasonal climatology chart ---------- */
#seasonal { width: 100%; height: 230px; display: block; }
@media (max-width: 30rem) { #seasonal { height: 200px; } }
.seasonal-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; color: var(--fg-soft); margin-top: .5rem; }
.seasonal-legend i { display: inline-block; width: 1.1rem; vertical-align: middle; margin-right: .35rem; }
.seasonal-legend .sw-level i { height: 0; border-top: 3px solid var(--fcst); }
.seasonal-legend .sw-vol i { height: .7rem; background: rgba(31,95,169,0.30); border-radius: 2px; }

/* ---------- outlook calendar (30 past days + 16-day forecast) ---------- */
.outlook-cal { margin: .9rem 0 .6rem; }
.cal-head, .cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: .28rem;
}
.cal-head {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--fg-soft); text-align: center; margin-bottom: .25rem;
}
.cal-pad { visibility: hidden; }
.cal-day {
  position: relative; border-radius: 6px; padding: .3rem .15rem .25rem;
  text-align: center; border: 1px solid var(--line); background: var(--bg-soft);
  min-height: 2.9rem; cursor: default;
}
.cal-day .dnum { display: block; font-size: .82rem; font-weight: 640; line-height: 1.15; }
.cal-day .dval {
  display: block; font-size: .64rem; color: var(--fg-soft);
  font-family: var(--mono); line-height: 1.2;
}
.cal-day .mon {
  position: absolute; top: -.72rem; left: 0; font-size: .62rem;
  letter-spacing: .04em; color: var(--fg-soft); font-weight: 600;
}
.cal-day .sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.cal-day.low  { background: #eef8f1; border-color: #cfe8d8; }
.cal-day.low .dnum { color: var(--low); }
.cal-day.elevated { background: #fdf6e3; border-color: #efe0b5; }
.cal-day.elevated .dnum { color: var(--elev); }
.cal-day.high { background: #fdeeec; border-color: #f2ccc7; }
.cal-day.high .dnum { color: var(--high); }
.cal-day.nodata { background: var(--bg-sunk); border-color: var(--line); }
.cal-day.nodata .dnum { color: var(--fg-soft); }

/* the past/future boundary: forecast days are outlined, not filled */
.cal-day.future { background: var(--bg); border-style: dashed; }
.cal-day.future.low { border-color: #9fd4b5; }
.cal-day.future.elevated { border-color: #e3c877; }
.cal-day.future.high { border-color: #e8a49b; }
.cal-day.today {
  box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent);
  border-style: solid;
}
.cal-day.today .dnum::after {
  content: "today"; display: block; font-size: .55rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--accent);
}

.cal-key {
  list-style: none; padding: 0; margin: .5rem 0 .3rem;
  display: flex; flex-wrap: wrap; gap: .25rem .9rem;
  font-size: .76rem; color: var(--fg-soft);
}
.cal-key i {
  display: inline-block; width: .8rem; height: .8rem; border-radius: 3px;
  vertical-align: -2px; margin-right: .3rem; border: 1px solid var(--line);
}
.cal-key .k-low i { background: #eef8f1; border-color: #cfe8d8; }
.cal-key .k-elev i { background: #fdf6e3; border-color: #efe0b5; }
.cal-key .k-high i { background: #fdeeec; border-color: #f2ccc7; }
.cal-key .k-fcst i { background: var(--bg); border: 1px dashed var(--fg-soft); }
@media (max-width: 22rem) {
  .cal-day { min-height: 2.5rem; }
  .cal-day .dval { display: none; }
}

.disclaimer {
  font-size: .82rem; color: var(--fg-soft); background: var(--bg-soft);
  border-left: 3px solid var(--line); padding: .6rem .8rem; border-radius: 0 6px 6px 0;
}

/* ---------- city index / search ---------- */
.searchbox {
  width: 100%; font: inherit; padding: .6rem .8rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg-soft);
}
.searchbox:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.citygrid {
  list-style: none; padding: 0; margin: 1rem 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .15rem .8rem;
}
.citygrid li { font-size: .93rem; }
.citygrid li[hidden] { display: none; }

.related { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.related li a {
  display: inline-block; font-size: .88rem; padding: .18rem .6rem;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
}

.geo-results { list-style: none; padding: 0; margin: .6rem 0 0; }
.geo-results li { border-bottom: 1px solid var(--line); }
.geo-results button {
  font: inherit; text-align: left; width: 100%; background: none; border: 0;
  padding: .5rem .2rem; cursor: pointer; color: var(--accent);
}
.geo-results button:hover { background: var(--bg-soft); }
