:root {
  /* === фирменная палитра HURMA LOMBARD (brandbook 10.03.2026) === */
  --h-orange: #DF7E18;   /* основной бренд-цвет */
  --h-orange-bright: #f08a1e;
  --h-gold: #F9BB42;
  --h-brown: #59482D;
  --h-brown-deep: #3a2f1c;
  --h-cream: #F7F2E2;
  --h-khaki: #9C814A;
  --h-teal: #196960;

  /* === семантические токены (ТЁМНАЯ тема — по умолчанию) === */
  --bg: #0a0a0b;
  --bg-2: #131316;
  --surface: #131316;
  --surface-2: #0d0d0f;
  --surface-3: #1c1c1f;
  --bg-card: rgba(19, 19, 22, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  /* нейтральный ramp: чуть холодные серые в тон #0a0a0b/#131316 — без бежевого налёта */
  --text: #f0f1f4;
  --text-muted: #a3a8b2;
  --text-dim: #787d87;
  --accent: var(--h-orange);
  --accent-bright: var(--h-orange-bright);
  --accent-2: var(--h-gold);
  --accent-ink: #231404;
  --accent-soft: rgba(223, 126, 24, 0.16);
  --accent-line: rgba(223, 126, 24, 0.5);
  --teal: #2aa198;
  --brown: var(--h-brown);
  --cream: var(--h-cream);
  --online: #3fb56b;
  --online-glow: rgba(63, 181, 107, 0.5);
  --offline: #e5533d;
  --offline-glow: rgba(229, 83, 61, 0.5);
  --unknown: #9c8a63;
  --router: var(--h-gold);
  --router-glow: rgba(249, 187, 66, 0.6);
  --server: var(--h-teal);
  --server-glow: rgba(25, 105, 96, 0.55);
  --grid-line: rgba(223, 126, 24, 0.035);
  --chip-bg: rgba(255, 255, 255, 0.045);
  --chip-bg-strong: rgba(0, 0, 0, 0.28);
  --font: 'Mulish', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --header-h: 92px;
}

/* === СВЕТЛАЯ тема === */
:root[data-theme="light"] {
  --bg: #f7f7f8;
  --bg-2: #efeff1;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #f0f0f2;
  --bg-card: rgba(255, 255, 255, 0.88);
  --border: rgba(89, 72, 45, 0.18);
  --border-strong: rgba(89, 72, 45, 0.34);
  --text: #3a2f1c;
  --text-muted: #7a6a4a;
  --text-dim: #8a744e;      /* было #a1906a — контраст 2.9:1 (провал AA) */
  --accent-ink: #231404;    /* было #ffffff — белый на оранжевом 2.9:1 (провал AA) */
  --accent-soft: rgba(223, 126, 24, 0.14);
  --accent-line: rgba(223, 126, 24, 0.55);
  --teal: #167a70;
  --online: #2e9e57;
  --online-glow: rgba(46, 158, 87, 0.4);
  --offline: #cf3e28;
  --offline-glow: rgba(207, 62, 40, 0.4);
  --unknown: #a1906a;
  --grid-line: rgba(89, 72, 45, 0.05);
  --chip-bg: rgba(89, 72, 45, 0.06);
  --chip-bg-strong: rgba(89, 72, 45, 0.12);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f7f8; --bg-2: #efeff1;
    --surface: #ffffff; --surface-2: #f7f7f8; --surface-3: #f0f0f2;
    --bg-card: rgba(255, 255, 255, 0.88);
    --border: rgba(89, 72, 45, 0.18); --border-strong: rgba(89, 72, 45, 0.34);
    --text: #3a2f1c; --text-muted: #7a6a4a; --text-dim: #8a744e;
    --accent-ink: #231404; --accent-soft: rgba(223, 126, 24, 0.14); --accent-line: rgba(223, 126, 24, 0.55);
    --teal: #167a70;
    --online: #2e9e57; --online-glow: rgba(46, 158, 87, 0.4);
    --offline: #cf3e28; --offline-glow: rgba(207, 62, 40, 0.4);
    --unknown: #a1906a; --grid-line: rgba(89, 72, 45, 0.05);
    --chip-bg: rgba(89, 72, 45, 0.06); --chip-bg-strong: rgba(89, 72, 45, 0.12);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(223, 126, 24, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(223, 126, 24, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.bg-glow--1 { width: 500px; height: 500px; top: -100px; left: -100px; background: rgba(223, 126, 24, 0.08); }
.bg-glow--2 { width: 400px; height: 400px; bottom: -50px; right: -50px; background: rgba(25, 105, 96, 0.06); }

/* Header */
.header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
  padding: 1.25rem 1.5rem 1.15rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header__brand { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.header__logo {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(223,126,24,0.2), rgba(25,105,96,0.2));
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--accent);
}
.header__logo svg { width: 28px; height: 28px; }
.header__logo--brand {
  background: transparent;
  border: none;
  width: 42px; height: 42px;
  filter: drop-shadow(0 3px 8px rgba(223, 126, 24, 0.35));
}
.header__logo--brand svg { width: 40px; height: 40px; }

/* вордмарк HURMA LOMBARD */
.brandword {
  font-weight: 900;
  font-size: 1.32rem;
  letter-spacing: 0.01em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.bw-hurma { color: var(--h-orange); }
.bw-lombard { color: var(--brown); }
:root[data-theme="dark"] .bw-lombard,
:root:not([data-theme="light"]) .bw-lombard { color: var(--h-khaki); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .bw-lombard { color: var(--brown); }
}

/* иконочная кнопка (тема) */
.btn--icon {
  padding: 0.5rem;
  width: 40px; height: 40px;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.btn--icon:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); transform: translateY(-1px); }

.header h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.header__sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; line-height: 1.3; }

.stats {
  display: flex;
  gap: 1rem;
  flex: 1;
  justify-content: center;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem 0.65rem;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 90px;
  min-height: 58px;
}
.stat__value { font-size: 1.5rem; font-weight: 700; font-family: var(--mono); line-height: 1.1; }
.stat__label { font-size: 0.7rem; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.05em; line-height: 1.2; }
.stat--online .stat__value { color: var(--online); }
.stat--offline .stat__value { color: var(--offline); }
.stat--unknown .stat__value { color: var(--unknown); }
.stat--branches .stat__value { color: var(--online); font-size: 1.35rem; }

.btn--ghost {
  text-decoration: none;
  background: var(--chip-bg);
  border-color: var(--border);
  color: var(--text-muted);
}
.btn--ghost:hover {
  color: var(--text);
  border-color: rgba(223,126,24,0.3);
  transform: translateY(-1px);
}

.region-sector {
  stroke-width: 1;
  opacity: 0.15;
}
.region-label {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-anchor: middle;
  pointer-events: none;
  opacity: 0.7;
}

.uptime-bar {
  margin-top: 0.75rem;
}
.uptime-bar__track {
  height: 6px;
  background: var(--chip-bg-strong);
  border-radius: 3px;
  overflow: hidden;
}
.uptime-bar__fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.uptime-bar__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.history-chart {
  margin-top: 0.75rem;
  width: 100%;
  height: 48px;
  border-radius: 6px;
  background: var(--chip-bg);
}

.node-item__region {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.last-check { font-size: 0.8rem; color: var(--text-muted); font-family: var(--mono); }

/* Легаси-блок .btn (оранжевый градиент + подпрыгивание на hover) удалён 04.08:
   кнопки без модификатора («На карту»/«Очистить» в гео-форме, .btn--small) наследовали
   старый неоновый вид и выбивались из плоских кнопок топбара. Базовый вид — ниже (:1444). */

/* Main layout */
.main {
  position: relative;
  z-index: 5;
  display: flex;
  height: calc(100vh - var(--header-h));
}

.sidebar {
  width: 348px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.railnav {
  width: 168px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  transition: width .18s var(--ease);
}
.railnav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 4px 8px;
}
.railnav__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 0 6px;
}
.railnav__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.railnav__toggle .ic { width: 16px; height: 16px; transition: transform .18s var(--ease); }
.railnav__toggle:hover { color: var(--text); background: var(--chip-bg); }
.railnav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--r);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.railnav__item .ic { width: 18px; height: 18px; flex-shrink: 0; }
.railnav__item:hover { color: var(--text); background: var(--chip-bg); }
.railnav__item.is-active { color: var(--accent); background: var(--accent-soft); }
.railnav__item--soon { opacity: .45; cursor: not-allowed; }
.railnav__item--soon:hover { background: none; color: var(--text-muted); }
.railnav__item--bottom { margin-top: auto; }
/* «Настройки» — кнопка, а не ссылка: сброс под общий вид рейла */
button.railnav__item { background: none; border: none; width: 100%; text-align: left; font-family: inherit; }

/* гамбургер в топбаре — раскрывает/сворачивает нав-рейл (та же логика, что стрелки в рейле) */
.burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-right: 4px; flex: none;
  border: 1px solid var(--border); border-radius: 9px; background: none;
  color: var(--text-muted); cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}
