:root {
  --bg: #0b0f14;
  --bg-2: #111722;
  --panel: #141b26;
  --panel-2: #18212e;
  --line: #243042;
  --line-soft: #1c2532;
  --text: #e6edf5;
  --text-dim: #9fb0c3;
  --muted: #6b7c91;
  --accent: #36c2ff;
  --accent-2: #0051ca;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #ef4444;
  --radius: 12px;
  --sidebar-w: 340px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --map-bg: #0a0e13;
  --overlay: rgba(17, 23, 34, 0.88);
  --scrim: rgba(10, 14, 19, 0.82);
  --cluster-bg: rgba(20, 27, 38, 0.92);
  --cluster-fg: #eaf1f8;
  --cluster-shadow: 0 0 0 4px rgba(54, 194, 255, 0.12), 0 4px 12px rgba(0, 0, 0, 0.4);
  --cluster-shadow-owl: 0 0 0 4px rgba(251, 191, 36, 0.12), 0 4px 12px rgba(0, 0, 0, 0.4);
  --font-ui: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-synthesis: none;
}

/* ---------- Светлая тема ---------- */
body.light {
  --bg: #eef1f6;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f4f9;
  --line: #d4dbe6;
  --line-soft: #e4e9f0;
  --text: #16202e;
  --text-dim: #43536a;
  --muted: #8995a6;
  --accent: #0a6ed1;
  --accent-2: #0051ca;
  --shadow: 0 12px 36px rgba(40, 60, 90, 0.16);
  --map-bg: #e6ebf1;
  --overlay: rgba(255, 255, 255, 0.92);
  --scrim: rgba(238, 241, 246, 0.82);
  --cluster-bg: rgba(255, 255, 255, 0.95);
  --cluster-fg: #18222f;
  --cluster-shadow: 0 0 0 3px rgba(10, 110, 209, 0.12), 0 2px 8px rgba(40, 60, 90, 0.20);
  --cluster-shadow-owl: 0 0 0 3px rgba(217, 150, 0, 0.16), 0 2px 8px rgba(40, 60, 90, 0.20);
}
body.light .spinner { border-color: var(--line); border-top-color: var(--accent); }
body.light .leaflet-bar a { background: var(--panel); color: var(--text); }
body.light .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.8) !important;
}
body.light .leaflet-control-attribution a { color: var(--accent) !important; }

* { box-sizing: border-box; }
html, body {
  height: 100%;
  min-height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  -webkit-font-smoothing: antialiased;
  /* Телефон: жест «потянуть вниз» не должен обновлять страницу поверх карты,
     а тап по кнопке — вспыхивать серым прямоугольником. */
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100%;
  min-height: 0;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: scroll;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
#app.collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w)); }

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px 14px; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; background: var(--bg-2); z-index: 2;
}
.brand-mark {
  font-size: 26px; line-height: 1;
  filter: drop-shadow(0 0 8px rgba(54, 194, 255, 0.4));
}
.brand-text h1 {
  margin: 0; font-size: 18px; letter-spacing: 0.5px; font-weight: 700;
}
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.3px; }
.brand .icon-btn { margin-left: auto; }

.live-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid var(--line-soft);
  font-size: 12px; color: var(--text-dim);
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--muted);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
}
.live-dot.on {
  background: var(--good);
  animation: pulse 2s infinite;
}
.live-dot.err { background: var(--bad); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.live-text { flex: 1; }
.live-row .icon-btn { margin-left: auto; }

.field { padding: 12px 16px 4px; }
.field > label {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--muted); margin-bottom: 6px;
}
select, input[type="text"], input[type="date"] {
  width: 100%; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  font-size: 13px; outline: none; transition: border-color 0.15s;
}
select:focus, input:focus { border-color: var(--accent); }
select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239fb0c3' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }

.search-wrap { display: flex; gap: 6px; }
.search-wrap input { flex: 1; }
.hint { font-size: 11px; color: var(--muted); margin-top: 5px; min-height: 14px; }

/* ---------- Panels ---------- */
.panel { padding: 14px 16px 6px; border-top: 1px solid var(--line-soft); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h2 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-dim); }
.panel-actions { display: flex; gap: 10px; }
.link-btn { background: none; border: none; color: var(--accent); font-size: 11px; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

.faction-list { display: flex; flex-direction: column; gap: 2px; }
.faction-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  border-radius: 8px; cursor: pointer; transition: background 0.12s;
  user-select: none;
}
.faction-item:hover { background: var(--panel); }
.faction-item.off { opacity: 0.4; }
.fc-swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.06); }
.fc-name { flex: 1; font-size: 13px; }
.fc-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.faction-item.off .fc-name { text-decoration: line-through; }

.quick-range { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.chip {
  background: var(--panel); border: 1px solid var(--line); color: var(--text-dim);
  padding: 5px 10px; border-radius: 20px; font-size: 12px; cursor: pointer; transition: all 0.12s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent-2); border-color: var(--accent); color: #fff; }
.date-inputs { display: flex; align-items: center; gap: 8px; }
.date-inputs span { color: var(--muted); }
.date-inputs input { padding: 7px 9px; font-size: 12px; }

/* ---------- Sources ---------- */
.collapsible.closed .sources-list { display: none; }
.toggler { cursor: pointer; }
.toggler .caret { color: var(--muted); transition: transform 0.18s; }
.collapsible.closed .caret { transform: rotate(-90deg); }
.sources-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; }
.src-group-title {
  font-size: 11px; color: var(--accent); font-weight: 600; letter-spacing: 0.3px;
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.src-item {
  display: block; text-decoration: none; color: var(--text); padding: 7px 9px;
  border: 1px solid var(--line-soft); border-radius: 8px; margin-bottom: 5px;
  background: var(--panel); transition: border-color 0.12s, transform 0.12s;
}
.src-item:hover { border-color: var(--accent); transform: translateX(2px); }
.src-name { font-size: 12.5px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.src-handle { color: var(--muted); font-weight: 400; font-size: 11px; }
.src-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; line-height: 1.35; }

.side-foot {
  margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--line-soft);
  font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 6px;
}
.dot-sep { color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.icon-btn {
  background: var(--panel); border: 1px solid var(--line); color: var(--text-dim);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; transition: all 0.12s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--text); }
.icon-btn.ghost { background: transparent; }
.icon-btn.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.expand-btn {
  position: absolute; top: 14px; left: 14px; z-index: 1100;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 18px;
  display: none; box-shadow: var(--shadow);
}
#app.collapsed .expand-btn { display: block; }

/* ---------- Map ---------- */
#mapWrap { position: relative; flex: 1; height: 100%; min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--map-bg); }
.leaflet-container { background: var(--map-bg); font-family: inherit; }
.leaflet-bar a, .leaflet-control-zoom a {
  background: var(--panel); color: var(--text); border-color: var(--line);
}
.leaflet-bar a:hover { background: var(--panel-2); }
.leaflet-control-attribution {
  background: rgba(11, 15, 20, 0.7) !important; color: var(--muted) !important;
  font-size: 10px;
}
.leaflet-control-attribution a { color: var(--text-dim) !important; }

/* marker dot */
.gp-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(10, 14, 19, 0.9);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}
/* cluster */
.gp-cluster {
  background: var(--cluster-bg);
  border: 1.5px solid var(--accent);
  color: var(--cluster-fg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  box-shadow: var(--cluster-shadow);
  font-variant-numeric: tabular-nums;
}
.gp-cluster.lg { font-size: 13px; }

/* legend */
.legend {
  position: absolute; bottom: 18px; right: 14px; z-index: 600;
  background: var(--overlay); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  max-width: 200px; box-shadow: var(--shadow); font-size: 11px;
}
.legend h3 { margin: 0 0 8px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.legend-item { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--text-dim); }
.legend-item .fc-swatch { width: 10px; height: 10px; }

/* loader */
.loader {
  position: absolute; inset: 0; z-index: 700; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: var(--scrim); backdrop-filter: blur(3px);
  color: var(--text-dim); transition: opacity 0.3s, visibility 0s; font-size: 13px;
}
/* Скрытый лоадер обязан пропадать из отрисовки И хит-теста — не полагаемся только на opacity
   (на слабых устройствах переход opacity может «залипнуть» и оставить оверлей поверх карты). */
.loader.hidden { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 0.3s, visibility 0s 0.3s; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

/* ---------- Detail drawer ---------- */
.detail {
  position: absolute; top: 0; right: 0; height: 100%; width: 380px; max-width: 92vw;
  min-height: 0;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-left: 1px solid var(--line); z-index: 1200; box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: scroll;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
}
.detail.open { transform: translateX(0); }
.detail-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; font-size: 20px;
}
.detail-body { padding: 22px 20px; }
.d-loading { color: var(--muted); padding: 40px 0; text-align: center; }
.d-badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px;
  border-radius: 20px; font-size: 12px; font-weight: 600; margin-bottom: 12px;
  color: #fff;
}
.d-title { font-size: 17px; font-weight: 700; margin: 4px 0 4px; line-height: 1.3; }
.d-orig-name { font-size: 12px; color: var(--muted); margin-bottom: 4px; line-height: 1.35; }
.d-date { font-size: 12px; color: var(--accent); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.d-icon-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.d-icon-row img { width: 30px; height: 30px; }
.d-desc {
  font-size: 13.5px; line-height: 1.55; color: var(--text); margin-bottom: 16px;
  white-space: pre-wrap; word-break: break-word;
}
.d-section { margin-bottom: 16px; }
.d-section h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); margin: 0 0 8px;
}
.d-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12.5px; }
.d-meta .k { color: var(--muted); }
.d-meta .v { color: var(--text); word-break: break-word; }
.d-link {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; margin-bottom: 7px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 9px;
  color: var(--text); text-decoration: none; font-size: 12.5px; transition: border-color 0.12s;
  word-break: break-all;
}
.d-link:hover { border-color: var(--accent); }
.d-link .tag {
  font-size: 10px; padding: 2px 7px; border-radius: 12px; background: var(--accent-2);
  color: #fff; flex: none; font-weight: 600;
}
.d-actions { display: flex; gap: 8px; margin-top: 8px; }
.btn {
  flex: 1; text-align: center; padding: 10px; border-radius: 9px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid var(--line);
  background: var(--panel); color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(54, 194, 255, 0.12); }
.btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.danger { border-color: rgba(220, 68, 68, 0.45); color: #ff8e8e; }
.btn.danger:hover { border-color: #dc4444; color: #ffb0b0; }

/* ---------- Project Owl panel ---------- */
#owlPanel .panel-head { justify-content: flex-start; gap: 8px; }
.owl-src {
  font-size: 10px; padding: 2px 7px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--warn); white-space: nowrap;
}
#owlPanel .caret { margin-left: auto; }
.owl-status { font-size: 11px; color: var(--text-dim); margin: 0 0 8px; line-height: 1.4; }
.owl-actions { justify-content: flex-end; margin-bottom: 6px; }
.collapsible.closed .owl-layers,
.collapsible.closed .owl-status,
.collapsible.closed .owl-actions { display: none; }
.owl-layers { display: flex; flex-direction: column; gap: 2px; }
.owl-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border-radius: 8px; cursor: pointer; transition: background 0.12s; user-select: none;
}
.owl-item:hover { background: var(--panel); }
.owl-item.off { opacity: 0.4; }
.owl-item.off .fc-name { text-decoration: line-through; }
.owl-kind { font-size: 10px; color: var(--muted); width: 12px; text-align: center; flex: none; }
/* Заголовок группы внутри списка слоёв («Укрепления» / «Слои карты» у зеркала Манула):
   исходная карта делит переключатель ровно так же, и без разделителя виды укреплений
   и слои карты сливались бы в один длинный список. */
