:root {
  --bg: #f5f7f6;
  --panel: #ffffff;
  --ink: #15201b;
  --muted: #5a6762;
  --line: #dbe2de;
  --accent: #1f6feb;
  /* Diverging wind scale: red = headwind, green = tailwind */
  --h3: #c0392b; --h2: #e06b5a; --h1: #f3b3a8;
  --t1: #a8dfbd; --t2: #4cbb7a; --t3: #1e8a4c;
  --h-ink: #9b2c20; --t-ink: #17733e;
  --unknown: #c9cfcc;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1412; --panel: #161e1b; --ink: #e5ece8; --muted: #9aa8a2; --line: #28332e;
    --accent: #5b9bff;
    --h3: #e0533f; --h2: #a8463a; --h1: #5c2f29;
    --t1: #24513a; --t2: #2f8a57; --t3: #46c77c;
    --h-ink: #ff8f80; --t-ink: #6fdc9b; --unknown: #3a4541;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1412; --panel: #161e1b; --ink: #e5ece8; --muted: #9aa8a2; --line: #28332e;
  --accent: #5b9bff;
  --h3: #e0533f; --h2: #a8463a; --h1: #5c2f29;
  --t1: #24513a; --t2: #2f8a57; --t3: #46c77c;
  --h-ink: #ff8f80; --t-ink: #6fdc9b; --unknown: #3a4541;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header, main, footer { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 24px; padding-bottom: 4px; }
.brand { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 4px 0 0; }
.navlink, footer a, .note a { color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.btn { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.star[aria-pressed="true"] { color: #b7791f; border-color: #b7791f; }
.picker { display: grid; grid-template-columns: 160px 1fr; gap: 10px; }
@media (max-width: 600px) { .picker { grid-template-columns: 1fr; } }
select, input[type="search"], input[type="time"] {
  padding: 9px 10px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; width: 100%;
}
.saved { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.saved:empty { display: none; }
.chip { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 0.9rem; cursor: pointer; }
.results { max-height: 280px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; }
.results button {
  display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 9px 12px;
  background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); font: inherit; cursor: pointer;
}
.results button:hover, .results button:focus-visible { background: var(--bg); outline: none; }
.results .where { color: var(--muted); font-size: 0.9em; white-space: nowrap; }
@media (max-width: 600px) { .results button { flex-direction: column; gap: 2px; } .results .where { white-space: normal; } }
.tag { display: inline-block; font-size: 0.72rem; padding: 0 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); vertical-align: 1px; }
.tag.cal { color: var(--t-ink); border-color: var(--t-ink); }
.track-head { display: grid; grid-template-columns: 1fr 210px; gap: 16px; align-items: start; }
@media (max-width: 600px) { .track-head { grid-template-columns: 1fr; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; }
.fact { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.fact b { display: block; font-size: 1.05rem; }
.fact span { color: var(--muted); font-size: 0.82rem; }
.dir { margin: 0; display: grid; justify-items: center; gap: 6px; text-align: center; }
.compass { width: 200px; height: 200px; }
.compass .cmp-l { fill: #fff; stroke: rgba(0,0,0,.75); stroke-width: 3px; paint-order: stroke; }
.compass .cmp-run { stroke: #22c55e; stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 1.5px #000); }
.compass .cmp-head { fill: #22c55e; stroke: #000; stroke-width: .8; }
.dir figcaption, .dir .credit { color: var(--muted); font-size: 0.75rem; }
.dir .note { margin: 0; font-size: 0.8rem; }
.dir-modes { display: flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.dir-modes button { font: inherit; font-size: 0.8rem; padding: 5px 9px; border: 0; background: var(--bg); color: var(--ink); cursor: pointer; white-space: nowrap; }
.dir-modes button + button { border-left: 1px solid var(--line); }
.dir-modes button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.days { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px; scrollbar-width: thin; }
.days button { flex: 0 0 auto; white-space: nowrap; }
.days button.outlook { border-style: dashed; }
.outlook-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: var(--bg); border: 1px dashed var(--line); color: var(--muted); font-size: 0.88rem; }
.days button { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; cursor: pointer; }
.days button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.verdict { border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 1.05rem; border-left: 6px solid var(--unknown); background: var(--bg); }
.verdict.tail { border-left-color: var(--t3); }
.verdict.head { border-left-color: var(--h3); }
.verdict small { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.strip { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; }
@media (max-width: 700px) { .strip { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.cell { border-radius: 6px; padding: 6px 2px; text-align: center; font-size: 0.78rem; line-height: 1.25; background: var(--unknown); color: var(--ink); min-height: 54px; }
.cell b { display: block; font-size: 0.9rem; }
.cell .hr { opacity: 0.85; }
.cell.t3 { background: var(--t3); color: #fff; } .cell.t2 { background: var(--t2); color: #fff; } .cell.t1 { background: var(--t1); }
.cell.h3 { background: var(--h3); color: #fff; } .cell.h2 { background: var(--h2); color: #fff; } .cell.h1 { background: var(--h1); }
.cell.now { outline: 2px solid var(--accent); outline-offset: 1px; }
.cell.past { opacity: 0.4; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px; color: var(--muted); font-size: 0.8rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .t3 { background: var(--t3); } .legend .t1 { background: var(--t1); } .legend .h1 { background: var(--h1); } .legend .h3 { background: var(--h3); }
.race { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.race-inputs { display: flex; gap: 10px; flex-wrap: wrap; }
.race-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); min-width: 150px; }
.race-card { display: flex; align-items: center; gap: 14px; margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--bg); flex-wrap: wrap; }
.race-card .big { font-size: 1.8rem; font-weight: 700; }
.race-card .big.tail { color: var(--t-ink); } .race-card .big.head { color: var(--h-ink); }
.race-card .side { color: var(--muted); font-size: 0.88rem; }
.more { margin-top: 14px; }
.more summary { cursor: pointer; color: var(--accent); }
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.val.tail { color: var(--t-ink); font-weight: 700; } .val.head { color: var(--h-ink); font-weight: 700; }
.arrow { display: inline-block; width: 14px; }
.note { color: var(--muted); font-size: 0.88rem; }
.err { color: var(--h-ink); }
footer { color: var(--muted); font-size: 0.85rem; padding-bottom: 40px; }
/* about page */
.prose { max-width: 720px; }
.prose p, .prose li { line-height: 1.6; }

.accuracy-note { margin: 10px 0 0; color: var(--muted); font-size: 0.88rem; }
.accuracy-note b { color: var(--ink); }
.accuracy-note a { color: var(--accent); }

.seg, .dir-modes { display: flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.seg button { font: inherit; font-size: 0.8rem; padding: 5px 10px; border: 0; background: var(--bg); color: var(--ink); cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
#best h3 { margin: 14px 0 6px; font-size: 0.92rem; }
.best-list { border: 1px solid var(--line); border-radius: 8px; }
.best-list button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; cursor: pointer; }
.best-list button:last-child { border-bottom: 0; }
.best-list button:hover, .best-list button:focus-visible { background: var(--bg); outline: none; }
.best-list small { display: block; color: var(--muted); font-size: 0.8rem; }
.best-stat { color: var(--muted); font-size: 0.85rem; text-align: right; }
.best-stat b.tl, .typical .tl { color: var(--t-ink); }
.best-stat b.hd { color: var(--h-ink); }
@media (max-width: 600px) { .best-list button { flex-direction: column; align-items: flex-start; gap: 2px; } .best-stat { text-align: left; } }
.typical { margin-top: 12px; background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.typical h3 { margin: 0 0 4px; font-size: 0.9rem; }
.typical p { margin: 0 0 8px; font-size: 0.88rem; }
.typical .note { margin: 6px 0 0; font-size: 0.75rem; }
.typ-bars { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; height: 52px; align-items: end; margin-bottom: 18px; }
.typ-bars span { position: relative; height: 52px; display: flex; align-items: flex-end; background: var(--panel); border-radius: 3px; }
.typ-bars i { display: block; width: 100%; border-radius: 3px; }
.typ-bars i.tl { background: var(--t2); } .typ-bars i.hd { background: var(--h2); }
.typ-bars em { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 0.62rem; color: var(--muted); white-space: nowrap; }

.meets-list { max-height: 300px; overflow-y: auto; margin-top: 8px; }
.t-meets { margin-top: 10px; font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.meet-out { margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); }
.meet-out h3 { margin: 0; }
.meet-out .note { margin: 2px 0 8px; }
.meet-out td.val.tail { color: var(--t-ink); font-weight: 600; } .meet-out td.val.head { color: var(--h-ink); font-weight: 600; }