.burger:hover { color: var(--text); background: var(--chip-bg); border-color: var(--border-strong); }
.burger .ic { width: 19px; height: 19px; }

/* стрелка-сворачивание в рейле больше не нужна — сворачиваем гамбургером в топбаре */
.railnav__toggle { display: none; }

/* Свёрнутое состояние — только иконки, подписи всплывают через title/tooltip */
:root[data-rail="collapsed"] .railnav { width: 60px; }
:root[data-rail="collapsed"] .railnav__label,
:root[data-rail="collapsed"] .railnav__label-text { display: none; }
:root[data-rail="collapsed"] .railnav__head { justify-content: center; }
:root[data-rail="collapsed"] .railnav__item { justify-content: center; padding: 10px 6px; }
:root[data-rail="collapsed"] .railnav__toggle .ic { transform: rotate(180deg); }

.sidebar__section { padding: 1rem; border-bottom: 1px solid var(--border); }
.sidebar__section--filters {
  padding: 0.75rem 1rem 1rem;
}
.sidebar__section--grow { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.sidebar__list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.sidebar__list-head .sidebar__title { margin-bottom: 0; }
.sidebar__list-count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(223, 126, 24, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}
.sidebar__title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.75rem; }

.search-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.search {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--chip-bg-strong);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.search:focus { border-color: rgba(223,126,24,0.5); }

