:root {
  --bg: #f7f2e8;
  --bg-scrim: #f7f2e8d9;
  --hud-top: #f7f2e8f2;
  --hud-top-fade: #f7f2e800;
  --map: #dfe7ec;
  --panel-solid: #fffdf8;
  --panel: #fffdf8f2;
  --card: #fffdf8f0;
  --panel-strong: #fffdf8f7;
  --card-soft: #fffdf8cc;
  --line: #ddd3c1;
  --line-soft: #e9e1d2;
  --line-strong: #d9cfbd;
  --hover: #ece4d5;
  --ctrl: #f4eee2;
  --ctrl-active: #efe7d8;
  --text: #2a2620;
  --muted: #5f5648;
  --dim: #7d7261;
  --label: #4b4335;
  --label-strong: #3b3428;
  --label-region: #6f6555;
  --halo: #f8f3e9;
  --key-none: #a49a86;
  --dot: #8a7f6b;
  --track-done: #9a9482;
  --underline: #b9ab90;
  --track-accent: #9db3c7;
  --track-arrow: #7d94a8;
  --track-note: #6f8497;
  --track-border: #a8bbcf;
  --missile: #dc2626;
  --uav: #c2410c;
  /* Подпись региона под угрозой: тёмные тона, белый текст поверх */
  --alert-uav-bg: #a3490a;
  --alert-missile-bg: #8c1414;
  --alert-glow: #f0a35a;
  --stale: #8e9aa4;
  --ok: #15803d;
  --danger: #b91c1c;
  --warn: #a4661f;
  --link: #1d4ed8;
  --focus: #2563eb;
  --warn-bg: #fdf3d3;
  --warn-line: #f0d59a;
  --warn-fg: #8a5a12;
  --danger-bg: #f6d5d5;
  --danger-bg2: #fbe3c8;
  --ok-bg: #e9f7ec;
  --ok-line: #b9dfc4;
  --accent-line: #f3d9a4;
  --white-ring: #ffffffd9;
  --shadow: #6b5b3f55;
  --shadow-warm: #6b3a1a4d;
  --scrim-strong: #3f3a2ecc;
  --shadow-lg: #6b5b3f44;
  --new-fill: #3a4a5d;
  --new-line: #5c7387;
  --none-fill: #c9bda6;
  --label-muted: #a9b6c4;
  --label-bright: #e7eef6;
  --chip-bg: #f7f2e8b3;
  --chip-bg-strong: #f8f3e9e6;
  --panel-soft: #fffdf8dd;
}

/* Тёмная тема: те же токены, другая палитра */
[data-theme="dark"] {
  --bg: #0b0f13;
  --bg-scrim: #0b0f13d9;
  --hud-top: #0b0f13f2;
  --hud-top-fade: #0b0f1300;
  --map: #0e1319;
  --panel-solid: #111820;
  --panel: #111820ee;
  --card: #0f151bee;
  --panel-strong: #111820f7;
  --card-soft: #0f151bcc;
  --line: #232c36;
  --line-soft: #1a222b;
  --line-strong: #2b3540;
  --hover: #17222c;
  --ctrl: #121a22;
  --ctrl-active: #1a232d;
  --text: #e6edf4;
  --muted: #8fa0b3;
  --dim: #5f6d7c;
  --label: #c3d2e2;
  --label-strong: #e6edf4;
  --label-region: #8194a8;
  --halo: #05080c;
  --key-none: #4c5866;
  --dot: #4a5a6b;
  --track-done: #46505c;
  --underline: #4d5b6a;
  --track-accent: #3f6c96;
  --track-arrow: #5f86a8;
  --track-note: #7f9ab3;
  --track-border: #33506b;
  --missile: #d64a4a;
  --uav: #d9922f;
  --alert-uav-bg: #8a3f0a;
  --alert-missile-bg: #761111;
  --alert-glow: #c8813e;
  --stale: #6b7a8a;
  --ok: #79c48a;
  --danger: #ff8b8b;
  --warn: #e2b063;
  --link: #8fb2d6;
  --focus: #6fb2ff;
  --warn-bg: #1d180d;
  --warn-line: #4a3a20;
  --warn-fg: #e2b063;
  --danger-bg: #4a2226;
  --danger-bg2: #4a3320;
  --ok-bg: #16321f;
  --ok-line: #2c5a3a;
  --accent-line: #4a3a20;
  --white-ring: #ffffffd9;
  --shadow: #00000088;
  --shadow-warm: #00000088;
  --scrim-strong: #000000cc;
  --shadow-lg: #00000099;
  --new-fill: #3a4a5d;
  --new-line: #5c7387;
  --none-fill: #2f3944;
  --label-muted: #8fa0b3;
  --label-bright: #e6edf4;
  --chip-bg: #0b0f13b3;
  --chip-bg-strong: #0b0f13e6;
  --panel-soft: #111820dd;
}