.owl-group {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: 8px 0 2px; padding: 0 8px;
}
.owl-group:first-child { margin-top: 0; }

/* Зеркало «Карта Манула»: образцы — отрезки линий, как на карте, а не круглые точки. */
#manulPanel .fc-swatch { width: 14px; height: 3px; border-radius: 2px; box-shadow: none; }

/* Слой «ЛБС»: образцы в панели повторяют вид на карте — сплошная синяя линия фронта
   и красное кольцо позиции, поэтому свотчи здесь не круглые точки, как у прочих слоёв. */
#lbsPanel .fc-swatch { box-shadow: none; }
.lbs-swatch-line { width: 14px; height: 3px; border-radius: 2px; background: #2f6fed; }
.lbs-swatch-pos {
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(229, 72, 77, 0.22); border: 1.5px solid #e5484d;
}

/* owl point marker — значок-«капля» как в исходной Google-карте (та же PNG, окрашенная маской) */
.gp-pin {
  width: 100%; height: 100%;
  -webkit-mask: url('/api/owl/pin') center / contain no-repeat;
          mask: url('/api/owl/pin') center / contain no-repeat;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.55));
}
.gp-cluster.owl {
  border-color: var(--warn);
  box-shadow: var(--cluster-shadow-owl);
}

/* dark popups */
.leaflet-popup-content-wrapper {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.leaflet-popup-tip { background: var(--panel-2); border: 1px solid var(--line); }
.leaflet-popup-content { margin: 10px 14px; font-size: 12.5px; line-height: 1.4; }
.leaflet-popup-content a { color: var(--accent); }
.pp-src { color: var(--muted); font-size: 10px; }
.pp-orig { color: var(--muted); font-size: 11px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }

/* ---------- Переключатель подложки ---------- */
.basemap {
  position: absolute; bottom: 18px; left: 14px; z-index: 600;
  display: flex; gap: 3px; padding: 4px;
  background: var(--overlay); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow);
}
.bm-btn {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: none; color: var(--text-dim);
  font-size: 12.5px; padding: 7px 11px; border-radius: 8px; cursor: pointer;
  transition: background 0.12s, color 0.12s; white-space: nowrap;
}
.bm-btn:hover { background: var(--panel); color: var(--text); }
.bm-btn.active { background: var(--accent-2); color: #fff; }

/* ---------- Переключатель источника ---------- */
.source-switch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 650; display: flex; flex-wrap: wrap; justify-content: center; gap: 3px;
  background: var(--overlay); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px; padding: 4px;
  box-shadow: var(--shadow); max-width: calc(100% - 120px);
}
.src-btn {
  border: none; background: transparent; color: var(--text-dim);
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 13px;
  border-radius: 9px; cursor: pointer; white-space: nowrap; transition: all 0.12s;
}
.src-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.src-btn.active { background: var(--accent-2); color: #fff; }

/* ---------- Google-переводчик ---------- */
/* убираем навязанный баннер сверху и сдвиг страницы (вернуть язык можно из выпадашки) */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
body > .skiptranslate,
.goog-te-gadget-icon { display: none !important; }
body, html.translated-ltr body, html.translated-rtl body { top: 0 !important; position: static !important; }
.goog-tooltip, .goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
.gt-box { line-height: 1; }
.gt-box .goog-te-gadget { font-size: 0; color: transparent; }
.gt-box .goog-te-gadget > span { display: none; } /* прячем "Powered by" текст рядом */
.gt-box .goog-te-combo {
  width: 100%; margin: 0;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  font-size: 13px; font-family: inherit; outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239fb0c3' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}
.gt-box .goog-te-combo:focus { border-color: var(--accent); }

/* ---------- Вкладка «Подразделения» ---------- */
.unit-pulse {
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; border: 3px solid var(--accent);
  animation: unitPulse 1.3s ease-out 3;
  pointer-events: none;
}
@keyframes unitPulse {
  0%   { transform: scale(0.35); opacity: 1; box-shadow: 0 0 0 0 rgba(54, 194, 255, 0.55); }
  100% { transform: scale(1.05); opacity: 0; box-shadow: 0 0 0 20px rgba(54, 194, 255, 0); }
}

.units-link {
  display: block; text-align: center; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 9px 11px; font-size: 13px; font-weight: 600;
  transition: border-color 0.12s, background 0.12s;
}
.units-link:hover { border-color: var(--accent); background: var(--panel-2); }
.quick-links {
  display: grid;
  gap: 8px;
}
.account-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.account-box.compact { margin-top: 12px; }
.account-name {
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
}
.account-role {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 12px;
}
.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.account-logout {
  padding: 0;
}
.back-link {
  color: var(--accent); text-decoration: none; font-size: 13px;
  display: inline-block; padding: 2px 0;
}
.back-link:hover { text-decoration: underline; }
.units-list { display: flex; flex-direction: column; gap: 1px; }
.unit-item {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px;
  border-radius: 8px; cursor: pointer; transition: background 0.12s; user-select: none;
}
.unit-item:hover { background: var(--panel); }
.unit-name {
  font-size: 12.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#unitsPanel .panel-head { justify-content: space-between; }

/* ---------- Слой «События» ---------- */
/* Точная точка события: устойчивый divIcon с явным размером и CSS fallback'ами. */
.ev-pin-wrap {
  background: none !important;
  border: none !important;
  width: 40px !important;
  height: 40px !important;
}
.ev-pin {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  transition: transform 0.16s ease, filter 0.16s ease;
}
.ev-pin::before,
.ev-pin::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.ev-pin::before {
  inset: 3px;
  background: rgba(var(--evc-rgb), 0.22);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
}
.ev-pin::after {
  inset: -3px;
  border: 2px solid rgba(var(--evc-rgb), 0.5);
  opacity: 0.85;
  animation: evPulse 2.6s ease-out infinite;
}
.ev-pin-core {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 2.5px solid var(--evc);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.42),
              0 0 0 4px rgba(var(--evc-rgb), 0.18);
  animation: evPopIn 0.28s ease-out;
}
.ev-pin-emoji {
  position: relative;
  z-index: 1;
  font-size: 15px;
  line-height: 1;
  transform: translateY(-0.5px);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.ev-pin:hover { transform: scale(1.12); filter: saturate(1.08); }

/* Счётчик по городу: делаем обёртку ненулевой, чтобы рендер был одинаковым в Safari/WebView. */
.ev-badge-wrap {
  background: none !important;
  border: none !important;
  width: 1px !important;
  height: 1px !important;
  overflow: visible !important;
}
.ev-badge {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 12px 4px 5px;
  border-radius: 999px;
  background: rgba(20, 27, 38, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid var(--evc);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28),
              0 0 0 3px rgba(var(--evc-rgb), 0.12);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  animation: evBadgeFloat 3.2s ease-in-out infinite;
}
.ev-badge:hover {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34),
              0 0 0 4px rgba(var(--evc-rgb), 0.18);
}
.ev-badge b {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--evc);
  color: #fff;
  font-size: 12px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.16);
}
.ev-badge span { color: var(--text-dim); }