.filter-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
.filter {
  min-width: 0;
  padding: 0.48rem 0.35rem;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.filter:hover { border-color: rgba(223,126,24,0.3); color: var(--text); }
.filter.active { background: rgba(223,126,24,0.15); border-color: rgba(223,126,24,0.4); color: var(--accent); }
.filter--warn { color: #f0a24b; border-color: rgba(240,120,50,0.35); }
.filter--warn.active { background: rgba(230,90,50,0.18); border-color: rgba(230,90,50,0.55); color: #ff9a5b; }
.node-item__meta--warn { color: #f0824b; font-weight: 600; }

.node-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* пустой результат поиска/фильтра — иначе голая пустота читается как поломка */
.node-list__empty { padding: 28px 16px; text-align: center; color: var(--text-dim); font-size: 0.85rem; line-height: 1.5; }

.node-list::-webkit-scrollbar { width: 4px; }
.node-list::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.3); border-radius: 2px; }

.node-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.node-item:hover { background: rgba(223,126,24,0.08); }
.node-item.selected { background: rgba(223,126,24,0.12); border-color: rgba(223,126,24,0.3); }
.node-item__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.node-item__num {
  flex-shrink: 0;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}
.node-item__num--infra {
  font-size: 0.62rem;
  color: var(--accent);
  border-color: rgba(223, 126, 24, 0.25);
}
.node-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.node-item__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
/* кегли подняты (было 0.6/0.65rem ≈ 9.6/10.4px — главная строка статуса на грани читаемости) */
.node-item__meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-item__status {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}
.node-item__status--online { background: rgba(34,197,94,0.15); color: var(--online); }
.node-item__status--offline { background: rgba(239,68,68,0.15); color: var(--offline); }
.node-item__status--unknown { background: rgba(120,125,135,0.15); color: var(--text-muted); }
/* фиксированная ширина — иначе бейджи ON/OFF гуляют по горизонтали от строки к строке */
.node-item__ping {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 5.5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.node-item__ip { font-family: var(--mono); font-size: 0.7rem; color: var(--text-muted); }

.detail-panel {
  flex: 0 1 auto;
  min-height: 100px;
  max-height: 46vh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
.detail-panel--branch {
  min-height: 280px;
  max-height: 58vh;
  background: rgba(223, 126, 24, 0.04);
  border-top: 1px solid rgba(223, 126, 24, 0.2);
}
.detail-card__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.detail-card__toolbar-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.detail-card__toolbar-main h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
}
.detail-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}
.detail-close:hover {
  color: var(--text);
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
}
.detail-panel::-webkit-scrollbar { width: 4px; }
.detail-panel::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 2px; }
.sidebar--branch-open .sidebar__section--grow {
  flex: 1 1 35%;
  min-height: 120px;
}
.detail-placeholder { font-size: 0.8rem; color: var(--text-muted); text-align: center; padding: 1rem 0; }
.detail-branch-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(223, 126, 24, 0.12);
  border: 1px solid rgba(223, 126, 24, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  margin: 0;
  flex-shrink: 0;
}
.detail-card h4 { font-size: 0.95rem; margin-bottom: 0.75rem; }
.detail-row { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 0.3rem 0; border-bottom: 1px solid rgba(148,163,184,0.08); }
.detail-row span:first-child { color: var(--text-muted); }
.detail-row span:last-child { font-family: var(--mono); }
.detail-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.detail-status--online { background: rgba(34,197,94,0.15); color: var(--online); }
.detail-status--offline { background: rgba(239,68,68,0.15); color: var(--offline); }
.detail-status--unknown { background: rgba(100,116,139,0.15); color: var(--unknown); }

/* Map */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #1c2a42;
}
.map-container::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 40px rgba(6, 10, 20, 0.18);
}
.map-container::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: rgba(186, 198, 214, 0.1);
}