:root {
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

/* Атрибут hidden должен побеждать любой display из авторских стилей,
   иначе блоки вроде .scheme{display:grid} видны всегда. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------- карта на весь экран ---------- */

.map-full {
  position: fixed;
  inset: 0;
  background: var(--map);
  z-index: 0;
}

.maplibregl-map {
  background: var(--map);
  font: inherit;
  color: var(--text);
}

/* дневные тайлы перекрашиваем в тёмный: ночью не выжигает глаза,
   а цвет опасности остаётся самым громким на экране */
.maplibregl-ctrl-attrib {
  background: var(--bg-scrim) !important;
  color: var(--dim) !important;
  font-size: 11px !important;
  border-radius: 4px;
}
.maplibregl-ctrl-attrib a { color: var(--label-region) !important; }

.maplibregl-ctrl-group {
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
}
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }

.maptip {
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
  font: inherit;
  font-size: 11.5px !important;
  box-shadow: none !important;
  padding: 2px 7px !important;
}
.maptip::before { display: none !important; }

/* ---------- подписи поверх карты ----------
   Слой лежит над картой и под панелями. Расстановку считает app.js:
   подпись видна, только если её прямоугольник ни на кого не налез. */
.label-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.map-label {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  line-height: 1;
  pointer-events: none;
  will-change: transform;
}

.map-label--city {
  font: 500 10.5px/1 "Segoe UI", system-ui, sans-serif;
  color: var(--label);
  /* ореол вместо подложки: подпись читается и над заливкой, и над сушей */
  text-shadow:
    0 0 2px var(--halo), 0 0 2px var(--halo), 0 1px 3px var(--halo), 1px 0 3px var(--halo),
    -1px 0 3px var(--halo);
}

/* административный центр субъекта — чуть заметнее остальных городов */
.map-label--city.is-capital {
  font-weight: 600;
  color: var(--label-strong);
}

/* регион — самый тихий: он фон для городов, а не новость */
.map-label--region {
  font: 600 11px/1 "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: var(--label-region);
  text-shadow:
    0 0 2px var(--halo), 0 0 3px var(--halo), 0 1px 4px var(--halo), 1px 0 4px var(--halo),
    -1px 0 4px var(--halo);
}

/* опасность в регионе — единственная подпись, которая кричит, но цвет
   зависит от угрозы: ракета — тёмно-красный, БПЛА — тёмно-оранжевый.
   Прочие угрозы сюда не попадают (см. toneOf в app.js). */
.map-label--alert {
  font: 700 11px/1 "Segoe UI", system-ui, sans-serif;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--alert-uav-bg);
  box-shadow: 0 0 0 1px var(--white-ring), 0 2px 8px var(--shadow-warm);
}

.map-label--alert.is-tone-missile {
  background: var(--alert-missile-bg);
}

/* Только что объявленная опасность мигает первые 15 минут как тревога:
   яркая вспышка, свечение вокруг и лёгкий «толчок» размера. Потом
   плашка просто светится своим цветом. */
.map-label--alert.is-fresh {
  animation: alertBlink 0.9s ease-in-out infinite;
}

@keyframes alertBlink {
  0%,
  100% {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 0 1px var(--white-ring), 0 2px 8px var(--shadow-warm);
  }
  45% {
    opacity: 0.55;
    filter: brightness(1.35);
    box-shadow:
      0 0 0 2px var(--white-ring),
      0 0 22px 8px var(--alert-glow),
      0 0 42px 14px var(--alert-glow);
  }
}



/* Уничтоженный борт: стоит на месте, пока сервер не закроет запись.
   Половина прозрачности и вспышка при наведении — поэтому !important:
   у значков бывает inline-opacity от анимации полёта, а `.flyer`
   ниже по файлу с той же специфичностью сбрасывал pointer-events. */
.flyer.flyer--parked {
  opacity: 0.5 !important;
  filter: saturate(0.75);
  /* только у уничтоженного ловим курсор: летящие должны пропускать
     клик и перетаскивание карты сквозь себя */
  pointer-events: auto;
  cursor: help;
  transition: opacity 160ms ease, filter 160ms ease;
}

/* наведение — читаем, что там написано; отвели курсор — снова 50% */
.flyer.flyer--parked:hover,
.flyer.flyer--parked:focus-visible {
  opacity: 1 !important;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.7)) saturate(1);
}

.flyer.flyer--parked:hover .flyer__label,
.flyer.flyer--parked:hover .flyer__time {
  color: var(--text);
}

.flyer--parked .flyer__label {
  background: var(--panel-strong);
  color: var(--muted);
}