@keyframes evPulse {
  0% {
    transform: scale(0.82);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}
@keyframes evPopIn {
  0% {
    transform: scale(0.72);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes evBadgeFloat {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -2px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ev-badge { background: var(--panel); }
}
@media (prefers-reduced-motion: reduce) {
  .ev-pin,
  .ev-pin-core,
  .ev-badge,
  .ev-search-pin,
  .live-dot.on,
  .spinner,
  .icon-btn.spin,
  .unit-pulse,
  .news-shell,
  .news-shell > *,
  .news-story-card,
  .news-brief-section,
  .wm-pin.wm-hot,
  .wm-zone-hot,
  .watch-pick-hint {
    animation: none !important;
  }
  .ev-row,
  .ev-thumb,
  .news-focus-chip,
  .news-featured,
  .news-story-card,
  .news-cta,
  .news-brief-item-action,
  .btn,
  .news-media {
    transition: none !important;
  }
}

/* Поиск по событиям */
.ev-search-field { margin-bottom: 10px; }
.ev-search-pin {
  font-size: 26px; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
  transform-origin: 50% 100%; animation: evPinDrop 0.5s ease;
}
@keyframes evPinDrop { 0% { transform: translateY(-14px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }

/* Панель «События» в сайдбаре */
.ev-hint { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin: 2px 0 10px; }
.ev-hint b { color: var(--text); font-weight: 600; }
.ev-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-leg-item {
  font-size: 11.5px; color: var(--text-dim); background: var(--line-soft);
  border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px;
}

/* ==========================================================================
   «Мой мониторинг» — метки наблюдения
   Цвет метки задаётся инлайновой переменной --wmc (как --evc у событий), чтобы не плодить
   :root-переменные под три состояния: quiet (--accent), new (--warn), hot (--bad).
   ========================================================================== */

/* --- пин метки на карте --- */
.wm-pin-wrap { background: none; border: 0; }
.wm-pin {
  /* Подпись «висит» НАД своей точкой (у точечной метки это северный край круга), поэтому
     сдвиг по вертикали на полную высоту, а не на половину: так она не накрывает события. */
  position: absolute; left: 0; top: 0; transform: translate(-50%, -115%);
  display: flex; align-items: center; gap: 6px;
  padding: 4px 9px 4px 5px; white-space: nowrap;
  background: var(--panel); color: var(--text);
  border: 1.5px solid var(--wmc); border-radius: 999px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
  font: 600 11.5px/1 var(--font-ui);
  cursor: pointer; transition: transform 0.12s ease;
}
.wm-pin:hover { transform: translate(-50%, -115%) scale(1.06); }
.wm-pin-core {
  display: grid; place-items: center; width: 20px; height: 20px; flex: none;
  border-radius: 50%; background: color-mix(in srgb, var(--wmc) 22%, transparent);
  font-size: 12px;
}
.wm-pin-label { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.wm-pin-badge {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--wmc); color: #0b0f14;
  font: 700 10.5px/1 var(--font-ui);
}
/* Пульсирует ТОЛЬКО пин, и только «горячий»: анимация SVG-круга на десятках меток
   роняет FPS при пане карты, а маленький DOM-узел — нет. */
.wm-pin.wm-hot { animation: wmPulse 1.7s ease-in-out infinite; }
@keyframes wmPulse {
  0%, 100% { box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45), 0 0 0 0 color-mix(in srgb, var(--wmc) 55%, transparent); }
  50% { box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45), 0 0 0 9px color-mix(in srgb, var(--wmc) 0%, transparent); }
}

/* --- зона радиуса (SVG path) --- */
.wm-zone { transition: opacity 0.15s ease; }
.wm-zone-hot { animation: wmDash 6s linear infinite; }
@keyframes wmDash { to { stroke-dashoffset: -120; } }
.wm-zone-preview { opacity: 0.85; }

/* --- панель --- */
.watch-actions { justify-content: space-between; align-items: center; margin: 2px 0 10px; }
.btn.xs { padding: 5px 10px; font-size: 12px; }

.watch-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
/* `display: flex` у класса перебивает браузерное `[hidden] { display: none }`, и форма
   осталась бы раскрытой при загрузке. То же для блоков «точка»/«город» внутри неё. */
.watch-form[hidden], .watch-form [hidden] { display: none; }
.watch-form label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.4px; }
.watch-form label b { color: var(--text); text-transform: none; letter-spacing: 0; }
.watch-form input[type='text'] {
  width: 100%; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit;
}
.watch-form input[type='range'] { width: 100%; accent-color: var(--accent); }
.watch-kind-switch { display: flex; gap: 6px; margin: 2px 0 10px; }

/* Нумерованные шаги: без них форма читалась как набор равнозначных полей и было неясно,
   с чего начинать. */
.wm-step {
  display: flex; align-items: center; gap: 7px; margin: 12px 0 4px;
  font-size: 11.5px; color: var(--text); text-transform: none; letter-spacing: 0;
}
.wm-step:first-child { margin-top: 2px; }
.wm-step-n {
  display: grid; place-items: center; width: 17px; height: 17px; flex: none;
  border-radius: 50%; background: var(--accent); color: #0b0f14;
  font: 700 10.5px/1 var(--font-ui);
}
.wm-pick-btn { width: 100%; justify-content: center; }
.wm-or { margin: 7px 0 4px; text-align: center; font-size: 11px; color: var(--muted); }
.wm-radius-presets { display: flex; gap: 5px; margin-bottom: 6px; }
.wm-radius-presets .chip { flex: 1; text-align: center; padding: 4px 0; font-size: 11.5px; }
/* Ответ на «а что вообще попадёт в метку» — до сохранения, а не после. */
.wm-preview-count {
  min-height: 16px; margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.4;
}
.wm-preview-count.has-hits { color: var(--accent); font-weight: 600; }
.watch-how {
  margin: 10px 0 12px; padding-left: 20px; text-align: left;
  font-size: 12px; color: var(--text-dim); line-height: 1.7;
}
.watch-how b { color: var(--text); }
/* Специфичность как у `.watch-form label`, иначе подпись чекбокса уезжает в КАПСЛОК. */
.watch-form label.watch-chk {
  display: flex; gap: 7px; align-items: flex-start; margin-top: 6px;
  font-size: 11.5px; color: var(--text-dim); text-transform: none; letter-spacing: 0; line-height: 1.4;
}
.watch-chk input { margin-top: 2px; flex: none; accent-color: var(--accent); }
.watch-form .form-actions { display: flex; gap: 8px; margin-top: 8px; }
.icon-btn.active { background: var(--accent); color: #0b0f14; border-color: var(--accent); }

/* --- список меток --- */
.watch-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.watch-card {
  position: relative; padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); border-left: 3px solid var(--wmc);
  background: var(--panel-2); cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.watch-card:hover { background: var(--panel); }
.watch-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.watch-card.is-focused { background: var(--panel); border-color: var(--wmc); }
.watch-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.watch-card-title { flex: 1; font-weight: 600; font-size: 13px; color: var(--text); }
.watch-card-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 999px; background: var(--wmc); color: #0b0f14; font: 700 11px/1 var(--font-ui);
}
.watch-card-meta { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; }
.watch-card-meta.muted { color: var(--muted); }
.watch-since { color: var(--text); font-variant-numeric: tabular-nums; }
.watch-card-note {
  margin-top: 5px; padding-left: 8px; border-left: 2px solid var(--line);
  font-size: 11.5px; color: var(--muted); font-style: italic;
}
.watch-card-actions { display: flex; gap: 10px; margin-top: 7px; }
.watch-card-actions .link-btn.danger { color: var(--bad); }

/* --- лента попаданий --- */
.watch-feed-head { margin-top: 4px; }
.watch-feed { gap: 8px; }
.watch-hit { border-radius: var(--radius); }
.watch-hit-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 3px;
  font-size: 11px; color: var(--text-dim);
}
.watch-hit-marks { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-new-dot {
  flex: none; padding: 1px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--warn) 20%, transparent);
  border: 1px solid var(--warn); color: var(--warn); font: 700 9.5px/1.5 var(--font-ui);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.watch-hit.is-new .ev-row { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }

/* --- пустые состояния --- */
.watch-empty { padding: 18px 14px; text-align: center; }
.watch-empty-icon { font-size: 28px; line-height: 1; margin-bottom: 8px; opacity: 0.85; }
.watch-empty-title { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 5px; }
.watch-empty-text { font-size: 12px; color: var(--text-dim); line-height: 1.55; }
.watch-empty .btn { margin-top: 12px; }

/* --- режим постановки метки кликом --- */
#map.watch-picking { cursor: crosshair; }
#map.watch-picking .leaflet-grab { cursor: crosshair; }
.watch-pick-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 900;
  padding: 11px 18px; border-radius: 999px;
  background: var(--accent); border: 1px solid var(--accent); color: #0b0f14;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow); pointer-events: none;
  animation: wmHintIn 0.18s ease-out;
}
.watch-pick-hint b { font-weight: 700; }
@keyframes wmHintIn { from { opacity: 0; transform: translate(-50%, 6px); } }

/* Карточка события: эмодзи-категория + галерея фото */
.ev-cat-emoji { font-size: 30px; line-height: 1; }
.ev-photos { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.ev-photo {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
  background: #000;
}
.ev-photo-video {
  max-height: min(52vh, 420px);
  object-fit: contain;
}
/* Вложения, у которых нет картинки: голосовые/музыка и документы. */
.ev-audio { width: 100%; display: block; }
.ev-file {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  text-decoration: none;
  word-break: break-all;
}

/* Лента списка событий города/части */
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev-row {
  position: relative;
  display: flex; gap: 10px; padding: 8px; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; background: var(--panel);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.ev-row-delete,
.news-story-delete {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 24px; height: 24px; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--danger, #e5484d) 12%, var(--panel));
  color: var(--danger, #e5484d); font-size: 16px; font-weight: 700;
  cursor: pointer; transition: background 0.15s ease, transform 0.15s ease;
}
.ev-row-delete:hover,
.news-story-delete:hover {
  background: var(--danger, #e5484d); color: #fff; transform: scale(1.08);
}
.ev-row-delete:disabled,
.news-story-delete:disabled { opacity: 0.5; cursor: default; transform: none; }
.ev-row:hover,
.ev-row:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(54, 194, 255, 0.12);
}
.ev-thumb {
  width: 60px; height: 60px; border-radius: 9px; object-fit: cover;
  flex: 0 0 auto; border: 1px solid var(--line);
  background: #000;
  transition: transform 0.22s ease, filter 0.22s ease, border-color 0.22s ease;
}
.ev-thumb-video { pointer-events: none; }
.ev-row:hover .ev-thumb,
.ev-row:focus-visible .ev-thumb {
  transform: scale(1.03);
  border-color: color-mix(in srgb, var(--evc, var(--accent)) 34%, var(--line));
  filter: saturate(1.04);
}
.ev-row-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ev-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ev-chip {
  font-size: 11px; font-weight: 600; color: #fff; padding: 2px 8px;
  border-radius: 999px; white-space: nowrap;
}
.ev-row-place {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.ev-row-date { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ev-row-text {
  font-size: 12.5px; color: var(--text-dim); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-feed { padding-bottom: 8px; }
.news-sidebar-brief {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.news-sidebar-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 58%),
    linear-gradient(180deg, var(--panel), var(--bg-2));
}
.news-sidebar-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1;
  margin-top: 4px;
}
.news-sidebar-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* News workspace */
#mapWrap.news-mode #map {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
#mapWrap.news-mode .leaflet-control-container {
  opacity: 0;
  pointer-events: none;
}
#mapWrap.news-mode #legend,
#mapWrap.news-mode #basemap {
  display: none !important;
}
#mapWrap.news-mode #sourceSwitch {
  left: 24px;
  right: 24px;
  top: 22px;
  transform: none;
  justify-content: flex-start;
  max-width: min(760px, calc(100% - 48px));
  z-index: 760;
}
.news-workspace {
  position: absolute;
  inset: 0;
  z-index: 720;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at top left, rgba(62, 118, 255, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(245, 122, 31, 0.16), transparent 30%),
    linear-gradient(180deg, #0a1017 0%, #0f1822 38%, #111723 100%);
}
body.light .news-workspace {
  background:
    radial-gradient(circle at top left, rgba(34, 118, 214, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(212, 112, 38, 0.14), transparent 30%),
    linear-gradient(180deg, #edf2f7 0%, #e9eef4 38%, #f4f7fb 100%);
}
.news-workspace-inner {
  min-height: 100%;
  padding: 88px 26px 30px;
}
.news-shell {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  gap: 22px;
  animation: newsReveal 0.42s ease;
}
.news-shell > * {
  animation: newsCardIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.news-shell > *:nth-child(1) { animation-delay: 0.04s; }
.news-shell > *:nth-child(2) { animation-delay: 0.08s; }
.news-shell > *:nth-child(3) { animation-delay: 0.12s; }
.news-shell > *:nth-child(4) { animation-delay: 0.16s; }
.news-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.95fr);
  gap: 20px;
}
.news-hero-panel,
.news-focusbar,
.news-featured,
.news-brief,
.news-timeline-wrap {
  position: relative;
  border: 1px solid rgba(151, 173, 198, 0.16);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 42%),
    rgba(9, 15, 22, 0.74);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}
body.light .news-hero-panel,
body.light .news-focusbar,
body.light .news-featured,
body.light .news-brief,
body.light .news-timeline-wrap {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.68)),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 22px 60px rgba(59, 77, 102, 0.14);
}
.news-hero-copy {
  padding: 28px;
  overflow: hidden;
}
.news-hero-copy::before {
  content: "";
  position: absolute;
  inset: auto auto -80px -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(54, 194, 255, 0.22), transparent 70%);
  pointer-events: none;
}
.news-eyebrow,
.news-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #9bc9ff;
}
body.light .news-eyebrow,
body.light .news-section-kicker {
  color: #0f5ba8;
}
.news-hero-copy h2 {
  margin: 0;
  max-width: 9.5em;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 54px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.news-hero-copy p {
  max-width: 60ch;
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
}
.news-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}
.news-stat {
  padding: 14px 15px;
  border: 1px solid rgba(151, 173, 198, 0.14);
  border-radius: 18px;
  background: rgba(8, 13, 20, 0.32);
}
body.light .news-stat {
  background: rgba(255, 255, 255, 0.72);
}
.news-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.news-stat-value {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1;
}
.news-stat-note {
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-dim);
}
.news-hero-side {
  padding: 22px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.news-hero-side h3,
.news-brief h3,
.news-featured h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.03em;
}
.news-hero-side p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.55;
}
.news-bullet-list,
.news-brief-list {
  display: grid;
  gap: 10px;
}
.news-bullet,
.news-brief-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(151, 173, 198, 0.12);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
body.light .news-bullet,
body.light .news-brief-item {
  background: rgba(255, 255, 255, 0.62);
}
.news-brief-item-action {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
}
.news-brief-item-action:hover,
.news-brief-item-action:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(54, 194, 255, 0.34);
  box-shadow: 0 12px 28px rgba(54, 194, 255, 0.1);
}
.news-bullet-mark {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(54, 194, 255, 0.12);
}
.news-bullet-label {
  font-size: 13px;
  color: var(--text);
}
.news-bullet-value,
.news-brief-meta {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.news-focusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px 16px;
}
.news-focusbar-title {
  margin-right: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.news-focus-chip {
  border: 1px solid rgba(151, 173, 198, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.news-focus-chip:hover,
.news-focus-chip.active,
.news-focus-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(54, 194, 255, 0.48);
  color: var(--text);
  background: rgba(54, 194, 255, 0.12);
}
.news-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(151, 173, 198, 0.16);
  border-radius: 999px;
  background: rgba(9, 15, 22, 0.6);
  justify-self: start;
}
body.light .news-tabs { background: rgba(255, 255, 255, 0.72); }
.news-tab {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}
.news-tab:hover,
.news-tab:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.news-tab.active {
  color: var(--text);
  background: rgba(54, 194, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(54, 194, 255, 0.42);
}
.news-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.78fr);
  gap: 20px;
  align-items: start;
}
.news-featured {
  position: relative;
  padding: 24px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}
