: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;
}

#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; font-size: 13px;
}
.loader.hidden { opacity: 0; pointer-events: none; }
.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-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 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; }
.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 {
    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;
}

/* Карточка события: эмодзи-категория + галерея фото */
.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-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-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) {
  :root { --sidebar-w: 86vw; }
  html, body { height: -webkit-fill-available; }
  #app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    min-height: -webkit-fill-available;
  }
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    box-shadow: var(--shadow);
  }
  .detail {
    top: 0;
    bottom: 0;
  }
  .sidebar, .detail { max-height: 100dvh; }
  .legend { display: none; }
  .bm-btn span { display: none; }
  #mapWrap.news-mode #sourceSwitch {
    left: 10px;
    right: 10px;
    top: 10px;
    max-width: calc(100% - 20px);
  }
  .news-workspace-inner {
    padding: 84px 12px 18px;
  }
  .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; }
}