/* Значки опасности на карте: маленькие, с обводкой, не перекрывают друг друга */
.hz {
  display: grid;
  place-items: center;
  pointer-events: none;
  filter: drop-shadow(0 0 2px #000);
}

.hz span {
  font-size: 13px;
  line-height: 1;
  color: var(--bg);
  text-shadow: 0 0 3px #000;
}

.hz--missile span { color: var(--missile); }
.hz--uav span { color: var(--uav); }

.offline {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  max-width: 380px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.offline a { color: var(--focus); }

/* ---------- HUD ---------- */

.hud {
  position: fixed;
  z-index: 20;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }

/* Шапка — два края: техстрока слева, кнопки справа. Бренд из потока вынесен,
   поэтому его центр совпадает с центром экрана, а не с остатком колонки. */
.hud--top {
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  min-height: 68px;
  padding: 10px 16px;
  background: linear-gradient(var(--hud-top), var(--hud-top-fade));
}

.brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
  pointer-events: none;
}

/* Логотип — готовая связка «знак + надпись». Сжимать её нельзя: при сжатии
   едет аспект (92×28 превращалось в 58×28), поэтому max-width снят. */
.brand__logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: none;
  flex: none;
}

.brand__title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand__sub {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--dim);
}

/* Технические числа шапки — мельче и тише сводки: нужны редко */
.tech {
  display: flex;
  flex-wrap: wrap;
  justify-self: start;
  gap: 2px 12px;
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.tech b { font-weight: 600; color: var(--text); }

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}

.theme-btn:hover { background: var(--hover); color: var(--text); }
.theme-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.theme-btn span:first-child { font-size: 13px; line-height: 1; }

/* Плашки разделов: «Лента», «Памятка», «Правовое» — те же круглые кнопки,
   что на телефоне, только в левой панели. */
.panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ctrl);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.pill:hover { background: var(--hover); color: var(--text); }
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.pill--on { color: var(--text); background: var(--ctrl-active); border-color: var(--line-strong); }

.summary {
  margin: 0;
  padding: 8px 20px;
  min-width: 214px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  text-align: right;
}

.summary__head {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
  margin: 0;
}

.summary__num {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.summary__label { font-size: 11.5px; color: var(--muted); }
.summary__word { font-size: 11.5px; color: var(--muted); }

/* Когда всё тихо, врущий «0» не нужен: важна фраза, а не число */
.summary--calm { min-width: 0; }
.summary--calm .summary__num { display: none; }
.summary--calm .summary__head { justify-content: flex-end; }
.summary--calm .summary__label { font-size: 12.5px; color: var(--text); }

/* Точка «всё тихо»: цвет говорит быстрее слов */
.summary__ok {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--ok);
  vertical-align: 1px;
}

/* Разделитель — часть текста самой части, поэтому скрытая на узком
   экране часть не оставляет висеть точку */
.summary__break {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 1px 0 0;
  min-height: 1.2em;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.summary__break .b { white-space: pre; }
.summary__break .b--missile { color: var(--missile); }
.summary__break .b--uav { color: var(--uav); }

.summary__tech {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px 10px;
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.summary__tech b { font-weight: 500; color: var(--muted); }

.conn--ok { color: var(--ok); }
.conn--wait { color: var(--muted); }
.conn--lost { color: var(--missile); font-weight: 600; }

/* Легенда — по центру снизу на любом экране: подписи выровнены по центру,
   а не по левому краю, и переносятся по строкам, а не уезжают за край. */
.hud--legend {
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: min(920px, calc(100vw - 24px));
}

/* На широком экране легенда центрируется в свободной части карты:
   по центру всего окна её левый край уезжал под панель. */
@media (min-width: 901px) {
  .hud--legend { left: 412px; right: 16px; transform: none; }
  body:has(.panel--hidden) .hud--legend { left: 16px; }
}

.key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  backdrop-filter: blur(8px);
}

.key::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}

.key--missile { color: var(--missile); }
.key--uav { color: var(--uav); }
.key--stale { color: var(--stale); }
.key--none { color: var(--key-none); }
.key--new { color: var(--dot); }
.key--icon, .key--flight { color: var(--label-region); padding-left: 10px; }
.key--icon::before, .key--flight::before {
  background: none;
  width: auto;
  height: auto;
  content: "◆";
  font-size: 10px;
}
.key--flight::before { content: "➤"; }

/* ---------- панель со списком ---------- */

.panel {
  position: fixed;
  z-index: 20;
  top: 76px;
  bottom: 16px;
  width: 380px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  overflow: hidden;
  /* Свёртывание и разворот — плавно: панель уезжает и уменьшается,
     а не исчезает рывком. */
  transition:
    opacity 170ms ease,
    transform 200ms cubic-bezier(0.22, 0.7, 0.3, 1),
    box-shadow 200ms ease;
}

.panel--left { left: 16px; }
.panel--right { right: 16px; width: 340px; }

