

:root {
  --bg-0: #08090b;
  --bg-1: #101216;
  --bg-2: #16181e;
  --line: #262932;
  --text-0: #e7e8ea;
  --text-1: #9a9da6;
  --text-2: #565963;
  --yellow: #FFCC00;
  --purple: #8A2BE2;
  --danger: #ff4d4d;
  --i1: #4fd18b;
  --i2: #c8e04a;
  --i3: #FFCC00;
  --i4: #ff8a3d;
  --i5: #ff4d4d;
  --mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--sans);
}
.hidden { display: none !important; }
a { color: var(--yellow); }

.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  height: calc(100vh - 44px - 38px);
  min-height: 420px;
}
.map {
  position: relative;
  background: #0d0f13;
  border-right: 1px solid var(--line);
}
.panel {
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-1);
}

.block { margin-bottom: 22px; }
.block-title {
  display: block;
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-2);
}
.muted { color: var(--text-2); }
.small { font-size: 11px; line-height: 1.5; margin: 8px 0 0; }

input[type="search"] {
  width: 100%;
  padding: 9px 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-0);
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: none;
}
input[type="search"]:focus { border-color: var(--yellow); }

.results { list-style: none; margin: 8px 0 0; padding: 0; }
.results li button {
  width: 100%;
  text-align: left;
  margin: 0 0 4px;
  padding: 7px 9px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-0);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}
.results li button:hover { border-color: var(--yellow); }
.results li.empty { font-size: 12px; color: var(--text-2); }
.results .num { color: var(--yellow); margin-right: 6px; }

.layer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 13px;
  cursor: pointer;
}
.layer input { accent-color: var(--yellow); margin: 0; }
.layer .muted { font-size: 11px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex: 0 0 auto; }
.sw-civil { background: #3a3f4a; }
.sw-bg { background: linear-gradient(90deg, #4cc9f0, #9bd34a, #ffcc00, #ff4d4d); }
.sw-beacon { background: #8A2BE2; border-radius: 50%; }

.legend { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--text-1); }
.legend li { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.lg { display: inline-block; flex: 0 0 auto; }
.lg-beacon { width: 12px; height: 12px; border-radius: 50%; background: #050607; border: 2px solid #c49cf5; box-shadow: 0 0 0 4px rgba(138,43,226,0.3); }
.lg-zone { width: 14px; height: 14px; border-radius: 50%; border: 1px dashed var(--yellow); background: rgba(255,204,0,0.12); }
.lg-me { width: 10px; height: 10px; border-radius: 50%; background: #FFCC00; box-shadow: 0 0 0 3px rgba(255,204,0,0.3); }
.legend-sub { margin: 12px 0 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--text-2); }
.scale { display: flex; }
.scale span {
  flex: 1;
  padding: 3px 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--bg-0);
}
.scale-names { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; margin-top: 4px; }
.scale-names span { font-size: 9px; letter-spacing: 0.04em; color: var(--text-2); text-align: center; }
.scale .i1 { background: var(--i1); }
.scale .i2 { background: var(--i2); }
.scale .i3 { background: var(--i3); }
.scale .i4 { background: var(--i4); }
.scale .i5 { background: var(--i5); }

button {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--bg-0);
  background: var(--yellow);
  border: 1px solid var(--yellow);
  border-radius: 3px;
  cursor: pointer;
}
button.secondary { color: var(--yellow); background: transparent; }

footer.sys-note {
  padding: 12px 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-2);
  border-top: 1px solid var(--line);
}

.leaflet-container { font-family: var(--sans); }
.leaflet-bar a:hover { background: var(--bg-2); color: var(--yellow); }
.sw-anomaly { background: #4c8dff; border-radius: 50%; }
.sw-team { background: #7cffb2; border-radius: 50%; }
.lg-anomaly { width: 12px; height: 12px; border-radius: 50%; background: #4c8dff; box-shadow: 0 0 6px #4c8dff; }
.lg-hospital { width: 12px; height: 12px; border-radius: 3px; background: #7cffb2; }
.lg-team { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #7cffb2; background: var(--bg-0); }
.grad { height: 8px; border-radius: 2px; background: linear-gradient(90deg, #4cc9f0 0%, #26a69a 10%, #2fa36b 20%, #9bd34a 32%, #d6de3c 44%, #ffcc00 55%, #ff9f1a 70%, #ff4d4d 85%, #b02bff 100%); }
.grad-ticks { display: flex; justify-content: space-between; margin-top: 3px; font-family: var(--mono); font-size: 10px; color: var(--text-2); }
.grad-ticks b { font-weight: 400; }
.term-link { display: block; margin-top: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 3px; color: var(--text-0); text-align: center; text-decoration: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; }
.term-link:hover { border-color: var(--yellow); color: var(--yellow); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg-1); color: var(--text-0); border: 1px solid var(--line); }
.leaflet-popup-content { font-size: 13px; line-height: 1.5; }
.leaflet-popup-content .num { font-family: var(--mono); color: var(--yellow); }
.leaflet-popup-content a.map-link { display: inline-block; margin-top: 6px; padding: 6px 10px; background: var(--yellow); color: #111; text-decoration: none; font-family: var(--mono); font-weight: 700; letter-spacing: 1px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-1); }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .map { height: 62vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .panel { padding: 16px; }
}