.map-viewport {
  width: 100%;
  height: 100%;
  cursor: grab;
  overflow: hidden;
}
.map-viewport:active { cursor: grabbing; }

#map-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.map-toolbar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 20;
}

.map-btn {
  width: 36px; height: 36px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.map-btn:hover { border-color: rgba(223,126,24,0.4); color: var(--accent); }
.map-btn--active {
  background: rgba(223, 126, 24, 0.2);
  border-color: rgba(223, 126, 24, 0.45);
  color: var(--accent);
}

.leaflet-map {
  width: 100%;
  height: 100%;
  background: var(--surface);
  z-index: 1;
}

.leaflet-container {
  font-family: var(--font);
  background: var(--surface);
}

/* Тёмная тема: осветляем тёмные тайлы CARTO. В светлой — тайлы уже светлые, фильтр не нужен. */
.leaflet-tile-pane {
  filter: brightness(1.55) contrast(0.84) saturate(0.75);
}
:root[data-theme="light"] .leaflet-tile-pane { filter: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .leaflet-tile-pane { filter: none; }
}

.leaflet-control-zoom {
  display: none !important;
}

.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover {
  background: rgba(223, 126, 24, 0.15) !important;
  color: var(--accent) !important;
}

.leaflet-control-attribution {
  background: var(--bg-card) !important;
  color: var(--text-muted) !important;
  font-size: 0.65rem !important;
  backdrop-filter: blur(8px);
}
.leaflet-control-attribution a { color: var(--accent) !important; }

.leaflet-div-icon,
.leaflet-marker-icon.map-marker-icon {
  background: transparent !important;
  border: none !important;
}

.leaflet-marker-icon .map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.68rem;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  box-sizing: border-box;
}
.map-marker:hover { transform: scale(1.12); z-index: 1000 !important; }
.map-marker--selected {
  transform: scale(1.18);
  box-shadow: 0 0 0 3px rgba(223, 126, 24, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1001 !important;
}
.map-marker--online { background: var(--online); }
.map-marker--offline { background: var(--offline); }
.map-marker--unknown { background: var(--unknown); }
.map-marker--branch.map-marker--online { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 10px var(--online-glow); }
.map-marker--branch.map-marker--offline { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 10px var(--offline-glow); }
.map-marker--router {
  width: 38px;
  height: 38px;
  background: var(--router);
  font-size: 0.65rem;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 12px var(--router-glow);
}
.map-marker--server {
  width: 30px;
  height: 30px;
  background: var(--server);
  font-size: 0.58rem;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 10px var(--server-glow);
}
.map-marker__num { line-height: 1; }

/* Popup на карте */
.map-popup-wrap .leaflet-popup-content-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.map-popup-wrap .leaflet-popup-tip { background: var(--surface); }
.map-popup-wrap .leaflet-popup-content { margin: 0.75rem 1rem; line-height: 1.4; }
.map-popup__num {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.map-popup__title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.map-popup__status { font-size: 0.78rem; margin-bottom: 0.25rem; }
.map-popup__status--online { color: var(--online); }
.map-popup__status--offline { color: var(--offline); }
.map-popup__status--unknown { color: var(--unknown); }
.map-popup__ip { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }
.map-popup__addr {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  border-top: 1px solid var(--border);
  padding-top: 0.35rem;
  line-height: 1.35;
}
.map-popup__link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
}
.map-popup__link:hover { text-decoration: underline; }

.legend__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  background: var(--online);
  border: 2px solid #fff;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
}

.legend {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  background: rgba(71, 85, 105, 0.9);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text);
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.legend__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
  white-space: nowrap;
}
.legend__chip:hover {
  color: var(--text);
  border-color: rgba(223, 126, 24, 0.35);
  background: rgba(223, 126, 24, 0.1);
}
.legend__chip--active {
  color: var(--text);
  border-color: rgba(223, 126, 24, 0.5);
  background: rgba(223, 126, 24, 0.18);
  box-shadow: 0 0 0 1px rgba(223, 126, 24, 0.15);
}
.legend__chip:active { transform: scale(0.97); }

/* Неоновая граница Узбекистана (SVG-пути слоёв Leaflet) */
.uz-border-glow { filter: drop-shadow(0 0 4px var(--accent)) drop-shadow(0 0 9px var(--accent-2)); }
.uz-border-core { filter: drop-shadow(0 0 3px var(--accent-2)) drop-shadow(0 0 7px var(--accent)); }