.panel__title {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 1;
}

/* лента сообщений */
/* Заголовок блока сообщений: отделяет разобранную сводку от сырых постов */
.feed__title {
  margin: 16px 4px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.feed__item {
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--line-strong);
  border-radius: 9px;
  background: var(--card);
  padding: 8px 10px;
  display: grid;
  gap: 4px;
  transition: border-color 160ms ease, background 160ms ease;
}

/* Новый пост: подсветка входа — видно, что пришло именно сейчас */
.feed__item--new {
  animation: feedIn 420ms cubic-bezier(0.22, 0.7, 0.3, 1) both;
}

@keyframes feedIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
    background: var(--warn-bg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Новая строка «Сейчас»: та же логика, что и у ленты — подсветка только
   у появившихся регионов, старые не дёргаются. */
.row--new {
  animation: rowIn 360ms cubic-bezier(0.22, 0.7, 0.3, 1) both;
}

@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Куда переехали по кнопке — короткая подстветка цели */
.is-jump-target {
  animation: jumpFlash 900ms ease both;
}

@keyframes jumpFlash {
  0% { background-color: var(--warn-bg); }
  100% { background-color: transparent; }
}

/* Кнопки перехода внутри ленты — самым верхом панели */
.jump {
  display: flex;
  gap: 6px;
  margin: 0 4px 8px;
}

.jump__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ctrl);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.jump__btn:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--line-strong);
}

.jump__btn:active { transform: scale(0.97); }

.jump__arrow {
  font-family: var(--mono);
  font-size: 11px;
  transition: transform 160ms ease;
}

.jump__btn:hover .jump__arrow { transform: translateY(2px); }

/* Кнопка свёртывания: мягкий отклик вместо мгновенного цвета */
.panel__toggle {
  transition:
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.panel__toggle:hover {
  background: var(--hover);
  color: var(--text);
}

.panel__toggle:active { transform: scale(0.9); }

/* Для тех, кому анимации мешают — всё включается без движения. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.feed__item--danger { border-left-color: var(--missile); }
.feed__item--uav { border-left-color: var(--uav); }

.feed__head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}

.feed__src { color: var(--muted); }
.feed__badge {
  font-family: inherit;
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
  color: var(--muted);
  white-space: nowrap;
}
.feed__badge--danger { color: var(--missile); border-color: var(--danger-bg); }
.feed__badge--uav { color: var(--uav); border-color: var(--danger-bg2); }

.feed__text {
  margin: 0;
  font-size: 12.5px;
  color: var(--label);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed__link { font-size: 11px; color: var(--link); text-decoration: none; justify-self: start; }
.feed__link:hover { text-decoration: underline; }

/* голосование */
.vote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.vote__btn {
  border: 1px solid var(--line);
  background: var(--ctrl);
  color: var(--muted);
  border-radius: 7px;
  padding: 4px 9px;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.vote__btn:hover { background: var(--hover); color: var(--text); }
.vote__btn--yes { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-fg); }
.vote__btn--no { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.vote__btn[disabled] { opacity: 0.5; cursor: default; }

.vote__num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
}

.vote__hint { font-size: 10.5px; color: var(--dim); }
.vote__note { font-size: 10px; color: var(--dim); }

.panel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.tabs { display: flex; gap: 4px; flex: 1; }

/* Все управляющие элементы — одной формы: таблетка, один кегль,
   одна высота. Раньше табы были прямоугольными, плашки — круглыми,
   кнопка темы — третьей высоты; на экране это читалось как три разных UI. */
.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}

.tab:hover { background: var(--hover); color: var(--text); }
.tab--on { color: var(--text); background: var(--ctrl-active); border-color: var(--line); }

/* Переключатель внутри ленты: «Сейчас / Направления / Отбои» — три такие же
   таблетки, как верхние табы, только с рамкой: они вторичны по смыслу. */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 2px 10px;
}

.seg__btn {
  border: 1px solid var(--line);
  background: var(--ctrl);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}

.seg__btn:hover { background: var(--hover); color: var(--text); }
.seg__btn--on { color: var(--text); background: var(--ctrl-active); border-color: var(--line-strong); }

