:root {
  --bg: #0e1318;
  --panel: rgba(17, 23, 30, 0.94);
  --chip: rgba(24, 32, 41, 0.92);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef2f6;
  --muted: #93a1af;
  --accent: #5ab0ff;
  --rain: #3fa7ff;
  --fcst: #b78cff;
  --warm: #ffb547;
  --card: #151c24;
  --tile: rgba(255,255,255,.035);
  --track: rgba(255,255,255,.07);
  --track-past: #4c5a69;
  --sel: #2a3644;
  --input: #1b232c;
  --btn: #23303d;
  --pop: #1f2a35;
  --grid: rgba(255,255,255,.07);
  --grid2: rgba(255,255,255,.18);
  --cross: rgba(255,255,255,.45);
  --axis: #3a4654;
  --handle: #3a4654;
  --chip-on: #eef2f6;
  --thumb: #8b97a4;
  --pending: #26303b;
  --chip-on-text: #0e1318;
  --radius: 14px;
  color-scheme: dark;
}

/* light theme: same layout, light surfaces to match the light map */
:root[data-theme="light"] {
  --bg: #f2f4f7;
  --panel: rgba(255, 255, 255, 0.96);
  --chip: rgba(255, 255, 255, 0.95);
  --line: rgba(20, 35, 55, 0.11);
  --text: #17212b;
  --muted: #5d6976;
  --accent: #1f78dc;
  --rain: #1769c9;
  --fcst: #7a4cd4;
  --warm: #e08600;
  --card: #ffffff;
  --tile: rgba(20, 35, 55, .045);
  --track: rgba(20, 35, 55, .10);
  --track-past: #b8c2cd;
  --sel: #dce6f2;
  --input: #eaeff4;
  --btn: #e1e8f0;
  --pop: #ffffff;
  --grid: rgba(20, 35, 55, .08);
  --grid2: rgba(20, 35, 55, .20);
  --cross: rgba(20, 35, 55, .40);
  --axis: #c3cbd5;
  --handle: #c3cbd5;
  --chip-on: #17212b;
  --thumb: #6f7b88;
  --pending: #e3e8ee;
  --chip-on-text: #ffffff;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#map { position: fixed; inset: 0; }

/* ---------- top bar ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; gap: 8px; align-items: center;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 8px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.places {
  flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
          mask-image: linear-gradient(90deg, #000 92%, transparent);
  padding-right: 18px;
}
.places::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px; border-radius: 19px;
  background: var(--chip); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
.chip .t { font-weight: 650; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--chip-on); color: var(--chip-on-text); border-color: transparent; }
.chip.add { width: 38px; padding: 0; justify-content: center; font-size: 22px; color: var(--muted); }
/* the current place at the top; opens the Places screen */
.curplace { flex: 1; min-width: 0; gap: 6px; }
.curplace .ci { font-size: 17px; }
.curplace .cn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.curplace .t { margin-left: auto; }
.curplace .cv { font-size: 11px; opacity: .6; }
/* Places screen: one card per place */
.pllist { display: flex; flex-direction: column; gap: 6px; }
.plc { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 14px 6px 10px;
  text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.plc.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plc .pli { font-size: 26px; text-align: center; }
.plc .pln { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plc .plt { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.plscreen .btn.wide { margin-top: 12px; }
.herebtn { flex: none; gap: 6px; padding: 0 12px; }
.herebtn .t:empty { display: none; }
.herei { color: var(--accent); font-size: .85em; }
.ptime { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.setbtn {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--chip); border: 1px solid var(--line); color: var(--muted);
}
.setbtn svg { width: 20px; height: 20px; fill: currentColor; }
.setdlg h2 { flex: 1; margin: 0; align-self: center; font-size: 17px; }
.setrow { margin-top: 14px; }
.setrow > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.setrow .seg { margin-top: 0; }
.setdlg { overflow-y: auto; }
/* Places in Settings: order with ▲ ▼, remove with ✕ */
.pcount { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.plist li:last-child { border-bottom: 0; }
.plist .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist button { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--input); color: var(--text); font-size: 13px; }
.plist button:disabled { visibility: hidden; }
.plist .pdel { color: #e0523f; }
.plist .pempty { color: var(--muted); font-size: 13px; border: 0; }

/* ---------- bottom sheet ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  max-width: 560px; margin: 0 auto;
  background: var(--panel);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 18px 18px 0 0;
  padding: 4px 14px calc(env(safe-area-inset-bottom) + 12px);
  max-height: 50dvh; display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.handle { display: block; width: 100%; height: 18px; position: relative; flex: none; }
.handle::after {
  content: ""; position: absolute; left: 50%; top: 7px; width: 40px; height: 4px;
  margin-left: -20px; border-radius: 2px; background: var(--handle);
}
.sheet.min .details { display: none; }

.timeline { display: flex; gap: 10px; align-items: center; flex: none; }
.play {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center;
}
.play svg { width: 24px; height: 24px; fill: #0e1318; }
.play .i-pause, .play.on .i-play { display: none; }
.play.on .i-pause { display: block; }
.track { flex: 1; min-width: 0; }
.when { display: flex; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
#whenTime { font-weight: 650; font-size: 17px; }
.rel { color: var(--muted); font-size: 13px; }
.rel.fcst { color: var(--fcst); }
.loading { margin-left: auto; color: var(--muted); font-size: 12px; }

input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 2px 0 0;
  background: transparent; touch-action: none;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  /* top layer: the part still loading, pale; below: past grey, forecast purple */
  background: linear-gradient(90deg, transparent 0 var(--loaded, 100%), var(--pending) var(--loaded, 100%) 100%),
    linear-gradient(90deg, var(--track-past) 0 var(--split, 100%), var(--fcst) var(--split, 100%) 100%);
}
input[type=range]::-moz-range-track {
  height: 6px; border-radius: 3px;
  /* top layer: the part still loading, pale; below: past grey, forecast purple */
  background: linear-gradient(90deg, transparent 0 var(--loaded, 100%), var(--pending) var(--loaded, 100%) 100%),
    linear-gradient(90deg, var(--track-past) 0 var(--split, 100%), var(--fcst) var(--split, 100%) 100%);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  box-sizing: border-box; background: var(--thumb); border: 2px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--thumb); border: 2px solid var(--card); box-sizing: border-box; }
/* where no radar forecast exists: the track goes on dashed after Now, with a short note */
.srow { display: flex; align-items: center; gap: 6px; }
.srow input { flex: 1; min-width: 0; }
.nofc { position: relative; flex: none; width: 58px; height: 28px; margin-top: 2px; }
.nofc::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; margin-top: -1px; border-top: 2px dashed var(--track-past); }
.nofc span { position: absolute; left: 0; right: 0; top: 100%; font-size: 10px; line-height: 14px; color: var(--muted); text-align: center; white-space: nowrap; }
.track.nofc-on .ticks { margin-right: 64px; }
.ticks { position: relative; height: 14px; font-size: 11px; color: var(--muted); }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ticks span.now { color: var(--text); font-weight: 600; }

/* ---------- details ---------- */
.details { overflow-y: auto; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.cur { display: flex; align-items: center; gap: 12px; }
.cur .big { font-size: 46px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.cur .ico { font-size: 38px; }
.cur .info { flex: 1; min-width: 0; }
.cur .name { font-weight: 650; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.cur .sub { color: var(--muted); font-size: 13px; }

.block { margin-top: 14px; }
.block h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.summary { font-size: 14px; margin-bottom: 6px; }
.summary.wet { color: var(--rain); font-weight: 600; }
.rainchart { width: 100%; height: 70px; display: block; }
.rainchart text { fill: var(--muted); font-size: 10px; }

.hours { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.hours::-webkit-scrollbar { display: none; }
.hour {
  flex: none; width: 52px; text-align: center; padding: 6px 0; border-radius: 10px;
  background: var(--tile); font-variant-numeric: tabular-nums;
}
.hour .h { font-size: 12px; color: var(--muted); }
.hour .e { font-size: 20px; margin: 2px 0; }
.hour .tt { font-weight: 600; }
.hour .p { font-size: 11px; color: var(--rain); min-height: 14px; }
.days { display: flex; flex-direction: column; }
.day {
  display: grid; grid-template-columns: 52px 30px 1fr 36px 36px; align-items: center; gap: 6px;
  min-height: 36px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.day:last-child { border-bottom: 0; }
.day .dn { font-weight: 600; }
.day .de { font-size: 20px; text-align: center; }
.day .dr { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; }
.day .dr b { font-weight: 600; color: var(--rain); white-space: nowrap; }
.day .dr em { font-style: normal; color: var(--muted); }
.day .rbar { flex: 1; min-width: 16px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.day .rbar i { display: block; height: 100%; border-radius: 3px; background: var(--rain); }
.day .lo { color: var(--muted); text-align: right; }
.day .hi { font-weight: 600; }
.note { margin-top: 6px; font-size: 12px; color: var(--muted); }
.src { margin-top: 12px; font-size: 11px; color: var(--muted); }
.src a { color: inherit; }
.empty { color: var(--muted); padding: 8px 0; }

/* ---------- map extras ---------- */
.dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(90,176,255,.25);
}
.dot.place { background: var(--warm); box-shadow: 0 0 0 6px rgba(255,181,71,.22); }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: var(--sheet-h, 120px); }

.toast {
  position: fixed; z-index: 6; left: 50%; top: calc(env(safe-area-inset-top) + 58px);
  transform: translateX(-50%); padding: 8px 14px; border-radius: 12px;
  background: #3a2a1a; color: #ffd9a8; font-size: 13px; border: 1px solid #6a4a2a;
  max-width: calc(100% - 32px);
}

/* ---------- add place ---------- */
.dlg {
  width: min(480px, calc(100% - 24px)); max-height: 70dvh; margin-top: 12dvh;
  padding: 10px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card); color: var(--text);
}
.dlg::backdrop { background: rgba(0,0,0,.55); }
.dlg-head { display: flex; gap: 8px; }
.dlg input {
  flex: 1; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
}
.dlg .close { width: 42px; color: var(--muted); font-size: 18px; }
.results { list-style: none; margin: 8px 0 0; padding: 0; overflow-y: auto; }
.results li { padding: 10px 8px; border-radius: 10px; cursor: pointer; }
.results li:hover, .results li:focus { background: var(--tile); outline: none; }
.results .r2 { color: var(--muted); font-size: 13px; }

/* ---------- model picker ---------- */
.modelrow { display: flex; gap: 8px; align-items: center; }
.msel { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 13px; }
.msel select {
  flex: 1; min-width: 0; height: 36px; padding: 0 8px; border-radius: 10px;
  background: var(--input); color: var(--text); border: 1px solid var(--line); font: inherit; font-size: 14px;
}
.btn {
  height: 36px; padding: 0 12px; border-radius: 10px; flex: none;
  background: var(--btn); border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.btn.wide { display: block; width: 100%; margin-top: 10px; background: var(--accent); color: #0e1318; border: 0; }

/* ---------- compare screen ---------- */
.compare {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto; background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 20px);
}
.compare > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.cmp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cmp-head h2 { margin: 0; font-size: 20px; }
.cmp-head .sub { color: var(--muted); }
.cmp-head .close { width: 40px; height: 40px; font-size: 18px; color: var(--muted); }
.seg { display: flex; margin-top: 12px; padding: 3px; border-radius: 12px; background: var(--input); }
.seg button { flex: 1; height: 34px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--sel); color: var(--text); }
.cmp-summary { margin: 12px 0 6px; font-size: 14px; display: grid; gap: 2px; }
.cmp-summary .k { color: var(--muted); display: inline-block; min-width: 110px; }
.cmp-summary .wet { color: var(--rain); font-weight: 600; }
#cmpSummary { text-align: center; }
#cmpSummary .k { min-width: 0; margin-right: 6px; }
.cmp-chart { position: relative; min-height: 120px; }
.cmpsvg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.cmpsvg .grid { stroke: var(--grid); stroke-width: 1; }
.cmpsvg .grid.day { stroke: var(--grid2); }
.cmpsvg .axis { fill: var(--muted); font-size: 10px; }
.cmpsvg .band { fill: rgba(90,176,255,.10); }
.cmpsvg .mline { fill: none; stroke: #66737f; stroke-width: 1.25; stroke-linejoin: round; }
.cmpsvg .mline-ring { fill: none; stroke: var(--bg); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.cmpsvg .mline.focus { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.cmpsvg .flabel { fill: var(--text); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.cmpsvg .cross { stroke: var(--cross); stroke-width: 1; }
.cmpsvg .fdot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.cmpsvg .rlabel { fill: var(--muted); font-size: 12px; }
.cmpsvg .rlabel.on { fill: var(--text); font-weight: 650; }
.cmpsvg .rfocus { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.cmp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.sw.focus { height: 3px; background: var(--accent); }
.sw.other { height: 2px; background: #66737f; }
.sw.band { background: rgba(90,176,255,.22); }
.tip {
  position: absolute; z-index: 2; pointer-events: none; min-width: 140px;
  padding: 8px 10px; border-radius: 10px; background: var(--pop); border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0,0,0,.4); font-size: 12px; font-variant-numeric: tabular-nums;
}
.tip .tt { color: var(--muted); margin-bottom: 4px; }
.tip .tr { display: flex; gap: 10px; color: var(--muted); }
.tip .tr b { color: var(--text); min-width: 42px; font-weight: 600; }
.tip .tr.em span { color: var(--text); font-weight: 600; }
.cmp-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.cmp-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 6px; }
.cmp-table td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.cmp-table td:first-child { white-space: normal; }
.cmp-table tr { cursor: pointer; }
.cmp-table tbody tr.on { background: rgba(90,176,255,.10); }
.cmp-table tbody tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.mn { font-weight: 600; }
.mn .cur { color: var(--accent); }
.mnote { color: var(--muted); font-size: 11px; }

/* ---------- panel: place header, rain things ---------- */
.phead { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.phead .name { font-weight: 650; font-size: 17px; }
.tots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tot { padding: 8px 6px; border-radius: 10px; background: var(--tile); text-align: center; font-variant-numeric: tabular-nums; }
.tot b { display: block; font-size: 18px; font-weight: 650; color: var(--rain); }
.tot b small { font-size: 11px; font-weight: 500; }
.tot span { font-size: 11px; color: var(--muted); }
.hour .p.big { font-size: 14px; font-weight: 600; margin: 4px 0 2px; }
.hour .mm { font-size: 11px; color: var(--muted); min-height: 14px; }
.rcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 3px; text-align: center; font-variant-numeric: tabular-nums; }
.rcol .rv { font-size: 10px; color: var(--text); min-height: 13px; white-space: nowrap; }
.rcol .rv small { display: none; }
.rcol .rb { height: 56px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--axis); }
.rcol .rb i { width: 70%; border-radius: 3px 3px 0 0; background: var(--rain); }
.rcol .rn { font-size: 11px; color: var(--muted); margin-top: 3px; }
.rcol .rp { font-size: 10px; color: var(--rain); min-height: 13px; }

/* ---------- forecast screen (Forecast mode) ---------- */
.fcscreen {
  display: none; position: fixed; inset: 0; z-index: 4; overflow-y: auto; background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 100px) 16px calc(env(safe-area-inset-bottom) + 20px);
}
.fcscreen > * { max-width: 720px; margin-left: auto; margin-right: auto; }
body.mode-forecast #forecast, body.mode-places #placesScr { display: block; }
body.mode-forecast .sheet, body.mode-places .sheet { display: none; }
.fcmodel { margin-top: 18px; }
.fcscreen .card { margin-top: 12px; padding: 10px 12px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.fcscreen .card .fch { margin-top: 0; }
.fcscreen .card:empty { display: none; }
.fcscreen.noplace > :not(#fcNow) { display: none; }
.cnds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.cnd { padding: 8px 10px; border-radius: 10px; background: var(--tile); font-variant-numeric: tabular-nums; }
.cnd .cl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cnd .cv { margin: 2px 0; font-size: 20px; font-weight: 650; line-height: 1.25; }
.cnd .cv small { font-size: 12px; font-weight: 400; color: var(--muted); }
.cnd .cs { font-size: 12px; color: var(--muted); }
.cnd .moonico { font-size: 14px; }
.fch { margin: 18px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.fch span { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.fcsum { margin-top: 0; }
.fcsum .k { min-width: 0; }
.fc24 .ico { font-size: 15px; }
.fc24 .flabel { font-size: 12px; }
.fc24 .midnight { stroke-dasharray: 3 3; }
.fc24 .daylbl { fill: var(--muted); font-size: 11px; font-weight: 600; }
.fc24 .pop { fill: var(--rain); font-size: 10px; }
.fcday { width: 100%; text-align: left; padding: 0 2px; }
.fcday .dn small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); }
.fcday.sel { background: rgba(90,176,255,.10); border-radius: 8px; border-bottom-color: transparent; }
.dd { padding: 8px 2px 12px; border-bottom: 1px solid var(--line); }
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.part { padding: 6px 2px; border-radius: 10px; background: var(--tile); }
.part .pn { font-size: 11px; color: var(--muted); }
.part .pe { font-size: 22px; margin: 2px 0; }
.part .pt { font-weight: 600; }
.part .pr, .part .pm { font-size: 11px; color: var(--rain); min-height: 14px; }
.part .pw { font-size: 11px; color: var(--muted); }
.dsum { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ---------- air quality ---------- */
.modes {
  position: fixed; z-index: 5; left: 12px; top: calc(env(safe-area-inset-top) + 56px);
  display: flex; padding: 3px; border-radius: 19px; background: var(--chip); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.modes button { height: 30px; padding: 0 12px; border-radius: 15px; color: var(--muted); font-weight: 600; font-size: 13px; }
.modes button.on { background: var(--sel); color: var(--text); }
.toast { top: calc(env(safe-area-inset-top) + 100px); }
:root[data-theme="light"] .toast { background: #fff4e3; color: #7a4a10; border-color: #f0cf9c; }
.sheet.air .timeline { display: none; }
.airbar { flex: none; }
.airtitle { font-weight: 650; font-size: 17px; }
.aqlegend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; }
.aqlegend span { display: inline-flex; align-items: center; gap: 5px; }
.aqlegend em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.aqdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.chip.on .aqdot { box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.aqnow { display: flex; align-items: center; gap: 10px; }
.aqbadge { min-width: 46px; height: 34px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.aqname { font-weight: 600; }
.aqfc { margin-top: 10px; }
.aqstrip { display: flex; gap: 2px; margin-top: 6px; }
.aqstrip i { flex: 1; height: 10px; border-radius: 2px; }
.aqaxis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }
.details .sub { color: var(--muted); font-size: 13px; }
.aqadvice { margin-top: 6px; }
.aqrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; text-align: center; }
.aqcell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; background: var(--tile); font-size: 12px; }
.aqcell em { font-style: normal; font-size: 10px; color: var(--muted); }
.aqmini { min-width: 34px; height: 24px; padding: 0 6px; border-radius: 7px; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; flex: none; }
.polrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.polrow:last-of-type { border-bottom: 0; }
.polrow .pn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.polrow .pn span { font-size: 11px; color: var(--muted); }
.polrow .pv { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.polrow .pv small { font-weight: 400; color: var(--muted); font-size: 11px; }
.maplibregl-popup-content { background: var(--pop); color: var(--text); border-radius: 12px; padding: 10px 12px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.maplibregl-popup-tip { border-top-color: var(--pop) !important; border-bottom-color: var(--pop) !important; }
.aqpop .pt { font-weight: 600; margin-bottom: 4px; }
.aqpop .pv { display: flex; align-items: center; gap: 6px; }
.aqpop .pv b { font-size: 18px; }
.aqpop .pv span, .aqpop .ps { color: var(--muted); font-size: 12px; }
