:root { --night: #05070b; --globe: #2e3033; --star: #e0f7ff; --muted: #9fb3bf; --panel: rgba(5, 7, 11, .82); color-scheme: dark; }
* { box-sizing: border-box; }
html, body, main { height: 100%; margin: 0; }
body { background: var(--night); color: var(--star); font: 14px/1.45 Montserrat, system-ui, sans-serif; overflow: hidden; }
#map { position: absolute; inset: 0; }
.maplibregl-map { font-family: Montserrat, system-ui, sans-serif; }
.maplibregl-canvas:focus-visible { outline: 2px solid var(--star); outline-offset: -2px; }

.panel { position: absolute; top: 16px; left: 16px; width: min(340px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; padding: 18px 18px 16px; background: var(--panel); border: 1px solid rgba(224, 247, 255, .14); border-radius: 4px; backdrop-filter: blur(6px); }
h1 { margin: 0 0 8px; font-size: 1.25rem; line-height: 1.2; font-weight: 700; }
.intro { margin: 0 0 12px; color: var(--muted); font-size: .8125rem; }
.count { margin: 0 0 12px; font-weight: 600; }
.controls > summary { cursor: pointer; font-size: .8125rem; color: var(--muted); }
.controls[open] > summary { margin-bottom: 10px; }
@media (min-width: 641px) and (min-height: 461px) { .controls > summary { display: none; } }
.filters { margin: 0 0 14px; padding: 0; border: 0; }
.filters legend { margin-bottom: 6px; color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.filters label { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; font-size: .8125rem; }
.filters input { accent-color: var(--star); width: 15px; height: 15px; margin: 0; }
.filters .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
button { font: inherit; font-size: .8125rem; color: var(--star); background: transparent; border: 1px solid rgba(224, 247, 255, .35); border-radius: 3px; padding: 6px 10px; cursor: pointer; }
button:hover { background: rgba(224, 247, 255, .1); }
button:focus-visible, .filters input:focus-visible { outline: 2px solid var(--star); outline-offset: 2px; }

.legend { position: absolute; left: 16px; bottom: 34px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel); border-radius: 4px; font-size: .75rem; color: var(--muted); }
.legend-swatch { position: relative; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(224, 247, 255, .28); }
.legend-swatch span { width: 4px; height: 4px; border-radius: 50%; background: var(--star); }

.maplibregl-popup-content { background: #0c1117; color: var(--star); border: 1px solid rgba(224, 247, 255, .2); border-radius: 4px; padding: 12px 30px 12px 14px; font: inherit; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.maplibregl-popup-tip { border-top-color: #0c1117 !important; border-bottom-color: #0c1117 !important; }
.maplibregl-popup-close-button { color: var(--star); font-size: 18px; padding: 2px 8px; border: 0; }
.popup h2 { margin: 0 0 2px; font-size: .9375rem; line-height: 1.25; }
.popup p { margin: 0 0 8px; color: var(--muted); font-size: .75rem; }
.popup dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: .75rem; }
.popup dt { color: var(--muted); }
.popup dd { margin: 0; }
.maplibregl-ctrl-attrib { background: rgba(5, 7, 11, .7) !important; color: var(--muted); font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--star); }
.maplibregl-ctrl-group { background: var(--panel); }
.maplibregl-ctrl-group button + button { border-top-color: rgba(224, 247, 255, .2); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.noscript { position: absolute; inset: auto 16px 16px; }

/* Embedded on a laptop page the frame is short, so the panel tightens up. */
@media (max-height: 620px) {
    .panel { top: 10px; left: 10px; padding: 12px 14px; max-height: calc(100% - 20px); }
    .intro { display: none; }
    h1 { font-size: 1.05rem; margin-bottom: 4px; }
    .count { margin-bottom: 8px; }
    .filters { margin-bottom: 10px; }
    .filters label { padding: 2px 0; }
    .legend { bottom: 28px; }
}

@media (max-width: 640px) {
    .panel { top: 8px; left: 8px; width: calc(100% - 16px); padding: 12px; max-height: 60%; }
    .count { margin-bottom: 6px; }
    .intro { display: none; }
    h1 { font-size: 1rem; }
    .legend { left: 8px; bottom: 44px; }
}