.panel__toggle {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.pane {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.pane::-webkit-scrollbar { width: 8px; }
.pane::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

/* строка списка: цветная полоса слева вместо заливки всей карточки —
   так список не превращается в стену красного при большой атаке */
.row {
  transition: background 140ms ease;
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 10px;
  padding: 9px 10px 9px 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}

.row__bar { border-radius: 3px; background: var(--stale); }
.row--missile .row__bar { background: var(--missile); }
.row--uav .row__bar { background: var(--uav); }

.row__body { display: grid; gap: 4px; min-width: 0; }

/* Имя региона — главное в карточке; сколько висит — рядом, одним взглядом */
.row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.row__title {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.row__hazard { font-family: inherit; font-weight: 600; }
.row--missile .row__hazard { color: var(--missile); }
.row--uav .row__hazard { color: var(--uav); }

/* «висит 01:12» — тише названия угрозы: это контекст, а не событие */
.row__since {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row--stale { border-style: dashed; }
.row--stale .row__title { color: var(--label); }

.row a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--underline); }

.tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: inherit;
}
.tag--warn { color: var(--warn-fg); border-color: var(--accent-line); background: var(--warn-bg); }

.hint {
  margin: 4px 4px 10px;
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.4;
}
.hint a { color: var(--link); }

.empty {
  margin: 8px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* Пустой список — это тоже сообщение: без времени последнего отбоя
   «нет предупреждений» читается как «данных не было». */
.empty-state {
  margin: 8px 4px;
  padding: 14px 14px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--card-soft);
}

.empty-state__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.empty-state__sub {
  margin: 3px 0 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.empty-state__cap {
  margin: 0 0 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dim);
}

.history--compact {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}
.history--compact li { padding: 5px 8px; font-size: 12px; background: transparent; }
.history--compact li + li { border-top: 1px solid var(--line-soft); }
.history--compact .empty { margin: 0; border: 0; padding: 6px 8px; font-size: 12px; }

/* ---------- траектории ---------- */

.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.track {
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--track-accent);
  border-radius: 9px;
  background: var(--card);
  padding: 9px 11px;
  display: grid;
  gap: 5px;
}

.track__route { display: flex; gap: 7px; align-items: baseline; font-size: 13.5px; font-weight: 600; }
.track__arrow { color: var(--track-arrow); font-weight: 400; }

.track__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.track__calc {
  font-family: inherit;
  font-size: 10.5px;
  color: var(--track-note);
  border: 1px dashed var(--track-border);
  border-radius: 4px;
  padding: 0 6px;
}

.track--done { border-left-color: var(--track-done); opacity: 0.65; }

/* ---------- отбои ---------- */

.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }

.history li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--card);
  font-size: 12.5px;
}

.history .time { font-family: var(--mono); font-size: 11px; color: var(--dim); }

.panel__foot {
  border-top: 1px solid var(--line-soft);
  padding: 6px 10px 8px;
}

/* ---------- мобильный режим ---------- */

/* Кнопка возврата панели. На телефоне показывается всегда, на десктопе —
   только когда соответствующая панель свёрнута. */
.fab {
  position: fixed;
  z-index: 25;
  bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.fab--left { left: 16px; }
.fab--right { right: 16px; }
.fab span { font-family: var(--mono); font-size: 12px; color: var(--uav); }

/* «Лента» возвращается сверху — там, откуда ушла панель, а не снизу.
   Прижатая вниз кнопка читается как «ещё что-то внизу», хотя это вход
   в ту самую панель, что была слева сверху. */
@media (min-width: 901px) {
  .fab--left {
    top: 84px;
    bottom: auto;
  }
}

/* свёрнутая панель уходит плавно, стягиваясь к верхнему левому углу —
   туда же, где появляется кнопка «Лента»; visibility снимается после
   анимации, чтобы панель не ловила клики прозрачной областью */
.panel--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-14px) scale(0.94);
  transition:
    opacity 200ms ease,
    transform 260ms cubic-bezier(0.33, 1.4, 0.5, 1),
    visibility 0s linear 260ms;
}

/* плашка возврата появляется мягко: падает сверху и чуть подпрыгивает */
.fab { animation: fabIn 320ms cubic-bezier(0.33, 1.4, 0.6, 1) both; }
@keyframes fabIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* на десктопе плашка появляется, только когда панель спрятана */
.panel--left.panel--hidden ~ .fab--left { display: inline-flex; }
.panel--right.panel--hidden ~ .fab--right { display: inline-flex; }

