:root {
  --bg: #07090c;
  --panel: rgba(12, 15, 20, 0.86);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e9edf2;
  --dim: #8792a0;
  --sorrel: #e0784a;
  --transit: #5fd0c4;
  --flight: #a9c8ff;
  --road: #f2b34a;
  --danger: #ff5f57;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
#map { position: fixed; inset: 0; background: var(--bg); }
.maplibregl-map { font-family: inherit; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(7, 9, 12, 0.75) !important; color: var(--dim) !important; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--dim) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-ctrl-group { background: var(--panel) !important; border: 1px solid var(--line); box-shadow: none !important; }
.maplibregl-ctrl-group button { background-color: transparent !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(.85); }
.view3d { position: fixed; bottom: 128px; left: 10px; z-index: 1000; width: 29px; height: 29px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 600 11px var(--mono); cursor: pointer; }
.view3d:hover { border-color: var(--sorrel); color: var(--sorrel); }

.eyebrow { font: 500 10.5px/1 var(--mono); letter-spacing: 0.22em; color: var(--dim); text-transform: uppercase; margin-bottom: 10px; }
.eyebrow .hint { letter-spacing: 0.04em; text-transform: none; color: #5d6773; margin-left: 6px; }

.brand { position: fixed; top: 18px; left: 18px; z-index: 1000; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(10px); }
.brand .pin { width: 22px; height: 22px; fill: var(--sorrel); }
.brand .eyebrow { margin: 4px 0 0; font-size: 9.5px; }
.wordmark { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; line-height: 1; }
.wordmark span { color: var(--sorrel); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6); animation: pulse 2s infinite; margin-left: 4px; }
.live-dot.warn { background: var(--road); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,.55); } 70% { box-shadow: 0 0 0 9px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }

.mock-banner { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000; font: 500 11px var(--mono); letter-spacing: 0.2em; color: #111; background: var(--road); padding: 6px 12px; border-radius: 6px; }

.panel { position: fixed; top: 18px; right: 18px; bottom: 18px; width: 360px; z-index: 1000; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(12px); transition: transform 0.25s ease; }
.panel.collapsed { transform: translateX(calc(100% + 18px)); }
.panel-toggle { position: absolute; left: -38px; top: 14px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.panel.collapsed .panel-toggle { transform: rotate(180deg); }
.panel section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel section.feed { flex: 1; display: flex; flex-direction: column; min-height: 0; border-bottom: 0; padding-bottom: 0; }

.wx-main { display: flex; align-items: baseline; gap: 12px; }
#wxTemp { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.wx-cond { color: var(--text); font-size: 15px; }
.wx-meta { color: var(--dim); font: 12px var(--mono); margin-top: 8px; }
.wx-alert { margin-top: 10px; padding: 8px 10px; border-radius: 8px; border-left: 3px solid var(--road); background: rgba(242, 179, 74, 0.08); font-size: 12.5px; }
.wx-alert.red { border-color: var(--danger); background: rgba(255, 95, 87, 0.08); }

.layers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.layer { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; user-select: none; font-size: 12.5px; color: var(--dim); }
.layer.on { color: var(--text); border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.03); }
.layer .sw { width: 9px; height: 9px; border-radius: 50%; flex: none; opacity: .35; }
.layer.on .sw { opacity: 1; box-shadow: 0 0 8px currentColor; }
.layer .n { margin-left: auto; font: 11px var(--mono); color: var(--dim); }
.layer.err .n { color: var(--danger); }

.near-row { display: flex; gap: 8px; }
.btn { font: inherit; font-size: 12.5px; color: var(--text); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; cursor: pointer; }
.btn:hover { border-color: rgba(255,255,255,.22); }
.btn.active { border-color: var(--sorrel); color: var(--sorrel); }
#nearBtn { flex: 1; }

.tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.tab { flex: 1; font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 0; cursor: pointer; }
.tab.active { color: var(--text); border-bottom-color: var(--sorrel); }
.list { overflow-y: auto; flex: 1; margin: 0 -18px; padding: 0 18px 16px; }
.item { padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 600; font-size: 13px; }
.item .d { color: var(--dim); font-size: 12.5px; margin-top: 3px; }
.item .m { font: 11px var(--mono); color: #5d6773; margin-top: 4px; }
.tag { display: inline-block; font: 500 10px var(--mono); letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; margin-right: 6px; background: rgba(255,255,255,.06); color: var(--dim); text-transform: uppercase; }
.tag.hot { background: rgba(255,95,87,.15); color: var(--danger); }
.empty { color: var(--dim); font-size: 12.5px; padding: 14px 0; }
.src-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.src-row .s { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; background: #3ddc84; }
.src-row .s.bad { background: var(--danger); } .src-row .s.na { background: #4a525c; }
.src-row a { color: var(--sorrel); }

.maplibregl-popup-content { background: #10141a; color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); padding: 12px 14px; font-size: 13px; }
.maplibregl-popup-tip { border-top-color: #10141a !important; border-bottom-color: #10141a !important; }
.maplibregl-popup-close-button { color: var(--dim); font-size: 16px; right: 4px; top: 2px; }
.pop a { color: var(--sorrel); }
.pop-t { font-weight: 600; margin-bottom: 4px; }
.pop-m { font: 11px var(--mono); color: var(--dim); }
.pop img { width: 260px; max-width: 100%; border-radius: 6px; margin-top: 8px; display: block; }

.plane { color: var(--flight); filter: drop-shadow(0 0 4px rgba(169,200,255,.7)); }
.plane.emg { color: var(--danger); }
.airport-label { font: 500 11px var(--mono); color: var(--text); background: rgba(12,15,20,.85); border: 1px solid var(--line); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }

@media (max-width: 760px) {
  .panel { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; height: 46vh; }
  .panel.collapsed { transform: translateY(calc(100% - 46px)); }
  .panel-toggle { left: auto; right: 12px; top: -40px; }
  .brand { top: 10px; left: 10px; padding: 9px 12px; }
  .mock-banner { top: 74px; left: 10px; transform: none; }
}

/* ---------- Place Lens ---------- */
.search { position: fixed; top: 92px; left: 18px; width: 340px; z-index: 1001; }
.search input { width: 100%; font: inherit; font-size: 14px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; backdrop-filter: blur(10px); outline: none; }
.search input:focus { border-color: var(--sorrel); }
.search-hint { font: 10.5px var(--mono); color: #5d6773; margin: 6px 4px 0; letter-spacing: .04em; }
.search-results { margin-top: 6px; background: #10141a; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.search-results button { display: block; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; cursor: pointer; }
.search-results button:hover, .search-results button.on { background: rgba(224,120,74,.1); }
.search-results .nb { color: var(--dim); font-size: 12px; }

.lens { position: fixed; top: 176px; left: 18px; bottom: 18px; width: 380px; z-index: 1000; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(12px); padding: 18px 18px 22px; }
.lens-close { position: sticky; top: 0; float: right; z-index: 2; margin: 0 0 6px 8px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #10141a; color: var(--text); cursor: pointer; font-size: 16px; line-height: 1; }
.lens h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin: 2px 0 4px; line-height: 1.2; }
.lens .sub { color: var(--dim); font-size: 13px; }
.lens .block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.lens .bh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lens .bh .eyebrow { margin: 0; }
.prov { margin-left: auto; font: 500 9.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; cursor: help; white-space: nowrap; }
.prov.official { color: #8fd18f; background: rgba(143,209,143,.1); }
.prov.live { color: var(--transit); background: rgba(95,208,196,.1); }
.prov.derived { color: #c9a8ff; background: rgba(201,168,255,.1); }
.prov.na { color: var(--dim); background: rgba(255,255,255,.05); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.permit { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.permit:last-child { border-bottom: 0; }
.permit .pd { font: 11px var(--mono); color: var(--dim); }
.permit .px { margin-top: 3px; }
.more { font: 11px var(--mono); color: var(--sorrel); background: none; border: 0; padding: 6px 0 0; cursor: pointer; }
.cam-thumb { width: 100%; border-radius: 8px; margin-top: 6px; display: block; }
.ask-form { display: flex; gap: 6px; }
.ask-form input { flex: 1; font: inherit; font-size: 13px; color: var(--text); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; }
.ask-form input:focus { border-color: var(--sorrel); }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ask-chips button { font: 11.5px inherit; color: var(--dim); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; cursor: pointer; }
.ask-chips button:hover { color: var(--text); }
.ask-answer { margin-top: 8px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.ask-answer sup { color: var(--sorrel); font: 10px var(--mono); }
.src { display: flex; gap: 8px; align-items: baseline; font-size: 12px; padding: 5px 0; }
.src .n { font: 10.5px var(--mono); color: var(--dim); width: 18px; flex: none; }
.src a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(255,255,255,.25); }
.notes { margin-top: 10px; font-size: 11.5px; color: #5d6773; }
.place-pin { width: 18px; height: 18px; border-radius: 50%; background: var(--sorrel); border: 3px solid #fff3; box-shadow: 0 0 0 6px rgba(224,120,74,.25), 0 0 18px rgba(224,120,74,.8); }
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: sk 1.2s infinite; margin: 8px 0; }
@keyframes sk { to { background-position: -200% 0; } }

body.lens-open .maplibregl-ctrl-bottom-left, body.lens-open .view3d { left: 404px; }
body.lens-open .view3d { left: 414px; }

@media (max-width: 760px) {
  body.lens-open .maplibregl-ctrl-bottom-left, body.lens-open .view3d { display: none; }
  .search { top: 74px; left: 10px; right: 10px; width: auto; }
  .search-hint { display: none; }
  .lens { top: 194px; left: 10px; right: 10px; bottom: 10px; width: auto; z-index: 1002; }
  .mock-banner { top: auto; bottom: 52%; left: 10px; transform: none; font-size: 9.5px; }
}

/* ---------- Ask / instant answers ---------- */
.search-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.search-row .search-hint { margin: 0 4px; }
.area-btn { font: 500 11.5px inherit; color: var(--sorrel); background: var(--panel); border: 1px solid rgba(224,120,74,.35); border-radius: 999px; padding: 5px 10px; cursor: pointer; backdrop-filter: blur(10px); white-space: nowrap; }
.area-btn:hover { background: rgba(224,120,74,.12); }
.ask-chips button.on { color: var(--sorrel); border-color: rgba(224,120,74,.5); }
.ask-out { margin-top: 10px; }
.ask-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ask-meta .prov { margin: 0; }
.speak { margin-left: auto; font: 11px var(--mono); color: var(--dim); background: none; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.speak:hover { color: var(--text); }
.cov { margin-top: 8px; font-size: 12px; color: var(--road); background: rgba(242,179,74,.08); border-left: 2px solid var(--road); padding: 6px 8px; border-radius: 4px; }
.ask-srcs { margin-top: 8px; }
@media (max-width: 760px) { .search-row .search-hint { display: none; } .search-row { justify-content: flex-end; } }

/* ---------- rich popups ---------- */
.pop-rich { min-width: 240px; }
.ph { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.ph .pop-t { font-size: 15px; font-weight: 700; margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ph .tag { margin: 0; }
.pk { font: 600 9.5px var(--mono); letter-spacing: .1em; padding: 6px 7px; border-radius: 6px; flex: none; }
.pk-ico { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 0 6px currentColor); }
.pdesc { font-size: 12.5px; color: var(--text); margin: 0 0 8px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 8px; }
.pgrid > div { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.pgrid span { display: block; font: 500 9px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.pgrid b { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pgrid i { display: block; font-style: normal; font-size: 11px; color: var(--dim); }
.pr { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.pr span { color: var(--dim); } .pr b { font-weight: 500; text-align: right; } .pr i { color: var(--dim); font-style: normal; font-size: 11px; }
.pop-foot { margin-top: 8px; font: 10.5px var(--mono); color: #5d6773; }

.enrich:empty { display: none; }
.route { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: rgba(224,120,74,.08); border: 1px solid rgba(224,120,74,.25); border-radius: 8px; padding: 7px 10px; margin: 2px 0 6px; }
.route b { display: block; font: 700 16px var(--mono); letter-spacing: .04em; }
.route span { font-size: 11px; color: var(--dim); }
.route div:last-child { text-align: right; }
.route .arrow { color: var(--sorrel); font-size: 18px; }

.pk.route { font: 700 13px var(--mono); letter-spacing: 0; padding: 6px 9px; min-width: 34px; text-align: center; }
.dly { font: 600 9.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; }
.dly.ok { color: #8fd18f; background: rgba(143,209,143,.12); } .dly.warn { color: var(--road); background: rgba(242,179,74,.12); }
.dly.bad { color: var(--danger); background: rgba(255,95,87,.12); } .dly.early { color: #7fb4ff; background: rgba(127,180,255,.12); }
.nextstop { background: rgba(95,208,196,.08); border: 1px solid rgba(95,208,196,.25); border-radius: 8px; padding: 7px 10px; margin: 2px 0 8px; }
.nextstop span { display: block; font: 500 9px var(--mono); letter-spacing: .14em; color: var(--transit); }
.nextstop b { display: block; font-size: 14px; } .nextstop i { font-style: normal; font-size: 11.5px; color: var(--dim); }

/* ---------- embed (landing hero) ---------- */
body.embed .brand, body.embed .search, body.embed .lens, body.embed .panel, body.embed .view3d, body.embed .mock-banner, body.embed .airport-label { display: none !important; }
body.embed .maplibregl-ctrl-attrib { font-size: 9px; opacity: .7; }

/* ---------- Place Lens actions ---------- */
.match { margin-top: 4px; font: 11px var(--mono); color: #5d6773; }
.pl-actions { margin-top: 12px; position: relative; }
.pl-radius { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.pl-radius select { font: inherit; font-size: 12.5px; color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.pl-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pl-btns button { font: 500 12px inherit; color: var(--text); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; cursor: pointer; }
.pl-btns button:hover { border-color: rgba(255,255,255,.25); }
.pl-btns button.on { color: var(--sorrel); border-color: rgba(224,120,74,.55); background: rgba(224,120,74,.1); }
.pl-toast { margin-top: 8px; font-size: 12px; color: var(--transit); min-height: 0; opacity: 0; transition: opacity .2s; }
.pl-toast.show { opacity: 1; }
.ask-chips.extra { margin-top: 6px; }
.ask-form.col { flex-direction: column; align-items: stretch; }
.ask-form textarea { font: inherit; font-size: 13px; color: var(--text); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; min-height: 56px; outline: none; }
.ask-form textarea:focus { border-color: var(--sorrel); }
.ask-form.col .btn { align-self: flex-end; }
.ask-scope { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font: 10.5px var(--mono); color: #5d6773; }
.spoken { display: inline-flex; align-items: center; gap: 5px; font: 11.5px inherit; color: var(--dim); cursor: pointer; white-space: nowrap; }
#watchAlerts { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 2000; display: grid; gap: 6px; }
.walert { background: #10141a; border: 1px solid rgba(224,120,74,.5); color: var(--text); border-radius: 10px; padding: 9px 14px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

/* ---------- Places in view, watched places, source counts ---------- */
.search-row2 { justify-content: flex-start; margin-top: 6px; }
.area-btn.quiet { color: var(--text); border-color: var(--line); }
.area-btn.quiet:hover { border-color: rgba(255,255,255,.25); background: var(--panel); }
#watchedBtn.has { color: var(--sorrel); border-color: rgba(224,120,74,.35); }
@media (max-width: 760px) { .search-row.search-row2 { justify-content: flex-end; } }
.mini { margin-left: auto; font: 10.5px var(--mono); color: var(--sorrel); background: none; border: 1px solid rgba(224,120,74,.35); border-radius: 6px; padding: 2px 7px; cursor: pointer; }
.mini:hover { background: rgba(224,120,74,.1); }
.src-count { color: #5d6773; font: 10.5px var(--mono); }
.iv-row { display: block; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 2px; cursor: pointer; }
.iv-row:hover, .iv-row:focus-visible { background: rgba(224,120,74,.08); outline: none; }
.iv-a { display: block; font-size: 13px; }
.iv-m { display: block; font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.wp { padding: 10px 0; border-bottom: 1px solid var(--line); }
.wp-name { width: 100%; font: inherit; font-size: 13.5px; color: var(--text); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; outline: none; }
.wp-name:focus { border-color: var(--sorrel); }
.wp-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 4px; }
.upcoming { margin: -2px 0 8px; display: grid; gap: 3px; }
.upcoming div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--dim); }
.upcoming b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming i { font-style: normal; font: 11px var(--mono); white-space: nowrap; }
.police-range { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11.5px; color: var(--dim); }
.police-range button { font: 11px inherit; color: var(--dim); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; cursor: pointer; }
.police-range button.on { color: #c9a8ff; border-color: rgba(201,168,255,.5); }
