:root{
  --bg:#0d1117;
  --bg-2:#141a23;
  --bg-3:#1b2430;
  --line:#243040;
  --text:#e6edf3;
  --muted:#8b98a9;
  --accent:#4cc9f0;
  --quake:#f0883e;
  --alert:#ff5d5d;
  --wiki:#a78bfa;
  --place:#43d17a;
  --event:#ffd166;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--text);
  font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,sans-serif;
  display:flex;flex-direction:column;overflow:hidden;
}

/* ---------- top bar ---------- */
.topbar{
  display:flex;align-items:center;gap:16px;padding:10px 16px;
  background:var(--bg-2);border-bottom:1px solid var(--line);flex:0 0 auto;
}
.brand{display:flex;align-items:center;gap:10px;min-width:190px}
.logo{
  width:34px;height:34px;border-radius:10px;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--accent),#7c5cff);color:#04121a;font-size:19px;font-weight:800;
}
.brand h1{margin:0;font-size:16px;letter-spacing:.3px}
.brand p{margin:0;font-size:11.5px;color:var(--muted);max-width:200px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.search{flex:1;display:flex;gap:6px;max-width:520px}
.search input{
  flex:1;padding:8px 12px;border-radius:9px;border:1px solid var(--line);
  background:var(--bg-3);color:var(--text);font-size:13px;
}
.search input:focus{outline:none;border-color:var(--accent)}
button{
  padding:8px 12px;border-radius:9px;border:1px solid transparent;
  background:var(--accent);color:#04121a;font-weight:650;font-size:13px;cursor:pointer;
}
button.ghost{background:var(--bg-3);color:var(--text);border-color:var(--line)}
button.ghost:hover{border-color:var(--accent);color:var(--accent)}
button.spinning{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.controls{display:flex;align-items:center;gap:8px}
.radius{font-size:11.5px;color:var(--muted);display:flex;align-items:center;gap:6px}
.radius select{
  background:var(--bg-3);color:var(--text);border:1px solid var(--line);
  border-radius:8px;padding:6px 8px;font-size:12.5px;
}

/* ---------- layout ---------- */
main{flex:1;display:flex;min-height:0}
#map{flex:1;background:var(--bg)}
.panel{
  width:360px;flex:0 0 360px;display:flex;flex-direction:column;
  background:var(--bg-2);border-right:1px solid var(--line);min-height:0;
}

/* ---------- pills ---------- */
.pills{
  display:grid;grid-template-columns:1fr 1fr;gap:1px;
  background:var(--line);border-bottom:1px solid var(--line);
  max-height:224px;overflow-y:auto;flex:0 0 auto;scrollbar-width:thin;
}
.pill{
  background:var(--bg-2);padding:8px 10px;display:flex;gap:8px;align-items:center;min-height:56px;
}
.pill .pi{font-size:19px;line-height:1}
.pill .pv{font-size:12.5px;font-weight:650;color:var(--text)}
.pill .ps{font-size:10.5px;color:var(--muted);margin-top:1px;line-height:1.3}

/* ---------- chips ---------- */
.chips{
  display:flex;flex-wrap:wrap;gap:5px;padding:9px 12px;border-bottom:1px solid var(--line);
}
.chip{
  display:flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;
  border:1px solid var(--line);background:var(--bg-3);color:var(--muted);
  font-size:11.5px;cursor:pointer;user-select:none;
}
.chip .dot{width:8px;height:8px;border-radius:50%;background:currentColor}
.chip.on{color:var(--text);border-color:currentColor}
.chip .n{opacity:.65;font-variant-numeric:tabular-nums}

.listhead{
  display:flex;justify-content:space-between;padding:8px 14px;
  font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.6px;
}

/* ---------- feed ---------- */
.feed{list-style:none;margin:0;padding:0 8px 8px;overflow-y:auto;flex:1;min-height:0}
.feed li{
  display:flex;gap:9px;align-items:flex-start;
  padding:10px 10px 10px 12px;border-radius:10px;cursor:pointer;
  border-left:3px solid transparent;margin-bottom:4px;
}
.feed li:hover{background:var(--bg-3)}
.feed li.active{background:var(--bg-3)}
.feed .txt{min-width:0;flex:1}
.feed .thumb{
  width:40px;height:40px;border-radius:7px;object-fit:cover;flex:0 0 40px;background:var(--bg-3);
}
.row1{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.row1 .t{font-weight:600;font-size:13px}
.row1 .d{font-size:11px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.row2{font-size:12px;color:var(--muted);margin-top:2px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.row3{font-size:11px;color:var(--muted);margin-top:4px;opacity:.8}
.empty{padding:24px 14px;color:var(--muted);font-size:12.5px;text-align:center}

/* ---------- sources ---------- */
.sources{
  border-top:1px solid var(--line);padding:8px 14px;max-height:74px;overflow-y:auto;
  display:flex;flex-wrap:wrap;gap:10px;font-size:10.5px;color:var(--muted);
}
.src{display:flex;align-items:center;gap:5px}
.src i{width:6px;height:6px;border-radius:50%;background:var(--muted);display:inline-block}
.src.ok i{background:var(--place)}
.src.err i{background:var(--alert)}
.src.load i{background:var(--event)}

/* ---------- map bits ---------- */
.pin{
  width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
  font-size:13px;border:2px solid rgba(255,255,255,.85);
  box-shadow:0 2px 8px rgba(0,0,0,.5);
}
.me{
  width:16px;height:16px;border-radius:50%;background:var(--accent);
  border:3px solid #fff;box-shadow:0 0 0 6px rgba(76,201,240,.25);
}
.leaflet-popup-content-wrapper,.leaflet-popup-tip{
  background:var(--bg-3);color:var(--text);border:1px solid var(--line);
}
.leaflet-popup-content{margin:10px 12px;font-size:12.5px;max-width:240px}
.leaflet-popup-content h3{margin:0 0 4px;font-size:13.5px}
.leaflet-popup-content a{color:var(--accent)}
.leaflet-container{background:#0d1117}
.leaflet-control-attribution{background:rgba(13,17,23,.8)!important;color:var(--muted)!important}
.leaflet-control-attribution a{color:var(--muted)!important}
.muted{color:var(--muted)}

/* ---------- modal ---------- */
.modal{position:fixed;inset:0;background:rgba(0,0,0,.6);display:grid;place-items:center;z-index:9999}
.modal.hidden{display:none}
.modal-card{
  background:var(--bg-2);border:1px solid var(--line);border-radius:14px;
  padding:20px;width:min(460px,92vw);
}
.modal-card h2{margin:0 0 6px;font-size:16px}
.modal-card p{font-size:12.5px;margin:0 0 14px}
.field{display:flex;flex-direction:column;gap:6px;font-size:12.5px;margin-bottom:14px}
.field em{color:var(--muted);font-style:normal}
.field input{
  padding:8px 10px;border-radius:8px;border:1px solid var(--line);
  background:var(--bg-3);color:var(--text);
}
.field small{color:var(--muted);font-size:11px}
.checkline{display:flex;gap:8px;align-items:center;font-size:12.5px;margin-bottom:16px}
.modal-actions{display:flex;gap:8px;justify-content:flex-end}

@media (max-width:860px){
  .topbar{flex-wrap:wrap}
  .search{order:3;max-width:none;flex-basis:100%}
  main{flex-direction:column}
  .panel{width:100%;flex:0 0 45%;border-right:none;border-bottom:1px solid var(--line)}
}

/* ---------- radar overlay ---------- */
button.ghost.on{background:var(--accent);color:#04121a;border-color:var(--accent)}
.radar-time{
  position:absolute;right:12px;bottom:26px;z-index:500;
  background:rgba(13,17,23,.85);border:1px solid var(--line);border-radius:8px;
  padding:5px 9px;font-size:11.5px;color:var(--text);font-variant-numeric:tabular-nums;
  pointer-events:none;
}
.radar-time.hidden{display:none}
.radar-time b{color:var(--accent);font-weight:650}
#map{position:relative}
