:root {
  --bg: #0B1620;
  --card: #13222E;
  --card2: #192C3B;
  --line: #1F3342;
  --text: #EAF2F7;
  --muted: #8FA6B5;
  --accent: #5CC8E0;
  --yellow: #F5C84C;
  --orange: #F08A3C;
  --red: #E5484D;
  --go: #5FD39B;
  --sheet-h: 96px;
  --side: 440px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; font-size: 15px; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h2 { font: 700 20px 'Space Grotesk', sans-serif; margin: 4px 0 8px; }
h3 { font: 600 13px Inter, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
h4 { margin: 10px 0 4px; font-size: 15px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.warn { color: var(--yellow); font-weight: 600; }
.nowrap { white-space: nowrap; }
#map { position: fixed; inset: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* animation canvases sit inside the map canvas container */
.wx-field, .wx-trails { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wx-trails { opacity: .17; }
.wx-field { opacity: .5; mix-blend-mode: screen; }

/* top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 56px 8px 12px;
  background: linear-gradient(var(--bg) 55%, transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.logo { font: 700 22px 'Space Grotesk', sans-serif; letter-spacing: -.5px; }
.search { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 0 12px; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; padding: 0 8px; outline: none; color: var(--text); }
.langs { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 2px; }
.langs button { min-width: 38px; height: 36px; border: 0; border-radius: 18px; background: transparent; font-weight: 600; font-size: 12px; color: var(--muted); }
.langs button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; margin: 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px #0008; max-height: 260px; overflow: auto; }
.suggest[hidden] { display: none; }
.suggest li { padding: 0; }
.suggest li.muted { padding: 8px 10px; }
.suggest button { width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; display: flex; flex-direction: column; }
.suggest button:hover, .suggest button:focus-visible { background: var(--card2); }
.suggest span { color: var(--muted); font-size: 12px; }

/* layer controls */
.layers { position: fixed; z-index: 5; top: calc(58px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.layers > * { pointer-events: auto; }
.seg { display: inline-flex; align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 2px; }
.seg button { height: 34px; padding: 0 12px; border: 0; background: transparent; border-radius: 17px; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--bg); }
.toggles { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.toggles::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.chip-btn[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: #12303b; }

/* legends */
.ov-legend, .legend { position: fixed; z-index: 4; top: calc(142px + env(safe-area-inset-top)); background: #0B1620E6; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 11px; color: var(--muted); }
.ov-legend { right: 12px; width: 190px; }
.ov-legend[hidden], .legend[hidden] { display: none; }
.lg-title { display: block; margin-bottom: 4px; }
.lg-bar { display: block; height: 8px; border-radius: 4px; }
.lg-scale { display: flex; justify-content: space-between; margin-top: 3px; }
.legend { left: 12px; display: flex; flex-direction: column; gap: 3px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.legend i.dash { background-image: repeating-linear-gradient(90deg, var(--red) 0 5px, transparent 5px 8px) !important; }
.notice { position: fixed; z-index: 7; top: calc(60px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: #3A2E0C; border: 1px solid #6B5414; color: #F8DA85; padding: 8px 14px; border-radius: 12px; font-size: 13px; }
.notice[hidden] { display: none; }

/* town markers */
.town { display: flex; flex-direction: column; align-items: center; background: transparent; border: 0; padding: 2px 4px; min-width: 48px; line-height: 1.1; color: var(--text); text-shadow: 0 0 3px #0B1620, 0 0 6px #0B1620, 0 1px 2px #0B1620; }
.town svg { filter: drop-shadow(0 1px 2px #0B1620cc); }
.town[hidden] { display: none; }
.town-t { font: 700 15px 'Space Grotesk', sans-serif; }
.town-w { font-size: 11px; color: var(--text); display: flex; align-items: center; gap: 2px; }
.town-name { font-size: 10px; color: var(--text); opacity: .85; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 759px) { .town-name, .town-w { display: none; } .town { padding: 2px 4px; min-width: 36px; } }

/* time bar */
/* time slider with bubble and day ticks */
.timebar { position: fixed; z-index: 5; left: 12px; right: 12px; bottom: calc(var(--sheet-h) + 10px); display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 10px 18px 22px 10px; }
.tb-main { display: flex; align-items: center; gap: 12px; padding-top: 28px; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); display: grid; place-items: center; }
.timebar .icon-btn { border: 0; background: var(--accent); color: var(--bg); width: 40px; height: 40px; }
.i-pause { display: none; }
.playing .i-play { display: none; }
.playing .i-pause { display: block; }

/* sheet: bottom on phones, side panel on desktop */
.sheet { position: fixed; z-index: 8; left: 0; right: 0; bottom: 0; height: 96px; background: var(--bg); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; transition: height .25s; padding-bottom: env(safe-area-inset-bottom); }
.sheet.open { height: 62vh; }
.grip { flex: none; height: 22px; background: none; border: 0; display: grid; place-items: center; }
.grip span { width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
.tabs { flex: none; display: flex; gap: 4px; overflow-x: auto; padding: 0 10px 8px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.badge { min-width: 18px; height: 18px; border-radius: 9px; font-size: 11px; display: inline-grid; place-items: center; color: #0B1620; background: var(--yellow); padding: 0 5px; }
.badge.orange { background: var(--orange); }
.badge.red { background: var(--red); color: #fff; }
.badge[hidden] { display: none; }
.panel { flex: 1; overflow-y: auto; padding: 0 14px 14px; overscroll-behavior: contain; }
.panel[hidden] { display: none; }
.sheet:not(.open) .panel, .sheet:not(.open) .disclaimer { display: none; }
.disclaimer { flex: none; margin: 0; padding: 8px 14px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }

@media (min-width: 760px) {
  .sheet, .sheet.open { top: 0; bottom: 0; right: auto; width: var(--side); height: auto; border-radius: 0; border-top: 0; border-right: 1px solid var(--line); padding-top: calc(60px + env(safe-area-inset-top)); }
  .sheet:not(.open) .panel { display: block; }
  .sheet:not(.open) .panel[hidden] { display: none; }
  .sheet:not(.open) .disclaimer { display: block; }
  .grip { display: none; }
  .topbar { left: var(--side); max-width: 700px; }
  .topbar .logo { position: fixed; left: 16px; top: calc(14px + env(safe-area-inset-top)); }
  .layers { left: calc(var(--side) + 12px); }
  .legend { left: calc(var(--side) + 12px); }
  .timebar { left: calc(var(--side) + 12px); right: 70px; bottom: 24px; max-width: 640px; }
}

/* lists & cards */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list > li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-btn { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left; min-height: 36px; }
.row-btn strong { flex: 1; min-width: 0; }
.row-btn .t { font: 700 17px 'Space Grotesk', sans-serif; min-width: 40px; text-align: right; }
.row-btn .w { min-width: 74px; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.icon-missing { width: 24px; }
.warn-strip { width: 100%; border: 0; text-align: left; padding: 10px 12px; border-radius: 12px; font-weight: 600; margin-bottom: 8px; color: #0B1620; background: var(--yellow); }
.warn-strip.orange { background: var(--orange); }
.warn-strip.red { background: var(--red); color: #fff; }
.text-fc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.text-fc h4 { margin: 0 0 6px; }
.text-fc p { margin: 0 0 6px; line-height: 1.45; }
.regions summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.warning { background: var(--card); border-left: 4px solid var(--yellow); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.warning.orange { border-color: var(--orange); }
.warning.red { border-color: var(--red); }
.warning h4 { margin: 2px 0 4px; }
.warning p { margin: 4px 0; line-height: 1.4; }
.w-color { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.obs-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.obs-card > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.big { font: 700 34px 'Space Grotesk', sans-serif; }
.table-wrap { overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.cmp th { font-weight: 600; color: var(--muted); text-align: center; padding: 4px; }
.cmp thead tr:first-child th { border-bottom: 1px solid var(--line); color: var(--text); }
.cmp td { padding: 4px; text-align: center; border-bottom: 1px solid #1F334266; }
.cmp td svg { vertical-align: middle; }
.cmp .when { text-align: left; color: var(--muted); white-space: nowrap; }
.mag { font: 700 16px 'Space Grotesk', sans-serif; width: 36px; height: 36px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; flex: none; }
.quake-list .row-btn { gap: 12px; }
.aurora .act { flex: none; width: 90px; height: 22px; background: var(--card2); border-radius: 11px; position: relative; overflow: hidden; }
.aurora .act i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #2c8f6b, #5FD39B); }
.aurora .act b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; }
.chip { --c: var(--muted); display: inline-block; border: 1px solid var(--c); color: var(--text); border-radius: 12px; padding: 2px 8px; font-size: 12px; background: color-mix(in srgb, var(--c) 18%, transparent); }
.warn-chip { --c: var(--yellow); display: inline-block; border: 1px solid var(--c); border-radius: 12px; padding: 2px 8px; font-size: 12px; }
.temp { font: 700 17px 'Space Grotesk', sans-serif; min-width: 40px; }
.bar { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }

/* route planner (bonus) */
.field { position: relative; margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select { width: 100%; height: 44px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.row { display: flex; gap: 8px; }
.msg { min-height: 20px; color: var(--yellow); font-size: 13px; margin: 0 0 8px; }
.primary { width: 100%; height: 48px; border: 0; border-radius: 24px; background: var(--accent); color: var(--bg); font-weight: 700; }
.primary:disabled { opacity: .6; }
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--accent); padding: 8px 0; font-weight: 600; }
.verdict { border-radius: 14px; padding: 12px; margin: 10px 0; border: 1px solid; }
.verdict ul { margin: 6px 0 0; padding-left: 18px; }
.verdict-title { font: 700 17px 'Space Grotesk', sans-serif; }
.verdict.go { background: #0F2E22; border-color: #1F5A41; }
.verdict.care { background: #3A2E0C; border-color: #6B5414; }
.verdict.nogo { background: #3B1416; border-color: #7A2A2E; }

/* map popups & controls */
.maplibregl-popup-content { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.maplibregl-popup-tip { display: none; }
.maplibregl-popup-close-button { color: var(--muted); }
.station-now { display: flex; gap: 10px; align-items: center; margin: 6px 0 2px; }
.station-now .big { font-size: 28px; }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--sheet-h) + 70px); }
@media (min-width: 760px) { .maplibregl-ctrl-bottom-right { bottom: 80px; } }
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }

.slider { --thumb: 22px; position: relative; flex: 1; min-width: 0; height: 22px; }
.slider input[type=range] { -webkit-appearance: none; appearance: none; position: absolute; inset: 0; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; touch-action: none; }
.slider input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--pct, 0%), #2a4152 var(--pct, 0%)); }
.slider input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: #2a4152; }
.slider input[type=range]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: var(--thumb); height: var(--thumb); margin-top: -8px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px #0008; }
.slider input[type=range]::-moz-range-thumb { width: calc(var(--thumb) - 6px); height: calc(var(--thumb) - 6px); border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px #0008; }
.slider input[type=range]:focus-visible { outline: none; }
.slider input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--text); outline-offset: 2px; }
#time-bubble { position: absolute; bottom: 30px; left: calc(var(--thumb) / 2 + var(--frac, 0) * (100% - var(--thumb))); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; min-width: 74px; padding: 4px 10px 5px; border-radius: 10px; background: var(--accent); color: var(--bg); line-height: 1.15; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 8px #0006; }
#time-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--accent); }
#time-bubble b { font: 700 16px 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }
#time-bubble span { font-size: 11px; font-weight: 600; }
.ticks { position: absolute; left: 0; right: 0; top: 24px; height: 18px; pointer-events: none; }
.ticks i { position: absolute; top: 0; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1px; white-space: nowrap; }
.ticks i::before { content: ''; width: 1px; height: 5px; background: var(--muted); }

/* animation choice lives in the time bar */
.timebar .seg { align-self: stretch; display: flex; }
.timebar .seg button { flex: 1; padding: 0 6px; }

/* right-hand icon rail */
.rail { position: fixed; z-index: 5; right: 12px; top: calc(64px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px; width: 66px; }
.rail button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 5px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 10px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.rail svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail button[aria-pressed="true"] { background: #12303b; color: var(--accent); }
.rail button:hover { color: var(--text); }
.ov-legend { right: 90px !important; top: calc(64px + env(safe-area-inset-top)) !important; }
.layers { display: none; }
@media (max-width: 759px) { .ov-legend { width: 160px; } .roads-on .ov-legend { top: calc(190px + env(safe-area-inset-top)) !important; } }

/* destination window on the roads layer */
.dest-card { position: fixed; z-index: 5; left: 12px; right: 90px; top: calc(64px + env(safe-area-inset-top)); max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px 10px; }
.dest-card[hidden] { display: none; }
.dest-card label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.dest-row { display: flex; gap: 6px; flex-wrap: wrap; }
.dest-field { position: relative; flex: 1 1 160px; min-width: 0; }
.dest-field input, .dest-card select { height: 40px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; width: 100%; }
.dest-card select { width: auto; }
.dest-card .primary { width: auto; height: 40px; padding: 0 16px; }
.dest-card .msg { min-height: 0; margin: 4px 0 0; }
.dest-card .msg:empty { display: none; }
.dest-card .legend { position: static; background: none; border: 0; padding: 0; margin-top: 8px; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
@media (min-width: 760px) { .dest-card { left: calc(var(--side) + 12px); right: auto; width: 420px; } }

/* ---- readability with many layers ---- */
.far .town-name, .far .town-w { display: none; }
.far .town svg { width: 20px; height: 20px; }
.busy .wx-trails { opacity: .08; }
.busy .wx-field { opacity: .25; }

/* ---- compact time bar: one row on desktop ---- */
.timebar { flex-direction: row; align-items: center; gap: 12px; padding: 8px 12px 18px 8px; border-radius: 18px; }
.timebar .icon-btn { width: 34px; height: 34px; }
.tb-main { order: 1; flex: 1; min-width: 0; padding-top: 0; gap: 10px; }
.timebar .seg { order: 2; flex: none; align-self: center; }
.timebar .seg button { flex: none; height: 30px; padding: 0 10px; font-size: 12px; }
.ticks { top: 20px; }
.ticks i { font-size: 10px; }
#time-bubble { bottom: 26px; min-width: 0; padding: 3px 8px 4px; }
#time-bubble b { font-size: 14px; }
#time-bubble span { font-size: 10px; }
@media (min-width: 760px) {
  .timebar { left: calc(var(--side) + 12px); right: 70px; bottom: 16px; max-width: 760px; margin: 0 auto; }
}
@media (max-width: 759px) {
  .timebar { flex-direction: column; align-items: stretch; gap: 0; padding: 6px 12px 16px 6px; }
  .timebar .seg { order: 0; align-self: stretch; }
  .timebar .seg button { flex: 1; }
  .tb-main { padding-top: 34px; }
}

/* ---- tidier panel tabs and destination card ---- */
.tabs { gap: 3px; }
.tabs button { padding: 0 10px; height: 34px; font-size: 12.5px; }
.dest-card { padding: 8px 10px; }
.dest-card label { font-size: 11px; margin-bottom: 4px; }
.dest-field input, .dest-card select, .dest-card .primary { height: 36px; }
.dest-card .legend { font-size: 10px; margin-top: 6px; }

/* ---- your weather card (right side) ---- */
.mywx { position: fixed; z-index: 5; right: 90px; top: calc(136px + env(safe-area-inset-top)); width: 300px; max-height: calc(100vh - 260px); overflow: auto; background: #0F1D28F2; border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(6px); }
.mywx[hidden] { display: none; }
.mywx-head { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 10px 12px; color: var(--muted); font-size: 12px; text-align: left; }
.mywx-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mywx-title span:first-child { color: var(--text); font-weight: 600; }
.mywx-pill { display: none; align-items: center; gap: 4px; color: var(--text); }
.mywx-pill b { font: 700 15px 'Space Grotesk', sans-serif; }
.chev { transition: transform .2s; }
.mywx.collapsed .chev { transform: rotate(-90deg); }
.mywx.collapsed .mywx-body { display: none; }
.mywx.collapsed .mywx-pill { display: flex; }
.mywx.collapsed { width: auto; }
.mywx.collapsed .mywx-title { display: none; }
.mywx-body { padding: 0 12px 10px; }
.mywx-hero { display: flex; align-items: center; gap: 12px; padding: 4px 0 10px; border-bottom: 1px solid var(--line); }
.mywx-hero > div { display: flex; flex-direction: column; min-width: 0; }
.mywx-now { font: 700 44px/1 'Space Grotesk', sans-serif; color: var(--tc); }
.mywx-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.mywx-quip { font-size: 13px; font-weight: 600; margin-top: 4px; }
.mywx-days { list-style: none; margin: 0; padding: 0; }
.mywx-days button { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name icon" "temps temps" "extra extra" "quip quip"; gap: 2px 8px; align-items: center; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 2px; text-align: left; border-radius: 0; }
.mywx-days li:last-child button { border-bottom: 0; }
.mywx-days button:hover { background: #ffffff08; }
.d-name { grid-area: name; font-weight: 600; }
.d-name::first-letter { text-transform: uppercase; }
.mywx-days .wxi { grid-area: icon; }
.d-temps { grid-area: temps; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.d-min { color: var(--muted); min-width: 30px; }
.d-max { font-weight: 700; min-width: 30px; text-align: right; }
.d-bar { flex: 1; height: 6px; border-radius: 3px; background: #ffffff12; position: relative; }
.d-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; min-width: 6px; }
.d-extra { grid-area: extra; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.d-extra span { display: inline-flex; align-items: center; gap: 3px; }
.d-extra small { font-size: 11px; opacity: .8; }
.d-rain { color: #5CB2F0; }
.d-quip { grid-area: quip; font-size: 12px; color: var(--text); opacity: .85; font-style: italic; }
.mywx-foot { margin: 6px 0 0; font-size: 10.5px; color: var(--muted); }

/* gently animated weather icons */
.wxi { display: inline-flex; }
.wxi svg { overflow: visible; }
.wxi-clear svg { animation: wx-spin 24s linear infinite; }
.wxi-partly svg, .wxi-showers svg, .wxi-snowshowers svg { animation: wx-bob 4s ease-in-out infinite; }
.wxi-cloudy svg, .wxi-overcast svg, .wxi-fog svg, .wxi-drift svg { animation: wx-drift 6s ease-in-out infinite; }
.wxi-rain svg, .wxi-sleet svg, .wxi-snow svg { animation: wx-bob 2.6s ease-in-out infinite; }
.wxi-thunder svg { animation: wx-flash 5s steps(1) infinite; }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-bob { 50% { transform: translateY(-2px); } }
@keyframes wx-drift { 50% { transform: translateX(2.5px); } }
@keyframes wx-flash { 0%, 88%, 94%, 100% { filter: none; } 90%, 96% { filter: brightness(1.8); } }
@media (prefers-reduced-motion: reduce) { .wxi svg { animation: none !important; } }

@media (max-width: 759px) {
  .mywx { left: 12px; right: auto; top: calc(64px + env(safe-area-inset-top)); width: calc(100% - 102px); max-height: calc(100vh - 300px); }
  .roads-on .mywx { top: calc(200px + env(safe-area-inset-top)); }
}

/* ---- left panel tidy-up ---- */
.sheet-head { display: none; }
.tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 0 8px 6px; overflow: visible; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; flex-direction: column; justify-content: center; gap: 3px; height: 54px; padding: 4px 2px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.1; text-align: center; }
.tabs button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button:hover { color: var(--text); background: #ffffff08; }
.tabs button[aria-selected="true"] { background: #12303b; color: var(--accent); border: 0; }
.tabs .badge { position: absolute; top: 3px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; }
.panel { padding: 12px 14px 14px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.panel h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 8px; }
.panel h3 .when { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); }
.block { margin-bottom: 18px; }
.warn-row { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; text-align: left; font-weight: 600; }
.warn-row span { margin-left: auto; color: var(--muted); font-size: 18px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); flex: none; }
.dot.orange { background: var(--orange); } .dot.red { background: var(--red); }
table.towns { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.towns th { font-size: 11px; font-weight: 600; color: var(--muted); text-align: left; padding: 0 6px 6px; }
.towns th:nth-child(3), .towns th:nth-child(4) { text-align: right; }
.towns td { padding: 6px; border-top: 1px solid var(--line); }
.towns tbody tr { cursor: pointer; }
.towns tbody tr:hover, .towns tbody tr:focus-visible { background: #ffffff08; outline: none; }
.towns .tn { font-weight: 500; }
.towns .ti { width: 30px; } .towns .ti svg { display: block; }
.towns .tt { text-align: right; font: 700 16px 'Space Grotesk', sans-serif; width: 46px; }
.towns .tw { text-align: right; color: var(--muted); font-size: 13px; white-space: nowrap; width: 82px; }
.towns .tw svg { vertical-align: -1px; }
.towns small { font-size: 10px; }
details.text-fc { padding: 0; }
.text-fc summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; font-weight: 600; }
.text-fc summary::-webkit-details-marker { display: none; }
.text-fc summary small { color: var(--muted); font-weight: 400; font-size: 11px; white-space: nowrap; }
.text-fc[open] summary { border-bottom: 1px solid var(--line); }
.text-fc p { padding: 10px 12px 2px; }
.src { margin-top: 4px; }
@media (min-width: 760px) {
  .sheet, .sheet.open { padding-top: env(safe-area-inset-top); }
  .sheet-head { display: flex; align-items: baseline; gap: 10px; padding: 16px 16px 12px; }
  .sheet-head .logo { font-size: 24px; }
  .sheet-head .tagline { font-size: 12px; color: var(--muted); }
  .topbar .logo { display: none; }
}

/* ================= panel v3: overview, my places, meteogram, slide-in detail ================= */
.tabs { grid-template-columns: repeat(4, 1fr); }
.sheet { overflow: hidden; }
.sub-seg { display: flex; margin-bottom: 12px; }
.sub-seg button { flex: 1; }
.sub-seg button[aria-selected="true"] { background: var(--accent); color: var(--bg); }
.panel h3 > span:first-child { color: var(--muted); }
.mywx-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 8px; }
.mywx-card .mywx-hero { border-bottom: 0; padding-top: 0; }
.mywx-card .mywx-days { border-top: 1px solid var(--line); margin-top: 6px; }
.hint { margin: 0; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; }
.places { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.places li + li { border-top: 1px solid var(--line); }
.places button { width: 100%; display: grid; grid-template-columns: 1fr auto 44px; grid-template-areas: "name icon t" "w w x"; gap: 0 8px; align-items: center; padding: 8px 12px; background: none; border: 0; text-align: left; }
.places button:hover { background: #ffffff08; }
.pl-name { grid-area: name; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.places .wxi { grid-area: icon; }
.pl-t { grid-area: t; font: 700 18px 'Space Grotesk', sans-serif; text-align: right; }
.pl-w { grid-area: w; font-size: 12px; display: flex; align-items: center; gap: 3px; }
.pl-x { grid-area: x; font-size: 12px; text-align: right; white-space: nowrap; }

/* meteogram */
.mg { position: relative; margin: 4px 0 6px; cursor: crosshair; }
.mg svg { display: block; width: 100%; height: auto; overflow: visible; }
.mg-lbl { font-size: 9px; fill: var(--muted); }
.mg-axis { font-size: 8.5px; fill: var(--muted); opacity: .8; }
.mg-tv { font-size: 9.5px; font-weight: 700; fill: var(--text); }
.mg-day { stroke: var(--line); stroke-width: 1; }
.mg-zero { stroke: #7FE0E8; stroke-width: .8; stroke-dasharray: 3 3; opacity: .5; }
.mg-rain { fill: #5CB2F0; opacity: .85; }
.mg-wind { fill: #8FA6B5; opacity: .35; }
.mg-gust { stroke: #EAF2F7; stroke-width: 1.4; opacity: .55; }
.mg-gust.hi { stroke: var(--yellow); opacity: .95; }
.mg-cursor { stroke: var(--accent); stroke-width: 1.5; }
.mg-legend { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); margin-top: 2px; flex-wrap: wrap; }
.mg-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-left: 4px; }
.mg-legend i.r { background: #5CB2F0; } .mg-legend i.w { background: #8FA6B566; } .mg-legend i.gst { height: 2px; background: #EAF2F7; }

/* slide-in place detail */
.detail { position: absolute; inset: 0; z-index: 3; background: var(--bg); display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .22s ease; }
.detail.in { transform: none; }
.detail[hidden] { display: none; }
.detail-head { flex: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.detail-head h2 { margin: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-head .back { padding: 6px 4px; }
.star { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--muted); }
.star svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.star[aria-pressed="true"] { color: var(--yellow); border-color: var(--yellow); }
.star[aria-pressed="true"] svg { fill: var(--yellow); }
.detail-body { flex: 1; overflow-y: auto; padding: 12px 14px 16px; }
.detail-body .obs-card { margin: 10px 0; }
.cmp-wrap summary { cursor: pointer; padding: 8px 0; font-weight: 600; font-size: 13px; }
@media (max-width: 759px) { .detail { top: 22px; } }
@media (prefers-reduced-motion: reduce) { .detail { transition: none; } }

/* desktop: search inside the panel header, and a hide/show button */
.panel-hide, .panel-show { display: none; }
@media (min-width: 760px) {
  .sheet, .sheet.open { width: 440px; transition: transform .25s ease; }
  .sheet-head { position: relative; padding: 16px 16px 62px; }
  .panel-hide { display: grid; place-items: center; position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); }
  .panel-hide:hover { background: #ffffff10; color: var(--text); }
  .topbar { left: 0 !important; right: auto; top: calc(58px + env(safe-area-inset-top)); width: 440px; max-width: none; z-index: 9; padding: 0 14px; background: none; gap: 8px; }
  .topbar .search { background: var(--card); }
  .panel-hidden { --side: 0px; }
  .panel-hidden .sheet { transform: translateX(-100%); }
  .panel-hidden .panel-show { display: grid; place-items: center; position: fixed; z-index: 9; left: 12px; top: calc(10px + env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
  .panel-hidden .topbar { left: 64px !important; top: calc(10px + env(safe-area-inset-top)); width: min(620px, calc(100% - 180px)); }
}
