:root {
  color-scheme: dark light;
  --bg: #0B1117; --surface: #121A22; --surface-2: #18232E; --line: rgba(255,255,255,.08); --line-strong: rgba(255,255,255,.14);
  --text: #E9EFF4; --muted: #8C9BA9; --accent: #5CC8E8;
  --go: #34D399; --mid: #FBBF24; --skip: #F87171; --none: #64748B;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -18px rgba(0,0,0,.7);
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #F3F6F9; --surface: #FFFFFF; --surface-2: #F0F4F8; --line: rgba(15,30,45,.08); --line-strong: rgba(15,30,45,.16);
    --text: #0E1A24; --muted: #5B6B7A; --accent: #0A84B5; --go: #087A53; --mid: #946200; --skip: #DC3B3B; --none: #8A97A5;
    --shadow: 0 1px 2px rgba(15,30,45,.05), 0 12px 28px -18px rgba(15,30,45,.25); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; font-size: 15px; -webkit-font-smoothing: antialiased;
  padding: 0 max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
main, .bar { max-width: 560px; margin-inline: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.fine, .sub, .eyebrow, footer { color: var(--muted); }
.fine { font-size: 12px; margin: 10px 0 0; }
a { color: var(--accent); text-underline-offset: 3px; }

/* header */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 0 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #0b3a55)); flex: none; }
.mark svg { width: 22px; height: 22px; fill: none; stroke: #041823; stroke-width: 2; stroke-linecap: round; }
h1 { white-space: nowrap; font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.brand > div { min-width: 0; }
.brand p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 0; font-size: 12px; color: var(--muted); }
.tools { display: flex; align-items: center; gap: 8px; flex: none; }
.chip { font-size: 12px; padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
#refresh { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
#refresh svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#refresh:active { background: var(--surface-2); }
#refresh.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -.005em; margin: 0; }
.sub { font-size: 12px; text-align: right; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; margin: 0; }

/* next 6 hours */
.hours-strip { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 0 0 10px; padding: 0; }
.hours-strip li { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; }
.hours-strip b { font-size: 12px; font-weight: 650; color: var(--text); white-space: nowrap; }
.hours-strip .dot { margin: 0; width: 10px; height: 10px; }
#hours-summary { margin: 0; }

/* hero */
.hero { --c: var(--none); background: radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 62%), var(--surface); }
.hero[data-level="0"] { --c: var(--go); } .hero[data-level="1"] { --c: var(--mid); } .hero[data-level="2"] { --c: var(--skip); }
.hero-main { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: var(--line-strong); }
.ring-fill { stroke: var(--c); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-text span { font-size: 32px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.ring-text small { font-size: 11px; color: var(--muted); margin-top: 3px; }
.hero-copy { min-width: 0; }
.status { font-size: 34px; font-weight: 750; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0 6px; color: var(--c); }
.why { margin: 0; font-size: 14px; color: var(--muted); }
.alerts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; }
.alerts:empty { display: none; }
.alerts li { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.alerts li[data-l="1"] { border-color: color-mix(in srgb, var(--mid) 60%, transparent); } .alerts li[data-l="2"] { border-color: color-mix(in srgb, var(--skip) 60%, transparent); }
.how { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; font-size: 13px; color: var(--accent); min-height: 26px; list-style-position: inside; }
#v-rules { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
#v-rules td { padding: 8px 0; border-bottom: 1px solid var(--line); }
#v-rules td:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--none); }
.dot[data-l="0"] { background: var(--go); } .dot[data-l="1"] { background: var(--mid); } .dot[data-l="2"] { background: var(--skip); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat.wide { grid-column: 1 / -1; }
.stat .k { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 28px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .v small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat.compact .v { font-size: 22px; padding-top: 4px; }
.stat.off .v { font-size: 15px; font-weight: 500; color: var(--muted); }

/* best times */
.spot-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; }
.spot-choice button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.spot-choice button[aria-pressed="true"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.bite-result { padding: 14px 2px 16px; }
.bite-label { font-size: 23px; font-weight: 720; letter-spacing: -.025em; line-height: 1.2; margin: 0; color: var(--muted); }
.bite-label[data-level="promising"] { color: var(--go); }
.bite-label[data-level="mixed"] { color: var(--mid); }
.bite-label[data-level="slow"] { color: var(--text); }
.bite-label[data-confidence="low"] { opacity: .6; }
.bite-conf { --c: var(--none); display: inline-block; margin: 8px 0 2px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); }
.bite-conf:empty { display: none; }
.bite-conf[data-level="high"] { --c: var(--go); } .bite-conf[data-level="moderate"] { --c: var(--mid); } .bite-conf[data-level="low"] { --c: var(--skip); }
.bite-time { font-size: 15px; font-weight: 600; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.bite-result .fine { margin-top: 5px; }
.bite-targets { color: var(--muted); font-size: 12px; margin: 9px 0 0; }
.bite-targets:empty { display: none; }
.times-title { font-size: 12px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0 0 9px; }
.times { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.times li { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.times li:first-child { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.times .n { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface); border: 1px solid var(--line-strong); }
.times li:first-child .n { background: var(--accent); color: #041823; border-color: transparent; }
.times b { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.times small { color: var(--muted); font-size: 12.5px; }
.times .badge { font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.times .empty { display: block; background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; }

/* 7-day chart */
.wk-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wk-col { display: flex; flex-direction: column; align-items: center; gap: 4px; --c: var(--none); min-width: 0; }
.wk-col[data-level="0"] { --c: var(--go); } .wk-col[data-level="1"] { --c: var(--mid); } .wk-col[data-level="2"] { --c: var(--skip); }
.wk-score { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.wk-track { width: 100%; height: 120px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.wk-bar { width: 100%; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 45%, var(--surface-2))); }
.wk-day { font-size: 12px; font-weight: 600; margin-top: 4px; }
.wk-meta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

footer { font-size: 12px; text-align: center; padding: 10px 0 0; }
footer p { margin: 4px 0; }
@media (max-width: 360px) { .hero-main { flex-direction: column; align-items: flex-start; } .status { font-size: 30px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 420px) { .chip .lbl { display: none; } .brand p { max-width: 150px; } }

/* Keep the report readable at narrow phone sizes and without color cues. */
#coverage:empty { display: none; }
#coverage { padding-top: 8px; }
#refresh { min-width: 44px; min-height: 44px; }
#refresh:disabled { cursor: wait; opacity: .7; }
summary { min-height: 44px; display: flex; align-items: center; gap: 6px; }
summary::before { content: "▸"; }
details[open] > summary::before { content: "▾"; }
.card-h { gap: 12px; flex-wrap: wrap; }
.wk-label { font-size: 10px; color: var(--text); }
@media (max-width: 420px) {
  .bar { flex-wrap: wrap; }
  .tools { margin-left: auto; }
  .wk-bars { gap: 4px; }
  .wk-meta, .wk-label { font-size: 9px; }
  .times li { grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
  .times .badge { grid-column: 2; justify-self: start; }
  .times b { font-size: 14px; }
  #v-rules td { vertical-align: top; }
}
