:root {
  --bg: #0b0d10;
  --panel: rgba(15, 18, 22, 0.86);
  --panel-solid: #12161b;
  --panel-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.10);
  --text: #eef1f4;
  --muted: #a3acb6;
  --faint: #8b95a1;
  --accent: #22d3ee;
  --accent-ink: #062a33;
  --grad: linear-gradient(120deg, #2563eb 0%, #06b6d4 60%, #2dd4bf 100%);
  --warn: #fbbf24;
  --danger: #f87171;
  --ground: #929292;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.3);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] { /* the map page is dark-first; chrome stays dark on purpose */ }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { position: fixed; inset: 0; }
.map { position: absolute; inset: 0; background: var(--ground); }
.map > .engine-host { position: absolute; inset: 0; width: 100%; height: 100%; }
.engine-stub { background: radial-gradient(ellipse at 50% 40%, #2a2f36, #15181c 70%); }

/* ---------- top bar ---------- */
.topbar { position: absolute; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; z-index: 5; pointer-events: none; max-width: calc(100% - 260px); }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.brand__logo { font-weight: 600; letter-spacing: -0.01em; }
.brand__logo b { font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand__sep { width: 1px; height: 16px; background: var(--line); }
.brand__place { color: var(--muted); font-size: 13px; }
.engines { display: flex; padding: 3px; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.engines button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.engines button:hover { color: var(--text); background: var(--panel-2); }
.engines button[aria-checked="true"] { background: var(--text); color: #0b0d10; }
.engines button .soon { font-size: 10px; opacity: .65; margin-left: 4px; }
.sources__label { align-self: center; padding: 0 4px 0 10px; font-size: 11px; color: var(--faint); white-space: nowrap; }

/* ---------- layer panel ---------- */
.layers { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 236px; max-height: calc(100% - 150px); z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(12px); box-shadow: var(--shadow); overflow: hidden auto; }   /* the rows scroll when the panel is shorter than its list */
.layers__head { display: flex; width: 100%; align-items: center; justify-content: space-between; border: 0; background: transparent; padding: 10px 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.layers__head:focus-visible { outline-offset: -2px; }   /* inside the panel, which clips what is outside it */
.layers__head svg { width: 16px; height: 16px; transition: transform .2s; }
.layers__head[aria-expanded="false"] svg { transform: rotate(-90deg); }
.layers__body { padding: 0 6px 6px; }
.layers__body[hidden] { display: none; }
.layer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.layer:hover { background: var(--panel-2); }
.layer__name { font-size: 13px; font-weight: 500; }
.layer__note { grid-column: 1 / -1; font-size: 11px; color: var(--faint); line-height: 1.35; min-height: 0; white-space: pre-line; }
.layer__note:empty { display: none; }
.layer input { position: absolute; opacity: 0; pointer-events: none; }
.toggle { width: 30px; height: 18px; border-radius: 999px; background: rgba(255,255,255,.16); position: relative; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.layer input:checked + .toggle { background: #0891b2; }
.layer input:checked + .toggle::after { transform: translateX(12px); }
.layer input:focus-visible + .toggle { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- status ---------- */
.status { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: min(560px, calc(100% - 32px)); padding: 8px 14px; border-radius: 10px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; color: var(--text); }
.status--warn { border-color: rgba(251, 191, 36, .45); }
.status--error { border-color: rgba(248, 113, 113, .5); }

/* ---------- in-map cards (engines) ---------- */
.map-card { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%); width: min(420px, calc(100% - 32px)); max-height: calc(100% - 150px); overflow-y: auto; padding: 18px 20px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 2; }
.map-card__title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.map-card__body { font-size: 13px; color: var(--muted); line-height: 1.5; }
.map-card__body code { font-size: 12px; color: var(--text); background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
.map-card--soon .map-card__title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 4px rgba(34, 211, 238, .18); }
.map-card--warn { border-color: rgba(251, 191, 36, .4); }
/* a notice that must not cover the radar: a compact banner under the top bar */
.map-card--banner { top: 60px; transform: translateX(-50%); width: min(560px, calc(100% - 290px)); max-height: calc(100% - 220px); padding: 10px 14px; border-radius: 12px; }
.map-card--banner .map-card__title { font-size: 13px; font-weight: 500; margin: 0; }
.map-card--banner .map-card__body { margin-top: 8px; }
.map-card__actions { display: flex; gap: 8px; margin-top: 8px; }
.map-card__actions button { padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.map-card__actions button:hover { background: rgba(255,255,255,.12); }
.map-card__actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) { .map-card--banner { top: 100px; width: calc(100% - 24px); } }

/* ---------- timeline ---------- */
.timeline { position: absolute; bottom: 0; left: max(12px, calc(42% - 340px)); width: min(680px, calc(100% - 24px)); display: flex; align-items: flex-end; gap: 12px; z-index: 5; pointer-events: none; }
.timeline > * { pointer-events: auto; }
.play { flex: none; width: 40px; height: 40px; margin-bottom: calc(30px + env(safe-area-inset-bottom)); border-radius: 50%; border: 0; background: #f1f5f9; color: #0b1220; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.45); transition: transform .12s; }
.play:hover { transform: scale(1.06); }
.play svg { width: 22px; height: 22px; grid-area: 1 / 1; }
.play .pause__icon, .play .wait__icon { display: none; }
.play[data-state="playing"] .play__icon { display: none; }
.play[data-state="playing"] .pause__icon { display: block; }
.play[data-state="waiting"] .play__icon { display: none; }
.play[data-state="waiting"] .wait__icon { display: block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tl { position: relative; flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; backdrop-filter: blur(12px); box-shadow: var(--shadow); padding: 0 12px calc(8px + env(safe-area-inset-bottom)); --nowf: .6; --hrf: .2; }
/* no model route (the public site today): four stretches share the track, the fifth is not drawn */
.tl[data-model="absent"] { --nowf: .75; --hrf: .25; }
.tl__track { position: relative; height: 22px; margin: 0 -12px; padding: 0 12px; cursor: pointer; touch-action: none; }
.tl__track::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 6px; background: rgba(255,255,255,.08); }
.tl__past, .tl__future, .tl__loaded { position: absolute; top: 0; height: 6px; }
/* five equal stretches: 24h-6h, 6h-1h, the past hour, the next hour, +1h to +6h (model) */
.tl__past { left: 12px; width: calc((100% - 24px) * var(--nowf)); background: linear-gradient(90deg, #99a3af 0 33.33%, #c2cad3 33.33% 66.66%, #e7ecf1 66.66%); }
.tl__future { left: calc(12px + (100% - 24px) * var(--nowf)); width: calc((100% - 24px) * var(--hrf)); background-color: rgba(34, 211, 238, .28); background-image: radial-gradient(circle, #67e8f9 1.1px, transparent 1.4px); background-size: 6px 6px; background-position: 0 0; }
/* +60 to +360: radar (cyan, as the hour before) to +90 = 10%, blending to the model's purple by +180 = 40%; hatching from +90 where the model comes in */
.tl__model { position: absolute; top: 0; height: 6px; left: calc(12px + (100% - 24px) * .8); width: calc((100% - 24px) * .2); background: repeating-linear-gradient(135deg, rgba(196, 181, 253, .55) 0 1.2px, transparent 1.2px 5px) 100% 0 / 90% 100% no-repeat, linear-gradient(90deg, rgba(34, 211, 238, .28) 10%, rgba(139, 92, 246, .26) 40%); }
.tl[data-model="error"] .tl__model { opacity: .3; }
.tl[data-model="absent"] .tl__model, .tl[data-model="absent"] .tl__labels > :nth-child(5) { display: none; }
.tl[data-model="absent"] .tl__labels { grid-template-columns: repeat(4, 1fr); }
.tl__loaded { left: 12px; width: 0; background: var(--accent); opacity: .9; transition: width .2s; }
.tl__loaded[data-done="true"] { opacity: 0; transition: opacity .6s .3s; }
.tl__ticks { position: absolute; left: 12px; right: 12px; top: 6px; height: 6px; }
.tl__ticks i { position: absolute; top: 0; width: 1px; height: 5px; background: rgba(255,255,255,.28); }
.tl__ticks i.major { height: 8px; background: rgba(255,255,255,.5); }
.tl__now { position: absolute; top: -3px; left: calc(12px + (100% - 24px) * var(--nowf) - 1.5px); width: 3px; height: 14px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.tl__head { position: absolute; top: -5px; left: 12px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; border: 3px solid #0891b2; box-shadow: 0 1px 4px rgba(0,0,0,.5); will-change: transform; }
.tl__bubble { position: absolute; top: -40px; left: 12px; transform: translateX(-50%); white-space: nowrap; padding: 0 11px; height: 26px; line-height: 26px; border-radius: 8px; background: var(--grad); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .005em; box-shadow: 0 2px 10px rgba(0,0,0,.45); pointer-events: none; will-change: transform; font-variant-numeric: tabular-nums; }
.tl__bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: #0aa6c4; }
.tl__bubble[data-future="true"] { background: linear-gradient(120deg, #0e7490, #6d28d9); }
.tl__bubble[data-future="true"]::after { border-top-color: #4c3fb8; }
.tl__bubble[data-model="true"] { background: linear-gradient(120deg, #5b21b6, #7c3aed); }
.tl__bubble[data-model="true"]::after { border-top-color: #6d28d9; }
.tl__labels { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; font-size: 12px; color: #cfd6dd; margin-top: 2px; }
.tl__labels > * { text-align: center; padding: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl__labels > * + * { box-shadow: inset 1px 0 0 rgba(255,255,255,.16); }   /* stretch dividers */
.tl__labels button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; border-radius: 4px; }
.tl__labels button:hover { color: #fff; background: rgba(255,255,255,.07); }
.tl__labels button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tl__labels i { font-style: normal; color: var(--faint); font-size: 11px; margin-left: 2px; }
@media (max-width: 560px) { .tl__labels i { display: none; } }   /* five stretches on a phone: the bare labels fit */
.tl__opts { display: flex; align-items: center; gap: 12px; margin-top: 7px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.seg { display: inline-flex; padding: 2px; border-radius: 999px; background: rgba(255,255,255,.06); }
.seg button { border: 0; background: transparent; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.seg button[aria-checked="true"] { background: rgba(255,255,255,.16); color: var(--text); }
.switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__ui { width: 26px; height: 15px; border-radius: 999px; background: rgba(255,255,255,.16); position: relative; transition: background .15s; }
.switch__ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .switch__ui { background: #0891b2; }
.switch input:checked + .switch__ui::after { transform: translateX(11px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.tl__status { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- legend + credits ---------- */
.corner { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: 8px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; pointer-events: none; }
.corner > * { pointer-events: auto; }
.legend { position: relative; display: block; width: 320px; height: 20px; padding: 0; border: 0; border-radius: 5px; overflow: hidden; cursor: pointer; box-shadow: 0 1px 6px rgba(0,0,0,.4); background: var(--ground); }
.legend canvas { display: block; width: 320px; height: 20px; }
.legend__labels { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); align-items: center; font-size: 10.5px; font-weight: 600; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.9), 0 0 1px #000; pointer-events: none; }
.legend__labels span { text-align: center; }
.legend__labels span:first-child { font-weight: 500; opacity: .9; }
.credits { max-width: 460px; text-align: right; font-size: 10px; line-height: 1.4; color: rgba(255,255,255,.86); padding: 2px 6px; border-radius: 6px; background: rgba(12,14,17,.55); }   /* readable on the light street map too */
.credits:empty { display: none; }
.credits-toggle { display: none; }
/* between phone and wide desktop the timeline reaches the corner: the credits wrap narrower, and the timeline stops short of the legend */
@media (min-width: 821px) and (max-width: 1400px) { .credits { max-width: 320px; } }
@media (min-width: 821px) and (max-width: 1180px) { .timeline { left: 12px; width: min(680px, calc(100% - 368px)); } }
.credits a { color: inherit; }

/* MapLibre controls: keep clear of the legend */
.maplibregl-ctrl-bottom-right { bottom: 84px !important; right: 4px !important; }
.maplibregl-ctrl-group { background: var(--panel-solid) !important; border: 1px solid var(--line); box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); opacity: .85; }

/* ---------- readout pin ---------- */
.pin { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; will-change: transform; }
.pin__dot { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(8,145,178,.9), 0 1px 4px rgba(0,0,0,.6); }
.pin__stem { position: absolute; left: -1px; bottom: 0; width: 2px; height: 104px; background: rgba(15,18,22,.9); }
.pin__flag { position: absolute; left: 1px; top: -104px; min-width: 184px; white-space: nowrap; padding: 8px 34px 8px 12px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 0 12px 12px 0; box-shadow: var(--shadow); pointer-events: auto; }
.pin__title { font-size: 11px; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }
.pin__value { display: block; border: 0; background: none; padding: 0; margin: 1px 0; font-size: 20px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; text-align: left; }
.pin__value:hover { color: var(--accent); }
.pin__sub { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.pin__close { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.pin__close:hover { background: var(--panel-2); color: var(--text); }
.pin__close svg { width: 14px; height: 14px; }
/* near the right edge the flag opens to the left; near the top it opens below the point */
.pin--left .pin__flag { left: auto; right: 1px; border-radius: 12px 0 0 12px; }
.pin--below .pin__flag { top: 8px; }
.pin--below .pin__stem { bottom: auto; top: 0; height: 8px; }

.hover-chip { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; padding: 4px 9px; border-radius: 7px; background: rgba(12,14,17,.88); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; will-change: transform; }
.hover-chip b { font-weight: 600; }
.hover-chip span { color: var(--muted); margin-left: 6px; }

.warn-card { position: absolute; z-index: 6; width: 300px; padding: 12px 14px 12px 16px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.45; }
.warn-card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; background: var(--wc, #fff); }
.warn-card h3 { margin: 0 24px 4px 0; font-size: 14px; }
.warn-card p { margin: 0 0 4px; color: var(--muted); }
.warn-card .pin__close { top: 8px; right: 8px; }

.debug { position: absolute; left: 12px; top: 60px; z-index: 6; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.72); font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; color: #cfe; white-space: pre; pointer-events: none; }

/* ---------- Google engine: keep Google's logo (bottom left) and terms (bottom right) visible ---------- */
/* engines/google.js adds .engine-google to .app only while a real Google map is mounted. */
.app.engine-google .timeline { bottom: 26px; }
.app.engine-google .tl { border-bottom: 1px solid var(--line); border-radius: 10px; }
@media (min-width: 821px) { .app.engine-google .corner { bottom: 28px; } }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  /* the pickers stay on one row (it scrolls sideways when it does not fit), so the legend and the Layers button below it never land on a second row of them */
  .topbar { left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); max-width: none; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; }
  .topbar::-webkit-scrollbar { display: none; }
  .topbar > * { flex: none; }
  .sources__label { display: none; }
  .brand__sep, .brand__place { display: none; }
  .engines button { padding: 0 9px; font-size: 12px; }
  /* below the legend (which moves to the top right here), never over it */
  .layers { top: calc(max(12px, env(safe-area-inset-top)) + 80px); bottom: auto; right: max(8px, env(safe-area-inset-right)); width: 210px; max-height: calc(100% - 92px - 196px); }
  .timeline { left: max(8px, env(safe-area-inset-left)); width: calc(100% - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right))); }
  .play { margin-bottom: calc(52px + env(safe-area-inset-bottom)); }
  .tl__opts { gap: 8px; }
  /* the loading text sits at the right of the speed row, out of the flow, so the panel does not grow (and move the track under a finger) when it appears */
  .tl__opts { position: relative; }
  .tl__status { position: absolute; top: 0; right: 0; margin: 0; line-height: 30px; }
  .corner { right: max(8px, env(safe-area-inset-right)); bottom: auto; top: calc(max(12px, env(safe-area-inset-top)) + 46px); }
  .legend, .legend canvas { width: 240px; }
  /* credits: behind an "i" beside the legend (the map's sources must stay reachable on a phone) */
  .credits-toggle { display: grid; place-items: center; position: absolute; top: 0; right: 248px; width: 20px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-solid); color: var(--text); font: italic 600 12px/1 Georgia, "Times New Roman", serif; cursor: pointer; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
  .credits-toggle::after { content: ""; position: absolute; inset: -12px; }
  .credits { display: none; position: absolute; top: 26px; right: 0; z-index: 7; width: min(300px, calc(100vw - 16px)); max-width: none; text-align: left; padding: 8px 10px; border-radius: 10px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 11px; }
  .corner[data-credits="open"] .credits { display: block; }
  /* messages sit above the timeline here, not over the legend */
  .status { top: auto; bottom: calc(190px + env(safe-area-inset-bottom)); }
  .maplibregl-ctrl-bottom-right { bottom: 122px !important; }
}
/* fingers: bigger things to hit (the look stays; the hit areas grow) */
@media (pointer: coarse) {
  .tl__track::after { content: ""; position: absolute; inset: -22px 0 0; }
  .play { width: 48px; height: 48px; }
  .seg button { padding: 9px 13px; }
  .tl__labels > * { padding: 8px 0; }
  .switch { min-height: 36px; }
  .engines button { height: 34px; }
  .layer { padding: 11px 8px; }
  .pin__close { width: 40px; height: 40px; top: 0; right: 0; }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }   /* pinch to zoom */
}
/* ---------- phone timeline (560 px wide or less; app.js tests the same width) ----------
   One linear bar showing the range picked with the chips (the range Play loops). Wider screens keep
   the five-stretch bar above and never show these parts. */
.tl-bar, .tl-more, .tl__plabels { display: none; }
@media (max-width: 560px) {
  .timeline { flex-wrap: wrap; gap: 0 10px; pointer-events: auto; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; backdrop-filter: blur(12px); box-shadow: var(--shadow); }
  .app.engine-google .timeline { border-bottom: 1px solid var(--line); border-radius: var(--radius); }
  /* chips row: 24h / 6h / 1h / Next 6h, then the loading text, Now and "..." */
  .tl-bar { display: flex; align-items: center; gap: 6px; width: 100%; margin-bottom: 14px; position: relative; z-index: 2; }
  .tl-chips { display: inline-flex; flex: none; padding: 2px; gap: 2px; border-radius: 999px; background: rgba(255,255,255,.06); }
  .tl-chips button { min-height: 36px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
  .tl-chips button[aria-checked="true"] { background: var(--text); color: #0b0d10; }
  .tl-chips button.is-dim { opacity: .5; }
  .tl-chips button[hidden] { display: none; }
  .tl-bar .tl__status { position: static; flex: 1; min-width: 0; margin: 0; font-size: 11px; line-height: 1.2; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tl-nowbtn { flex: none; min-height: 36px; padding: 0 12px; border: 1px solid rgba(34, 211, 238, .55); border-radius: 999px; background: rgba(34, 211, 238, .14); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; }
  .tl-nowbtn[hidden] { display: none; }
  .tl-morebtn { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.06); color: var(--text); display: grid; place-items: center; cursor: pointer; }
  .tl-morebtn[aria-expanded="true"] { background: rgba(255,255,255,.16); }
  .tl-morebtn svg { width: 20px; height: 20px; }
  /* "..." options: speed and the forecast switch, in a small panel above the timeline */
  .tl-more:not([hidden]) { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; position: absolute; right: 12px; bottom: calc(100% + 8px); z-index: 8; padding: 10px 12px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 12.5px; color: var(--muted); }
  .tl-more .seg button { font-size: 12.5px; }
  /* Play beside the bar, centered on it */
  .play { width: 48px; height: 48px; margin-bottom: 19px; }
  /* the bar itself: the panel is the timeline section here, so .tl only lays out the track and labels */
  .tl { align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0 12px; }
  .tl__labels, .tl__opts { display: none; }
  .tl__track { height: 30px; }
  .tl__track::after { content: ""; position: absolute; inset: -14px 0 0; }   /* a 44 px hit area */
  .tl__track::before, .tl__past, .tl__future, .tl__model, .tl__loaded { height: 8px; border-radius: 0; }
  .tl__past { background: #e7ecf1; }                                            /* observed: solid */
  .tl__model { display: none; left: calc(12px + (100% - 24px) * var(--mdf, 1)); width: calc((100% - 24px) * (1 - var(--mdf, 1))); }
  .tl[data-prange="next6h"] .tl__model { display: block; }
  .tl__ticks { top: 8px; }
  .tl__now { top: -6px; height: 22px; }
  .tl__head { top: -7px; width: 22px; height: 22px; margin-left: -11px; }
  /* the bubble sits above the panel (over the chips row) */
  .tl__bubble { top: -97px; font-size: 12.5px; padding: 0 10px; }
  .tl__plabels { display: block; position: relative; height: 16px; margin-top: 0; font-size: 11.5px; line-height: 16px; color: #cfd6dd; font-variant-numeric: tabular-nums; }
  .tl__plabels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
  .tl__plabels span.is-start { transform: translateX(-4px); }
  .tl__plabels span.is-end { transform: translateX(calc(-100% + 4px)); }
  .tl__plabels span.is-now { color: #fff; font-weight: 600; }
  .status { bottom: calc(170px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.engines[hidden] { display: none; }
