:root {
  --fpv-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%20width%3D%2264%22%20height%3D%2264%22%3E%20%3Cg%20stroke%3D%22%23ffffff%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%3E%20%3Cline%20x1%3D%2216%22%20y1%3D%2216%22%20x2%3D%2248%22%20y2%3D%2248%22%2F%3E%3Cline%20x1%3D%2248%22%20y1%3D%2216%22%20x2%3D%2216%22%20y2%3D%2248%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20stroke%3D%22%23ff6d00%22%20stroke-width%3D%225%22%20stroke-linecap%3D%22round%22%3E%20%3Cline%20x1%3D%2216%22%20y1%3D%2216%22%20x2%3D%2248%22%20y2%3D%2248%22%2F%3E%3Cline%20x1%3D%2248%22%20y1%3D%2216%22%20x2%3D%2216%22%20y2%3D%2248%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20fill%3D%22%23ff6d00%22%20fill-opacity%3D%22.28%22%20stroke%3D%22%23ff6d00%22%20stroke-width%3D%223%22%3E%20%3Ccircle%20cx%3D%2214%22%20cy%3D%2214%22%20r%3D%2211%22%2F%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2214%22%20r%3D%2211%22%2F%3E%3Ccircle%20cx%3D%2214%22%20cy%3D%2250%22%20r%3D%2211%22%2F%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2211%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20fill%3D%22%23ffffff%22%20stroke%3D%22%23ff6d00%22%20stroke-width%3D%222.5%22%3E%20%3Ccircle%20cx%3D%2214%22%20cy%3D%2214%22%20r%3D%223.5%22%2F%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2214%22%20r%3D%223.5%22%2F%3E%3Ccircle%20cx%3D%2214%22%20cy%3D%2250%22%20r%3D%223.5%22%2F%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%223.5%22%2F%3E%20%3C%2Fg%3E%20%3Crect%20x%3D%2222%22%20y%3D%2220%22%20width%3D%2220%22%20height%3D%2224%22%20rx%3D%226%22%20fill%3D%22%23ff6d00%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%222.5%22%2F%3E%20%3Ccircle%20cx%3D%2232%22%20cy%3D%2225.5%22%20r%3D%223.6%22%20fill%3D%22%231d232b%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%221.5%22%2F%3E%20%3C%2Fsvg%3E");
  --bg: #f4f5f7; --fg: #1d232b; --muted: #5d6773; --card: #ffffff; --line: #d7dbe0;
  --danger: #d93025; --watch: #f2a900; --fpv: #ff6d00; --clear: #b8bec6; --none: #e6e8eb; --accent: #1a73e8;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151a; --fg: #e8ebef; --muted: #9aa4b0; --card: #1b2128; --line: #2c343d; --clear: #4a525c; --none: #262c33; --accent: #8ab4f8; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.bar { position: fixed; inset: 0 0 auto 0; z-index: 3; display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.title { display: flex; flex-direction: column; min-width: 0; }
.title strong { font-size: 16px; }
.sub { color: var(--muted); font-size: 12px; }
.tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; }
.base { font-size: 13px; color: var(--muted); }
.base select { margin-left: 4px; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; }
.link { color: var(--accent); text-decoration: none; font-size: 14px; }
#map { position: fixed; inset: 0; }
.legend { position: fixed; left: 12px; bottom: 28px; z-index: 2; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }
.sw.danger { background: var(--danger); } .sw.yellow { background: var(--watch); } .sw.clear { background: var(--clear); } .sw.none { background: var(--none); }
.panel { position: fixed; z-index: 4; right: 12px; top: 72px; width: 340px; max-height: calc(100% - 100px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
.panel h2 { margin: 0 28px 6px 0; font-size: 18px; }
.panel .st { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 13px; }
.st.danger { background: var(--danger); color: #fff; } .st.yellow { background: var(--watch); color: #1d232b; }
/* FPV: point + label exactly as the source named the place */
.fpv-mk { display: flex; align-items: center; gap: 4px; pointer-events: auto; cursor: pointer; transform: translateY(-1px); }
.fpv-mk i { width: 28px; height: 28px; flex: none; background: var(--fpv-ico) center/contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); animation: fpvp 1.6s ease-in-out infinite; }
.fpv-mk span { font: 600 11px/1.15 system-ui, sans-serif; color: #1d232b; background: rgba(255,255,255,.92); border: 1px solid var(--fpv); border-radius: 4px; padding: 1px 4px; white-space: nowrap; }
@keyframes fpvp { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.sw.fpv { background: var(--fpv-ico) center/contain no-repeat; border: 0; width: 16px; height: 16px; vertical-align: -3px; }
.fpvlist { margin: 4px 0 0; padding-left: 18px; } .fpvlist li { margin: 2px 0; } .st.clear { background: var(--clear); color: var(--fg); } .st.none { background: var(--none); color: var(--muted); }
.panel dl { margin: 10px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; }
.panel dt { color: var(--muted); } .panel dd { margin: 0; overflow-wrap: anywhere; }
.panel a { color: var(--accent); }
.panel .nb { margin-top: 10px; font-size: 13px; color: var(--muted); }
.close { position: absolute; right: 8px; top: 6px; border: 0; background: none; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.conn { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: 70px; background: #333; color: #fff; padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.btn { font: inherit; font-size: 13px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.btn.on { background: var(--danger); color: #fff; border-color: var(--danger); }
.alarm { position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); top: 70px; max-width: calc(100% - 32px);
  background: var(--danger); color: #fff; font-weight: 700; font-size: 18px; padding: 10px 44px 10px 16px; border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.3); animation: pulse 1s ease-in-out 6; }
.alarm.clear { background: #2e7d32; animation: none; }
.alarm button { position: absolute; right: 8px; top: 6px; border: 0; background: none; color: #fff; font-size: 24px; cursor: pointer; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.04); } }
.watch { width: 360px; }
.watch .hint { font-size: 12px; color: var(--muted); margin: 6px 0 10px; }
.watch-actions { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
#watch-filter { width: 100%; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); margin-bottom: 6px; }
#watch-list { max-height: 50vh; overflow: auto; font-size: 13px; }
#watch-list label { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
#watch-list label.on { font-weight: 600; }
@media (max-width: 640px) {
  .bar { padding: 6px 12px; } .title strong { font-size: 14px; } .sub { display: none; }
  .panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 55%; border-radius: 14px 14px 0 0; }
  .legend { bottom: 64px; font-size: 11px; padding: 6px 8px; }
}

.legend .ico { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.unlock { position: fixed; z-index: 7; left: 50%; transform: translateX(-50%); bottom: 90px; max-width: calc(100% - 32px);
  font: inherit; font-size: 16px; font-weight: 600; color: #fff; background: #1a73e8; border: 0; border-radius: 999px;
  padding: 12px 20px; box-shadow: 0 6px 24px rgba(0,0,0,.3); cursor: pointer; animation: pulse 1.2s ease-in-out infinite; }
@media (max-width: 640px) { .unlock { bottom: auto; top: 175px; font-size: 14px; } }
.alarm.warn { background: #b26a00; animation: none; }
/* drones by district (radar posts): the threat icon, red label */
.uav-mk i { width: 24px; height: 24px; background-size: contain; background-repeat: no-repeat; background-position: center; animation: none; }
.uav-mk { position: relative; }
.uav-mk b { position: absolute; right: -7px; top: -6px; min-width: 15px; text-align: center; font: 700 10px/14px system-ui, sans-serif; color: #fff; background: var(--danger); border: 1px solid #fff; border-radius: 8px; padding: 0 3px; }
.panel .muted { color: var(--muted); font-size: 12px; }
.admin-link { opacity: .55; } .admin-link:hover { opacity: 1; }
