/* รู้ฟ้า (RooFah) — styles (tokens follow the canvas design) */
:root {
  --ground: #EEF2F1;
  --surface: #FFFFFF;
  --ink: #13201F;
  --ink2: #4A5A5B;
  --ink3: #2C3B3C;
  --line: #D9E1E0;
  --line2: #E4EAE9;
  --primary: #1F5FA8;
  --primary-ink: #174A84;
  --primary-soft: #E3EDF8;
  --r1: #93BDEB; --r2: #4F92DE; --r3: #1F5FA8; --r4: #5B2D96;
  --warn-soft: #FFF1DD; --warn-ink: #7A4A00;
  --danger: #B42318;
  --font: 'IBM Plex Sans Thai', 'Sukhumvit Set', 'Thonburi', system-ui, sans-serif;
  --display: 'Bai Jamjuree', 'IBM Plex Sans Thai', 'Sukhumvit Set', system-ui, sans-serif;
  --tabs-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid rgba(31, 95, 168, .45); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; padding-top: var(--safe-t); }
#view { padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 16px); }
#view.no-tabs { padding-bottom: calc(24px + var(--safe-b)); }

/* ---------- header ---------- */
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 16px 12px 20px; }
.hdr h1, .hdr .title { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.15; }
.hdr .sub { font-size: 14px; color: var(--ink2); }
.hdr .place-btn { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; }
.hdr .actions { display: flex; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex: none; }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.back-hdr { display: flex; align-items: center; gap: 12px; padding: 14px 16px 8px; }
.back-hdr h1 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.2; }
.back-hdr .sub { font-size: 14px; color: var(--ink2); }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; padding: 0 16px 14px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.add { width: 44px; padding: 0; justify-content: center; border-style: dashed; border-color: #8A9A99; background: transparent; }

/* ---------- cards ---------- */
.card { margin: 12px 16px 0; background: var(--surface); border-radius: 20px; padding: 16px; }
.card.hero { margin-top: 0; border-radius: 24px; padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.card h2 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 600; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.muted { color: var(--ink2); }
.small { font-size: 12px; }
.cap { font-size: 13px; color: var(--ink2); line-height: 1.5; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--primary); }
.eyebrow.muted { color: var(--ink2); }
.dot { width: 10px; height: 10px; border-radius: 5px; background: var(--r2); flex: none; }
.badge { font-size: 12px; color: var(--ink2); background: var(--ground); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.badge.low { background: var(--warn-soft); color: var(--warn-ink); }
.headline { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1.05; letter-spacing: -.5px; }
.headline.long { font-size: 36px; }
.lead { margin: 8px 0 0; font-size: 16px; line-height: 1.5; }
.meta { display: flex; gap: 10px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--line2); font-size: 14px; line-height: 1.5; }
.meta svg { flex: none; margin-top: 2px; }

/* rain chart */
.chart { display: flex; gap: 8px; }
.chart .plot { flex: 1; min-width: 0; }
.chart .area { position: relative; height: 100px; }
.chart .gl { position: absolute; left: 0; right: 0; border-top: 1px dashed #C9D3D2; }
.chart .split { position: absolute; top: -4px; bottom: 0; border-left: 1px dashed #8A9A99; }
.bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); column-gap: 3px; align-items: end; }
.bars i { display: block; border-radius: 3px 3px 1px 1px; }
.xl { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); column-gap: 3px; margin-top: 6px; font-size: 12px; color: var(--ink2); white-space: nowrap; }
.yl { width: 50px; flex: none; position: relative; height: 100px; font-size: 11px; color: var(--ink2); }
.yl span { position: absolute; left: 0; }
.chart .empty { position: absolute; left: 0; right: 0; top: 18px; text-align: center; font-size: 14px; color: var(--ink2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--r2); display: inline-block; }

