/* Weather: one stylesheet. Sections: tokens · base · shell and rail · cards ·
   hero · alerts · hourly · daily · details · icons · states · motion. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #f4f6fa; --surface: #ffffff; --tile: #f3f5f9; --chip: #e9edf3;
  --text: #131a26; --muted: #5f6b7c; --line: rgba(22, 32, 54, .09);
  --accent: #2466e0; --wet: #1f6fd6; --danger: #c93a2c;
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 8px 28px rgba(20, 30, 60, .06);
  --sun: #ffb020; --moon: #8fa0c8; --cloud: #c3cddc; --cloud-heavy: #94a1b6; --cloud-back: #a9b5c8;
  --drop: #3d8fe8; --flake: #6fa6e6; --bolt: #f5a800; --mist: #9aa7ba;
  --radius: 22px; --pad: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.3, 1.35, .5, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1117; --surface: #161c26; --tile: #1d2430; --chip: #232b38;
  --text: #e9eef6; --muted: #95a2b6; --line: rgba(255, 255, 255, .08);
  --accent: #78a9ff; --wet: #6cb0ff; --danger: #ff8a7a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  --sun: #ffc247; --moon: #d5dcf2; --cloud: #c5cfdf; --cloud-heavy: #8493aa; --cloud-back: #5d6a80;
  --drop: #6cb0ff; --flake: #dbe9fb; --bolt: #ffd04d; --mist: #8a97ab;
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  transition: background-color .35s, color .35s;
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .8125rem; color: var(--muted); }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none;
  transition: background-color .2s, transform .2s var(--spring);
}
.icon-btn:hover { background: var(--chip); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg, .search svg, .locate svg, .p-remove svg, .chev {
  width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Shell and rail ─────────────────────────────────────────────────────── */
.shell { min-height: 100dvh; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: 320px; z-index: 6; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background: var(--surface); border-right: 1px solid var(--line);
  transition: background-color .35s, transform .4s var(--ease);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.125rem; letter-spacing: -.01em; padding: 2px 4px; }
.brand svg { width: 32px; height: 32px; color: var(--cloud-heavy); }
.brand span { flex: 1; }
.narrow-only { display: none; }

.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 46px; padding: 0 14px 0 40px; border-radius: 14px; border: 1px solid transparent;
  background: var(--chip); color: var(--text); font: inherit; outline: none; appearance: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }

.results:empty { display: none; }
.results { display: grid; gap: 2px; margin-top: -6px; }
.results li { animation: rise .35s var(--ease) both; animation-delay: calc(var(--n, 0) * 30ms); }
.results button { width: 100%; text-align: left; padding: 9px 12px; border-radius: 12px; display: grid; }
.results button:hover, .results button:focus-visible { background: var(--chip); }
.results .note { color: var(--muted); font-size: .875rem; padding: 8px 12px; }

.locate {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; color: var(--accent); font-weight: 550;
  transition: background-color .2s;
}
.locate:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.locate svg { width: 20px; height: 20px; }
.locate.busy svg { animation: pulse 1s ease-in-out infinite; }

.rail-h { font-size: .75rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 12px 0; }
.places { display: grid; gap: 4px; flex: 1; align-content: start; }
.places li { position: relative; border-radius: 16px; transition: background-color .2s; }
.places li:hover { background: var(--tile); }
.places li.active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.place { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 11px 44px 11px 14px; border-radius: 16px; }
.p-name { flex: 1; min-width: 0; display: grid; font-weight: 600; }
.p-name, .p-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-name small { font-weight: 400; }
.p-now { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.p-now .wx { width: 26px; height: 26px; }
.p-now b { font-weight: 600; min-width: 2.2em; text-align: right; }
.p-remove {
  position: absolute; right: 8px; top: 50%; translate: 0 -50%; width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity .2s, background-color .2s;
}
.p-remove svg { width: 16px; height: 16px; }
.places li:hover .p-remove, .p-remove:focus-visible { opacity: 1; }
.p-remove:hover { background: var(--chip); color: var(--danger); }
@media (hover: none) { .p-remove { opacity: .7; } }

.settings { display: grid; gap: 8px; }
.seg {
  --count: 2; --i: 0;
  position: relative; display: grid; grid-template-columns: repeat(var(--count), 1fr); padding: 3px; border-radius: 13px; background: var(--chip);
}
.seg button { position: relative; padding: 8px 0; border-radius: 10px; font-size: .875rem; font-weight: 550; color: var(--muted); transition: color .2s; }
.seg button[aria-checked="true"] { color: var(--text); }
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--count)); border-radius: 10px;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .14);
  transform: translateX(calc(var(--i) * 100%)); transition: transform .35s var(--spring), background-color .35s;
}