@media (max-width: 900px) {
  /* Лого — центр верхней строки, кнопки — второй строкой: в одну строку
     он наезжал на плашку сводки и сжимался под неё. */
  .hud--top {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand brand" "theme summary";
    row-gap: 8px;
    padding: 8px 12px 10px;
    min-height: 0;
  }
  .brand { position: static; transform: none; grid-area: brand; justify-self: center; }
  .brand__logo { height: 30px; }
  /* на телефоне подпись под логотипом занимает четыре строки — убираем */
  .brand__sub { display: none; }
  .theme-btn { grid-area: theme; justify-self: start; }
  .summary { grid-area: summary; justify-self: end; min-width: 0; padding: 6px 14px; }
  /* Лента — вся высота панели, внутренние блоки дышат одинаково */
  .seg { padding: 4px 2px 10px; }
  .feed__title { margin: 12px 4px 6px; }
  .tech { display: none; }
  .summary__num { font-size: 16px; }
  /* на телефоне хватает числа и вида угрозы: пояснения — в подсказке */
  /* «15 регионов» без слова читается как случайное число: единицу измерения
     на телефоне оставляем, а пояснение «под опасностью» убираем */
  .summary__label { display: none; }
  /* пустое состояние — единственный текст в плашке */
  .summary--calm .summary__label { display: inline; white-space: nowrap; }
  .summary__break { font-size: 10px; }
  .summary__break .b--stale { display: none; }

  .panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    height: 56vh;
    border-radius: 14px;
    transform: translateY(calc(100% + 16px));
    transition:
      transform 240ms cubic-bezier(0.22, 0.7, 0.3, 1),
      opacity 170ms ease,
      visibility 0s linear 240ms;
  }

  /* на телефоне свёрнутая панель — та же «шторка», только уехавшая вниз */
  .panel--hidden {
    transform: translateY(calc(100% + 16px));
    opacity: 0;
  }

  .panel--open {
    transform: none;
    opacity: 1;
    visibility: visible;
    transition:
      transform 240ms cubic-bezier(0.22, 0.7, 0.3, 1),
      opacity 170ms ease,
      visibility 0s;
  }
  .panel--left { left: 8px; right: 8px; }
  .panel--right { left: 8px; right: 8px; }
  .fab--right { right: 14px; left: auto; transform: none; }

  .fab { display: inline-flex; left: 50%; bottom: 14px; transform: translateX(-50%); }
  .fab--left { left: 14px; transform: none; }
  .panel--open ~ .fab { display: none; }

  /* по пальцу, а не по курсору: кнопки в карточке тоже увеличиваем */
  .vote__btn { padding: 7px 12px; font-size: 12.5px; }
  .vote__note { display: none; }

  /* На телефоне легенда уходит вниз над кнопками: сверху она спорила
     бы с шапкой, а открытая панель всё равно её закрывает */
  .hud--legend { top: auto; bottom: 64px; left: 12px; transform: none;
                 justify-content: center; max-width: calc(100% - 24px); }
  .key { font-size: 11px; padding: 5px 9px; }
}

/* Узкие телефоны: подпись кнопки темы и слово «сейчас» съедают строку —
   без них плашка и кнопка перестают соприкасаться. */
@media (max-width: 480px) {
  .theme-btn { padding: 9px 11px; }
  .theme-btn span:last-child { display: none; }
  /* Легенда держится одной строкой: «опасность» не несёт смысла рядом
     с красной точкой, а без него все четыре пункта влезают по центру. */
  .key__more { display: none; }
  .key { font-size: 10.5px; padding: 4px 8px; }
  .hud--legend { gap: 4px; }
}

/* ---------- схема без подложки ---------- */

.scheme {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-content: center;
  background: var(--bg);
  padding: 24px;
}

.scheme svg {
  width: min(92vw, 1200px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.scheme svg path { fill: var(--ctrl-active); stroke: var(--bg); stroke-width: 0.6; }
.scheme svg path.is-missile { fill: var(--danger); }
.scheme svg path.is-uav { fill: var(--warn); }
.scheme svg path.is-aging { opacity: 0.55; }

.scheme__close {
  margin-top: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


/* ---------- значки опасности и перелёты ---------- */

.banner {
  display: grid;
  justify-items: center;
  gap: 2px;
  pointer-events: none;
  filter: drop-shadow(0 2px 5px rgba(90, 70, 40, 0.35));
}

/* Значок опасности без круга и кольца: сам знак и мягкая тень под ним.
   Тень — только чтобы знак не терялся на светлой подложке. */
.banner img {
  width: 40px;
  height: 40px;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(60, 45, 20, 0.55));
}

.banner--missile img { width: 44px; height: 44px; }
.banner--fpv img { width: 36px; height: 36px; }

.banner__time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--label);
  background: var(--chip-bg-strong);
  border-radius: 4px;
  padding: 0 4px;
  white-space: nowrap;
}

.flyer {
  display: grid;
  justify-items: center;
  gap: 1px;
  pointer-events: none;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
  will-change: transform;
}

.flyer img {
  width: 30px;
  height: auto;
  display: block;
  transform-origin: 50% 50%;
  transition: transform 120ms linear;
  will-change: transform;
}

.flyer--missile img { width: 34px; }
/* давно без подтверждения: не исчезает, но явно тускнеет */
.flyer--stale { filter: grayscale(0.55) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }
.flyer--stale .flyer__label { color: var(--label-muted); }
.flyer--fpv img { width: 26px; }
.flyer--pvo img { width: 28px; }

.flyer__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--label-bright);
  background: var(--bg-scrim);
  border-radius: 4px;
  padding: 0 5px;
  white-space: nowrap;
}