/* rows / buttons */
.row-link { margin: 12px 16px 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 44px; border-radius: 16px; text-decoration: none; color: var(--ink); background: var(--primary-soft); }
.row-link.dashed { background: var(--surface); border: 1px dashed #8A9A99; }
.row-link.warn { background: var(--warn-soft); }
.row-link .txt { flex: 1; display: flex; flex-direction: column; font-size: 14px; line-height: 1.45; }
.row-link .txt b { font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--ground); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; }
.btn.block { width: 100%; }
.btn.primary { background: var(--primary); color: #fff; height: 52px; border-radius: 16px; font-size: 16px; }
.btn.primary:disabled { background: #8A9A99; }
.btn.outline { background: var(--surface); border: 1px solid #C9D3D2; font-weight: 500; }
.btn.danger { background: var(--surface); color: var(--danger); border: 1px solid #F1C9C5; }
.btn.small { height: 36px; font-size: 14px; padding: 0 12px; }
.btn.link { background: transparent; font-weight: 500; }

/* hourly */
.hours { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.hours div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hours b { font-family: var(--display); font-weight: 600; font-size: 15px; }
.hours .tube { width: 26px; height: 48px; background: var(--ground); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.hours .tube i { width: 100%; background: var(--r2); display: block; }

/* dust */
.scale { position: relative; margin-top: 14px; }
.scale .seg5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; height: 8px; }
.scale .seg5 span:first-child { border-radius: 4px 0 0 4px; }
.scale .seg5 span:last-child { border-radius: 0 4px 4px 0; }
.scale .mark { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px #fff; }
.scale.big .seg5 { height: 10px; }
.scale.big .mark { height: 20px; top: -5px; }
.ticks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin-top: 6px; font-size: 12px; color: var(--ink2); }
.big-num { font-family: var(--display); font-weight: 700; line-height: .9; letter-spacing: -2px; font-size: 84px; }
.swatch { width: 12px; height: 12px; border-radius: 6px; display: inline-block; flex: none; }
.advice { display: flex; gap: 12px; margin-top: 12px; align-items: flex-start; }
.advice .ic { flex: none; width: 36px; height: 36px; border-radius: 18px; background: var(--ground); display: flex; align-items: center; justify-content: center; }
.advice .txt { display: flex; flex-direction: column; font-size: 15px; line-height: 1.5; }
.days3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.days3 > div { background: #F5F7F6; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 56px; border-top: 1px solid var(--line2); }
.list-row:first-of-type { border-top: 0; }

/* places */
.pin-list { margin: 0 16px; background: var(--surface); border-radius: 20px; overflow: hidden; }
.pin-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 72px; border-top: 1px solid var(--line2); text-decoration: none; color: var(--ink); }
.pin-row:first-child { border-top: 0; }
.pin-row .ic, .ic-circle { flex: none; width: 40px; height: 40px; border-radius: 20px; background: var(--ground); display: flex; align-items: center; justify-content: center; }
.ic-circle.blue { background: var(--primary-soft); }
.pin-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pill { align-self: flex-start; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--ground); color: #3A4A4B; }
.pill.rain { background: var(--primary-soft); color: var(--primary-ink); }
.section-h { display: flex; justify-content: space-between; align-items: baseline; padding: 20px 20px 8px; }
.section-h h2 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 600; }

/* forms */
.seg { display: grid; gap: 4px; background: var(--ground); border-radius: 14px; padding: 4px; }
.seg button { height: 44px; border: 0; border-radius: 11px; background: transparent; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); font-weight: 600; box-shadow: 0 1px 2px rgba(19, 32, 31, .08); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .lbl { font-size: 14px; font-weight: 600; }
.input { height: 48px; border: 1px solid #C9D3D2; border-radius: 12px; padding: 0 12px; font-size: 16px; background: #fff; width: 100%; min-width: 0; }
.switch-row { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.switch-row .txt { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.switch-row .txt b { font-size: 15px; font-weight: 500; }
.switch { flex: none; width: 52px; height: 44px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; }
.switch span { width: 52px; height: 32px; border-radius: 16px; padding: 3px; background: #B7C3C2; display: flex; justify-content: flex-start; transition: background .15s; }
.switch span::after { content: ''; width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(19, 32, 31, .25); }
.switch[aria-checked="true"] span { background: var(--primary); justify-content: flex-end; }
.sec { background: var(--surface); border-radius: 20px; padding: 6px 16px 16px; margin: 12px 16px 0; }
.sec-h { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.sec-h h2 { flex: 1; margin: 0; font-family: var(--display); font-size: 19px; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 16px; padding-top: 6px; }
.daychips { display: flex; flex-wrap: wrap; gap: 6px; }
.daychips button { width: 44px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.daychips button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.preview { margin: 12px 16px 0; background: var(--ink); color: #fff; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.notif { background: #fff; color: var(--ink); border-radius: 16px; padding: 12px 14px; display: flex; gap: 12px; }
.notif img { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.notif .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; line-height: 1.45; }

/* add place */
.mini-map { position: relative; height: 220px; margin: 0 16px; border-radius: 20px; overflow: hidden; background: #E2E8E4; }
.mini-map .map { position: absolute; inset: 0; }
.center-pin { position: absolute; left: 50%; top: 50%; width: 28px; height: 38px; margin: -38px 0 0 -14px; z-index: 500; pointer-events: none; }
.map-hint { position: absolute; left: 10px; bottom: 10px; z-index: 500; font-size: 12px; background: #fff; border-radius: 999px; padding: 4px 10px; }
.result { display: flex; gap: 10px; align-items: flex-start; background: var(--primary-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.result.warn { background: var(--warn-soft); }
.result.err { background: #FDECEA; }
.search-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.search-list button { text-align: left; border: 0; border-top: 1px solid var(--line2); background: #fff; padding: 10px 12px; min-height: 44px; font-size: 14px; line-height: 1.4; }
.search-list button:first-child { border-top: 0; }
.pad { padding: 0 16px; }
.gap12 { display: flex; flex-direction: column; gap: 14px; }

/* radar */
.radar { position: relative; height: calc(100dvh - var(--tabs-h) - var(--safe-b) - var(--safe-t)); min-height: 560px; }
.radar .map { position: absolute; left: 0; right: 0; top: 0; height: 58%; background: #E2E8E4; }
.radar .top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; z-index: 600; pointer-events: none; }
.radar .top > * { pointer-events: auto; }
.radar .title-chip { height: 44px; display: flex; align-items: center; padding: 0 16px; background: #fff; border-radius: 22px; font-family: var(--display); font-size: 18px; font-weight: 700; box-shadow: 0 1px 3px rgba(19, 32, 31, .12); }
.radar .status { background: #fff; border-radius: 14px; padding: 6px 12px; font-size: 12px; line-height: 1.4; text-align: right; box-shadow: 0 1px 3px rgba(19, 32, 31, .12); }
.radar .locate { position: absolute; right: 12px; top: 68px; z-index: 600; box-shadow: 0 1px 3px rgba(19, 32, 31, .12); }
.radar .rlegend { position: absolute; left: 12px; bottom: calc(42% + 24px); z-index: 600; display: flex; gap: 10px; background: #fff; border-radius: 12px; padding: 8px 12px; font-size: 12px; box-shadow: 0 1px 3px rgba(19, 32, 31, .12); }
.radar .rlegend span { display: inline-flex; align-items: center; gap: 4px; }
.radar .rlegend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.radar .panel { position: absolute; left: 0; right: 0; bottom: 0; top: calc(58% - 20px); background: #fff; border-radius: 24px 24px 0 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; z-index: 700; overflow-y: auto; }
.radar .tline { display: flex; align-items: center; justify-content: space-between; }
.radar .tline b { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1; }
.kind { font-size: 13px; font-weight: 600; border-radius: 999px; padding: 5px 12px; background: var(--ground); }
.kind.now { background: var(--ink); color: #fff; }
.kind.fc { background: var(--primary-soft); color: var(--primary-ink); }
.scrub { display: flex; align-items: center; gap: 12px; }
.scrub input { flex: 1; min-width: 0; height: 44px; accent-color: var(--primary); margin: 0; }
.play { flex: none; width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; }
.scrub-ticks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 12px; color: var(--ink2); margin-top: -6px; padding-left: 56px; }
.info-rows { display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; }
.info-rows div { display: flex; gap: 10px; align-items: flex-start; }
.info-rows svg { flex: none; margin-top: 1px; }

/* onboarding */
.onb { min-height: calc(100dvh - var(--safe-t)); display: flex; flex-direction: column; padding: 28px 24px calc(24px + var(--safe-b)); }
.onb .brand { display: flex; align-items: center; gap: 10px; }
.onb .brand img { width: 40px; height: 40px; border-radius: 12px; }
.onb .brand b { font-family: var(--display); font-size: 22px; }
.onb h1 { margin: 14px 0 0; font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1.2; }
.onb .tagline { margin: 8px 0 0; font-size: 16px; font-weight: 600; color: var(--primary); }
.onb .bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 20px; }
.choice3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice3 button { height: 52px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 15px; font-weight: 500; }
.choice3 button[aria-pressed="true"] { border: 2px solid var(--primary); background: var(--primary-soft); font-weight: 600; }
.steps { display: flex; flex-direction: column; gap: 14px; background: #fff; border-radius: 20px; padding: 16px; margin-top: 12px; }
.steps .st { display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 1.45; }
.steps .n { flex: none; width: 28px; height: 28px; border-radius: 14px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; font-size: 14px; }

/* tabs */
#tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(100%, 520px); height: calc(var(--tabs-h) + var(--safe-b)); padding: 6px 8px var(--safe-b); background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); z-index: 1000; }
#tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--ink2); font-size: 12px; font-weight: 500; }
#tabs a[aria-current="page"] { color: var(--primary); font-weight: 600; }
#tabs[hidden] { display: none; }

/* misc */
.skel { background: linear-gradient(90deg, #E9EEED 0%, #F4F7F6 50%, #E9EEED 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14px; z-index: 2000; max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0, 0, 0, .2); }
.banner { margin: 8px 16px 0; padding: 8px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn-ink); font-size: 13px; }
.foot { margin: 14px 20px 0; font-size: 12px; color: var(--ink2); line-height: 1.6; }
.bulletin { font-size: 14px; line-height: 1.6; color: var(--ink3); margin: 8px 0 0; }
.empty-state { margin: 24px 16px; background: #fff; border-radius: 24px; padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.empty-state h2 { margin: 0; font-family: var(--display); font-size: 22px; }
.leaflet-container { font-family: var(--font); background: #E2E8E4; }
.here-dot { width: 16px; height: 16px; border-radius: 8px; background: var(--primary); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(31, 95, 168, .18); }
.pin-mk { width: 26px; height: 34px; }
.pin-label { background: #fff; border: 0; border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.pin-label::before { display: none; }
@media (prefers-reduced-motion: reduce) { .skel, .icon-btn.spin svg { animation: none; } }

/* Softer OSM colours; stronger on the radar map so rain colours stand out */
.leaflet-tile-pane { filter: saturate(.75); }
.map-muted .leaflet-tile-pane { filter: saturate(.45) brightness(1.04) contrast(.94); }
.map-mk { position: relative; }
.map-mk .map-label { position: absolute; left: 30px; top: 4px; white-space: nowrap; background: #fff; border-radius: 8px; padding: 2px 8px; font-size: 13px; font-weight: 600; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.search-list button b { display: block; font-weight: 600; font-size: 15px; }
.search-list button span { display: block; font-size: 13px; color: var(--ink3); }
.coords { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; }
.coords span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.coords svg { width: 16px; height: 16px; color: var(--primary); }
.coords .gmaps { color: var(--primary); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }

/* Rain timeline: start → strongest → lighter → stop */
.tl { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); position: relative; }
.tl::before { content: ''; position: absolute; top: 7px; left: calc(50% / var(--n)); right: calc(50% / var(--n)); height: 2px; background: var(--line); }
.tl li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 0 2px; }
.tl i { width: 16px; height: 16px; border-radius: 8px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); margin-bottom: 4px; background: var(--line); z-index: 1; }
.tl i.stop { background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.tl i.open { background: #fff; box-shadow: 0 0 0 2px var(--line); border-style: dashed; }
.tl b { font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tl span { font-size: 12.5px; color: var(--ink3); line-height: 1.3; }
.tl li.approx b { color: var(--ink2); font-weight: 600; }
.tl-note { margin: 4px 0 0; font-size: 12px; color: var(--ink2); }

/* Road cameras near a place */
.cams { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 10px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
.cams::-webkit-scrollbar { display: none; }
.cam { flex: 0 0 68%; max-width: 250px; scroll-snap-align: start; border: 0; background: none; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.cam.skel { height: 150px; border-radius: 12px; }
.cam .shot { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #CFD8D6; }
.cam .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .shot .live { position: absolute; left: 8px; top: 8px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 11px; font-style: normal; font-weight: 600; padding: 2px 7px; border-radius: 6px; }
.cam .shot .live::first-letter { color: #FF5A4E; }
.cam .shot .na { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-style: normal; font-size: 13px; color: var(--ink2); }
.cam .shot.off img { display: none; }
.cam .shot.off .na { display: flex; }
.cam b { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam > span { display: block; font-size: 12.5px; color: var(--ink2); }
.cam .shot .still { position: absolute; left: 8px; top: 8px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 11px; font-style: normal; font-weight: 600; padding: 2px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.cam .shot.old .still { background: #8A5A00; }
.cam .shot.old img { filter: grayscale(.6); opacity: .8; }
.cam .shot.off .still { display: none; }
.cam-mk { width: 30px; height: 30px; border-radius: 15px; background: #1F5FA8; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.viewer .vmap-wrap { padding: 10px 16px 0; }
.viewer .vmap { height: 132px; border-radius: 12px; overflow: hidden; background: #2A3433; }
.viewer .vmap-cap { margin: 6px 0 0; font-size: 12.5px; color: #B7C3C2; }
.viewer .vmsg { color: #B7C3C2; font-size: 14px; padding: 24px; text-align: center; }
.cam-more { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--primary); text-decoration: none; }
.viewer { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; background: #0B1212; color: #fff; padding: var(--safe-t) 0 var(--safe-b); }
.viewer header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.viewer header .icon-btn { background: rgba(255, 255, 255, .12); color: #fff; flex: none; }
.viewer .vt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.viewer .vt b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .vt span { font-size: 13px; color: #B7C3C2; }
.viewer .media-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.viewer .media { flex: 1; display: flex; align-items: center; justify-content: center; background: #000; min-height: 0; }
.viewer .vclock { position: absolute; left: 12px; top: 12px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.viewer .vclock:empty { display: none; }
.viewer .vnote { font-size: 12px; color: #8FA09F; }
.viewer .media video, .viewer .media img { width: 100%; max-height: 100%; object-fit: contain; display: block; }
.viewer footer { padding: 12px 16px; font-size: 13px; color: #B7C3C2; }

/* Dust: 24-hour average line and hourly history bars */
.aqi24 { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink3); border-top: 1px solid var(--line2); padding-top: 10px; }
.aqi24 .swatch { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.aqi24 b { font-weight: 600; color: var(--ink); }
.hbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; align-items: end; height: 112px; margin-top: 12px; }
.hb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.hb i { display: block; width: 100%; border-radius: 3px 3px 1px 1px; opacity: .85; }
.hb.last i { opacity: 1; box-shadow: 0 0 0 2px var(--ink) inset; }
.hchart { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.hbars.active .hb i { opacity: .3; }
.hbars.active .hb.sel i { opacity: 1; }
.hbars.active .hb.last:not(.sel) i { box-shadow: none; }
.hb.sel i { box-shadow: 0 0 0 2px var(--ink) inset; }
.htip { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 1px; padding: 7px 11px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.35; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.htip::after { content: ""; position: absolute; left: calc(var(--ax, 50%) - 6px); bottom: -5px; width: 12px; height: 6px; background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.htip .t { opacity: .75; }
.htip .v { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.htip .v b { font-family: var(--display); font-size: 18px; font-weight: 700; }
.htip .swatch { width: 9px; height: 9px; border-radius: 5px; }
.hb span { font-size: 11px; color: var(--ink2); height: 14px; line-height: 14px; font-variant-numeric: tabular-nums; }

/* dust station picker */
.st-list { display: flex; flex-direction: column; }
.st-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 0; border: 0; border-top: 1px solid var(--line2); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.st-row:first-child { border-top: 0; }
.st-row .radio { flex: none; width: 20px; height: 20px; border-radius: 10px; border: 2px solid var(--line); }
.st-row.on .radio { border-color: var(--primary); box-shadow: inset 0 0 0 4px #fff; background: var(--primary); }
.st-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.st-row .txt b { font-size: 15px; font-weight: 500; }
.st-row .txt b .badge { padding: 1px 7px; margin-left: 4px; vertical-align: 1px; font-weight: 500; }
.st-row .txt > span { font-size: 12.5px; color: var(--ink2); }
.st-row .val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; flex: none; }
.st-row .val b { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 20px; font-weight: 600; }
.st-row .val b .swatch { width: 10px; height: 10px; border-radius: 5px; }
.st-row .val > span { font-size: 12.5px; color: var(--ink2); }
.st-row.stale .val b { color: #98A6A5; }
.st-row.stale .txt > span { color: #8A5A00; }
.warn-line { margin: 0; font-size: 13px; color: #8A5A00; background: var(--warn-soft, #FFF3D6); border-radius: 8px; padding: 6px 10px; }

/* note shown on the old workers.dev address */
.move-note { display: flex; align-items: flex-start; gap: 10px; margin: 12px 16px 0; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--primary-soft, #E3EEF9); color: var(--ink); }
.move-note .txt { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 13px; line-height: 1.45; }
.move-note .txt b { font-size: 15px; }
.move-note .txt .links { display: flex; gap: 16px; margin-top: 2px; }
.move-note .txt a { font-weight: 600; color: var(--primary); text-decoration: none; }
.move-note .icon-btn { flex: none; width: 32px; height: 32px; background: transparent; }

/* moving pins between installs */
.mv-steps { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 10px; }
.mv-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.5; }
.mv-steps .n { flex: none; width: 24px; height: 24px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.mv-code { margin-top: 18px; padding: 16px; border-radius: 16px; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mv-code b { font-family: var(--display); font-size: 40px; font-weight: 700; letter-spacing: 4px; font-variant-numeric: tabular-nums; }
.mv-form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.mv-input { height: 60px; text-align: center; font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: 6px; font-variant-numeric: tabular-nums; }
.foot a { color: var(--primary); }

.move-note .links { align-items: center; }
.move-note .btn.small { height: 36px; padding: 0 16px; border-radius: 18px; font-size: 14px; color: #fff; }
.move-note.done { background: #E6F4EA; }
.btn.disabled { opacity: .55; pointer-events: none; }
.mv-alt { margin-top: 18px; border-top: 1px solid var(--line2); padding-top: 12px; }
.mv-alt summary { font-size: 14px; font-weight: 600; color: var(--primary); cursor: pointer; }
.mv-steps svg { vertical-align: -5px; color: var(--primary); }
