:root { --bg:#f6f8fb; --fg:#0c1b33; --card:#fff; --muted:#64748d; --accent:#0b3d91; --ok:#0a7d3b; --warn:#b45309;
        --line:#d5dde9; --dark:rgba(30,41,82,.20); --play:rgba(10,125,59,.18); }
@media (prefers-color-scheme: dark) {
  :root { --bg:#0b1220; --fg:#eef3fb; --card:#141d30; --muted:#9db0cc; --accent:#7fb0ff; --ok:#4ade80; --warn:#fbbf24;
          --line:#26344f; --dark:rgba(0,0,0,.40); --play:rgba(74,222,128,.20); }
}
* { box-sizing: border-box; }
html { height:100%; overscroll-behavior:none; }
body { height:100%; height:100dvh; display:flex; flex-direction:column; overflow:hidden; overscroll-behavior:none; margin:0; background:var(--bg); color:var(--fg); font:17px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; }
a { color:var(--accent); }
.bar { display:flex; flex-wrap:wrap; gap:.3rem .75rem; align-items:center; padding:.5rem 1rem .4rem; background:#0b3d91; color:#fff; position:relative; flex:none; z-index:5;
       padding-top:calc(.5rem + env(safe-area-inset-top)); }
.bar a { color:#fff; text-decoration:none; }
.brand { display:flex; align-items:center; gap:.5rem; font-weight:800; font-size:1.2rem; }
.brand img { border-radius:7px; display:block; }
.tabs { display:flex; gap:.2rem; width:100%; order:3; }
.tabs a { flex:1; text-align:center; padding:.3rem .4rem; border-radius:999px; font-size:.95rem; }
.tabs a.on { background:rgba(255,255,255,.22); font-weight:700; }
.brand { margin-right:auto; }
.hbtn { background:none; border:0; color:#fff; padding:.35rem; border-radius:.5rem; display:grid; place-items:center; cursor:pointer; } .hbtn .i { width:1.5rem; height:1.5rem; color:#fff; vertical-align:0; }
.hbtn.on { background:rgba(255,255,255,.22); }
[x-cloak] { display:none !important; }
.menu { position:absolute; top:100%; right:.5rem; min-width:13rem; background:var(--card); color:var(--fg); border:1px solid var(--line); border-radius:.7rem; box-shadow:0 6px 20px rgba(0,0,0,.25); padding:.3rem; z-index:9; }
.bar .menu a { color:var(--fg); display:block; padding:.6rem .8rem; border-radius:.5rem; font-size:1rem; } .bar .menu a.on { background:var(--line); font-weight:700; }
.unitsw { display:flex; justify-content:space-between; align-items:center; padding:.6rem .8rem; margin-top:.2rem; border-top:1px solid var(--line); cursor:pointer; }
.unitsw input { position:absolute; opacity:0; } .sw2 { width:2.6rem; height:1.5rem; border-radius:99px; background:var(--line); position:relative; transition:background .15s; }
.sw2::after { content:""; position:absolute; top:.15rem; left:.15rem; width:1.2rem; height:1.2rem; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.4); transition:transform .15s; }
.unitsw input:checked + .sw2 { background:#0b3d91; } .unitsw input:checked + .sw2::after { transform:translateX(1.1rem); }
.unitsw input:focus-visible + .sw2 { outline:2px solid var(--accent); }
/* only the content scrolls; the header stays put and a screen that fits does not move at all */
main { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:none; -webkit-overflow-scrolling:touch; padding:.6rem max(1rem, calc((100% - 60rem) / 2)) calc(1rem + env(safe-area-inset-bottom)); }
h1 { font-size:1.4rem; margin:.2rem 0; } h2 { font-size:1.05rem; margin:.2rem 0 .5rem; } h2 small { color:var(--muted); font-weight:400; }
.sub { color:var(--muted); margin:.1rem 0 .6rem; }
.card { background:var(--card); border:1px solid var(--line); border-radius:.8rem; padding:.8rem .9rem; margin:.7rem 0; }
.chart { width:100%; min-height:210px; position:relative; }
.legend { font-size:.8rem; color:var(--muted); margin:.4rem 0 0; display:flex; flex-wrap:wrap; gap:.2rem .9rem; align-items:center; }
.legend .item { white-space:nowrap; } .legend .item:last-child { white-space:normal; }
.key { display:inline-block; width:1.5rem; border-top:3px solid var(--c); vertical-align:middle; margin-right:.35rem; }
.key.dash { border-top-style:dashed; }
.key.band { height:.8rem; border:0; background:var(--c); opacity:.35; vertical-align:-.1rem; }
.key.bar { height:.8rem; width:.8rem; border:0; background:var(--c); opacity:.6; vertical-align:-.1rem; }
.arr { color:var(--accent); font-weight:800; margin-right:.35rem; }
.badge { display:inline-block; padding:.05rem .6rem; border-radius:999px; font-size:.8rem; font-weight:700; border:2px solid; margin-right:.4rem; }
.badge.ok { color:var(--ok); } .badge.warn { color:var(--warn); }
.grid4 { display:grid; grid-template-columns:repeat(auto-fit,minmax(7rem,1fr)); gap:.6rem; }
.grid4 div { display:flex; flex-direction:column; } .grid4 b { font-size:1.5rem; } .grid4 small,.grid4 i { color:var(--muted); font-style:normal; font-size:.8rem; }
.error { background:#fee2e2; color:#7f1d1d; padding:.6rem 1rem; border-radius:.5rem; }
.sw { display:inline-block; width:1rem; height:1rem; vertical-align:-.15rem; border:1px solid var(--line); margin-right:.35rem; }
.sw.dark { background:var(--dark); } .sw.play { background:var(--play); }
.thr { display:grid; gap:.6rem; } .thr label { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; }
.thr input[type=number] { width:5rem; font:inherit; padding:.2rem .4rem; }
.thr select { font:inherit; padding:.2rem; }
.bestlist { padding-left:1.2rem; } .bestlist li { margin:.25rem 0; }
.strip { display:flex; flex-wrap:wrap; gap:2px; }
.cell { width:2.5rem; height:3.6rem; border-radius:.3rem; display:flex; flex-direction:column; align-items:center; justify-content:center; color:#04210f; }
.cell em { font-style:normal; font-size:.6rem; font-weight:800; height:.8rem; line-height:.8rem; }
.cell small { font-size:.62rem; } .cell b { font-size:.95rem; }
table { border-collapse:collapse; width:100%; font-size:.9rem; } th,td { text-align:left; padding:.25rem .4rem; border-bottom:1px solid var(--line); }
.credits p { font-size:.85rem; color:var(--muted); margin:0; }
.u-legend { display:none; }
.u-over { touch-action:pan-y; }
.tip { position:absolute; top:22px; z-index:4; display:none; pointer-events:none; background:var(--card); color:var(--fg); border:1px solid var(--line);
       border-radius:.4rem; padding:.25rem .45rem; font-size:.75rem; line-height:1.35; white-space:nowrap; box-shadow:0 2px 8px rgba(0,0,0,.18); }
.tip i { display:inline-block; width:.6rem; height:.6rem; border-radius:50%; margin-right:.3rem; }

/* home */
.homehead { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.homehead h1 { font-size:1.2rem; } .spot { font:inherit; font-size:.85rem; max-width:45%; }
.note { font-size:.8rem; color:var(--muted); margin:.4rem 0 0; }

/* icons: one stroke style everywhere, colour by meaning */
.i { width:1.15rem; height:1.15rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none; vertical-align:-.2rem; }
.c-sun { color:#f59e0b; } .c-moon { color:#6366f1; } .c-cloud { color:#64748b; } .c-partly { color:#d97706; } .c-rain { color:#2563eb; } .c-fog { color:#64748b; }
.c-wind { color:#0ea5e9; } .c-thermo { color:#f97316; } .c-drop { color:#2563eb; } .c-clock { color:var(--accent); } .c-check { color:#0a7d3b; } .c-alert { color:#b42318; }
.homehead { margin:.2rem 0 .1rem; } .homehead h1 { font-size:1.25rem; margin:0; }
.chip { display:inline-flex; align-items:center; gap:.3rem; padding:.2rem .65rem; border-radius:999px; font-weight:800; font-size:.95rem; background:var(--card); white-space:nowrap; }
.chip.good { color:#0a7d3b; } .chip.ok { color:#b45309; } .chip.bad { color:#b42318; }
.cap { font-size:.7rem; color:var(--muted); margin:.2rem 0; text-align:center; }
/* now: A boxes */
.stats { display:flex; gap:.35rem; margin:.4rem 0; }
.st { flex:1; min-width:0; background:var(--card); border:1px solid var(--line); border-radius:.6rem; padding:.3rem .2rem; text-align:center; display:flex; flex-direction:column; align-items:center; line-height:1.15; }
.st b { font-size:1.05rem; white-space:nowrap; } .st small { font-size:.62rem; color:var(--muted); max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.st.alert { border-color:#b42318; } .st.alert b { color:#b42318; }
/* now: B sentence */
.sentence { display:flex; gap:.5rem; align-items:flex-start; margin:.4rem 0; padding:.5rem .7rem; background:var(--card); border:1px solid var(--line); border-radius:.6rem; font-size:.88rem; line-height:1.35; } .sentence .i { margin-top:.1rem; width:1.4rem; height:1.4rem; }
/* now: C bars against limits */
.limits { margin:.4rem 0; padding:.45rem .7rem; background:var(--card); border:1px solid var(--line); border-radius:.6rem; }
.lb { display:grid; grid-template-columns:1.2rem 3rem 1fr 4rem; align-items:center; gap:.4rem; font-size:.85rem; padding:.12rem 0; } .lb b { text-align:right; white-space:nowrap; }
.track { position:relative; height:.55rem; background:var(--line); border-radius:99px; } .track i { position:absolute; left:0; top:0; bottom:0; border-radius:99px; } .track i.ok { background:#0a7d3b; } .track i.bad { background:#b42318; }
.track u { position:absolute; top:-3px; bottom:-3px; width:2px; background:var(--fg); }
/* now: D next 12 hours */
.ribbon { display:flex; gap:.25rem; overflow-x:auto; margin:.4rem 0; padding-bottom:.1rem; }
.rb { flex:0 0 2.6rem; display:flex; flex-direction:column; align-items:center; gap:.05rem; padding:.25rem 0; border-radius:.5rem; background:var(--c); color:#10240f; font-size:.8rem; line-height:1.2; } .rb small { font-size:.62rem; }
/* best */
.best { margin:.4rem 0; padding:.45rem .7rem; background:var(--card); border:1px solid var(--line); border-radius:.6rem; } .best.nobest { font-size:.85rem; }
.bl { display:flex; align-items:center; gap:.55rem; margin:0; line-height:1.2; } .bl small { display:block; font-size:.66rem; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; } .bl > span > b { font-size:1rem; }
.bl em { display:block; font-style:normal; font-size:.72rem; color:var(--muted); }
.pill { margin-left:auto; text-align:right; } .pill b { font-size:1.25rem; color:var(--c); } .pill em { max-width:5.5rem; margin-left:auto; }
.ring { --p:0; width:2.9rem; height:2.9rem; border-radius:50%; flex:none; display:grid; place-items:center; background:conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); position:relative; }
.ring::before { content:""; position:absolute; inset:.3rem; border-radius:50%; background:var(--card); } .ring b { position:relative; font-size:.95rem; }
.bl.col { flex-direction:column; align-items:stretch; gap:.3rem; } .bhead { display:flex; gap:.4rem; align-items:center; font-size:1rem; }
.meter { height:.6rem; background:var(--line); border-radius:99px; overflow:hidden; } .meter i { display:block; height:100%; border-radius:99px; }
.ring.sm { width:2.3rem; height:2.3rem; } .ring.sm::before { inset:.25rem; } .ring.sm b { font-size:.8rem; }
.duo { display:grid; grid-template-columns:1fr 1fr; gap:.4rem; } .half { display:flex; align-items:center; gap:.5rem; line-height:1.2; } .half small { display:block; font-size:.66rem; color:var(--muted); text-transform:uppercase; } .half b { font-size:.95rem; }
.duo .full { grid-column:1/-1; font-style:normal; font-size:.72rem; color:var(--muted); }
.nowline { display:flex; align-items:center; gap:.5rem; margin:.4rem 0 0; font-size:.75rem; color:var(--muted); } .nowline .meter { flex:1; height:.45rem; }
.nowtag { margin-left:auto; display:flex; flex-direction:column; align-items:center; font-size:.9rem; } .nowtag small { font-size:.6rem; text-transform:uppercase; color:var(--muted); }
.by { margin:.3rem 0 0; font-size:.7rem; color:var(--muted); }
/* grid */
.days { display:grid; grid-template-columns:repeat(var(--n,1),1fr); gap:.4rem; margin:.4rem 0; }
.day { background:var(--card); border:1px solid var(--line); border-radius:.6rem; padding:.3rem; min-width:0; }

@media (max-width: 480px) {
  body { font-size:16px; }
  main { padding:.4rem .7rem calc(.8rem + env(safe-area-inset-bottom)); }
  .card { padding:.6rem .6rem; margin:.5rem 0; }
}

.stt { display:flex; align-items:center; gap:.25rem; } .stt.good { color:#0a7d3b; } .stt.ok { color:#b45309; } .stt.bad { color:#b42318; }
.half small { font-weight:800; } .half b { font-weight:400; }
.half small { color:var(--fg); }
.homehead { display:flex; align-items:center; justify-content:space-between; gap:.5rem; } .homehead h1 { white-space:nowrap; }
.now-dt { text-align:right; line-height:1.2; font-size:.75rem; color:var(--muted); display:flex; flex-direction:column; } .now-dt b { font-size:.95rem; color:var(--fg); }
.thr fieldset { border:0; padding:0; margin:0; display:grid; gap:.6rem; } .thr fieldset.off { opacity:.4; }
.install { position:fixed; left:0; right:0; bottom:0; display:flex; align-items:center; gap:.6rem; padding:.7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background:#0b3d91; color:#fff; font-size:.9rem; z-index:20; box-shadow:0 -2px 12px rgba(0,0,0,.25); }
.install[x-cloak] { display:none; }
.install span { flex:1; }
.install .i { width:1.2rem; height:1.2rem; vertical-align:middle; stroke:currentColor; fill:none; stroke-width:2; flex:none; }
.install .go { background:#fff; color:#0b3d91; border:0; border-radius:.5rem; padding:.4rem .8rem; font-weight:600; }
.install .x { background:none; border:0; color:#fff; font-size:1.1rem; padding:.2rem .4rem; }

/* hourly table: header and rows share one column template */
.days { --bar:3px; --cols:2.3rem 1.9rem minmax(0,1fr) 2.75rem; }
.days.thick { --bar:.5rem; }
.dh { display:grid; grid-template-columns:var(--cols); align-items:baseline; padding:0 0 .2rem calc(var(--bar) + .3rem); font-size:.9rem; }
.dh b { grid-column:1 / 3; margin-left:calc(-1 * (var(--bar) + .3rem) + .2rem); white-space:nowrap; }
.dh small { display:none; }
.dh .u { font-size:.65rem; color:var(--muted); text-align:center; }
.dh .u:nth-of-type(1) { grid-column:3; } .dh .u:nth-of-type(2) { grid-column:4; }
.hr { display:grid; grid-template-columns:var(--cols); align-items:center; min-height:1.84rem; padding:.12rem 0 .12rem .3rem; margin-top:2px; border:0; border-left:var(--bar) solid var(--c); border-radius:.3rem;
      background:var(--card); color:var(--fg); box-shadow:inset 0 0 0 1px var(--line); font-size:.8rem; line-height:1.2; }
.days.tint .hr { background:color-mix(in srgb, var(--c) 30%, var(--card)); }
.hr .hh { font-weight:700; }
.hr .tt { text-align:center; }
.hr .ww { display:flex; justify-content:center; align-items:center; padding:0 4px; white-space:nowrap; font-size:.8rem; border-left:1px solid rgba(0,0,0,.18); align-self:stretch; }
.hr .ww .g { align-self:flex-start; margin:.2rem 0 0 1px; color:#b45309; font-weight:700; font-size:.55rem; } .hr .ww .g::before { content:"↗"; }
.wx { display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1; }
.wx em { font-style:normal; font-size:.6rem; font-weight:800; color:#1d4ed8; } .wx em:empty { display:none; }
.hr .i { width:1rem; height:1rem; }
.half b, .half .stt { white-space:nowrap; }
.updated { text-align:center; font-size:.7rem; color:var(--muted); margin:.5rem 0 0; }
/* clean look: white page, no boxes; hairlines separate the sections */
@media (prefers-color-scheme: light) { body.clean { --bg:#fff; } }
.clean { --line:rgba(120,135,160,.28); --rule:rgba(120,135,160,.14); } /* --rule: the hairlines between sections */
.clean .stats { gap:0; margin:.5rem 0; padding:.2rem 0; border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); }
.clean .st { background:none; border:0; border-radius:0; border-left:1px solid var(--line); padding:.2rem .1rem; }
.clean .st:first-child { border-left:0; } .clean .st.alert { border-color:var(--line); }
.clean .best { background:none; border:0; border-radius:0; padding:.2rem 0 .5rem; border-bottom:1px solid var(--rule); margin:.2rem 0 .4rem; }
.clean .ring::before { background:var(--bg); }
.clean .day { background:none; border:0; border-radius:0; padding:0; }
.clean .days { gap:.9rem; }
.clean .st { border-left:0; }
.clean .best { padding-bottom:.5rem; margin-bottom:.5rem; }
.clean .hr .ww { border-left:0; }
.clean .hr { background:none; box-shadow:none; border-radius:3px; margin-top:3px; }
.clean .days.tint .hr { background:color-mix(in srgb, var(--c) 35%, transparent); }  /* Preferences: "Tint the whole row" */
.clean .dh { padding-bottom:.35rem; }
.clean .updated { border-top:0; }
#bootfail { margin-top:.6rem; font:400 .9rem system-ui,sans-serif; color:var(--muted); text-align:center; display:flex; flex-direction:column; align-items:center; gap:.5rem; }
#bootfail[hidden] { display:none; }
#bootfail button { font:inherit; font-weight:600; padding:.45rem 1.1rem; border-radius:.5rem; border:0; background:#0b3d91; color:#fff; }
.hr.measured .hh, .hr.measured .wx, .hr.measured .tt, .hr.measured .ww { opacity:.45; } .hr.empty .tt, .hr.empty .ww, .hr.empty .wx { visibility:hidden; }
.stt .until { font-size:.68rem; font-weight:400; color:var(--muted); white-space:nowrap; margin-left:.05rem; }
.half small.until { text-transform:none; letter-spacing:0; display:inline; }
.half .nday { color:var(--muted); }
.thr .hint { color:var(--muted); font-size:.75rem; }
.toast { position:fixed; left:50%; bottom:calc(1.2rem + env(safe-area-inset-bottom)); transform:translateX(-50%); background:#0c1b33; color:#fff; padding:.55rem 1rem; border-radius:99px; font-size:.9rem; z-index:30; }
#wake { position:fixed; top:env(safe-area-inset-top); left:0; right:0; height:3px; z-index:50; pointer-events:none; }
#wake[hidden] { display:none; }
#wake i { display:block; height:100%; width:0; background:#4da3ff; }
#wake.go i { width:92%; transition:width 9s cubic-bezier(.15,.6,.3,1); }
#wake.end i { width:100%; transition:width .25s ease-out; }