.news-featured:hover,
.news-featured:focus-visible,
.news-story-card:hover,
.news-story-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(54, 194, 255, 0.32);
  box-shadow: 0 22px 48px rgba(16, 28, 44, 0.22);
}
.news-featured-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}
.news-story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.news-story-badge,
.news-story-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.news-story-badge {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(151, 173, 198, 0.14);
}
.news-story-side {
  color: #fff;
}
.news-story-time {
  font-size: 12px;
  color: var(--muted);
}
.news-featured-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 38px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.news-featured-desc {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
}
.news-featured-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.news-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(151, 173, 198, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.news-cta:hover,
.news-cta:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(54, 194, 255, 0.42);
  box-shadow: 0 12px 24px rgba(54, 194, 255, 0.12);
}
.news-cta.primary {
  background: linear-gradient(135deg, #0a6ed1, #36c2ff);
  border-color: transparent;
  color: #fff;
}
.news-media {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid rgba(151, 173, 198, 0.14);
  background: #070b10;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease, border-color 0.3s ease;
}
.news-media-video { pointer-events: none; }
.news-featured:hover .news-media,
.news-featured:focus-visible .news-media,
.news-story-card:hover .news-media,
.news-story-card:focus-visible .news-media {
  transform: scale(1.02);
  filter: saturate(1.04);
  border-color: rgba(54, 194, 255, 0.24);
}
.media-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(var(--evc-rgb, 154, 164, 178), 0.2), transparent 42%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(8, 12, 19, 0.92));
}
body.light .media-fallback {
  background:
    radial-gradient(circle at top left, rgba(var(--evc-rgb, 154, 164, 178), 0.14), transparent 42%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.7), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(229, 236, 245, 0.92));
}
.media-fallback-art {
  position: relative;
  width: min(120px, 70%);
  aspect-ratio: 1.5;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(var(--evc-rgb, 154, 164, 178), 0.18), rgba(7, 10, 16, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
body.light .media-fallback-art {
  border-color: rgba(102, 126, 155, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.media-fallback-sun {
  position: absolute;
  top: 16%;
  right: 16%;
  width: 20%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.08);
}
.media-fallback-ridge {
  position: absolute;
  inset: auto 10% 14% 10%;
  border-radius: 999px 999px 14px 14px;
  background: rgba(255, 255, 255, 0.18);
}
.media-fallback-ridge-back {
  height: 28%;
  transform: skewX(-16deg);
  opacity: 0.66;
}
.media-fallback-ridge-front {
  inset: auto 18% 0 6%;
  height: 42%;
  background: rgba(var(--evc-rgb, 154, 164, 178), 0.38);
  transform: skewX(18deg);
}
.media-fallback-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.media-fallback-compact {
  gap: 0;
}
.media-fallback-compact .media-fallback-art {
  width: 74%;
  border-radius: 12px;
}
.media-fallback-compact .media-fallback-label {
  display: none;
}
.news-featured-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.news-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(151, 173, 198, 0.12);
}
.news-brief {
  padding: 22px;
  display: grid;
  gap: 18px;
}
.news-brief-section {
  display: grid;
  gap: 10px;
}
.news-brief-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.news-brief-head span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.news-brief-name {
  font-size: 13px;
  color: var(--text);
}
.news-brief-share {
  font-family: var(--font-display);
  font-size: 17px;
}
.news-timeline-wrap {
  padding: 22px;
}
.news-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.news-section-head p {
  margin: 8px 0 0;
  color: var(--text-dim);
}
.news-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.news-story-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(151, 173, 198, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
  animation: newsCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--enter-delay, 0s);
}
body.light .news-story-card {
  background: rgba(255, 255, 255, 0.64);
}
.news-story-card .news-media {
  min-height: 170px;
  border-radius: 18px;
}
.news-story-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.news-story-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
}
.news-empty {
  padding: 44px 18px;
  text-align: center;
  color: var(--text-dim);
}

@keyframes newsReveal {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes newsCardIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Responsive ---------- */
/* Раскладка телефона (панель-ящик, лента разделов, карточка на весь экран) — в блоке
   «Телефоны» в конце файла: он обязан идти ПОСЛЕ правил новостной ленты и дашборда. */
@media (max-width: 720px) {
  .news-shell,
  .news-hero,
  .news-main-grid,
  .news-featured-grid,
  .news-timeline {
    grid-template-columns: 1fr;
  }
  .news-hero-copy,
  .news-hero-side,
  .news-featured,
  .news-brief,
  .news-timeline-wrap {
    padding: 18px;
    border-radius: 22px;
  }
  .news-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .news-featured-title {
    font-size: 28px;
  }
  .news-story-title {
    font-size: 18px;
  }
  .news-media {
    min-height: 180px;
  }
  .news-story-card .news-media {
    min-height: 150px;
  }
}

@media (max-width: 1080px) {
  .news-hero,
  .news-main-grid,
  .news-timeline {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Читаемая новостная лента: одна широкая колонка, крупный
   яркий текст с переносами, плавное появление и hover.
   (переопределяет правила выше — идёт последним)
   ============================================================ */
.news-timeline {
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 860px;
  margin: 4px auto 0;
}
.news-story-card {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  opacity: 0;
  animation: nfcCardIn 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  animation-delay: var(--enter-delay, 0s);
}
.news-story-media {
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-soft);
}
.news-story-media .news-media {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 400px;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.news-story-card:hover .news-story-media .news-media,
.news-story-card:focus-visible .news-story-media .news-media {
  transform: scale(1.045);
  filter: none;
  border: 0;
}
.news-story-body {
  padding: 16px 20px 18px;
}
.news-story-meta {
  margin-bottom: 10px;
}
.news-story-time {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-dim);
}
.news-story-desc {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-line-clamp: unset;
  overflow: visible;
  display: block;
}
.news-story-card .news-featured-tags {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  align-items: center;
}
.news-open-hint {
  margin-left: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.news-story-card:hover .news-open-hint,
.news-story-card:focus-visible .news-open-hint {
  opacity: 1;
  transform: none;
}
.news-story-card:hover,
.news-story-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(54, 194, 255, 0.42);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}
body.light .news-story-card {
  box-shadow: 0 4px 16px rgba(40, 60, 90, 0.08);
}
body.light .news-story-card:hover,
body.light .news-story-card:focus-visible {
  box-shadow: 0 18px 40px rgba(40, 60, 90, 0.16);
}
.news-timeline-wrap {
  padding: 18px 20px 22px;
}
@keyframes nfcCardIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .news-story-card { animation: none; opacity: 1; }
  .news-story-card:hover,
  .news-story-card:focus-visible { transform: none; }
  .news-story-media .news-media { transition: none; }
  .news-story-card:hover .news-story-media .news-media { transform: none; }
}
@media (max-width: 640px) {
  .news-story-body { padding: 13px 15px 15px; }
  .news-story-desc { font-size: 15px; }
  .news-story-media,
  .news-story-media .news-media { max-height: 300px; }
}

/* ============================================================
   Аналитика / Статистика — премиальный дашборд событий
   (переиспользует .news-workspace / .news-hero-panel / .news-stat)
   ============================================================ */
.stats-head { padding: 26px 28px 22px; }
.stats-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.stats-head-copy { min-width: 0; }
.stats-title {
  margin: 0; font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 40px); line-height: 1.03; letter-spacing: -0.035em; color: var(--text);
}
.stats-sub { max-width: 64ch; margin: 12px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--text-dim); }
.stats-sub b { color: var(--text); }
.stats-range { display: inline-flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; justify-content: flex-end; }
.news-hero-stats.stats-kpis { margin-top: 22px; }

.stats-chart-panel { padding: 20px 22px 22px; }
.stats-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.stats-panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.stg-legend { display: inline-flex; gap: 14px; flex-wrap: wrap; }
.stg-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.stg-leg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.stg-wrap { position: relative; width: 100%; }
.stg-svg { width: 100%; height: auto; display: block; overflow: visible; }
.stg-grid { stroke: var(--line-soft); stroke-width: 1; }
.stg-ylabel, .stg-xlabel { fill: var(--muted); font-size: 12px; font-family: var(--font-ui); }
.stg-endlbl { font-size: 12.5px; font-weight: 700; font-family: var(--font-ui); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.stg-cross { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.65; pointer-events: none; }
.stg-dot { stroke: var(--panel); stroke-width: 2; pointer-events: none; }
.stg-capture { cursor: crosshair; }

.stg-tip {
  position: absolute; top: 6px; transform: translateX(-50%); pointer-events: none; z-index: 5;
  background: var(--overlay); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42); backdrop-filter: blur(8px); min-width: 156px;
}
.stg-tip.flip { transform: translateX(-100%) translateX(-14px); }
.stg-tip-date { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.stg-tip-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.stg-tip-row b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.stg-tip-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }

