:root {
  --bar: #1b1d21; --panel: #24272c; --row: #2d3137; --line: #3a3f47;
  --text: #f2f3f5; --muted: #9aa1ab; --accent: #1fb6e6; --ok: #3ccf6e;
  --bar-h: 50px;
  font: 14px/1.35 "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bar); color: var(--text); overflow: hidden; }
a { color: var(--accent); }
button { font: inherit; color: var(--text); background: var(--row); border: 0; border-radius: 4px; padding: 7px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button:hover { background: #363b42; }
button.on { background: #3d434b; }
button svg { width: 16px; height: 16px; }

.bar { position: fixed; inset: 0 0 auto 0; height: var(--bar-h); display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--bar); z-index: 20; }
.brand { display: flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; font-size: 19px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand b { color: var(--accent); }
.brand svg { width: 26px; height: 26px; color: var(--accent); }
.search { position: relative; flex: 0 1 300px; }
.search input { width: 100%; font: inherit; color: var(--text); background: var(--row); border: 0; border-radius: 4px; padding: 8px 10px; outline: none; }
.search input::placeholder { color: var(--muted); }
#results { position: absolute; top: 38px; left: 0; right: 0; margin: 0; padding: 0; list-style: none; background: var(--panel); border-radius: 4px; max-height: 60vh; overflow-y: auto; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
#results li { padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: 8px; align-items: center; }
#results li:last-child { border-bottom: 0; }
#results li:hover { background: var(--row); }
#results .sub { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.tools { display: flex; gap: 6px; }
.live { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 13px; color: var(--muted); }
.live b { color: var(--ok); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.live b::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.live b.off { color: #f0524a; } .live b.off::before { background: #f0524a; }

#map { position: fixed; inset: var(--bar-h) 0 0 0; }
.maplibregl-ctrl-attrib { font-size: 11px; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }

.panel { position: fixed; top: calc(var(--bar-h) + 10px); left: 10px; width: 330px; max-height: calc(100% - var(--bar-h) - 20px); overflow-y: auto; background: var(--panel); border-radius: 6px; z-index: 15; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.panel .close { position: absolute; top: 10px; right: 10px; padding: 2px 9px; font-size: 18px; background: transparent; }
.panel .head { padding: 12px 44px 10px 14px; background: var(--bar); border-radius: 6px 6px 0 0; }
.panel h1 { font-size: 18px; margin: 0 0 2px; }
.panel .kind { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.panel .photo img { display: block; width: 100%; height: 190px; object-fit: cover; background: var(--row); }
.panel .photo .credit { color: var(--muted); font-size: 11.5px; padding: 5px 14px 0; }
.panel .photo .credit a { color: var(--muted); }
.panel .btns { display: flex; gap: 6px; padding: 10px 14px; }
.panel .btns button { flex: 1; justify-content: center; padding: 6px 8px; font-size: 13px; }
.panel h2 { font-size: 13px; font-weight: 700; color: var(--text); margin: 0; padding: 9px 14px 6px; border-top: 1px solid var(--line); }
.panel dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 14px 10px; background: var(--line); border-radius: 4px; overflow: hidden; }
.panel dl div { background: var(--row); padding: 6px 9px; min-width: 0; }
.panel dl div.wide { grid-column: span 2; }
.panel dt { color: var(--muted); font-size: 11.5px; }
.panel dd { margin: 1px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.panel .src { color: var(--muted); font-size: 12px; padding: 4px 14px 12px; }
.stale { color: #ffab1a !important; }

.drop { position: fixed; top: calc(var(--bar-h) + 6px); width: 280px; max-height: calc(100% - var(--bar-h) - 20px); overflow-y: auto; background: var(--panel); border-radius: 6px; padding: 6px 14px 12px; z-index: 25; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
#filters, #layers, #menu { right: 10px; }
.drop h2 { font-size: 13px; font-weight: 700; margin: 10px 0 6px; }
.drop a { display: block; padding: 7px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.drop .row { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.drop .note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
#legend { list-style: none; margin: 0; padding: 0; }
#legend li label { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
#legend .count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.noscript { position: fixed; inset: var(--bar-h) 0 0 0; padding: 24px; background: var(--panel); z-index: 30; }

@media (max-width: 760px) {
  .brand span, .tools button span, .live .count-label { display: none; }
  .brand svg { width: 28px; height: 28px; }
  .search { flex: 1; }
  .tools button { padding: 7px 9px; }
  .live { font-size: 12px; gap: 6px; }
  .panel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 55%; border-radius: 10px 10px 0 0; }
  .panel .head { border-radius: 10px 10px 0 0; }
  .drop { left: 8px !important; right: 8px; width: auto; }
}

/* static pages */
body.page { overflow: auto; }
.page main { max-width: 760px; margin: 0 auto; padding: calc(var(--bar-h) + 24px) 18px 40px; }
.page h1 { font-size: 24px; margin: 0 0 12px; }
.page h2 { font-size: 17px; margin: 26px 0 8px; }
.page p, .page li { color: #cfd9e1; }
.page table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.page td, .page th { text-align: left; border: 1px solid var(--line); padding: 6px 9px; }
.page footer { color: var(--muted); font-size: 12px; margin-top: 30px; border-top: 1px solid var(--line); padding-top: 12px; }
