:root {
  --bg: #0d0f14; --bg2: #13161e; --border: #252a38; --text: #e2e8f0; --muted: #8892a4; --accent: #4f9cf9;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.5;
  display: grid; grid-template-rows: auto 1fr; grid-template-columns: 1fr 340px;
  grid-template-areas: "head head" "map panel"; height: 100vh;
}
header { grid-area: head; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 0.6rem 1rem; }
header h1 { font-size: 1.05rem; margin: 0.1rem 0; }
.back { color: var(--accent); text-decoration: none; font-size: 0.8rem; }
.back:hover { text-decoration: underline; }
.warn { color: var(--muted); font-size: 0.78rem; }
.warn strong { color: #f7b731; }
#map { grid-area: map; min-height: 300px; background: #dfe3e8; }
#panel { grid-area: panel; background: var(--bg2); border-left: 1px solid var(--border); overflow-y: auto; padding: 0.9rem; }
#toggle { display: none; }
section { margin-bottom: 1.1rem; }
h2 { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 0.4rem; font: inherit; }
label { display: block; padding: 0.15rem 0; cursor: pointer; }
label.slider { margin-top: 0.4rem; color: var(--muted); }
input[type=range] { width: 100%; }
.hint, .credit { color: var(--muted); font-size: 0.75rem; margin-top: 0.4rem; }
.notes ul { padding-left: 1.1rem; color: var(--muted); font-size: 0.82rem; }
.notes li { margin-bottom: 0.35rem; }
.notes a { color: var(--accent); }
#legend { margin-top: 0.6rem; }
#legend div { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; margin: 2px 0; }
#legend i { width: 16px; height: 12px; border-radius: 2px; border: 1px solid rgba(255,255,255,0.15); flex-shrink: 0; }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.1rem 0 0.35rem 1.4rem; }
.chips span { font-size: 0.68rem; padding: 0.05rem 0.4rem; border-radius: 10px; color: #fff; }
.chips .g { background: #2ea043; } .chips .n { background: #c49862; } .chips .w { background: #3478dc; }
#stats p { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.3rem; }
#stats b { color: var(--text); }
.leaflet-popup-content { font-size: 13px; line-height: 1.45; color: #1c2230; }
.leaflet-popup-content table { border-collapse: collapse; }
.leaflet-popup-content td { padding: 1px 8px 1px 0; }
.leaflet-popup-content td:last-child { font-weight: 600; text-align: right; }
@media (max-width: 800px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; grid-template-areas: "head" "map"; }
  #panel { position: fixed; left: 0; right: 0; bottom: 0; max-height: 55vh; z-index: 1000; border-left: 0;
           border-top: 1px solid var(--border); transform: translateY(100%); transition: transform 0.2s; }
  body.open #panel { transform: none; }
  #toggle { display: block; position: fixed; right: 10px; bottom: 10px; z-index: 1100; background: var(--accent);
            color: #fff; border: 0; border-radius: 20px; padding: 0.5rem 1rem; font: inherit; font-weight: 600; }
  .warn { font-size: 0.72rem; }
  header h1 { font-size: 0.95rem; }
}
.credit a { color: var(--accent); }
