:root {
  --bg: #0f1115;
  --panel: #171a21;
  --line: #262b36;
  --text: #e8eaee;
  --muted: #98a0ad;
  --accent: #4c9aff;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--accent); }

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand { font-weight: 600; text-decoration: none; color: var(--text); }
.top nav { display: flex; gap: 16px; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }

/* --- карта --- */

.map-page { height: 100vh; display: flex; flex-direction: column; }
.map-wrap { position: relative; flex: 1; min-height: 0; }
.map { position: absolute; inset: 0; background: #10131a; }

.panel {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 300px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(23, 26, 33, .94);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

.panel .row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.panel label { color: var(--muted); font-size: 13px; }

.panel select {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #11141a;
  color: var(--text);
  font-size: 14px;
}

.legend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 12px 0 8px; }
.legend span { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

.counts { margin: 8px 0 4px; font-size: 13px; }
.hint { margin: 4px 0; font-size: 13px; color: #f0b429; min-height: 1em; }
.note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.card {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 290px;
  max-width: calc(100% - 24px);
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(23, 26, 33, .96);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

.card h3 { margin: 0 0 8px; font-size: 16px; }
.card .close {
  position: absolute; top: 6px; right: 8px;
  border: 0; background: none; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; text-align: right; }

.ol-attribution { font-size: 11px; }

/* --- текстовые страницы --- */

.page { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
.page h1 { font-size: 26px; margin: 8px 0 16px; }
.page h2 { font-size: 19px; margin: 28px 0 8px; }
.page ul { padding-left: 20px; }
.page li { margin: 4px 0; }
.page .lead { color: var(--muted); }

.button {
  display: inline-block;
  margin: 12px 0;
  padding: 11px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #08101d;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 620px) {
  .panel { width: calc(100% - 24px); }
  .card { width: calc(100% - 24px); }
}

/* --- форма кода доступа --- */

.gate { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 18px 0; }
.gate label { width: 100%; color: var(--muted); font-size: 13px; }

.gate input {
  flex: 1 1 200px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11141a;
  color: var(--text);
  font-size: 16px;
}

.gate .button { margin: 0; border: 0; cursor: pointer; font-size: 15px; }
