/* KC Weather Check */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #18202b; --muted: #5b6676; --line: #dfe3ea;
  --accent: #c47a00; --accent-ink: #8a5600; --link: #0b5fb0;
  --team: #b4331f; --web: #7a5ab8; --nws: #0b7a6b; --model: #6b7280;
  --hi: #c2410c; --lo: #1d4ed8; --wet: #0e7490;
  --good: #15803d; --bad: #b91c1c; --m0: #dcfce7; --m1: #f0fdf4; --m2: #fef3c7; --m3: #fee2e2;
  --radius: 10px;
  /* forecast-history chart: the dataviz reference palette's slots, validated on #fff (light) and #171e27 (dark) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6;
  --ctx: #d3d8e0; --day: #f3f5f8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b; --panel: #171e27; --ink: #e6eaf0; --muted: #9aa5b4; --line: #2a3441;
    --accent: #f0b13a; --accent-ink: #f0b13a; --link: #7cb7ff;
    --team: #ff8a73; --web: #b9a1ff; --nws: #4fd1bd; --model: #a3aab5;
    --hi: #fb923c; --lo: #93b4ff; --wet: #5fd0e6;
    --good: #4ade80; --bad: #f87171; --m0: #14532d; --m1: #1a2e22; --m2: #4a3b10; --m3: #4c1d1d;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9;
    --ctx: #333e4c; --day: #1c2430;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--panel); padding: 6px 10px; z-index: 10; }

.top { background: #101820; border-bottom: 3px solid #ffc400; }   /* the brand navy and gold (logo package), light or dark */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 24px; padding-top: 4px; padding-bottom: 4px; }
.brand { display: flex; align-items: center; margin-left: -8px; }   /* the logo's artwork has its own side margin */
.brand img { display: block; height: 60px; width: auto; max-width: 100%; }
.brand.wordmark { gap: 10px; margin-left: 0; color: #fff; text-decoration: none; font: 700 1.6rem/1 Arial, Helvetica, sans-serif; letter-spacing: -.01em; }
.brand.wordmark img { height: 48px; width: 48px; }
.brand.wordmark b { color: #ffc400; }
.markets > div { padding: 14px 18px; }
nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
nav a { color: #c3cdd8; text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
nav a:hover { color: #fff; }
nav a[aria-current="page"] { color: #fff; border-bottom-color: #ffc400; }

main { padding-top: 24px; padding-bottom: 40px; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 8px 0 12px; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin: 36px 0 8px; }
h3 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--muted); }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 70ch; margin-top: 0; }
.note { color: var(--muted); font-size: .92rem; max-width: 80ch; }
.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 18px; color: var(--muted); max-width: 80ch; }
.empty strong { color: var(--ink); }
.prose { max-width: 72ch; }
.prose li { margin: 6px 0; }
.crumbs { margin: 0; font-size: .92rem; }
.warn { display: inline-block; margin-left: 6px; font-size: .78rem; color: var(--bad); font-weight: 600; }

.hero { padding: 8px 0 4px; }
.board { margin-top: 8px; }
.no1 { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid #ffc400; border-radius: var(--radius); padding: 10px 14px; margin: 8px 0 4px; max-width: 760px; }
.seal { vertical-align: middle; height: 23px; width: auto; }
.facts.no1s > div { flex: 1 1 260px; }
.score.past td, .score.past thead th { text-align: left; white-space: normal; vertical-align: top; }
.score.past td:last-child, .score.past thead th:last-child { text-align: right; }
.score.past tbody th { white-space: nowrap; vertical-align: top; }
.facts.no1s .v { font-size: 1.25rem; line-height: 1.3; margin: 2px 0; }
.rank { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; max-width: 760px; }
.rank li { display: grid; grid-template-columns: 40px 1fr auto; grid-template-areas: "pos who val" "pos sub sub"; align-items: baseline; gap: 2px 12px;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--model); border-radius: var(--radius); padding: 10px 14px; }
.rank li.g-team { border-left-color: var(--team); }
.rank li.g-web { border-left-color: var(--web); }
.rank li.g-nws { border-left-color: var(--nws); }
.pos { grid-area: pos; font-size: 1.4rem; font-weight: 800; color: var(--muted); }
.who { grid-area: who; font-weight: 650; }
.who a { color: var(--ink); text-decoration: none; }
.who a:hover { text-decoration: underline; }
.tag { font-weight: 400; font-size: .8rem; color: var(--muted); margin-left: 6px; }
.val { grid-area: val; text-align: right; color: var(--muted); font-size: .9rem; }
.val b { font-size: 1.25rem; color: var(--ink); }
.sub { grid-area: sub; color: var(--muted); font-size: .88rem; }
.more { font-weight: 600; }

.toprow { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 0 28px; align-items: start; }
.cbox { margin-top: 36px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 4px 18px 8px; }
.cbox h2 { margin: 12px 0 4px; font-size: 1.1rem; }
.cbox p { margin: 0; }
.cpart { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cpart .k { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.cpart .k .dt { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 4px; }
.cpart .v { font-size: 2.2rem; font-weight: 800; line-height: 1.15; }
.cpart .v .hi, .cpart .v .lo { display: inline; font-size: inherit; font-weight: inherit; }
.cpart .what { font-size: .9rem; font-weight: 400; color: var(--muted); }
.cpart .s { color: var(--muted); font-size: .88rem; }
.cpart .s b { color: var(--ink); }
.cpart .s.wet b { color: var(--wet); }
.cbox .how { margin: 8px 0 4px; font-size: .8rem; }
.rank li.g-consensus, .score tr.g-consensus th { border-left-color: var(--accent); }
@media (max-width: 860px) {
  .toprow { grid-template-columns: minmax(0, 1fr); }
  .cbox { order: -1; margin-top: 16px; }
}

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: var(--panel); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; }
tbody th a { color: var(--ink); text-decoration: none; }
tbody th a:hover { text-decoration: underline; }

.fc td { text-align: center; min-width: 74px; }
.fc thead th { text-align: center; }
.fc thead th:first-child { text-align: left; }
.fc .dt { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; }
.fc tr.grp th { background: var(--bg); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 10px; }
.fc tr.stale td { opacity: .5; }
.fc th[scope="row"] { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 190px; }
.hi, .lo, .pop { display: block; line-height: 1.25; }
.hi { color: var(--hi); font-weight: 700; }
.lo { color: var(--lo); font-size: .9rem; }
.pop { color: var(--muted); font-size: .8rem; }
.pop.wet { color: var(--wet); font-weight: 650; }
.none { color: var(--muted); }
.earlier { display: block; opacity: .7; }

.score td { text-align: right; }
.score thead th { white-space: normal; vertical-align: bottom; text-align: right; line-height: 1.25; }
.score thead th:first-child { text-align: left; }
.score td, .score thead th { padding-left: 8px; padding-right: 8px; }
.score td:first-child { text-align: left; }
.score tr.newlead td, .score tr.newlead th { border-top: 2px solid var(--line); }
.score tbody th { border-left: 4px solid var(--model); }
.score tr.g-team th { border-left-color: var(--team); }
.score tr.g-web th { border-left-color: var(--web); }
.score tr.g-nws th { border-left-color: var(--nws); }
.score tr.grp th { border-left: 0; background: var(--bg); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 10px; }
.miss { display: inline-block; min-width: 2.4em; text-align: center; font-size: .8rem; border-radius: 4px; padding: 0 4px; margin-left: 4px; color: var(--ink); }
.m0 { background: var(--m0); } .m1 { background: var(--m1); } .m2 { background: var(--m2); } .m3 { background: var(--m3); }
.ok { color: var(--good); font-weight: 700; margin-left: 4px; }
.bad { color: var(--bad); font-weight: 700; margin-left: 4px; }
.obs td { text-align: right; }

.facts { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 8px; }
.facts > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; min-width: 140px; }
.facts .k { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.facts .v { display: block; font-size: 1.8rem; font-weight: 800; }
.facts .s { display: block; font-size: .82rem; color: var(--muted); max-width: 32ch; }

.srcs { display: grid; gap: 10px; margin: 8px 0; max-width: 80ch; }
.srcs > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.srcs dt { font-weight: 700; }
.srcs dd { margin: 4px 0 0; color: var(--muted); }
.dl dt a { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.foot { border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: .88rem; }
.foot .wrap { padding-top: 16px; padding-bottom: 24px; }
.foot p { max-width: 90ch; }

@media (max-width: 600px) {
  .rank li { grid-template-columns: 32px 1fr; grid-template-areas: "pos who" "pos val" "pos sub"; }
  .val { text-align: left; }
  .fc th[scope="row"] { min-width: 130px; white-space: normal; }
}
.fn { text-decoration: none; font-weight: 700; color: var(--accent-ink); margin-left: 2px; }
.narrow { max-width: 760px; margin: 12px 0; }
.narrow td, .narrow thead th { white-space: normal; text-align: left; }

/* forecast-history charts (day pages) */
.trk-groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.trk-groups button { font: inherit; font-size: .88rem; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.trk-groups button[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.trk-legend { display: none; flex-wrap: wrap; gap: 4px 16px; list-style: none; padding: 0; margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.trk[data-show="team"] .trk-legend[data-group="team"], .trk[data-show="web"] .trk-legend[data-group="web"],
.trk[data-show="other"] .trk-legend[data-group="other"] { display: flex; }
.trk-legend .sw, .trk-tip i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--c); vertical-align: middle; margin-right: 6px; }
.trk-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.trk-plot { position: relative; min-width: 600px; }
.trk-svg { display: block; width: 100%; min-width: 640px; height: auto; touch-action: pan-x pan-y; }
.trk-day { fill: var(--day); }
.trk-grid { stroke: var(--line); stroke-width: 1; }
.trk-ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.trk-ax-day { fill: var(--ink); font-weight: 650; }
.trk-ln { fill: none; stroke: var(--ctx); stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; }
.trk[data-show="team"] .trk-ln[data-group="team"], .trk[data-show="web"] .trk-ln[data-group="web"],
.trk[data-show="other"] .trk-ln[data-group="other"] { stroke: var(--c); stroke-width: 2; }
.trk-actual { stroke: var(--ink); stroke-width: 1.5; }
.trk-actual-l { fill: var(--ink); font-size: 12px; font-weight: 650; paint-order: stroke; stroke: var(--panel); stroke-width: 4px; }
.trk-cross { stroke: var(--muted); stroke-width: 1; display: none; }
.trk-tip { position: absolute; top: 8px; z-index: 2; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  font-size: .82rem; box-shadow: 0 4px 14px rgba(0,0,0,.12); pointer-events: none; white-space: nowrap; }
.trk-tip span { display: block; color: var(--muted); }
.trk-tip span b { color: var(--ink); }
.trk-table td { white-space: normal; text-align: left; min-width: 90px; }
.trk-table td:nth-child(3), .trk-table td:nth-child(5), .trk-table td:nth-child(7) { text-align: right; min-width: 0; }
.daylinks { display: flex; flex-wrap: wrap; gap: 8px; }
.daylinks a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); text-decoration: none; }
.dayhead { color: inherit; text-decoration: none; }
.dayhead:hover { text-decoration: underline; }

.sharecard { width: 100%; max-width: 720px; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.sharetext { width: 100%; max-width: 720px; font: .95rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