.legend__item { display: flex; align-items: center; gap: 0.4rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot--online { background: var(--online); box-shadow: 0 0 6px var(--online-glow); }
.dot--offline { background: var(--offline); box-shadow: 0 0 6px var(--offline-glow); }
.dot--unknown { background: var(--unknown); }
.dot--router { background: var(--router); box-shadow: 0 0 6px var(--router-glow); }
.dot--server { background: var(--server); box-shadow: 0 0 6px var(--server-glow); }
.dot--camera { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.45); }
.dot--competitor { background: #ff7a1a; box-shadow: 0 0 6px rgba(255, 122, 26, 0.6); border-radius: 2px; }

.legend__hint { color: var(--text-muted); font-style: italic; }

/* P4 «Конкуренты» — легенда + маркеры */
.legend__sep { width: 1px; align-self: stretch; background: rgba(120, 140, 175, 0.28); margin: 2px 3px; }
.legend__chip--comp.legend__chip--active { border-color: rgba(255, 122, 26, 0.55); background: rgba(255, 122, 26, 0.18); box-shadow: 0 0 0 1px rgba(255, 122, 26, 0.18); color: var(--text); }
.legend__chip--add { font-size: 16px; font-weight: 700; padding: 4px 10px; line-height: 1; color: #ff9d54; }
.legend__chip--add:hover { border-color: rgba(255, 122, 26, 0.55); }

.map-marker--competitor {
  width: 18px; height: 18px; border-radius: 3px;
  background: linear-gradient(135deg, #ff8a2b, #ff5e1a);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 8px rgba(255, 110, 26, 0.85), 0 2px 6px rgba(0, 0, 0, 0.5);
  transform: rotate(0deg);
}
.map-marker--comp-closed { filter: grayscale(0.7) opacity(0.7); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.map-popup__status--comp { color: #ff9d54; }
.map-popup__comp-actions { display: flex; gap: 8px; margin-top: 10px; }
.map-comp-btn { flex: 1; padding: 6px 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); border-radius: 7px; font-size: 12.5px; cursor: pointer; }
.map-comp-btn:hover { border-color: var(--accent); }
.map-comp-btn--del:hover { border-color: #fb7185; color: #fb7185; }

/* Uzbekistan map background */
.uzbekistan-bg path {
  fill: rgba(18, 32, 52, 0.94);
  stroke: rgba(223, 126, 24, 0.32);
  stroke-width: 1.1;
  transition: fill 0.2s, stroke 0.2s;
}
.uzbekistan-bg path.uz-region--active {
  fill: rgba(223, 126, 24, 0.14);
  stroke: rgba(223, 126, 24, 0.45);
}

.region-labels text {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  fill: rgba(148, 163, 184, 0.55);
  text-anchor: middle;
  pointer-events: none;
  letter-spacing: 0.02em;
}

.city-dot {
  fill: rgba(148, 163, 184, 0.5);
  stroke: rgba(226, 232, 240, 0.25);
  stroke-width: 0.5;
  pointer-events: none;
}
.city-dot--major {
  fill: rgba(223, 126, 24, 0.7);
  stroke: rgba(223, 126, 24, 0.4);
}
.city-label {
  font-family: var(--font);
  font-size: 7.5px;
  fill: rgba(148, 163, 184, 0.75);
  text-anchor: middle;
  pointer-events: none;
}
.city-label--major {
  font-size: 10px;
  font-weight: 600;
  fill: rgba(203, 213, 225, 0.9);
}
.city-label--town {
  font-size: 6.5px;
  fill: rgba(100, 116, 139, 0.8);
}

.legend__toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
}
.legend__toggle input { accent-color: var(--accent); }
.map-node { cursor: grab; }
.map-node.dragging { cursor: grabbing; }
.map-node.dragging circle { filter: brightness(1.4); }

/* SVG guides */
.guide-ring {
  fill: none;
  stroke: rgba(223, 126, 24, 0.1);
  stroke-width: 1;
  stroke-dasharray: 6 8;
}
.guide-ring--hub {
  stroke: rgba(223, 126, 24, 0.2);
  stroke-width: 1.5;
  stroke-dasharray: none;
}
.guide-ring--servers {
  stroke: rgba(25, 105, 96, 0.25);
  stroke-width: 1.5;
  stroke-dasharray: 8 6;
}
.guide-sector {
  stroke: rgba(148, 163, 184, 0.04);
  stroke-width: 1;
}

/* SVG nodes */
.link-line {
  stroke: url(#tunnel-gradient);
  stroke-width: 1.2;
  fill: none;
  opacity: 0.5;
  transition: opacity 0.3s, stroke 0.3s;
}
.link-line--active { opacity: 0.85; stroke: rgba(223,126,24,0.5); }
.link-line--offline { stroke: rgba(239,68,68,0.35); opacity: 0.45; }

.map-node { cursor: pointer; }
.map-node circle { transition: r 0.2s, fill 0.3s, stroke 0.3s; }
.map-node:hover circle { filter: brightness(1.3); }
.map-node.selected circle { stroke-width: 3; }

.map-node--router .node-ring {
  animation: pulse-ring 3s ease-in-out infinite;
}
.map-node--server .node-core {
  animation: pulse-server 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 0.3; r: 28; }
  50% { opacity: 0.6; r: 32; }
}
@keyframes pulse-server {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.node-label {
  font-family: var(--font);
  font-size: 9px;
  fill: var(--text-muted);
  text-anchor: middle;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.map-node:hover .node-label,
.map-node.selected .node-label { opacity: 1; }
.map-node--router .node-label,
.map-node--server .node-label { opacity: 1; font-size: 11px; fill: var(--text); font-weight: 600; }
.map-node--server-room.map-node--server .node-label { opacity: 0; font-size: 8px; }
.map-node--server-room.map-node--server:hover .node-label,
.map-node--server-room.map-node--server.selected .node-label { opacity: 1; }
.map-node--router .node-label { opacity: 0; }
.map-node--router:hover .node-label,
.map-node--router.selected .node-label { opacity: 1; }
.map-node--server-room .node-label--datacenter {
  opacity: 0;
  font-size: 8px;
  fill: var(--text);
  font-weight: 600;
}
.map-node--server-room:hover .node-label--datacenter,
.map-node--server-room.selected .node-label--datacenter { opacity: 1; }
.map-node--server-room.map-node--router .node-label--datacenter {
  font-size: 10px;
}

/* Checking overlay */
.checking-overlay {
  position: fixed;
  top: var(--header-h);
  left: calc(168px + 348px); /* рейл + сайдбар; было 280px от старого макета — баннер лёг на список */
  right: 0;
  padding: 0.5rem;
  background: rgba(223,126,24,0.1);
  border-bottom: 1px solid rgba(223,126,24,0.2);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--accent);
  z-index: 15;
}
.checking-overlay.visible { display: flex; }

.checking-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(223,126,24,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* GPS / unplaced zone */
.unplaced-zone rect {
  fill: rgba(15, 23, 42, 0.55);
  stroke: rgba(148, 163, 184, 0.35);
  stroke-width: 1;
  stroke-dasharray: 6 4;
}
.unplaced-zone text {
  fill: #94a3b8;
  font-size: 11px;
  font-family: var(--sans);
  font-weight: 600;
}
.map-node--unplaced .node-core {
  stroke-dasharray: 3 2;
  opacity: 0.85;
}
.server-room-zone rect {
  fill: rgba(223, 126, 24, 0.06);
  stroke: rgba(223, 126, 24, 0.45);
  stroke-width: 1.5;
}
.server-room-zone text {
  fill: var(--accent);
  font-size: 11px;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.map-node--server-room .node-core {
  stroke: rgba(25, 105, 96, 0.5);
}
.map-node--geo .node-core {
  stroke: rgba(223, 126, 24, 0.6);
  stroke-width: 2;
}
.map-node--cluster {
  cursor: zoom-in;
}
.map-node--cluster:hover circle {
  filter: brightness(1.15);
}
.cluster-label {
  pointer-events: none;
  user-select: none;
}
.node-item__geo {
  font-size: 0.7rem;
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
}
.node-item__geo--none {
  color: var(--text-muted);
  opacity: 0.6;
}
.geo-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.geo-address-wrap {
  position: relative;
  margin-bottom: 0.5rem;
}
.geo-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 30;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.geo-suggest__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
}
.geo-suggest__item:hover,
.geo-suggest__item:focus {
  background: rgba(223, 126, 24, 0.12);
  outline: none;
}
.geo-suggest__item:last-child {
  border-bottom: none;
}
.geo-suggest__label {
  font-size: 0.75rem;
  line-height: 1.35;
}
.geo-suggest__meta {
  font-size: 0.68rem;
  color: var(--accent);
  font-family: var(--mono);
}
.geo-suggest__empty {
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.geo-distance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.5rem;
  background: rgba(223, 126, 24, 0.08);
  border: 1px solid rgba(223, 126, 24, 0.2);
  border-radius: 6px;
  font-size: 0.78rem;
}
.geo-distance__label {
  color: var(--text-muted);
}
.geo-distance__value {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 600;
}
.geo-block--primary {
  margin-top: 0;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--chip-bg);
  border: 1px solid var(--accent-line);
  border-radius: 10px;
}
.geo-input--address {
  font-family: var(--font);
  font-size: 0.82rem;
}
.geo-hint--info {
  margin-top: 0.75rem;
  padding: 0.5rem 0.6rem;
  background: rgba(100, 116, 139, 0.12);
  border-radius: 6px;
}
.detail-meta {
  margin-top: 0.25rem;
}
.geo-block {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.geo-block h5 {
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.geo-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.geo-hint code {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
}
.geo-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.4rem;
  background: var(--chip-bg-strong);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.geo-input:focus {
  outline: none;
  border-color: rgba(223, 126, 24, 0.45);
}
.geo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.geo-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.btn--small {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}
.geo-status {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: #22c55e;
}
.geo-status--warn {
  color: #fbbf24;
}
.geo-error {
  font-size: 0.72rem;
  color: #ef4444;
  margin-top: 0.35rem;
  min-height: 1em;
}

/* Responsive. Старый блок правил .header/.stats — классы редизайна их не используют,
   реальной адаптации не было. Порог 1280px: ноутбук 1366px в полуэкране / зум 125%. */
@media (max-width: 1280px) {
  .sidebar { width: 280px; }
  .checking-overlay { left: calc(168px + 280px); }
  .kpis .kpi__lbl { display: none; }          /* оставляем числа, подписи в title */
  .kpis { gap: 10px; }
  .legend { flex-wrap: wrap; justify-content: center; max-width: 95%; gap: 0.6rem 1rem; }
}
@media (max-width: 1024px) {
  .sidebar { width: 240px; }
  .checking-overlay { left: calc(168px + 240px); }
  .btn__label { display: none; }              /* кнопки топбара — только иконки */
}

/* ═══════════ РЕДИЗАЙН · Фаза 1: визуальный язык + шапка + хром карты ═══════════ */
:root { --r: 8px; --r-lg: 12px; --ease: cubic-bezier(.2,.7,.2,1); --header-h: 64px; }

/* убрать декоративный фон (glow-орбы/сетка) — не «AI-dark» */
.bg-grid, .bg-glow { display: none !important; }

/* ── верхняя панель ── */
.topbar {
  position: relative; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  height: 64px; padding: 0 18px;
  background: var(--bg-card); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar__left { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 2px 5px rgba(223,126,24,.3)); }
.brand__logo svg { width: 34px; height: 34px; }
.brand__word { font-weight: 800; font-size: 1.05rem; letter-spacing: .01em; display: flex; gap: 3px; }
.brand__word b { color: var(--h-orange); font-weight: 900; }
.brand__word span { color: var(--text-muted); }
:root[data-theme="light"] .brand__word span { color: var(--brown); }

.topnav { display: flex; gap: 2px; }
.topnav__link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--r); color: var(--text-muted);
  text-decoration: none; font-size: .9rem; font-weight: 600;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.topnav__link .ic { width: 17px; height: 17px; }
.topnav__link:hover { color: var(--text); background: var(--chip-bg); }
.topnav__link.is-active { color: var(--accent); background: var(--accent-soft); }

/* KPI как компактные чипы */
.kpis { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center; flex-wrap: wrap; }
.kpi {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--border);
  font-size: .82rem; white-space: nowrap;
}
.kpi__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kpi__dot--online { background: var(--online); }
.kpi__dot--offline { background: var(--offline); }
.kpi__val { font-family: var(--mono); font-weight: 700; color: var(--text); font-size: .9rem; }
.kpi__lbl { color: var(--text-muted); }
.kpi--time { background: transparent; border-color: transparent; color: var(--text-dim); }
.kpi--time .ic { width: 15px; height: 15px; color: var(--text-dim); }

.topbar__right { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }

/* кнопки — иерархия, без неона */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r);
  /* по умолчанию — вид --secondary (модификаторы ниже перекрывают) */
  background: var(--chip-bg); color: var(--text); border: 1px solid var(--border);
  font-family: var(--font); font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease), transform .05s;
}
.btn:not([class*="btn--"]):hover { border-color: var(--accent-line); color: var(--accent); }
.btn .ic { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-bright); }
.btn--secondary { background: var(--chip-bg); color: var(--text); border-color: var(--border); }
.btn--secondary:hover { border-color: var(--accent-line); color: var(--accent); }

/* Бегущий блик (порт Animated Shiny Button, Eldora UI → чистый CSS).
   ПРАВИЛО: одна такая кнопка на экран — главное действие. Если блестят все,
   глаз перестаёт их различать и подсказка «вот главное» пропадает. */
.btn--shiny { position: relative; overflow: hidden; }
.btn--shiny::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.42) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: hurmaShine 3.6s var(--ease, ease-in-out) infinite;
}
.btn--shiny:disabled::after { animation: none; opacity: 0; }
@keyframes hurmaShine { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(120%); } }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--r);
  background: var(--chip-bg); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.iconbtn .ic { width: 19px; height: 19px; }