.flyer__time {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--label-region);
  background: var(--chip-bg);
  border-radius: 3px;
  padding: 0 4px;
}


/* ---------- памятка ---------- */

.key--btn {
  cursor: pointer;
  color: var(--label-muted);
  border-color: var(--line);
  background: var(--panel-soft);
}
.key--btn:hover { background: var(--hover); }
.key--btn::before { content: "?"; display: grid; place-items: center;
  width: 14px; height: 14px; border-radius: 50%; font-size: 10px;
  background: var(--line); color: var(--label); }

.memo {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--scrim-strong);
  backdrop-filter: blur(3px);
}

.memo__box {
  width: min(720px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 60px var(--shadow-lg);
  overflow: hidden;
}

.memo__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.memo__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.memo__x {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.memo__x:hover { background: var(--hover); color: var(--text); }

.memo__body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.memo__group {
  margin: 18px 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--dim);
}
.memo__group:first-child { margin-top: 0; }

.memo__hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 62ch;
}

.memo__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.memo__list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--ctrl);
}

.memo__list img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px #0008);
}

.memo__list b { font-size: 14px; }

.memo__list p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.memo__more { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.memo__more li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--muted);
}

.sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); }
.sw--missile { background: var(--missile); }
.sw--uav { background: var(--uav); }
.sw--new { background: var(--new-fill); border-color: var(--new-line); }
.sw--none { background: var(--none-fill); }

.memo__foot {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--dim);
  max-width: 70ch;
}

/* атрибуция карты: видна без раскрытия кнопки (i) в углу карты */
.memo__attr {
  margin: 8px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--dim);
  max-width: 70ch;
}

@media (max-width: 620px) {
  .memo__list li { grid-template-columns: 44px 1fr; }
  .memo__list img { width: 40px; height: 40px; }
  .memo__box { max-height: 92vh; }
}


/* сбитый объект: замирает, тускнеет, рядом вспышка */
.flyer--down { opacity: 0.35; }
.flyer--down .flyer__label,
.flyer--down .flyer__time { opacity: 0.9; }

.burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle, #fff3c4 0%, #ffb347 32%, #ff6b2c 55%, rgba(255, 90, 40, 0) 72%);
  box-shadow: 0 0 18px 6px rgba(255, 140, 60, 0.45);
  animation: burst 1.6s ease-out infinite;
  z-index: -1;
}

.burst::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 170, 90, 0.5);
  animation: burst-ring 1.6s ease-out infinite;
}

@keyframes burst {
  0%   { transform: scale(0.55); opacity: 0; }
  25%  { transform: scale(1);    opacity: 1; }
  100% { transform: scale(1.25); opacity: 0.55; }
}

@keyframes burst-ring {
  0%   { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(2.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .burst, .burst::after { animation: none; }
  .burst { opacity: 0.8; }
}

/* ---------- выезд панелей и смена содержимого ---------- */

/* Памятка и лента открываются движением, а не мгновенной подменой кадра. */
.panel--right {
  transition: transform 260ms cubic-bezier(0.22, 0.8, 0.3, 1), opacity 200ms ease;
}

.panel--right.panel--hidden {
  display: flex;
  opacity: 0;
  transform: translateX(calc(100% + 24px));
  pointer-events: none;
}

/* лента/правовое/направления: содержимое проявляется и подъезжает */
.pane {
  transition: opacity 180ms ease;
}

.pane--in {
  animation: pane-in 240ms cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@keyframes pane-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* карточка «Карта и данные» в ленте */
.about-map {
  margin: 4px 4px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.about-map__title { margin: 0 0 6px; font-size: 13px; letter-spacing: 0.02em; }
.about-map__text { margin: 0 0 8px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.about-map__list { margin: 0 0 8px; padding-left: 16px; font-size: 11.5px; line-height: 1.55; color: var(--dim); }
.about-map__list b { color: var(--text); font-weight: 600; }

/* правовой раздел */
.legal { padding: 4px 6px 12px; }
.legal__title { margin: 2px 0 10px; font-size: 15px; }
.legal__head {
  margin: 14px 0 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dim);
}
.legal__p { margin: 0 0 8px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.legal__p b { color: var(--text); font-weight: 600; }
.legal__p a { color: var(--link); }

/* зум справа по центру экрана, круглый */
.map-zoom {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
}

/* внутри своей плашки контрол не должен позиционироваться сам */
.map-zoom .maplibregl-ctrl { position: static; margin: 0; }

.map-zoom .maplibregl-ctrl-group {
  border-radius: 999px !important;
  overflow: hidden;
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px var(--shadow);
}

.map-zoom .maplibregl-ctrl-group button {
  width: 38px;
  height: 38px;
  background: transparent;
}

.map-zoom .maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.map-zoom .maplibregl-ctrl-group button:hover { background: var(--hover); }
.map-zoom .maplibregl-ctrl-icon { filter: none; }

@media (max-width: 900px) {
  .map-zoom { right: 10px; }
  .map-zoom .maplibregl-ctrl-group button { width: 40px; height: 40px; }
  /* Открытая панель занимает низ экрана — зум оказывается поверх её шапки */
  body:has(.panel--open) .map-zoom { display: none; }
}

/* Точки вылета на украинской стороне: тихие, чтобы не спорить с опасностью */
.origin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px 2px 4px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.85;
}

.origin__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--key-none);
}

.origin--border .origin__dot { background: var(--uav); }
.origin--border { color: var(--text); }

/* Сирена: пульсирующее кольцо вокруг значка. Живёт 2–5 минут и снимается
   самим фронтом по expires_at, поэтому анимация не «залипает». */
.siren {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  pointer-events: none;
}

.siren__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--danger);
  animation: siren-pulse 1.6s ease-out infinite;
}

