/* Today: the live home screen. Tokens extend styles.css (ground, ink, line, panel). */
:root {
  --c-frost: #a9cde4;
  --c-fair: #3f8a5a;
  --c-sage: #9db48f;
  --c-cold: #c9cfc2;
  --c-slate: #8a8f99;
  --c-wait: #dfe2da;
  --c-dusk: #3a3550;
  --c-cinder: #c0492b;
  --c-past: #e7e9e3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --c-frost: #6f9fbe; --c-fair: #4f9f6b; --c-sage: #7d9470; --c-cold: #4b5249;
    --c-slate: #5e636c; --c-wait: #2c332e; --c-dusk: #2e2a47; --c-cinder: #ea6a48; --c-past: #262d28;
  }
}

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.today { display: grid; gap: 22px; padding-top: 8px; }
.t-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.t-when { font: 600 17px/1.3 var(--body); letter-spacing: 0; margin: 0; color: var(--muted); }
.t-when #t-clock { color: var(--ink); }
.t-temp::before { content: ""; }
.t-temp:not(:empty)::before { content: "  ·  "; white-space: pre; }
.t-near { font: 600 14px var(--body); background: none; border: 0; color: var(--sky); cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }

.verdict {
  font: 700 clamp(30px, 4.6vw, 52px)/1.06 var(--display);
  letter-spacing: -0.022em; text-wrap: balance; max-width: 30ch; margin: 0;
}
.today[data-state="loading"] .verdict { opacity: .55; }
.verdict-sub { font-size: 18px; color: var(--muted); margin: -8px 0 0; max-width: 62ch; }

/* The day line: the one bold element. */
.dayline { margin: 6px 0 0; }
.dayline svg { display: block; width: 100%; height: 72px; border-radius: 14px; cursor: ew-resize; touch-action: pan-y; }
.dayline svg:focus-visible { outline: 3px solid var(--c-cinder); outline-offset: 3px; }
.dayline .needle { filter: drop-shadow(0 0 0 var(--ground)); }
.dayline-cap { display: grid; gap: 8px; margin-top: 6px; }
.axis { position: relative; height: 18px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }
.legend { font-size: 15px; color: var(--muted); margin: 0; }
.linkish { font: inherit; color: var(--sky); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* Week */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wk { display: grid; gap: 5px; justify-items: start; padding: 9px 9px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); cursor: pointer; font: 600 14px var(--body); text-align: left; min-width: 0; }
.wk:hover { border-color: var(--ink); }
.wk.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.wk-line { width: 100%; height: 8px; border-radius: 4px; overflow: hidden; display: block; }
.wk-t { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 620px) {
  .week { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 92px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
  .wk { scroll-snap-align: start; }
}

/* Ask */
.ask { display: grid; gap: 10px; }
.ask input {
  width: 100%; font: 400 19px var(--body); padding: 14px 18px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
.ask input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-fair) 30%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { font-size: 14px; padding: 5px 12px; }
.chips .chip.on::after { content: " ×"; }

/* Grid */
.t-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 940px) { .t-grid { grid-template-columns: minmax(0, 1fr) 320px; } .t-side { position: sticky; top: 16px; } }

