/* Weather — calm sky page. The sky colour follows the place's time of day and whether it's gray out. */
:root {
  --ink: #fff; --ink2: rgba(255,255,255,.78); --ink3: rgba(255,255,255,.55);
  --card: rgba(255,255,255,.11); --line: rgba(255,255,255,.14);
  --go: #7ee2a8; --maybe: #ffd27a; --no: #ff9a8a; --rain: #8fc8ff;
  --warn: #ff6b5b; --watch: #ffb648;
  --a: #0b1026; --b: #1b2550;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }   /* classes that set display (banners, flex cards) must still hide */
html, body { margin: 0; min-height: 100%; }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--a); -webkit-font-smoothing: antialiased;
}
.sky { position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--a) 0%, var(--b) 100%); transition: background 1.2s; }

/* time-of-day × gray themes (set on <body> by app.js) */
.t-night { --a: #070b1c; --b: #1a2350; }
.t-dawn  { --a: #2c2d5e; --b: #d98a6c; }
.t-day   { --a: #2563b8; --b: #7fb7e8; }
.t-dusk  { --a: #261f4d; --b: #c8664f; }
.t-gray.t-day   { --a: #3f4d5d; --b: #8794a3; }
.t-gray.t-dawn, .t-gray.t-dusk { --a: #2e3443; --b: #6f6a74; }
.t-gray.t-night { --a: #0d1118; --b: #252e3b; }

#app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 10px) 16px calc(env(safe-area-inset-bottom) + 28px); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bar-r { display: flex; gap: 6px; flex-shrink: 0; }
.bar .place { min-width: 0; }
.storm-btn.l2 { background: #ffb648; color: #2a1a00; font-weight: 700; }
.storm-btn.l3 { background: #ff6b5b; font-weight: 700; }
.place { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 1.05rem; padding: 8px 12px 8px 8px; border-radius: 999px; background: var(--card); max-width: 72%; }
.place #placeName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin { font-size: .95rem; }
.chev { color: var(--ink3); font-size: .8rem; }
.ghost { padding: 8px 14px; border-radius: 999px; background: var(--card); font-weight: 500; font-size: .92rem; }
.stale { margin: 10px 0 0; font-size: .82rem; color: var(--ink2); text-align: center; }

.hero { text-align: center; padding: 26px 0 6px; }
.hero-icon svg { width: 56px; height: 56px; }
.temp { font-size: 6.4rem; font-weight: 200; line-height: 1; letter-spacing: -.04em; margin: 2px 0 4px 18px; font-variant-numeric: tabular-nums; }
.cond { font-size: 1.25rem; font-weight: 500; }
.sub { color: var(--ink2); font-size: .92rem; margin-top: 4px; }
.sub small { display: block; color: var(--ink3); font-size: .78rem; margin-top: 3px; }

.summary { font-size: 1.22rem; line-height: 1.45; font-weight: 500; margin: 18px 4px 16px; text-wrap: pretty; }

.card { background: var(--card); border-radius: 20px; padding: 14px 16px; margin: 12px 0; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.card-h { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); margin-bottom: 10px; }
.legend { text-transform: none; letter-spacing: 0; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 14px; height: 8px; border-radius: 3px; margin-left: 6px; }
.lg-band { background: rgba(255,255,255,.28); }
.lg-walk { background: rgba(126,226,168,.35); }

/* alerts */
.alert { display: block; width: 100%; text-align: left; border-radius: 16px; padding: 12px 14px; margin: 10px 0 0; font-weight: 600; }
.alert.warning { background: rgba(255,107,91,.9); }
.alert.watch { background: rgba(255,182,72,.88); color: #2a1a00; }
.alert.advisory { background: var(--card); }
.alert small { display: block; font-weight: 400; opacity: .85; margin-top: 2px; }

/* walk */
.walk { display: flex; align-items: center; gap: 14px; }
.walk .verdict { font-size: 1.5rem; font-weight: 700; min-width: 74px; }
.walk.go .verdict { color: var(--go); } .walk.maybe .verdict { color: var(--maybe); } .walk.no .verdict { color: var(--no); }
.walk .why { font-size: .92rem; color: var(--ink2); }
.walk .why b { color: var(--ink); font-weight: 600; }

/* next-3-hours rain strip */
.nc-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; align-items: end; height: 46px; margin-top: 4px; }
.nc-bars i { display: block; border-radius: 3px 3px 1px 1px; background: rgba(143,200,255,.85); min-height: 2px; }
.nc-bars i.dry { background: rgba(255,255,255,.14); }
.nc-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink3); margin-top: 5px; }
.nc-head { font-weight: 600; }
.air-alert { font-weight: 600; }
.air-alert small { display: block; font-weight: 400; color: var(--ink2); margin-top: 2px; }
.aqi-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* what to wear */
.wear { display: flex; align-items: center; gap: 14px; }
.wear .icons { font-size: 1.7rem; letter-spacing: .08em; min-width: 74px; line-height: 1.1; }
.wear .main { font-weight: 600; }
.wear .note { font-size: .88rem; color: var(--ink2); margin-top: 2px; }
.wear .when { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); margin-bottom: 2px; }

/* air & allergies */
.air-row { display: flex; align-items: center; gap: 14px; }
.air-big { font-size: 1.9rem; font-weight: 600; min-width: 74px; font-variant-numeric: tabular-nums; }
.air-main { font-weight: 600; }
.air-sub { font-size: .86rem; color: var(--ink2); margin-top: 3px; }
.air-block { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.air-label { font-weight: 600; font-size: .92rem; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pchip { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }

/* sunrise / sunset */
.sun .sun-head { font-weight: 600; font-size: 1.02rem; }
.sun .sun-arc svg { display: block; width: 100%; height: auto; margin: 6px 0 2px; }
.sun .sun-arc text { fill: var(--ink3); font-size: 10px; }
.sun-times { display: flex; justify-content: space-between; align-items: flex-end; }
.sun-times .t { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sun-times .k { font-size: .72rem; color: var(--ink3); text-transform: uppercase; letter-spacing: .08em; }
.sun-times .r { text-align: right; }
.sun .note { margin-top: 8px; }
.moon-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.moon-ic { font-size: 1.9rem; line-height: 1; }
.moon-name { font-weight: 600; }
.moon-sub { font-size: .84rem; color: var(--ink2); margin-top: 2px; }

/* timeline */
.timeline { overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.timeline::-webkit-scrollbar { display: none; }
.timeline svg { display: block; }
.timeline text { fill: var(--ink); font-size: 12px; }
.timeline .hr { fill: var(--ink3); font-size: 11px; }
.timeline .pc { fill: var(--rain); font-size: 10.5px; font-weight: 600; }
.timeline .tv { font-size: 13px; font-weight: 600; }

/* days */
.day { display: grid; grid-template-columns: 48px 30px 44px 1fr; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.day .dow { font-weight: 600; }
.day svg { width: 26px; height: 26px; }
.day .pop { color: var(--rain); font-size: .82rem; font-weight: 600; }
.range { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.range .lo { color: var(--ink3); text-align: right; }
.range .track { position: relative; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); }
.range .fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #8fd0ff, #ffd27a 60%, #ff9a6a); }
.day .unsure { grid-column: 3 / -1; font-size: .74rem; color: var(--maybe); margin-top: -4px; }

.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; color: var(--ink2); font-size: .84rem; margin-top: 18px; text-align: center; }
.foot .learn { flex-basis: 100%; color: var(--ink3); font-size: .78rem; }

/* details */
.back { margin: 14px 0 2px; }
#radar { height: 320px; border-radius: 14px; overflow: hidden; background: rgba(0,0,0,.25); }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.row:first-child { border-top: 0; }
.row .k { color: var(--ink2); } .row .k small { display: block; color: var(--ink3); font-size: .76rem; }
.row .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.models { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
table.models th { color: var(--ink3); font-weight: 500; font-size: .74rem; text-align: right; padding: 0 0 6px; }
table.models th:first-child, table.models td:first-child { text-align: left; }
table.models td { padding: 7px 0; border-top: 1px solid var(--line); text-align: right; }
table.models td small { color: var(--ink3); display: block; font-size: .72rem; }
.note { color: var(--ink3); font-size: .8rem; margin: 10px 0 0; }
.alert-full h4 { margin: 4px 0; } .alert-full p { white-space: pre-wrap; font-size: .86rem; color: var(--ink2); margin: 0 0 12px; }
.walkset { display: flex; gap: 14px; }
.walkset select { font: inherit; color: var(--ink); background: rgba(255,255,255,.12); border: 0; border-radius: 10px; padding: 6px 8px; margin-left: 6px; }

/* history + scorecard */
.linkcard { display: block; width: 100%; text-align: left; font-weight: 600; }
.foot .linkish { flex-basis: 100%; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tabs { display: flex; gap: 6px; background: var(--card); border-radius: 999px; padding: 4px; margin: 16px 0 4px; }
.tabs button { flex: 1; padding: 8px 0; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--ink2); }
.tabs button.on { background: rgba(255,255,255,.2); color: var(--ink); }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--ink3); font-size: 9.5px; }
.lg-gust { background: rgba(255,210,122,.8); } .lg-wind { background: rgba(255,255,255,.7); }
.headline { font-size: 1.02rem; line-height: 1.5; margin: 0 0 10px; }
.score-good { color: var(--go); } .score-bad { color: var(--no); }
tr.blend td { font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; }
.stat .k { font-size: .74rem; color: var(--ink3); text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: .78rem; color: var(--ink3); font-weight: 400; margin-left: 4px; }
.rec { display: grid; grid-template-columns: 92px 1fr 1fr 34px; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: .88rem; font-variant-numeric: tabular-nums; }
.rec:first-child { border-top: 0; }
.rec .lbl { font-size: .7rem; color: var(--ink3); display: block; }
.rec .mark { text-align: right; font-size: .95rem; letter-spacing: 2px; }

.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.switch input { width: 20px; height: 20px; accent-color: #7ee2a8; }

/* storm center */
.muted { color: var(--ink3); font-weight: 400; }
.storm-banner { display: block; width: 100%; text-align: left; border-radius: 16px; padding: 12px 14px; margin: 10px 0 0; font-weight: 600; background: var(--card); }
.storm-banner small { display: block; font-weight: 400; opacity: .9; margin-top: 2px; }
.storm-banner.l2 { background: rgba(255,182,72,.88); color: #2a1a00; }
.storm-banner.l3 { background: rgba(255,107,91,.92); }
.card-h .lvl, .card-h .demo-tag { white-space: nowrap; letter-spacing: .02em; }
.lvl { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: rgba(255,255,255,.16); }
.lvl.l2 { background: #ffb648; color: #2a1a00; } .lvl.l3 { background: #ff6b5b; }
.demo-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: #c48bff; color: #1a0b2e; }
.storm-name { font-size: 1.35rem; font-weight: 700; margin: 2px 0; }
.storm-sub { color: var(--ink2); font-size: .92rem; }
.chip { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: rgba(255,107,91,.25); }
#stormMap { height: 300px; border-radius: 14px; overflow: hidden; background: rgba(0,0,0,.25); margin-top: 4px; }
.track-key { display: flex; gap: 14px; font-size: .78rem; color: var(--ink2); margin-top: 8px; }
.track-key i { display: inline-block; width: 18px; height: 3px; vertical-align: 3px; margin-right: 5px; border-radius: 2px; }
.nhc-img { display: block; width: 100%; border-radius: 12px; margin-top: 8px; background: rgba(255,255,255,.06); }
details.warn { border-top: 1px solid var(--line); padding: 9px 0; }
details.warn summary { font-weight: 600; cursor: pointer; }
details.warn p { white-space: pre-wrap; font-size: .86rem; color: var(--ink2); margin: 8px 0 0; }

/* place sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 10; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; max-width: 560px; margin: 0 auto; max-height: 78vh; overflow-y: auto;
  background: #1c2230; border-radius: 22px 22px 0 0; padding: 8px 16px calc(env(safe-area-inset-bottom) + 18px); }
.grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 4px auto 12px; }
.opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 13px 10px; border-radius: 12px; font-size: 1.02rem; }
.opt:active, .opt.on { background: rgba(255,255,255,.08); }
.opt .x { margin-left: auto; color: var(--ink3); padding: 0 6px; }
.opt small { color: var(--ink3); margin-left: 4px; }
#search { width: 100%; margin: 10px 0 6px; padding: 12px 14px; border-radius: 12px; border: 0; background: rgba(255,255,255,.1); color: var(--ink); font: inherit; }
#search::placeholder { color: var(--ink3); }

@media (min-width: 900px) { #app { max-width: 620px; } }