.siren__core {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

@keyframes siren-pulse {
  0%   { transform: scale(0.55); opacity: 0.9; }
  70%  { transform: scale(1.25); opacity: 0.15; }
  100% { transform: scale(1.25); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .siren__ring { animation: none; opacity: 0.7; }
}

/* Район: простой красный «!» вместо знака опасности. Полигона у района нет,
   поэтому отметка стоит в его центре и подписана — иначе непонятно, что это. */
.district-mark {
  display: grid;
  justify-items: center;
  gap: 1px;
  pointer-events: none;
}

.district-mark__sign {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.district-mark__name {
  font-size: 10px;
  color: var(--label);
  background: var(--chip-bg-strong);
  border-radius: 4px;
  padding: 0 4px;
  white-space: nowrap;
}

/* Отметка района в памятке — тот же знак, что и на карте: красный
   круг с белым «!». Раньше здесь был безымянный красный кружок, и по
   нему нельзя было понять, о каком знаке вообще речь. */
.sw--district {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.sw--district::after {
  content: "!";
}

/* Опасность «по маршруту»: регион под перелётом, а не из текста поста */
.tag--route {
  color: var(--uav);
  border-color: var(--accent-line);
  background: var(--warn-bg);
}

/* Сбитый борт: падение с вспышкой при появлении */
.flyer--crash img {
  animation: flyerFall 900ms cubic-bezier(0.3, 0.9, 0.4, 1) both;
}

@keyframes flyerFall {
  0% {
    transform: translateY(-42px) rotate(-35deg) scale(1.25);
    opacity: 0.2;
  }
  55% {
    transform: translateY(4px) rotate(12deg) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: none;
  }
}

.flyer--crash::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid var(--missile);
  animation: flyerBlast 900ms ease-out both;
  pointer-events: none;
}

@keyframes flyerBlast {
  0% { transform: scale(0.2); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ---------- мобильное удобство ----------

   Сайт открывают с телефона в спешке: кнопки должны попадаться пальцем,
   а не курсором. Всё, что меньше 40 px, на телефоне увеличиваем; двойной
   тап отключаем (иначе панель «залипает» на полсекунды). */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
.tab,
.seg__btn,
.jump__btn,
.vote__btn,
.theme-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* панель и списки не должны «пружинить» страницу */
.pane {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
  /* высота шторки по видимой части экрана, а не по макетной */
  .panel {
    height: 56vh;
    height: 56dvh;
  }

  /* пальцем: минимум 40 px по высоте */
  .tab,
  .seg__btn {
    min-height: 40px;
    padding: 10px 14px;
  }

  .jump__btn {
    min-height: 40px;
  }

  .theme-btn {
    min-height: 40px;
    padding: 8px 12px;
  }

  .panel__toggle {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .vote__btn {
    min-height: 38px;
  }

  /* карточки «Сейчас» — с запасом под палец */
  .row {
    padding: 11px 12px 11px 0;
  }

  /* крупнее подписи карты: на телефоне мелкий шрифт не читается */
  .map-label--city {
    font-size: 11.5px;
  }

  .map-label--region,
  .map-label--alert {
    font-size: 12px;
  }
}

/* На тач-экранах наведение не работает — активное состояние важнее */
@media (hover: none) {
  .jump__btn:active,
  .seg__btn:active,
  .tab:active,
  .vote__btn:active {
    transform: scale(0.97);
    background: var(--hover);
  }
}

/* На телефоне легенда стояла поверх кнопки «Лента» — поднимаем её */
@media (max-width: 900px) {
  .hud--legend {
    bottom: 74px;
  }
}


/* счётчик тИЦ в правовом разделе: маленький, в одну строку, без отступа снизу */
.legal__p--counter {
  margin: 0 0 18px;
}

.legal__p--counter img {
  display: block;
  border: 0;
  border-radius: 6px;
}
