:root{
  --bg: #0b0f14; --panel: #0f172a; --panel2:#101826; --text:#e7ecf5; --muted:#a9b3c7;
  --gold:#d4af37; --lapis:#1e40af; --border:#22324a; --danger:#b00020;
  --light-bg:#f7f8fb; --light-text:#0b1220; --light-panel:#ffffff; --light-border:#e5e7eb;
}
html,body,#map{height:100%;margin:0}
body{font-family:system-ui,Segoe UI,Roboto,Arial}

body.dark{background:#0b0f14; color:var(--text)}
body.light{background:#f7f8fb; color:var(--light-text)}

.linkbar{position:sticky;top:0;z-index:5000;display:flex;gap:14px;align-items:center;padding:10px 14px;border-bottom:1px solid #1f2b40;background:var(--panel2)}
.linkbar a{color:var(--gold);text-decoration:none;font-weight:700}
.linkbar .brand{margin-left:auto; color:#9fb4ff}

body.light .linkbar{background:#0f172a; color:#fff}

/* Panels */
.panel{position:absolute; background:rgba(15,23,42,.96); backdrop-filter:blur(6px); border:1px solid var(--border); border-radius:14px; box-shadow:0 10px 30px rgba(0,0,0,.35); min-width:300px; max-width:92vw; top:82px; z-index:900}
.panel.left{left:12px}
.panel.right{right:12px}
.panel .hdr{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;background:linear-gradient(180deg,#0f172a,#0c1422);border-bottom:1px solid var(--border);border-radius:14px 14px 0 0}
.panel .body{padding:10px 12px;max-height:64vh;overflow:auto}
.btn{background:var(--lapis);color:#fff;border:none;border-radius:10px;padding:8px 10px;cursor:pointer;font-weight:600}
.btn.ghost{background:#1f2937;border:1px solid #374151}
.btn.danger{background:#611a1a;border:1px solid #7a1f1f}
.small{font-size:.9rem;color:var(--muted)}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.badge{display:inline-block;padding:2px 8px;border-radius:999px;background:#223055;margin:2px 6px 2px 0;color:#e5e7eb;font-size:.85rem}

/* light mode specifics for panels */
body.light .panel{background:rgba(255,255,255,.98); border:1px solid var(--light-border)}
body.light .panel .hdr{background:linear-gradient(180deg,#ffffff,#f3f6ff); border-bottom:1px solid var(--light-border)}
body.light .btn.ghost{background:#f2f4f7; border:1px solid #d1d9e6; color:#0b1220}

/* popups */
.leaflet-popup-content{color:#111}
