:root {
  --bg: #0b1020;
  --panel: #111a2e;
  --panel-2: #182340;
  --line: #27345a;
  --text: #e8edf7;
  --muted: #8d9bbb;
  --accent: #ffb300;
  --accent-2: #ffd54a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}
a { color: var(--accent-2); }

/* ---------- layout ---------- */
#panel {
  width: 340px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-height: 0;
}
#map { flex: 1; position: relative; min-width: 0; min-height: 0; }
@media (max-width: 760px) {
  body { flex-direction: column; }
  #map { order: 1; flex: 1 1 55%; }
  #panel { order: 2; width: auto; flex: 0 0 45%; border-right: 0; border-top: 1px solid var(--line); }
}

/* ---------- panel header ---------- */
.brand {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 14px 6px;
}
.brand .logo { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: .02em; }
.brand .logo:hover { color: var(--accent-2); }
.brand .demo-name { color: var(--muted); font-size: 13px; }
.demos { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.demos a {
  font-size: 12px; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
}
.demos a:hover { color: var(--text); border-color: var(--muted); }
.demos a.current { color: #000; background: var(--accent); border-color: var(--accent); font-weight: 600; }

/* ---------- controls ---------- */
.controls { padding: 0 14px 10px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.controls input, .controls select, .controls button {
  width: 100%; font: inherit; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.controls input:focus, .controls select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.controls .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.controls button { cursor: pointer; background: var(--accent); color: #000; font-weight: 600; border-color: var(--accent); }
.controls button:hover { background: var(--accent-2); }
.count { color: var(--muted); font-size: 12px; }

/* ---------- list ---------- */
.list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; flex: 1; min-height: 0; }
.list li {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center;
  padding: 7px 14px; cursor: pointer; border-left: 3px solid transparent;
}
.list li:hover { background: var(--panel-2); }
.list li.active { background: var(--panel-2); border-left-color: var(--accent); }
.list .flag { font-size: 20px; line-height: 1; text-align: center; }
.list .name { font-weight: 600; }
.list .meta { color: var(--muted); font-size: 12px; }
.list .empty { color: var(--muted); padding: 20px 14px; text-align: center; }

/* ---------- info card ---------- */
.info { border-top: 1px solid var(--line); padding: 12px 14px; background: var(--panel-2); }
.info h2 { margin: 0; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.info .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.info dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 10px 0 8px; font-size: 13px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.badge { font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }

/* ---------- map helpers ---------- */
.loader {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
  background: var(--bg); color: var(--muted); font-size: 15px;
}
.loader.hidden { display: none; }
.map-note {
  position: absolute; left: 10px; bottom: 10px; z-index: 4;
  background: rgba(11,16,32,.75); color: var(--muted); font-size: 11px; padding: 4px 8px; border-radius: 6px;
  pointer-events: none;
}