/* Course list: rows, not cards */
.courses { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.course-row { display: grid; gap: 7px; padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.course-row.pinned { background: linear-gradient(90deg, color-mix(in srgb, var(--c-fair) 9%, transparent), transparent 70%); padding-left: 12px; margin-left: -12px; border-radius: 10px 0 0 10px; }
.course-row.sel .cr-line svg { outline: 2px solid var(--ink); outline-offset: 2px; }
.cr-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cr-name { font: 700 21px/1.2 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.cr-name:hover { color: var(--c-cinder); }
.cr-town { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pin { width: 26px; height: 26px; padding: 3px; border: 0; background: none; cursor: pointer; color: var(--line); align-self: center; }
.pin svg { width: 100%; height: 100%; fill: currentColor; }
.pin:hover, .pin[aria-pressed="true"] { color: #d4a22b; }
.cr-line { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.cr-line svg { display: block; width: 100%; height: 10px; border-radius: 5px; }
.cr-line:disabled { cursor: default; font-size: 14px; color: var(--muted); text-align: left; }
.cr-meta { margin: 0; font-size: 16px; font-variant-numeric: tabular-nums; }
.cr-status { margin: 0; font-size: 15px; color: var(--muted); max-width: 70ch; }
.cr-actions { margin: 2px 0 0; display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; font-weight: 600; }
.cr-actions a { text-decoration: none; }
.cr-actions a:hover { text-decoration: underline; }
.cr-actions .primary { color: var(--panel); background: var(--ink); padding: 3px 14px; border-radius: 999px; }
.cr-actions .primary:hover { background: var(--c-fair); color: #fff; text-decoration: none; }
.courses .empty { padding: 24px 0; color: var(--muted); }

.st { display: inline-block; font-weight: 600; font-size: 14px; padding: 1px 9px; border-radius: 999px; margin-right: 4px; background: var(--c-wait); color: var(--ink); }
.st-good { background: var(--c-fair); color: #fff; }
.st-ok { background: var(--c-sage); color: #14200f; }
.st-frost { background: var(--c-frost); color: #10283a; }
.st-rough { background: var(--c-slate); color: #fff; }
.st-dark { background: var(--c-dusk); color: #e9e6f5; }

.closed { border-top: 1px solid var(--line); padding: 14px 0; }
.closed summary { cursor: pointer; font-weight: 600; }
.closed ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 15px; }
.closed li span { color: var(--muted); }
.t-fine { font-size: 14px; color: var(--muted); max-width: 70ch; }

/* Map */
.map { width: 100%; height: auto; display: block; }
.map .peaks path { fill: var(--ink); opacity: .82; }
.map .peak-l { font: 500 10.5px var(--body); fill: var(--muted); }
.map .towns-l text, .map .peak-l { paint-order: stroke; stroke: var(--ground); stroke-width: 3px; stroke-linejoin: round; }
.map .towns-l text { font: 700 11.5px var(--body); fill: var(--ink); }
.map .dot circle { fill: var(--c-wait); stroke: var(--ground); stroke-width: 1.5; }
.map .dot { cursor: pointer; }
.map .dot:focus-visible circle { stroke: var(--c-cinder); stroke-width: 3; }
.map .dot.sel circle { stroke: var(--ink); stroke-width: 2.5; }
.map .d-good circle { fill: var(--c-fair); }
.map .d-ok circle { fill: var(--c-sage); }
.map .d-frost circle { fill: var(--c-frost); }
.map .d-rough circle, .map .d-cold circle { fill: var(--c-slate); }
.map .d-dark circle { fill: var(--c-dusk); }
.map .d-closed circle { fill: none; stroke: var(--muted); stroke-width: 1; cursor: default; }
.map .members circle { stroke-dasharray: 2 2; }
.map .you { fill: var(--c-cinder); }
.t-side::after { content: "Peaks are the Cascades you see from the tees. Dots are courses; hollow ones are closed for the season."; display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }

.beyond { display: grid; gap: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.beyond h2 { margin: 18px 0 0; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Narrow screens: keep the day line's labels from colliding. */
.axis > span { position: absolute; }
.axis .noon { transform: translateX(-50%); }
@media (max-width: 560px) {
  .axis .noon, .axis .ax-w { display: none; }
  .verdict { font-size: 30px; }
  .dayline svg { height: 58px; }
}

.axis .ax-w { position: static; transform: none; margin-right: .25em; }

/* ---------- Answer: the sentence and what to do about it ---------- */
.t-answer { display: grid; gap: 14px; }
.t-answer .verdict-sub { margin: 0; }
.answer-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.act {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  font: 600 16px var(--body); text-decoration: none; cursor: pointer; border: 1.5px solid var(--ink);
  background: transparent; color: var(--ink);
}
.act:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.act.primary { background: var(--c-fair); border-color: var(--c-fair); color: #fff; }
.act.primary:hover { background: color-mix(in srgb, var(--c-fair) 85%, #000); color: #fff; }
.act.ghost { border-color: var(--line); }
.act:focus-visible { outline: 3px solid var(--c-cinder); outline-offset: 2px; }

/* ---------- Day line labels ---------- */
.dl-wrap { position: relative; }
.dl-labels { position: absolute; inset: 0; pointer-events: none; }
.dl-lab {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center;
  font: 600 14px var(--body); white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.dl-lab.on-light { color: #fff; }
.dl-lab.on-dark { color: #1b2a22; }
.dl-now {
  position: absolute; top: -22px; transform: translateX(-50%); font: 700 12px var(--body); color: var(--c-cinder);
}
.dayline { margin-top: 18px; }
@media (prefers-color-scheme: dark) { .dl-lab.on-dark { color: #0e1612; } }

/* ---------- Week: windows, not just temperatures ---------- */
.wk-w { font: 600 13.5px var(--body); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk.none .wk-w { color: var(--muted); font-weight: 400; }
.wk-best { font: 700 11px var(--body); background: var(--c-fair); color: #fff; padding: 1px 6px; border-radius: 999px; vertical-align: 1px; }
.wk.best { border-color: var(--c-fair); }
.wk-t { display: none; }

/* ---------- List header and rows ---------- */
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; }
.list-head p { margin: 0; font-weight: 600; }
.list-head .t-near { font-size: 15px; }
.st-next { background: var(--ink); color: var(--ground); }
.st-unknown { background: var(--c-wait); color: var(--muted); }
.cr-actions { gap: 10px; align-items: center; }
.cr-actions .act { min-height: 38px; padding: 0 14px; font-size: 15px; border-color: var(--line); }
.cr-actions .act.primary { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.cr-actions .act.primary:hover { background: var(--c-fair); border-color: var(--c-fair); color: #fff; }
.course-row { gap: 9px; }
.wk-tt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Grid children must be allowed to shrink, so the week strip scrolls inside itself instead of widening the page. */
.today > *, .t-grid > * { min-width: 0; }
@media (prefers-color-scheme: dark) { .dl-lab.l-past, .dl-lab.l-cold, .dl-lab.l-wait, .dl-lab.l-shut { color: #c9d2cb; } }
.why { margin: -4px 0 0; font-size: 16px; color: var(--ink); max-width: 66ch; }
.why:empty { display: none; }