.stats-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.stats-block { padding: 20px 22px 22px; }
.stats-mini-note { margin: 4px 0 14px; font-size: 12.5px; color: var(--muted); }
.stbars { display: flex; flex-direction: column; gap: 11px; }
.stbar-row { display: flex; align-items: center; gap: 12px; }
.stbar-name { width: 92px; flex-shrink: 0; font-size: 13px; color: var(--text-dim); }
.stbar-track { flex: 1; min-width: 0; height: 12px; border-radius: 999px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line-soft); }
.stbar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.sttype-fill { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.stbar-val { width: 62px; flex-shrink: 0; text-align: right; font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.sttype-ic { width: 26px; height: 26px; flex-shrink: 0; object-fit: contain; }
.sttype-row { gap: 10px; }

.stats-disclaimer { max-width: 92ch; margin: 4px auto 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* --- Честная подача: плашка «как читать», композиция событий, реальный урон --- */
.stats-howto {
  margin-top: 18px; padding: 14px 16px; border-radius: 14px;
  background: var(--panel-2);
  background: color-mix(in srgb, var(--accent) 9%, var(--panel-2));
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}
.stats-howto-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); margin-bottom: 6px; }
.stats-howto p { margin: 0; font-size: 13.5px; line-height: 1.62; color: var(--text-dim); }
.stats-howto b { color: var(--text); }

.stats-comp { padding: 20px 22px 22px; }
.comp-list { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
.comp-row { display: flex; flex-direction: column; gap: 8px; }
.comp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.comp-total { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.comp-track { height: 16px; }
.comp-nums { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.comp-num { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.comp-num i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.comp-num b { color: var(--text); font-variant-numeric: tabular-nums; }
.stats-callout-line {
  margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6;
  color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--line-soft);
}
.stats-callout-line b { color: var(--text); }

.vbars { display: flex; flex-direction: column; gap: 12px; }
.vrow { display: flex; align-items: center; gap: 12px; }
.vrow-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.35; }
.vrow-track { width: 84px; flex-shrink: 0; height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line-soft); }
.vrow-fill { display: block; height: 100%; border-radius: 999px; transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.vrow-val { width: 44px; flex-shrink: 0; text-align: right; font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

body.light .stg-endlbl { stroke: #ffffff; }
body.light .stg-dot { stroke: #ffffff; }
body.light .stg-tip { background: rgba(255, 255, 255, 0.94); }

@media (max-width: 860px) {
  .stats-secondary { grid-template-columns: 1fr; }
  .stats-head-row { flex-direction: column; }
  .news-hero-stats.stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gbar-name { width: 108px; }
}

/* Техника (gearItems) в дашборде — стек-бары по сторонам */
.gear-progress { font-size: 12.5px; color: var(--text-dim); margin-bottom: 10px; }
.gear-progress b { color: var(--text); font-variant-numeric: tabular-nums; }
.gear-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 2px 0 12px; }
.gear-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 16px 0 9px; }
.gbars { display: flex; flex-direction: column; gap: 9px; }
.gbar-row { display: flex; align-items: center; gap: 10px; }
.gbar-name { width: 154px; flex-shrink: 0; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gbar-track { flex: 1; min-width: 0; height: 12px; border-radius: 999px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line-soft); display: flex; }
.gbar-seg { height: 100%; transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.gbar-val { width: 54px; flex-shrink: 0; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* Oryx — выверенные потери техники */
.oryx-panel { padding: 22px 24px 24px; }
.oryx-updated { font-size: 12px; color: var(--muted); margin: 4px 0 16px; }
.oryx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.oryx-side-head { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.oryx-total { font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 46px); line-height: 1; letter-spacing: -0.03em; }
.oryx-break { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.oryx-break span { font-size: 11.5px; color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 3px 8px; }
.oryx-break b { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .oryx-grid { grid-template-columns: 1fr; } }

/* Уверенность привязки рядом с точностью в карточке события: подпись вторична по отношению
   к самому значению точности, поэтому приглушена. */
.d-conf {
  color: var(--muted, #9fb0c3);
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- Вкладка «Погода и тревоги» ---------- */
/* Холст ветра лежит над панами Leaflet, но ниже элементов управления карты (у них z-index
   800/1000). pointer-events:none — клики уходят на карту, попапы работают как обычно. */
.wx-canvas {
  position: absolute; inset: 0; z-index: 640;
  display: none; pointer-events: none;
}
.wx-canvas.on { display: block; }
/* Холст ветра живёт отдельным слоем поверх карты. Явно поднимаем popup-pane выше него:
   иначе в некоторых сборках Leaflet его pane наследовал низкий z-index и анимированные
   линии визуально проходили поверх открытой карточки угрозы/погоды. */
#map .leaflet-popup-pane { z-index: 1100 !important; }

.wx-airport {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bad); color: #fff; font-size: 11px;
  border: 1.5px solid rgba(0, 0, 0, 0.5); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Сводка по регионам под тревогой */
.wx-sum-head { font-size: 12.5px; color: var(--text-dim); margin: 4px 0 8px; }
.wx-sum-head b { color: var(--text); font-variant-numeric: tabular-nums; }
.wx-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 8px; margin-bottom: 4px;
  background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 9px;
  color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
}
.wx-row:hover { border-color: var(--accent); }
.wx-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.wx-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-row-kind { color: var(--muted); font-size: 11px; white-space: nowrap; }
.wx-calm { font-size: 12.5px; color: var(--good); padding: 6px 0; }

.wx-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 10px 0 8px; }
.wx-leg { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); }
.wx-leg i { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.wx-attrib a { color: var(--text-dim); }

/* Карточки на карте (погода и тревога) */
.wx-popup-wrap .leaflet-popup-content { margin: 12px 14px; }
.wx-popup { font-size: 12.5px; line-height: 1.5; min-width: 210px; }
.wx-pop-title { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.wx-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.wx-chip {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(239, 68, 68, 0.16); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3);
}
.wx-pop-text { color: var(--text-dim); white-space: pre-line; margin-bottom: 7px; }
.wx-pop-foot { color: var(--muted); font-size: 10.5px; margin-top: 7px; }

.wx-wind-block { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.wx-wind-row { display: flex; align-items: baseline; gap: 7px; }
.wx-wind-h { width: 52px; flex-shrink: 0; color: var(--muted); font-size: 11px; }
.wx-wind-row b { font-variant-numeric: tabular-nums; }
.wx-wind-dir { color: var(--text-dim); font-size: 11.5px; }

.wx-pop-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px;
  padding: 7px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.wx-pop-note { color: var(--text-dim); margin-top: 7px; }
.wx-verdict { margin-top: 7px; padding: 6px 8px; border-radius: 8px; font-weight: 600; }
.wx-verdict.ok { background: rgba(52, 211, 153, 0.14); color: var(--good); }
.wx-verdict.warn { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.wx-verdict.bad { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }

.wx-here-btn {
  display: block; width: 100%; margin-top: 9px; padding: 6px 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 12px; cursor: pointer;
}
.wx-here-btn:hover { border-color: var(--accent); }

/* Направления пролёта: «бегущий» пунктир от источника к цели. Анимация — CSS по SVG-пути,
   ради неё стрелки и рисуются отдельным svg-рендерером (карта в целом на canvas). */
.wx-arrow {
  stroke-dasharray: 7 11;
  animation: wx-arrow-flow 1.05s linear infinite;
}
@keyframes wx-arrow-flow { to { stroke-dashoffset: -18; } }
.wx-arrowhead { line-height: 0; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
/* Бегущий пунктир — декоративная подсказка направления; при запрете анимаций
   оставляем статичный штрих, направление всё равно читается по наконечнику. */
@media (prefers-reduced-motion: reduce) {
  .wx-arrow { animation: none; }
}

/* ---------- Статистика тревог ---------- */
.rs-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.rs-controls select { flex: 1; min-width: 130px; }
.rs-range { margin: 0; }

.rs-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.rs-tile {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 6px; text-align: center; min-width: 0;
}
.rs-tile b { display: block; font-size: 15px; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.rs-tile span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--text-dim); line-height: 1.25; }

.rs-block { margin-bottom: 14px; }
.rs-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); margin-bottom: 6px; }
.rs-sub { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .75; }

.rs-bars { display: flex; flex-direction: column; gap: 2px; }
.rs-bar-row { display: grid; grid-template-columns: 42px 1fr 26px; align-items: center; gap: 6px; }
.rs-bar-label { font-size: 10px; color: var(--text-dim); text-align: right; white-space: nowrap; }
.rs-bar-track { height: 11px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.rs-bar { display: block; height: 100%; border-radius: 3px; background: var(--accent-2); }
.rs-bar.hot { background: #f97316; }
.rs-bar-val { font-size: 10px; color: var(--text-dim); text-align: left; }
/* Часовой профиль плотнее дневного — 24 строки подряд иначе занимают пол-экрана. */
.rs-hours .rs-bar-row { grid-template-columns: 22px 1fr 24px; }
.rs-hours .rs-bar-track { height: 9px; }

.rs-heat { display: flex; flex-direction: column; gap: 2px; }
.rs-heat-row { display: flex; align-items: center; gap: 2px; }
.rs-heat-day { width: 20px; flex: none; font-size: 10px; color: var(--text-dim); }
.rs-heat-cell {
  flex: 1; height: 12px; min-width: 0; border-radius: 2px;
  background: var(--panel-2); font-size: 8px; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
}
.rs-heat-axis .rs-heat-cell { background: none; height: 12px; }

.rs-top-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 6px; align-items: baseline; padding: 3px 0; border-bottom: 1px solid var(--line); }
.rs-top-row:last-child { border-bottom: none; }
.rs-top-n { font-weight: 700; font-size: 12px; color: #f97316; text-align: right; }
.rs-top-name { font-size: 11.5px; min-width: 0; overflow-wrap: anywhere; }
.rs-top-min { font-size: 10px; color: var(--text-dim); white-space: nowrap; }

/* ==========================================================================
   «Объекты» — общий слой инфраструктуры (JIGA) и постоянный мониторинг поражений.
   Визуальный язык взят у «Моих меток» (.watch-*): те же карточки, отступы и пустые
   состояния — вкладки должны читаться как один инструмент, а не два разных.
   Цвет набора приходит из данных в переменной --ic.
   ========================================================================== */

.infra-sub-head { margin-top: 14px; }
.infra-sub-head h3 {
  margin: 0; font: 600 12px/1.2 var(--font-ui); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-dim);
}

/* ---- сводка ---- */
.infra-summary { margin: 10px 0 4px; }
.infra-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.infra-stat {
  padding: 9px 8px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel-2);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.infra-stat.is-hot { border-color: rgba(239, 68, 68, 0.55); }
.infra-stat-n { font: 700 19px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.infra-stat.is-hot .infra-stat-n { color: var(--bad); }
.infra-stat-l { font-size: 10.5px; line-height: 1.25; color: var(--text-dim); }
.infra-summary-foot {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  margin-top: 8px; font-size: 11.5px; color: var(--text-dim);
}
.infra-new-pill {
  padding: 3px 9px; border-radius: 999px; font-weight: 600;
  background: rgba(251, 191, 36, 0.14); color: var(--warn);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

/* ---- наборы ---- */
.infra-family-layers { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:6px; margin-top:8px; }
.infra-family-layer {
  display:grid; grid-template-columns:auto minmax(0, 1fr) auto; gap:6px; align-items:center;
  min-width:0; padding:8px 9px; border:1px solid var(--line); border-radius:var(--radius);
  color:var(--text-dim); background:var(--panel-2); cursor:pointer; font:inherit; text-align:left;
  transition:background .12s, border-color .12s, color .12s;
}
.infra-family-layer:hover { background:var(--panel); color:var(--text); }
.infra-family-layer.is-on { color:var(--text); border-color:var(--accent); background:color-mix(in srgb, var(--accent) 12%, var(--panel-2)); }
.infra-family-layer.is-partial { color:var(--text); border-color:rgba(96,165,250,.45); }
.infra-family-layer b { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.infra-family-layer small { font-size:10px; color:var(--text-dim); font-variant-numeric:tabular-nums; }
.infra-layer-note { margin:7px 1px 2px; color:var(--text-dim); font-size:10.5px; line-height:1.35; }
.infra-sets { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.infra-set {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: var(--radius); cursor: pointer; text-align: left;
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  background: var(--panel-2); color: var(--text);
  font: inherit; transition: border-color 0.12s, background 0.12s, opacity 0.12s;
  opacity: 0.55;
}
.infra-set:hover { background: var(--panel); }
.infra-set.is-on { opacity: 1; border-left-color: var(--ic); border-color: var(--line); }
.infra-set-dot {
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: color-mix(in srgb, var(--ic) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--ic) 55%, transparent);
}
.infra-set-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.infra-set-title { font-size: 12.5px; font-weight: 600; }
.infra-set-meta { font-size: 10.5px; color: var(--text-dim); }
.infra-more { margin-top: 8px; }
.infra-more > summary {
  cursor: pointer; font-size: 11.5px; color: var(--text-dim);
  padding: 4px 0; list-style: none;
}
.infra-more > summary::-webkit-details-marker { display: none; }
.infra-more > summary::before { content: '▸ '; }
.infra-more[open] > summary::before { content: '▾ '; }

/* ---- «под ударом» ---- */
.infra-struck { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.infra-struck-card {
  padding: 9px 11px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line); border-left: 3px solid var(--ic);
  background: var(--panel-2); transition: background 0.12s, border-color 0.12s;
}
.infra-struck-card:hover { background: var(--panel); }
.infra-struck-card.is-focused { border-color: var(--accent); background: var(--panel); }
.infra-struck-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.infra-struck-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.infra-struck-title { font-size: 12.5px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.infra-struck-badge {
  flex: none; min-width: 20px; padding: 1px 6px; border-radius: 999px;
  font: 700 11px/1.5 var(--font-ui); text-align: center;
  background: rgba(239, 68, 68, 0.16); color: var(--bad);
  border: 1px solid rgba(239, 68, 68, 0.45);
}
.infra-struck-badge.is-fresh { background: var(--bad); color: #fff; }
.infra-struck-meta { font-size: 10.5px; color: var(--text-dim); margin-top: 3px; }

/* ---- лента поражений ---- */
.infra-feed { margin-top: 8px; }
.infra-hit { margin-bottom: 10px; }
.infra-hit-head { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 4px; }
.infra-hit-object {
  display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%;
  padding: 2px 8px; border-radius: 999px; cursor: pointer;
  font: 600 11px/1.6 var(--font-ui); color: var(--text);
  background: color-mix(in srgb, var(--ic) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ic) 50%, transparent);
}
.infra-hit-object:hover { background: color-mix(in srgb, var(--ic) 26%, transparent); }
.infra-hit-dist { font-weight: 400; font-size: 10px; color: var(--text-dim); }
.infra-kept-pill {
  padding: 2px 8px; border-radius: 999px; font: 600 10.5px/1.6 var(--font-ui);
  background: rgba(52, 211, 153, 0.14); color: var(--good);
  border: 1px solid rgba(52, 211, 153, 0.4);
}
/* Новость, привязанная к объекту по тексту (news_verified): не поражение, а упоминание. */
.infra-news-pill {
  padding: 2px 8px; border-radius: 999px; font: 600 10.5px/1.6 var(--font-ui);
  background: rgba(96, 165, 250, 0.14); color: var(--accent, #60a5fa);
  border: 1px solid rgba(96, 165, 250, 0.4);
}
.infra-hit.is-kept .ev-row { border-left: 2px solid rgba(52, 211, 153, 0.5); }
.infra-object-feed { max-height: none; }

/* ---- метки на карте ---- */
.infra-pin-wrap { background: none; border: none; }
.infra-pin {
  position: relative; width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  background: var(--panel); border: 1.5px solid var(--ic);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease;
}
.infra-pin:hover { transform: scale(1.15); }
.infra-pin.is-struck { border-color: var(--bad); border-width: 2px; }
.infra-pin-core { line-height: 1; }
.infra-pin-badge {
  position: absolute; top: -7px; right: -7px; min-width: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--bad); color: #fff;
  font: 700 10px/16px var(--font-ui); text-align: center;
  box-shadow: 0 0 0 2px var(--panel);
}
/* Свежее поражение (до 48 ч) пульсирует — на карте это единственный способ отличить
   «ударили только что» от «ударили в прошлом году», не открывая карточку. */
.infra-pin.is-fresh { animation: infra-pulse 1.8s ease-in-out infinite; }
@keyframes infra-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55), 0 2px 8px rgba(0, 0, 0, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0), 0 2px 8px rgba(0, 0, 0, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
  .infra-pin.is-fresh { animation: none; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.45); }
}
.infra-ring { pointer-events: none; }
.infra-cluster {
  background: var(--cluster-bg); border: 1.5px solid #8b5cf6; color: var(--cluster-fg);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12), 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.light .infra-pin { background: #fff; }
body.light .infra-pin-badge { box-shadow: 0 0 0 2px #fff; }

@media (max-width: 720px) {
  .infra-summary-grid { grid-template-columns: 1fr 1fr; }
  .infra-stat:last-child { grid-column: span 2; }
}

/* ---------- Погода / БПЛА: живые сообщения тревоги ---------- */
/* Маркер — сообщение источника в населённом пункте, НЕ координата борта. Пульсация помогает
   увидеть свежие сообщения, а не создаёт ложное впечатление о треке. */
.radar-drone-wrap, .radar-flight-wrap { background: transparent; border: 0; }
.radar-drone { position: relative; width: 38px; height: 38px; display: grid; place-items: center; }
.radar-drone-radar, .radar-drone-pulse { position: absolute; inset: 5px; border: 1.5px solid rgba(249,115,22,.8); border-radius: 50%; }
.radar-drone-radar { box-shadow: 0 0 0 4px rgba(249,115,22,.09), 0 0 16px rgba(249,115,22,.65); }
.radar-drone-pulse { animation: radar-drone-ping 2.3s ease-out infinite; }
.radar-drone-body { position: relative; z-index: 2; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fff7ed, #f97316 55%, #9a3412); border: 1px solid rgba(255,255,255,.8); box-shadow: 0 2px 10px rgba(0,0,0,.65); font-size: 15px; transform: rotate(-18deg); }
.radar-drone.is-fresh .radar-drone-body { animation: radar-drone-hover 1.65s ease-in-out infinite; }
.radar-drone.is-launch .radar-drone-radar { border-color: #fde047; box-shadow: 0 0 0 5px rgba(253,224,71,.14), 0 0 18px rgba(253,224,71,.8); }
.radar-drone-time { position: absolute; z-index: 3; top: 35px; left: 50%; transform: translateX(-50%); padding: 1px 5px; white-space: nowrap; border-radius: 999px; background: rgba(8,12,18,.86); border: 1px solid rgba(249,115,22,.45); color: #fed7aa; font-size: 9.5px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: 0 1px 5px rgba(0,0,0,.55); }
.radar-flight-drone { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: #fff; font-size: 17px; transform: rotate(-22deg); background: color-mix(in srgb, var(--drone-color) 78%, #111); border: 1px solid rgba(255,255,255,.75); box-shadow: 0 2px 10px color-mix(in srgb, var(--drone-color) 55%, transparent); animation: radar-flight-hover 1.1s ease-in-out infinite alternate; }
.radar-drone-timer, .radar-drone-direction, .radar-drone-no-direction { margin: 6px 0; padding: 6px 8px; border-radius: 8px; font-size: 11.5px; }
.radar-drone-timer { color: var(--text-dim); background: rgba(148,163,184,.1); font-variant-numeric: tabular-nums; }
.radar-drone-timer b { color: var(--text); }
.radar-drone-direction { color: #fed7aa; background: rgba(249,115,22,.14); border: 1px solid rgba(249,115,22,.28); }
.radar-drone-no-direction { color: var(--muted); background: rgba(148,163,184,.08); }
@keyframes radar-drone-ping { 0% { transform: scale(.72); opacity: .9; } 75%,100% { transform: scale(1.75); opacity: 0; } }
@keyframes radar-drone-hover { 50% { transform: translateY(-3px) rotate(-18deg); } }
@keyframes radar-flight-hover { to { transform: translateY(-2px) rotate(-22deg) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .radar-drone-pulse, .radar-drone.is-fresh .radar-drone-body, .radar-flight-drone { animation: none; } }

/* Контраст карточки БПЛА: прошлый оранжевый текст на оранжевой плашке был нечитаем. */
.radar-drone-direction {
  color: #fff7ed;
  background: #9a3412;
  border-color: #fdba74;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.radar-drone-direction b { color: #fff; }
.radar-drone-no-direction { color: #dbeafe; background: #1e293b; border: 1px solid #475569; }
.rs-calm-list .rs-top-n { color: #38bdf8; }

/* Интерактивные точки угроз: белая обводка и курсор дают понять, что карточка открывается по клику. */
.radar-alert-point { cursor: pointer; filter: drop-shadow(0 1px 3px rgba(0,0,0,.72)); }
.radar-alert-detail { min-width: 260px; }
.radar-alert-head { display:flex; align-items:center; gap:9px; margin-bottom:8px; }
.radar-alert-head .wx-pop-title { margin:0; }
.radar-alert-signal { width:13px; height:13px; flex:none; border-radius:50%; background:var(--threat); box-shadow:0 0 0 4px color-mix(in srgb,var(--threat) 18%,transparent),0 0 13px var(--threat); }
.radar-alert-status { margin-top:1px; font-size:10.5px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.045em; }
.radar-alert-grid { display:grid; grid-template-columns:1fr 1fr; gap:5px; margin:8px 0; }
.radar-alert-grid > div { padding:6px 7px; border:1px solid var(--line-soft); border-radius:7px; background:var(--panel-2); min-width:0; }
.radar-alert-grid span { display:block; font-size:9.5px; color:var(--muted); }
.radar-alert-grid b { display:block; margin-top:1px; color:var(--text); font-size:11px; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.radar-alert-source { margin-top:8px; padding:7px 8px; border-radius:8px; background:rgba(148,163,184,.09); border-left:3px solid var(--line); }
.radar-alert-source > div { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.radar-alert-source p { margin:3px 0 0; color:var(--text-dim); white-space:pre-line; font-size:11.5px; line-height:1.42; }

/* Гибкий срез свежести: компактный селект, но с заметной рамкой и полной шириной на мобильном. */
.wx-freshness {
  width: 100%; min-height: 34px; padding: 6px 30px 6px 9px;
  border: 1px solid var(--line-soft); border-radius: 8px;
  color: var(--text); background: var(--panel-2); font: inherit; font-size: 12px;
}
.wx-freshness:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wx-freshness-hint { margin: 5px 0 0; font-size: 10.5px; line-height: 1.35; }

/* ===== Аналитическая панель: оперативный контур ===== */
.ops-live { display: flex; flex-direction: column; gap: 18px; }
.ops-live-head {
  display:flex; justify-content:space-between; align-items:flex-end; gap:18px; padding:28px;
  border-radius:18px; position:relative; overflow:hidden; color:#eef7ff;
  background:radial-gradient(95% 130% at 0% 0%,rgba(14,165,233,.28),transparent 53%),radial-gradient(80% 110% at 100% 10%,rgba(139,92,246,.24),transparent 54%),linear-gradient(135deg,#071322,#101329 58%,#0c1c26);
  border:1px solid rgba(125,211,252,.22); box-shadow:0 20px 55px rgba(0,0,0,.24);
}
.ops-live-head::after { content:""; position:absolute; width:300px;height:300px;border-radius:50%; right:-110px;bottom:-220px;border:1px solid rgba(103,232,249,.25);box-shadow:0 0 0 32px rgba(103,232,249,.035),0 0 0 65px rgba(103,232,249,.025); pointer-events:none; }
.ops-live-head h2 { margin:5px 0 0; font:700 clamp(27px,3.5vw,44px)/1 var(--font-display); letter-spacing:-.045em; }
.ops-live-head p { max-width:62ch;margin:9px 0 0;color:#b7c9df;font-size:14px;line-height:1.55; }
.ops-live-head .news-section-kicker { color:#8be9ff; }
.ops-live-dot { display:inline-block; width:7px;height:7px;border-radius:50%;vertical-align:1px;margin-right:6px;background:#34d399;box-shadow:0 0 0 0 rgba(52,211,153,.8);animation:ops-pulse 1.6s ease-out infinite; }
@keyframes ops-pulse { 70% { box-shadow:0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow:0 0 0 0 rgba(52,211,153,0); } }
.ops-actions { position:relative;z-index:1;display:flex;align-items:center;gap:10px;flex-wrap:wrap; }
.ops-updated { font-size:11.5px;color:#9fb7d0;font-variant-numeric:tabular-nums; }
.ops-kpis { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px; }
.ops-kpis article { min-height:115px;padding:17px;border-radius:14px;border:1px solid var(--line-soft);background:linear-gradient(145deg,var(--panel),var(--panel-2));box-shadow:inset 0 1px 0 rgba(255,255,255,.025);animation:ops-card-in .48s both; }
.ops-kpis article:nth-child(2){animation-delay:.05s}.ops-kpis article:nth-child(3){animation-delay:.1s}.ops-kpis article:nth-child(4){animation-delay:.15s}
@keyframes ops-card-in { from {opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
.ops-kpis span,.ops-card header span { display:block;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.07em;font-weight:700; }
.ops-kpis b { display:block;margin:8px 0 3px;font:700 30px/1 var(--font-display);letter-spacing:-.04em;font-variant-numeric:tabular-nums;color:var(--text); }
.ops-kpis small { color:var(--text-dim);font-size:11.5px; }.ops-kpis .is-alert { border-color:rgba(249,115,22,.42);background:linear-gradient(145deg,rgba(154,52,18,.28),var(--panel-2)); }.ops-kpis .is-alert b { color:#fdba74; }
.ops-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px; }
.ops-card { min-width:0;padding:19px;border:1px solid var(--line-soft);border-radius:15px;background:var(--panel);box-shadow:0 8px 25px rgba(0,0,0,.08); }
.ops-card header { display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:16px; }.ops-card h3 { margin:5px 0 0;font-size:16px;color:var(--text); }.ops-range{display:flex;gap:4px;}.ops-range .chip{padding:4px 7px;font-size:10.5px}
.ops-trend { grid-column:span 2; }.ops-spark { height:126px;display:flex;align-items:flex-end;gap:3px;padding:7px 1px 0;border-bottom:1px solid var(--line-soft); }.ops-spark i { flex:1;min-width:2px;border-radius:5px 5px 1px 1px;background:linear-gradient(to top,#38bdf8,#a78bfa);opacity:.82;transition:height .55s cubic-bezier(.22,1,.36,1),opacity .15s; }.ops-spark i:hover{opacity:1}.ops-spark-meta{display:flex;justify-content:space-between;margin-top:8px;color:var(--muted);font-size:10.5px}
.ops-bars{display:flex;flex-direction:column;gap:11px}.ops-bar-row{display:grid;grid-template-columns:minmax(82px,1.15fr) minmax(65px,2fr) 38px;align-items:center;gap:8px;font-size:12px;color:var(--text-dim)}.ops-bar-row>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ops-bar-row>i{height:8px;border-radius:99px;overflow:hidden;background:var(--panel-2);border:1px solid var(--line-soft)}.ops-bar-row b{display:block;height:100%;border-radius:inherit;background:var(--bar);transition:width .6s cubic-bezier(.22,1,.36,1)}.ops-bar-row strong{text-align:right;font-size:11.5px;color:var(--text);font-variant-numeric:tabular-nums}
.ops-radar{display:flex;flex-direction:column;gap:9px}.ops-radar-row{display:grid;grid-template-columns:1fr 30px 58px;gap:8px;align-items:center;padding-bottom:8px;border-bottom:1px solid var(--line-soft);font-size:12px}.ops-radar-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-dim)}.ops-radar-row b{color:#fdba74;text-align:right}.ops-radar-row small{font-size:10.5px;color:var(--muted);text-align:right}
.ops-feed-list{display:flex;flex-direction:column;gap:5px;max-height:254px;overflow:auto}.ops-feed{display:grid;grid-template-columns:8px minmax(0,1fr) auto;gap:8px;text-align:left;padding:8px;border:0;border-radius:9px;background:transparent;color:var(--text);cursor:pointer;font:inherit}.ops-feed:hover{background:var(--panel-2)}.ops-feed>i{width:7px;height:7px;border-radius:50%;margin-top:5px}.ops-feed b{font-size:12px}.ops-feed small{display:block;margin-top:3px;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ops-feed time{color:var(--muted);font-size:10.5px;white-space:nowrap;padding-top:2px}
@media (max-width:860px){.ops-kpis{grid-template-columns:1fr 1fr}.ops-grid{grid-template-columns:1fr}.ops-trend{grid-column:auto}.ops-live-head{padding:21px;align-items:flex-start;flex-direction:column}}@media (max-width:520px){.ops-kpis{gap:8px}.ops-kpis article{padding:13px;min-height:98px}.ops-kpis b{font-size:25px}.ops-card{padding:15px}.ops-live-head h2{font-size:30px}}@media (prefers-reduced-motion:reduce){.ops-live-dot,.ops-kpis article{animation:none}.ops-bar-row b,.ops-spark i{transition:none}}
/* Углублённая аналитика БПЛА внутри аналитической панели. */
.ops-uav-card { background:linear-gradient(145deg,rgba(154,52,18,.17),var(--panel)); border-color:rgba(249,115,22,.32); }.ops-uav-total{color:#fdba74;font:700 24px/1 var(--font-display);text-align:right;font-variant-numeric:tabular-nums}.ops-uav-total small{display:block;margin-top:3px;font:10px var(--font-ui);color:var(--muted);text-transform:uppercase;letter-spacing:.06em}.ops-uav-spark{height:92px;display:flex;align-items:flex-end;gap:3px;border-bottom:1px solid var(--line-soft);padding:4px 0}.ops-uav-spark i{min-width:2px;flex:1;border-radius:4px 4px 1px 1px;background:linear-gradient(to top,#ea580c,#fde047);opacity:.87;transition:height .55s cubic-bezier(.22,1,.36,1)}.ops-uav-meta{display:flex;justify-content:space-between;gap:10px;margin-top:9px;font-size:11px;color:var(--muted)}.ops-uav-meta b{color:var(--text);font-variant-numeric:tabular-nums}.ops-card-note{font-size:10.5px;color:var(--muted);text-align:right}.ops-heat{display:flex;flex-direction:column;gap:3px;overflow:hidden}.ops-heat-row,.ops-heat-axis{display:grid;grid-template-columns:26px repeat(24,minmax(4px,1fr));gap:2px;align-items:center}.ops-heat-row>span{font-size:10px;color:var(--muted)}.ops-heat-row i{aspect-ratio:1;border-radius:2px;background:rgba(249,115,22,var(--a));min-width:0}.ops-heat-axis{margin-top:5px}.ops-heat-axis span,.ops-heat-axis i{font-size:8px;color:var(--muted);font-style:normal;text-align:center;overflow:visible}
.ops-load-fail { display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:17px 19px;border-radius:13px;color:var(--text-dim);background:var(--panel);border:1px solid rgba(239,68,68,.38); }.ops-load-fail b{color:var(--text)}.ops-load-fail span{font-size:12px}.ops-load-fail .chip{margin-left:auto}

/* ---------- Тестовая вкладка «Авиация» (ADS-B) ---------- */
/* Кнопка вкладки и заголовок панели помечены как опытные: слой зависит от чужих
   некоммерческих агрегаторов, и пользователь должен видеть это до, а не после клика. */
.src-btn-test { display: inline-flex; align-items: center; gap: 5px; }
.src-test-tag,
.test-badge {
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 1px 5px; border-radius: 5px; line-height: 1.5;
  background: rgba(251, 191, 36, 0.18); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.42);
}
.src-btn.active .src-test-tag { background: rgba(255, 255, 255, 0.2); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.panel-test { border-left: 2px solid rgba(251, 191, 36, 0.45); padding-left: 8px; }
.test-badge { vertical-align: middle; margin-left: 6px; }

/* Значок борта: divIcon, который разворачивается по курсу. */
.adsb-icon { background: none; border: 0; }
.adsb-plane {
  display: block; width: 26px; height: 26px;
  color: var(--adsb-color, #7dd3fc);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.65));
  transform-origin: 50% 50%;
}
.adsb-plane svg { width: 100%; height: 100%; fill: currentColor; }
.adsb-plane.gnd { opacity: 0.65; }
.adsb-plane.mil svg { stroke: #fff; stroke-width: 0.6; }
.adsb-plane.em { animation: adsb-em-pulse 1.1s ease-in-out infinite; }
@keyframes adsb-em-pulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.9)); }
  50% { filter: drop-shadow(0 0 8px rgba(239, 68, 68, 1)); }
}
.adsb-label {
  position: absolute; left: 30px; top: 6px; white-space: nowrap;
  font-size: 10px; font-weight: 700; color: var(--text);
  text-shadow: 0 0 3px var(--map-bg), 0 0 3px var(--map-bg);
  pointer-events: none;
}

/* Карточка борта */
.adsb-popup .leaflet-popup-content { margin: 11px 13px; }
.adsb-pp { font-size: 12.5px; line-height: 1.5; min-width: 190px; }
.adsb-pp-hex { font-size: 10.5px; color: var(--muted); letter-spacing: 0.05em; margin-bottom: 6px; }
.adsb-pp-row { margin-bottom: 2px; }
.adsb-pp-tags { color: var(--text-dim); font-size: 11.5px; }
.adsb-warn { color: #fca5a5; }

/* Карточка NOTAM. Текст приходит сегментами с инлайновыми стилями апстрима,
   поэтому здесь только каркас: отступы, скролл и разделители между зонами. */
.notam-popup .leaflet-popup-content { margin: 11px 13px; }
/* Акценты текста NOTAM: значения подобраны под фон попапа каждой темы (контраст ≥ 4.5:1).
   Цвета самого апстрима рассчитаны на белый фон и дают лишь 3.5–4.1:1 — их не используем. */
.notam-pp { min-width: 240px; max-width: 360px; --notam-date: #5aa3f0; --notam-warn: #ff6b5a; }
body.light .notam-pp { --notam-date: #1a5fb4; --notam-warn: #b02a1c; }
.notam-pp .adsb-pp-head { margin-bottom: 8px; }
/* Точка вида зоны стоит перед заголовком: в попап может попасть несколько зон разных видов. */
.notam-pp-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 7px; vertical-align: baseline;
  box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.45);
}
.notam-pp-body { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.notam-pp-item + .notam-pp-item { margin-top: 6px; }
.notam-pp-title { line-height: 1.45; margin-bottom: 6px; }
/* Координатные выкладки NOTAM приходят предформатированными — перенос по словам их ломает. */
.notam-pp-block { line-height: 1.45; margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; }
.notam-pp-block:last-child { margin-bottom: 0; }
.notam-pp-sep { height: 1px; background: var(--border, rgba(255, 255, 255, 0.14)); margin: 9px 0; }
.notam-pp-foot { margin-top: 9px; padding-top: 7px; border-top: 1px solid var(--line-soft); }
.notam-pp-orig {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 11.5px; color: var(--accent); text-decoration: underline;
}
.notam-pp-orig:hover { opacity: 0.8; }
.notam-pp-empty { color: var(--text-dim); font-size: 12px; }

/* Блок NOTAM внутри панели «Авиация» — отделён линией как самостоятельный подслой */
.notam-block { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.notam-opts { margin-top: 8px; }
.notam-opacity { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.notam-opacity label { font-size: 12px; color: var(--text-dim); }
.notam-opacity-val { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.notam-opts input[type='range'] { width: 100%; accent-color: var(--accent); margin: 3px 0 2px; }
.notam-hint { margin-top: 6px; }

/* Легенда видов зон в панели слоя */
.notam-legend { display: flex; flex-direction: column; gap: 5px; margin: 9px 0 2px; }
.notam-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.notam-legend-sw { width: 15px; height: 10px; border-radius: 2px; flex: none; border: 1px solid currentColor; }

/* Панель слоя */
.adsb-alerts { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.adsb-note {
  font-size: 11.5px; line-height: 1.45; color: var(--text-dim);
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 9px; padding: 8px 9px;
}
.adsb-note-em { border-color: rgba(239, 68, 68, 0.42); color: #fca5a5; }
.adsb-em-row {
  display: block; width: 100%; text-align: left; margin-top: 5px; padding: 5px 7px;
  font: inherit; font-size: 11.5px; color: var(--text); cursor: pointer;
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 7px;
}
.adsb-em-row:hover { background: rgba(239, 68, 68, 0.2); }
.adsb-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 8px 0; }
.adsb-legend-title { flex-basis: 100%; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.adsb-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); }
.adsb-legend-item i { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) { .adsb-plane.em { animation: none; } }
/* На светлой подложке жёлто-зелёные борта сливались с фоном: добавляем силуэту тонкий
   тёмный контур (paint-order — чтобы обводка не съедала заливку). */
body.light .adsb-plane { filter: drop-shadow(0 1px 1.5px rgba(15, 23, 42, 0.45)); }
body.light .adsb-plane svg { stroke: rgba(15, 23, 42, 0.6); stroke-width: 0.55; paint-order: stroke fill; }
body.light .adsb-plane.mil svg { stroke: #0f172a; stroke-width: 0.8; }
/* Борта переезжают между опросами рывком раз в несколько секунд — сглаживаем перемещение.
   При зуме Leaflet сам двигает все маркеры, и анимация там только мешает: гасим её по классу,
   который Leaflet вешает на контейнер во время зум-анимации. */
.leaflet-marker-icon.adsb-icon { transition: transform .2s linear; }
.leaflet-zoom-anim .leaflet-marker-icon.adsb-icon { transition: none; }
@media (prefers-reduced-motion: reduce) { .leaflet-marker-icon.adsb-icon { transition: none; } }

/* ============================================================
   Обложки роликов в ленте.
   Кадр вырезает ffmpeg в media/posters/ (monitor.make_poster), адрес собирает
   eventVideoPoster() в map-app-v5.js. Обложки может не быть — старый файл, ffmpeg не
   справился, — и отследить это нечем: у атрибута poster нет события ошибки. Поэтому
   запасной вариант рисуем фоном самого <video>: фон виден ровно там, где обложка не
   загрузилась, и это тот же треугольник, который раньше стоял у всех роликов подряд.
   Блок идёт после .ev-thumb-video / .news-media-video: специфичность равная, решает порядок.
   ============================================================ */
.ev-thumb-video,
.news-media-video,
.ev-photo-video {
  background: #101926 url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20640%20360'%3E%3Crect%20width='640'%20height='360'%20fill='%23101926'/%3E%3Ccircle%20cx='320'%20cy='180'%20r='54'%20fill='%2336c2ff'%20fill-opacity='.9'/%3E%3Cpath%20d='M302%20147L302%20213L352%20180Z'%20fill='white'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* На тачскрине превью запускает тап по самой картинке (см. EV_HOVER_CAPABLE), значит она
   обязана ловить события — в остальных раскладках ролик кликов не принимает, чтобы тап
   по нему открывал карточку. */
.ev-media-tappable { pointer-events: auto; cursor: pointer; }
/* Значок «это видео»: с настоящим кадром ролик иначе не отличить от фотографии.
   Рисуем на обёртке медиа, у <video> псевдоэлементов не бывает — оно замещаемое. */
.ev-row:has(.ev-thumb-video)::after,
.news-story-media:has(.news-media-video)::after,
.news-featured-grid > div:has(> .news-media-video)::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(8, 14, 22, 0.62) url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M9%207.5L9%2016.5L17%2012Z'%20fill='white'/%3E%3C/svg%3E") center / 68% no-repeat;
  pointer-events: none;
}
/* Превью в строке события — 60×60 в первой колонке flex-строки с padding 8px. */
.ev-row:has(.ev-thumb-video)::after {
  left: 26px; top: 26px; width: 24px; height: 24px;
}
.news-story-media,
.news-featured-grid > div:has(> .news-media-video) { position: relative; }
.news-story-media:has(.news-media-video)::after,
.news-featured-grid > div:has(> .news-media-video)::after {
  left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px;
}

/* ============================================================
   Телефоны и короткие экраны (ландшафт телефона).
   Панель — выдвижной ящик поверх карты (стартует свёрнутой, см. map-app-v5.js),
   разделы — прокручиваемая пальцем лента в одну строку справа от ☰,
   карточка — на весь экран. Отступы учитывают «чёлку» и полосу жестов
   (env(safe-area-inset-*), нужен viewport-fit=cover в <meta viewport>).
   Блок идёт последним: часть правил (лента новостей, дашборд) объявлена выше
   без медиазапроса и при равной специфичности побеждала бы более ранний блок.
   ============================================================ */
.side-scrim { display: none; }
.mobile-only { display: none; }

@media (max-width: 720px), (max-height: 520px) and (pointer: coarse) {
  :root { --sidebar-w: min(86vw, 400px); }
  .desktop-only { display: none; }
  .mobile-only { display: inline; }
  html, body { height: 100%; height: -webkit-fill-available; }
  #app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
  }

  /* --- панель-ящик --- */
  .sidebar {
    position: absolute; top: 0; left: 0; bottom: 0;
    box-shadow: var(--shadow);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .brand { padding-top: calc(18px + env(safe-area-inset-top)); }
  /* Затемнение карты под открытой панелью: тап по нему закрывает панель. */
  .side-scrim {
    display: block; position: absolute; inset: 0; z-index: 990;
    background: rgba(5, 8, 12, 0.55);
    opacity: 0; pointer-events: none; transition: opacity 0.28s;
  }
  #app:not(.collapsed) .side-scrim { opacity: 1; pointer-events: auto; }
  .expand-btn {
    top: calc(10px + env(safe-area-inset-top));
    left: calc(10px + env(safe-area-inset-left));
    width: 44px; height: 44px; font-size: 20px;
  }

  /* --- лента разделов: одна строка, горизонтальная прокрутка --- */
  .source-switch,
  #mapWrap.news-mode #sourceSwitch {
    top: calc(10px + env(safe-area-inset-top));
    left: calc(62px + env(safe-area-inset-left));
    right: calc(10px + env(safe-area-inset-right));
    transform: none; max-width: none; justify-content: flex-start;
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding: 4px;
    border-radius: 12px;
  }
  .source-switch::-webkit-scrollbar { display: none; }
  .src-btn { flex: 0 0 auto; scroll-snap-align: start; padding: 10px 12px; }

  /* --- карточка события / объекта: на весь экран --- */
  .detail {
    top: 0; bottom: 0; height: auto; width: 100%; max-width: 100%;
    border-left: 0; padding-bottom: env(safe-area-inset-bottom);
  }
  .detail-body { padding: calc(16px + env(safe-area-inset-top)) 14px 24px; }
  .detail-close {
    top: calc(10px + env(safe-area-inset-top)); right: 10px;
    width: 40px; height: 40px;
  }
  .sidebar, .detail { max-height: 100dvh; }

  /* --- элементы поверх карты --- */
  .legend { display: none; }
  .basemap {
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: calc(10px + env(safe-area-inset-left));
  }
  .bm-btn span { display: none; }
  .bm-btn { padding: 9px 12px; font-size: 15px; }
  /* Зум-кнопки Leaflet на телефоне стоят внизу справа (map-app-v5.js), над полосой жестов. */
  .leaflet-bottom.leaflet-right {
    bottom: calc(12px + env(safe-area-inset-bottom));
    right: calc(6px + env(safe-area-inset-right));
  }
  .watch-pick-hint {
    bottom: calc(76px + env(safe-area-inset-bottom));
    max-width: calc(100% - 24px); white-space: normal; text-align: center;
  }

  /* iOS Safari увеличивает страницу при фокусе в поле мельче 16px — и не возвращает
     масштаб при user-scalable=no. */
  select, input[type="text"], input[type="date"], input[type="search"],
  input[type="number"], input[type="password"], textarea,
  .date-inputs input, .gt-box .goog-te-combo { font-size: 16px; }

  /* --- новости / аналитика: лента разделов теперь в одну строку --- */
  .news-workspace-inner {
    padding: calc(70px + env(safe-area-inset-top)) 10px calc(24px + env(safe-area-inset-bottom));
  }
  .news-shell { gap: 14px; }
  .news-timeline-wrap { padding: 14px 12px 18px; }
  .news-story-body { padding: 12px 14px 14px; }
  .oryx-panel { padding: 16px 14px 18px; }
}

/* Пальцем не попасть в кнопку 30px и в ссылку-текст 11px: на сенсорных
   устройствах цели крупнее независимо от ширины экрана (планшет тоже). */
@media (pointer: coarse) {
  .icon-btn { width: 38px; height: 38px; }
  .chip { padding: 8px 13px; font-size: 13px; }
  .link-btn { font-size: 12.5px; padding: 6px 2px; }
  .faction-item { padding: 9px 8px; }
  .src-btn { padding: 10px 12px; }
  .bm-btn { padding: 9px 12px; }
  .toggler { padding: 4px 0; }
  .watch-chk input, .adsb-legend input, input[type="checkbox"] { width: 18px; height: 18px; }
  input[type="range"] { min-height: 32px; }
  .leaflet-touch .leaflet-bar a, .leaflet-bar a { width: 38px; height: 38px; line-height: 38px; }
}

/* Без наведения подсказки «открыть» в карточках новостей никогда бы не появились. */
@media (hover: none) {
  .news-open-hint { opacity: 1; transform: none; }
}