.iconbtn:hover, .iconbtn.is-active { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ── хром карты: слои + зум ── */
.map-controls { position: absolute; top: 14px; left: 14px; z-index: 15; }
.map-zoom { position: absolute; top: 14px; right: 14px; z-index: 15; display: flex; flex-direction: column; gap: 6px; }
.iconbtn--map { width: 40px; height: 40px; background: var(--bg-card); backdrop-filter: blur(10px); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.layers-menu {
  position: absolute; top: 48px; left: 0; width: 224px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.5); padding: 8px; z-index: 16;
}
.layers-menu__group { padding: 4px; }
.layers-menu__group + .layers-menu__group { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.layers-menu__title { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); padding: 2px 6px 6px; }
.lm-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 10px; border: none; background: none; border-radius: var(--r); color: var(--text);
  font-size: .88rem; cursor: pointer; transition: background .14s var(--ease);
}
.lm-item:hover { background: var(--chip-bg); }
.lm-item.legend__chip--active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.lm-item--add { color: var(--accent); font-weight: 600; }
.lm-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* маркеры — чище, меньше свечения */
.map-marker { box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.map-marker--branch.map-marker--online,
.map-marker--branch.map-marker--offline { box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.map-marker--router, .map-marker--server { box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.map-marker--selected { box-shadow: 0 0 0 3px var(--accent-line), 0 4px 10px rgba(0,0,0,.4); }
.uz-border-glow { filter: drop-shadow(0 0 3px var(--accent)); }
.uz-border-core { filter: none; }

/* ===== Редизайн · Фаза 1: анимации ===== */
/* Пульс — осознанно только у ПРОБЛЕМНЫХ (офлайн) и выбранного маркера: движение ведёт
   взгляд к тому, что требует внимания, а не рябит на всех 187 точках. Цвет — из тем-токенов. */
.leaflet-marker-icon .map-marker { position: relative; }
.map-marker--offline::before,
.map-marker--selected::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
}
.map-marker--offline::before { animation: hurmaPulseOff 1.9s ease-out infinite; }
.map-marker--selected::after  { animation: hurmaPulseSel 1.9s ease-out infinite; }
@keyframes hurmaPulseOff {
  0%   { box-shadow: 0 0 0 2px var(--offline-glow); opacity: .85; }
  70%  { box-shadow: 0 0 0 13px var(--offline-glow); opacity: 0; }
  100% { box-shadow: 0 0 0 2px var(--offline-glow); opacity: 0; }
}
@keyframes hurmaPulseSel {
  0%   { box-shadow: 0 0 0 3px var(--accent-line); opacity: .8; }
  70%  { box-shadow: 0 0 0 15px var(--accent-line); opacity: 0; }
  100% { box-shadow: 0 0 0 3px var(--accent-line); opacity: 0; }
}
/* Появление списка узлов — мягкий стагер + лёгкий hover-сдвиг */
.node-list .node-item { animation: hurmaItemIn .34s cubic-bezier(.2,.75,.2,1) backwards; }
.node-list .node-item:nth-child(1){animation-delay:.02s}
.node-list .node-item:nth-child(2){animation-delay:.05s}
.node-list .node-item:nth-child(3){animation-delay:.08s}
.node-list .node-item:nth-child(4){animation-delay:.11s}
.node-list .node-item:nth-child(5){animation-delay:.14s}
.node-list .node-item:nth-child(6){animation-delay:.17s}
.node-list .node-item:nth-child(7){animation-delay:.2s}
.node-list .node-item:nth-child(8){animation-delay:.23s}
.node-list .node-item:nth-child(9){animation-delay:.26s}
.node-list .node-item:nth-child(n+10){animation-delay:.29s}
@keyframes hurmaItemIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.node-item { transition: background .15s, border-color .15s, transform .15s; }
.node-item:hover { transform: translateX(2px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Пакет 5/6: фокус с клавиатуры, бейдж «скоро» ── */
.node-item:focus-visible,
.bt-th-label:focus-visible,
.railnav__item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.railnav__soon {
  margin-left: auto; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim);
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}
:root[data-rail="collapsed"] .railnav__soon { display: none; }