.scrim { display: none; }

main { container-type: inline-size; min-width: 0; margin-left: 320px; padding: 0 clamp(14px, 3vw, 32px) calc(24px + env(safe-area-inset-bottom)); padding-right: max(clamp(14px, 3vw, 32px), env(safe-area-inset-right)); }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  max-width: 1120px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 0 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: background-color .35s;
}
.where { flex: 1; min-width: 0; padding-left: 4px; }
.where h1 { font-size: 1.375rem; font-weight: 680; letter-spacing: -.02em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.where p { font-size: .8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#refresh.busy svg { animation: spin .9s linear infinite; }

.view { max-width: 1120px; margin: 4px auto 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 800px) {
  .view { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
  .hero, .alerts, .hourly, .radar, .empty, .skeleton { grid-column: 1 / -1; }
}

.foot { max-width: 1120px; margin: 22px auto 0; text-align: center; color: var(--muted); font-size: .8125rem; }

@media (max-width: 1079px) {
  .narrow-only { display: grid; }
  .rail {
    z-index: 20; width: min(340px, 88vw); border-right: 0;
    transform: translateX(-102%); box-shadow: none; visibility: hidden;
    transition: transform .4s var(--ease), visibility 0s .4s, background-color .35s;
  }
  .rail-open .rail { transform: none; visibility: visible; box-shadow: 0 0 60px rgba(0, 0, 0, .3); transition: transform .4s var(--ease), visibility 0s, background-color .35s; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(8, 12, 20, .45); opacity: 0; pointer-events: none; transition: opacity .35s; }
  .rail-open .scrim { opacity: 1; pointer-events: auto; }
  main { margin-left: 0; padding-left: max(clamp(14px, 3vw, 32px), env(safe-area-inset-left)); }
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius); padding: var(--pad); box-shadow: var(--shadow);
  min-width: 0; transition: background-color .35s;
}
.card > h2 { font-size: .75rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.wx { width: 30px; height: 30px; overflow: visible; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  --g1: #1759c4; --g2: #3f8fe8;
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  padding: clamp(22px, 4cqw, 36px); border-radius: 28px;
  background: linear-gradient(115deg, var(--g1), var(--g2));
  box-shadow: 0 14px 40px -12px color-mix(in srgb, var(--g1) 60%, transparent);
  --sun: #ffd257; --moon: #f3f5ff; --cloud: #ffffff; --cloud-heavy: #e3ebf7; --cloud-back: rgba(255, 255, 255, .55);
  --drop: #cfe6ff; --flake: #ffffff; --bolt: #ffe066; --mist: rgba(255, 255, 255, .8);
}
.mood-night { --g1: #0e1738; --g2: #2b3a78; }
.mood-cloud { --g1: #415169; --g2: #687b95; }
.mood-night-cloud { --g1: #1a2032; --g2: #3b4459; }
.mood-rain { --g1: #2a4563; --g2: #4c6f90; }
.mood-storm { --g1: #25274a; --g2: #4b4473; }
.mood-snow { --g1: #446a92; --g2: #6f93b6; }
.mood-fog { --g1: #4d5864; --g2: #74808d; }

.orbs { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.orbs i { position: absolute; border-radius: 50%; background: #fff; opacity: .11; filter: blur(34px); animation: float 16s ease-in-out infinite alternate; }
.orbs i:nth-child(1) { width: 46%; aspect-ratio: 1; right: -8%; top: -40%; }
.orbs i:nth-child(2) { width: 30%; aspect-ratio: 1; left: 22%; bottom: -46%; animation-duration: 21s; animation-direction: alternate-reverse; }
.orbs i:nth-child(3) { width: 22%; aspect-ratio: 1; left: -6%; top: -18%; opacity: .07; animation-duration: 26s; }

.hero-temp { font-size: clamp(5.25rem, 20cqw, 8.5rem); font-weight: 250; line-height: .95; letter-spacing: -.045em; font-variant-numeric: tabular-nums; display: flex; }
.hero-temp sup { font-size: .5em; font-weight: 300; line-height: 1.25; margin-left: .04em; opacity: .9; }
.hero-cond { font-size: clamp(1.25rem, 3.4cqw, 1.625rem); font-weight: 600; letter-spacing: -.01em; margin-top: 8px; }
.hero-feels { opacity: .92; margin-top: 2px; min-height: 1.45em; }
.hero-range { display: flex; gap: 14px; margin-top: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-icon .wx { width: clamp(108px, 30cqw, 200px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .18)); }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alerts { padding: 6px; display: grid; }
.alert summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; cursor: pointer; list-style: none; }
.alert summary::-webkit-details-marker { display: none; }
.alert summary:hover { background: var(--tile); }
.alert-mark { --alert: #f5a800; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--alert) 22%, transparent); animation: pulse 2.4s ease-in-out infinite; }
.alert-mark svg { width: 22px; height: 22px; fill: none; stroke: color-mix(in srgb, var(--alert) 60%, var(--text)); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.alert-title { flex: 1; display: grid; min-width: 0; }
.chev { color: var(--muted); transition: rotate .3s var(--ease); flex: none; }
.alert[open] .chev { rotate: 180deg; }
.alert-body { padding: 4px 14px 12px 62px; display: grid; gap: 8px; font-size: .9375rem; animation: rise .35s var(--ease); white-space: pre-line; }
.fine { font-size: .8125rem; color: var(--muted); }

/* ── Hourly ─────────────────────────────────────────────────────────────── */
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 12px; }
.card-head h2 { font-size: .75rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .75rem; color: var(--muted); }
.key span { display: flex; align-items: center; gap: 6px; }
.key-temp { width: 18px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #4f9dff, #f5c846, #fa8c32); }
.key-rain { width: 7px; height: 12px; border-radius: 2px; background: var(--wet); }
.hscroll { overflow-x: auto; margin: 0 calc(var(--pad) * -1) -8px; padding: 0 calc(var(--pad) - 10px) 8px; scrollbar-width: thin; scrollbar-color: var(--chip) transparent; overscroll-behavior-x: contain; }
.htrack { position: relative; }
.hours { display: flex; }
.hours li { width: 62px; flex: none; display: grid; grid-template-rows: 20px 36px 62px 30px 18px; justify-items: center; align-items: center; border-radius: 14px; transition: background-color .2s; }
.hours li:hover { background: var(--tile); }
.h-time { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.h-time b { color: var(--accent); font-weight: 650; }
.h-curve { position: relative; width: 100%; height: 100%; z-index: 1; }
.h-temp { position: absolute; left: 0; right: 0; text-align: center; font-weight: 620; font-variant-numeric: tabular-nums; line-height: 20px; }
.h-bar { position: relative; width: 16px; height: 26px; border-radius: 5px; background: var(--chip); overflow: hidden; align-self: end; }
.h-bar i { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--p) * 1%); background: var(--wet); border-radius: 0 0 5px 5px; transform-origin: bottom; }
.h-pop { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.h-pop.wet, .d-half small.wet { color: var(--wet); font-weight: 600; }
.hline { position: absolute; left: 0; top: 56px; pointer-events: none; overflow: visible; }
.hline-stroke { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; }
.hline-now { fill: var(--surface); stroke-width: 2.5; }

/* ── Radar ──────────────────────────────────────────────────────────────── */
.map { position: relative; height: clamp(260px, 42cqw, 420px); border-radius: 16px; overflow: hidden; background: var(--tile); isolation: isolate; cursor: grab; user-select: none; -webkit-user-select: none; }
.map:active { cursor: grabbing; }
.map-layer { position: absolute; inset: 0; }
.map-layer img { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .3s; pointer-events: none; max-width: none; }
.map-layer img.in { opacity: 1; }
/* One base map for both themes: muted so the radar stands out, inverted for dark. */
.map-base { filter: saturate(.45) brightness(1.04); }
:root[data-theme="dark"] .map-base { filter: invert(1) hue-rotate(180deg) saturate(.35) brightness(.82) contrast(.92); }
.map-radar .map-layer { opacity: 0; transition: opacity .25s linear; }
.map-radar .map-layer.on { opacity: .8; }
.map-radar img { image-rendering: auto; }
.map-pin { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); pointer-events: none; }
.map-pin::after { content: ''; position: absolute; inset: -2.5px; border-radius: 50%; border: 2px solid var(--accent); animation: ping 2.4s ease-out infinite; }
.map-zoom, .map-full { position: absolute; right: 10px; z-index: 2; background: var(--surface); border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.map-zoom { top: 10px; display: grid; overflow: hidden; }
.map-zoom button { width: 38px; height: 36px; font-size: 1.25rem; line-height: 1; }
.map-zoom button + button { border-top: 1px solid var(--line); }
.map-zoom button:hover, .map-full:hover { background: var(--chip); }
.map-full { top: 94px; width: 38px; height: 38px; display: grid; place-items: center; }
.map-full svg, .radar-play svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-credit { position: absolute; right: 0; bottom: 0; z-index: 2; padding: 2px 8px; font-size: .6875rem; color: var(--muted); background: color-mix(in srgb, var(--surface) 78%, transparent); border-top-left-radius: 8px; }
.map-credit a { color: inherit; }
.map-note { position: absolute; left: 50%; bottom: 34px; translate: -50%; z-index: 2; padding: 6px 12px; border-radius: 10px; background: var(--surface); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.radar-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.radar-play { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent); color: #fff; transition: transform .2s var(--spring); }
:root[data-theme="dark"] .radar-play { color: #0d1117; }
.radar-play:active { transform: scale(.9); }
.radar-scrub { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; }
.radar-time { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 9.5em; text-align: right; }
.radar.full { position: fixed; inset: 0; z-index: 50; border-radius: 0; margin: 0; display: flex; flex-direction: column; animation: none !important;
  padding: calc(12px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.radar.full > h2 { display: none; }
.radar.full .map { flex: 1; height: auto; touch-action: none; }
.radar-full, .radar-full body { overflow: hidden; }
@keyframes ping { from { transform: scale(1); opacity: .8; } to { transform: scale(3.2); opacity: 0; } }

/* ── Daily ──────────────────────────────────────────────────────────────── */
.days { display: grid; }
.day + .day { border-top: 1px solid var(--line); }
.day-row, .day-head {
  width: 100%; display: grid; align-items: center; gap: 8px; padding: 7px 6px; text-align: left;
  grid-template-columns: minmax(58px, 1fr) 46px 46px 38px minmax(44px, 1.4fr) 38px;
}
.day-head { padding-block: 0 4px; font-size: .6875rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; }
.day-row { border-radius: 12px; font-variant-numeric: tabular-nums; transition: background-color .2s; }
.day-row:hover { background: var(--tile); }
.d-name { font-weight: 600; display: grid; line-height: 1.25; }
.d-name small { font-weight: 400; }
.d-half { display: grid; justify-items: center; padding: 3px 0 1px; border-radius: 10px; }
/* The night column sits on a darker strip, so the two halves read apart at a glance. */
.d-half + .d-half { background: color-mix(in srgb, var(--text) 6%, transparent); }
.d-half .wx { width: 28px; height: 28px; }
.d-half small { font-size: .6875rem; line-height: 1.3; }
.d-lo { color: var(--muted); text-align: right; }
.d-hi { font-weight: 650; }
.d-bar { position: relative; height: 6px; border-radius: 3px; background: var(--chip); }
.d-bar i {
  position: absolute; top: 0; bottom: 0; left: calc(var(--a) * 100%); width: max(8px, calc((var(--z) - var(--a)) * 100%));
  border-radius: 3px; background: linear-gradient(90deg, var(--c1), var(--c2)); transform-origin: left;
}
.day-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s var(--ease); }
.day.open .day-more { grid-template-rows: 1fr; }
.day-more > div { overflow: hidden; display: grid; gap: 8px; padding: 0 6px; font-size: .9375rem; opacity: 0; transition: opacity .3s, padding .38s var(--ease); }
.day.open .day-more > div { opacity: 1; padding: 4px 6px 14px; }
.day-more p { display: flex; gap: 10px; align-items: flex-start; }
.day-more b { font-weight: 650; margin-right: 4px; }
.half .wx { width: 30px; height: 30px; }
.chips { flex-wrap: wrap; gap: 6px !important; }
.chips span { background: var(--tile); border-radius: 999px; padding: 4px 10px; font-size: .8125rem; color: var(--muted); }

/* ── Details ────────────────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; background: var(--tile); border-radius: 16px; padding: 14px; min-height: 104px; transition: background-color .35s, transform .3s var(--spring); }
.tile:hover { transform: translateY(-2px); }
.tile h3 { font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.t-value { font-size: 1.375rem; font-weight: 640; letter-spacing: -.015em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.t-sub { font-size: .8125rem; color: var(--muted); }
.art { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; }
.art.sunarc { width: 62px; height: 32px; top: 14px; }
.art.scale, .art.bar { position: relative; inset: auto; width: auto; height: 6px; border-radius: 3px; margin-top: 10px; }
.art.scale { background: linear-gradient(90deg, #4cc36a, #f2cb3d 30%, #f58a3a 55%, #e14b4b 78%, #9b59d0); }
.art.scale i { position: absolute; top: 50%; left: calc(var(--p) * 100%); width: 12px; height: 12px; border-radius: 50%; translate: -50% -50%; background: var(--surface); border: 3px solid var(--text); }
.art.bar { background: var(--chip); overflow: hidden; }
.art.bar i { position: absolute; inset: 0; width: calc(var(--p) * 100%); border-radius: 3px; background: var(--cloud-heavy); transform-origin: left; }
.compass circle, .ring circle { fill: none; stroke: var(--chip); stroke-width: 3; }
.compass .ticks { stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; }
.needle { transform-origin: 24px 24px; rotate: var(--deg); }
.needle path { fill: var(--accent); }
.needle .tail { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.ring { rotate: -90deg; }
.ring .ring-v { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: var(--v) 100; }
.sunarc path { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.arc-track { stroke: var(--chip); }
.arc-done { stroke: var(--sun); stroke-dasharray: var(--f) 1; }
.horizon { stroke: var(--line); stroke-width: 1.5 !important; }
.arc-sun { fill: var(--sun); }
.moon-glyph { width: 40px; height: 40px; }
.moon-glyph .dark { fill: color-mix(in srgb, var(--muted) 30%, var(--tile)); }
.moon-glyph .lit { fill: var(--moon); }

/* ── Icons ──────────────────────────────────────────────────────────────── */
.i-sun circle { fill: var(--sun); }
.i-sun line, .i-drop, .i-mist, .i-wind path, .i-snowflake path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.i-sun line { stroke: var(--sun); stroke-width: 3; }
.i-moon path { fill: var(--moon); }
.i-star { fill: var(--moon); }
.i-cloud { fill: var(--cloud); }
.i-cloud.heavy { fill: var(--cloud-heavy); }
.i-cloud-back { fill: var(--cloud-back); }
.i-drop { stroke: var(--drop); stroke-width: 3; }
.i-ice { stroke-dasharray: .1 5.5; }
.i-flake { fill: var(--flake); }
.i-bolt { fill: var(--bolt); }
.i-mist { stroke: var(--mist); stroke-width: 3; }
.i-wind path { stroke: var(--cloud-heavy); stroke-width: 3.2; }
.i-snowflake path { stroke: var(--drop); stroke-width: 3; }
.i-snowflake { transform-origin: 32px 32px; }

/* Icons move where they are the centre of attention, and on hover elsewhere:
   forty-eight little rain showers at once would be a distraction, not a delight. */
.wx:not(:is(.hero-icon *, .empty-icon *, li:hover > *, .day-row:hover *, .place:hover *)) * { animation: none !important; }
.i-rays { animation: spin 22s linear infinite; }
.i-sun circle { animation: breathe 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.i-moon { animation: sway 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.i-star { animation: twinkle 2.6s ease-in-out infinite; }
.i-star.s2 { animation-delay: -1.3s; }
.i-cloud-wrap { animation: drift 6s ease-in-out infinite; }
.i-cloud-back { animation: drift 8s ease-in-out infinite reverse; }
.i-drop { animation: fall 1.1s linear infinite; }
.i-flake { animation: snow 2.6s linear infinite; }
.d1 { animation-delay: -.35s; } .d2 { animation-delay: -.7s; } .d3 { animation-delay: -.15s; }
.i-flake.d1 { animation-delay: -.9s; } .i-flake.d2 { animation-delay: -1.7s; } .i-flake.d3 { animation-delay: -.4s; }
.i-bolt { animation: flash 3.2s ease-in-out infinite; }
.i-mist { animation: mist 5s ease-in-out infinite; }
.i-wind path { stroke-dasharray: 1; animation: gust 3.4s ease-in-out infinite; }
.i-snowflake { animation: spin 30s linear infinite; }
.i-hot { animation: breathe 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* ── States ─────────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: clamp(36px, 8cqw, 72px) 24px; display: grid; justify-items: center; gap: 10px; }
.empty-icon .wx { width: 120px; height: 120px; }
.card.empty > h2 { font-size: 1.625rem; font-weight: 680; letter-spacing: -.02em; text-transform: none; color: var(--text); margin: 0; }
.empty p { color: var(--muted); max-width: 34ch; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.btn { padding: 11px 18px; border-radius: 14px; background: var(--chip); font-weight: 600; color: var(--text); transition: transform .2s var(--spring), filter .2s; }
.btn.primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0d1117; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.96); }

.skeleton { min-height: 150px; box-shadow: none; background: linear-gradient(100deg, var(--chip) 30%, var(--surface) 50%, var(--chip) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton.hero-skel { min-height: 250px; border-radius: 28px; }
.skeleton.tall { min-height: 320px; }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 40; translate: -50% 150%;
  max-width: min(92vw, 440px); padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg);
  font-size: .9375rem; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); opacity: 0;
  transition: translate .45s var(--spring), opacity .3s;
}
.toast.show { translate: -50% 0; opacity: 1; }

/* ── Motion ─────────────────────────────────────────────────────────────── */
.view.enter .card { animation: rise .65s var(--ease) both; animation-delay: calc(var(--i, 0) * 75ms); }
.view.enter .hero-icon { animation: pop .9s var(--spring) both .15s; }
.view.enter .hline-stroke { animation: draw 1.5s var(--ease) both .45s; }
.view.enter .hline-now, .view.enter .h-temp { animation: fade .8s ease both .9s; }
.view.enter .h-bar i { animation: growUp .7s var(--ease) both; animation-delay: calc(var(--n, 0) * 35ms + 500ms); }
.view.enter .d-bar i, .view.enter .art.bar i { animation: grow .8s var(--ease) both; animation-delay: calc(var(--n, 0) * 45ms + 420ms); }
.view.enter .tile { animation: rise .55s var(--ease) both; animation-delay: calc(var(--n, 0) * 45ms + 380ms); }
.view.enter .needle { animation: needle 1.3s var(--spring) both .6s; }
.view.enter .ring-v { animation: ring 1.1s var(--ease) both .6s; }
.view.enter .arc-done { animation: arc 1.2s var(--ease) both .6s; }
.view.enter .art.scale i { animation: slide 1s var(--spring) both .6s; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes growUp { from { transform: scaleY(0); } }
@keyframes needle { from { rotate: 0deg; } }
@keyframes ring { from { stroke-dasharray: 0 100; } }
@keyframes arc { from { stroke-dasharray: 0 1; } }
@keyframes slide { from { left: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.06); } }
@keyframes sway { 50% { transform: rotate(-7deg); } }
@keyframes twinkle { 50% { opacity: .25; } }
@keyframes drift { 50% { transform: translateX(2.5px); } }
@keyframes fall { from { transform: translate(1px, -3px); opacity: 0; } 25% { opacity: 1; } to { transform: translate(-3px, 9px); opacity: 0; } }
@keyframes snow { from { transform: translate(0, -4px); opacity: 0; } 20% { opacity: 1; } 50% { transform: translate(2px, 3px); } to { transform: translate(-1px, 10px); opacity: 0; } }
@keyframes flash { 0%, 100% { opacity: 1; } 46% { opacity: 1; } 50% { opacity: .25; } 54% { opacity: 1; } 58% { opacity: .4; } 62% { opacity: 1; } }
@keyframes mist { 50% { transform: translateX(4px); opacity: .6; } }
@keyframes gust { 0% { stroke-dashoffset: 1; } 45%, 70% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@keyframes float { to { transform: translate(8%, 10%) scale(1.15); } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes shimmer { to { background-position: -300% 0; } }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

@media (max-width: 420px) {
  :root { --pad: 16px; }
  .day-row, .day-head { grid-template-columns: minmax(54px, 1fr) 42px 42px 34px minmax(36px, 1.1fr) 34px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
