:root {
  --bg: #080b12;
  --bg2: #0d1220;
  --panel: #0b1019;
  --line: #1c2740;
  --text: #d7e0f0;
  --muted: #7d8bab;
  --red: #ff3b30;
  --red-soft: #ff6b60;
  --amber: #ffb020;
  --cyan: #38e1ff;
  --violet: #a78bfa;
  --magenta: #ff4fd8;
  --green: #35d07f;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  text-align: left;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100vh;
}

/* ---------------- topbar ---------------- */
#topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #0e1524, #0a0f1a);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  z-index: 1200;
}

.brand { display: flex; align-items: center; gap: 9px; }
.brand-logo {
  display: block; width: 28px; height: 28px;
  filter: drop-shadow(0 0 5px rgba(255, 176, 32, .22));
  animation: logoGlow 2.6s ease-in-out infinite;
}
@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 176, 32, .18)); }
  50%      { filter: drop-shadow(0 0 11px rgba(255, 176, 32, .48)); }
}
.brand h1 {
  font-size: 15px;
  font-weight: 650;
  margin: 0;
  letter-spacing: .3px;
  white-space: nowrap;
}
.live-tag {
  font: 700 10px/1 var(--mono);
  letter-spacing: 1.5px;
  color: #ff8a80;
  border: 1px solid #4a1a17;
  background: #2a0d0b;
  padding: 4px 6px;
  border-radius: 5px;
}

/* інфо-кнопка (поруч з «оновити») + бульбашка «Про додаток» */
.actions { position: relative; }
#infoBtn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #131c2e;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: .15s;
}
#infoBtn:hover { background: #1b2740; border-color: #2d3d5e; }
#infoBtn:active { transform: scale(.94); }
#infoBtn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
#infoBtn[aria-expanded="true"] { background: #21180a; border-color: #5a4320; color: var(--amber); }

#infoPop {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 1300;
  width: min(330px, calc(100vw - 28px));
  padding: 13px 14px 14px;
  background: rgba(11,16,26,.97);
  border: 1px solid #24314d;
  border-radius: 11px;
  box-shadow: 0 16px 44px rgba(0,0,0,.6);
  text-align: left;
  cursor: default;
}
#infoPop[hidden] { display: none; }
#infoPop::before {
  content: "";
  position: absolute;
  top: -6px; right: 52px;
  width: 10px; height: 10px;
  background: rgba(11,16,26,.97);
  border-left: 1px solid #24314d;
  border-top: 1px solid #24314d;
  transform: rotate(45deg);
}
.info-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.info-logo { display: block; width: 20px; height: 20px; }
.info-title { font: 700 12px/1 var(--font); letter-spacing: 1px; color: var(--amber); }
.info-head .info-title { margin-right: auto; }
#infoCloseBtn {
  width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 5px;
  background: transparent; color: var(--muted);
  font-size: 11px; cursor: pointer; transition: .15s;
}
#infoCloseBtn:hover { background: #1b2740; color: #fff; }
#infoPop p { margin: 0 0 9px; font: 400 11.5px/1.5 var(--font); color: #9fb0cc; }
#infoPop b { color: #dbe6f7; font-weight: 650; }
.info-lead { color: #c3cfe4 !important; }
.info-warn {
  color: #e0b9a6 !important;
  background: rgba(255,158,27,.08);
  border: 1px solid rgba(255,158,27,.22);
  border-radius: 8px;
  padding: 8px 10px;
}
.info-free { margin-bottom: 11px !important; }
#infoPop .donate-btn {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ffc457;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffc457, var(--amber));
  color: #241703;
  font: 700 12px/1 var(--font);
  letter-spacing: .3px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(255,176,32,.28);
  transition: .15s;
}
#infoPop .donate-btn:hover { background: linear-gradient(180deg, #ffd178, #ffb020); box-shadow: 0 5px 18px rgba(255,176,32,.42); }
#infoPop .donate-btn:active { transform: scale(.98); box-shadow: 0 2px 8px rgba(255,176,32,.3); }
#infoPop .donate-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.stats { display: flex; gap: 7px; flex-wrap: wrap; }
.pill {
  font: 500 12px/1 var(--mono);
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #0e1626;
  white-space: nowrap;
}
.pill b { font-weight: 700; }
.pill-alert b { color: var(--red-soft); }
.pill-alert #alertYellowEl { color: var(--amber); }
.lv-dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; vertical-align: middle; margin: 0 4px 0 0;
}
.lv-red { background: var(--red); box-shadow: 0 0 6px rgba(255,59,48,.85); }
.lv-yellow { background: var(--amber); box-shadow: 0 0 6px rgba(255,176,32,.75); margin-left: 8px; }
.pill-track b { color: var(--amber); }
.pill-clock { color: var(--muted); }

.actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status {
  font: 400 11px/1.3 var(--mono);
  color: var(--muted);
  max-width: 320px;
  text-align: right;
}
#refreshBtn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #131c2e;
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  transition: .15s;
}
#refreshBtn:hover { background: #1b2740; border-color: #2d3d5e; }
#refreshBtn:active { transform: scale(.94); }
#refreshBtn.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- офлайн-банер («немає інтернету») ---------------- */
/* З'являється під шапкою, коли мережі немає. Не перекриває мапу — останні
   відомі дані лишаються видимими, лише додає попередження зверху. */
#offlineEl {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 12px 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,106,106,.45);
  background: linear-gradient(180deg, rgba(84,17,22,.95), rgba(58,12,16,.95));
  box-shadow: 0 6px 22px rgba(0,0,0,.45);
  color: #ffe6e6;
  font: 500 12.5px/1.35 var(--font);
  text-align: left;
}
#offlineEl[hidden] { display: none; }
#offlineEl .off-ico {
  display: inline-flex;
  color: #ff8a80;
  flex: 0 0 auto;
  animation: off-pulse 1.6s ease-in-out infinite;
}
@keyframes off-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .42; }
}
#offlineEl .off-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 220px; }
#offlineEl .off-txt b { font-size: 13px; font-weight: 700; letter-spacing: .01em; }
#offlineEl .off-txt > span { color: #f3c3c3; font-size: 11.5px; }
#offlineRetryBtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,138,128,.5);
  background: rgba(255,138,128,.14);
  color: #ffd9d9;
  font: 650 11.5px/1 var(--font);
  letter-spacing: .02em;
  cursor: pointer;
  transition: .15s;
}
#offlineRetryBtn:hover { background: rgba(255,138,128,.24); border-color: #ff8a80; }
#offlineRetryBtn:active { transform: scale(.97); }
#offlineRetryBtn:focus-visible { outline: 2px solid #ff8a80; outline-offset: 2px; }
#offlineRetryBtn .off-spin { display: none; }
#offlineRetryBtn.busy .off-spin {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,217,217,.35);
  border-top-color: #ffd9d9;
  animation: spin .7s linear infinite;
}
#offlineRetryBtn.busy { cursor: progress; opacity: .85; }

.feed-offline-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,106,106,.35);
  background: rgba(84,17,22,.5);
  color: #f3c3c3;
  font: 500 11.5px/1.4 var(--font);
}
.feed-offline-note .off-svg { width: 16px; height: 16px; flex: 0 0 auto; color: #ff8a80; }
.feed-off .off-svg { width: 28px; height: 28px; color: #ff8a80; margin-bottom: 2px; animation: off-pulse 1.6s ease-in-out infinite; }
.feed-off-t { color: #ffd9d9; font-weight: 650; font-size: 13px; margin-top: 2px; }
.feed-off-s { color: #c9a6a6; font-size: 11.5px; margin-top: 2px; }
.feed-off { color: #c9a6a6; }

/* ---------------- layout ---------------- */
#layout {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

#mapWrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: #070a10; }

.leaflet-container { background: #070a10; font-family: var(--font); }
/* темний супутниковий гібрид: приглушуємо яскравість знімків, лишаємо підписи */
.bm-imagery { filter: brightness(0.62) contrast(1.06) saturate(0.82); }
.bm-labels { filter: brightness(1.2) drop-shadow(0 0 1px rgba(0,0,0,.9)); opacity: .92; }
.leaflet-control-attribution {
  background: rgba(8,11,18,.75) !important;
  color: #5d6b88 !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: #7f8dab !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: #0e1626;
  color: var(--text);
  border: 1px solid #24314d;
  box-shadow: 0 8px 30px rgba(0,0,0,.55);
}
.leaflet-popup-content { margin: 11px 13px; font-size: 13px; line-height: 1.45; }
.leaflet-popup-close-button { color: #7d8bab !important; }
.leaflet-bar a {
  background: #131c2e !important; color: #cbd6ea !important;
  border-color: #24314d !important;
}
.leaflet-bar a:hover { background: #1b2740 !important; }

/* legend */
#legend {
  position: absolute;
  left: 12px; bottom: 22px;
  z-index: 900;
  background: rgba(9,13,21,.86);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 11.5px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
#legendToggle {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin: 0;
  padding: 1px 2px 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: 600 11.5px/1 var(--font);
  letter-spacing: .02em;
  text-align: left;
  cursor: pointer;
  transition: color .15s;
}
#legendToggle:hover { color: #fff; }
#legendToggle:active { transform: scale(.985); }
#legendToggle:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
#legendToggle .lg-toggle-ico {
  color: var(--amber);
  font-size: 12px;
  line-height: 1;
  transition: transform .18s ease;
}
#legendToggle .lg-toggle-txt { flex: 1; }
#legend:not(.collapsed) #legendToggle { border-bottom: 1px solid var(--line); }
#legend.collapsed #legendToggle { padding-bottom: 1px; }
#legend.collapsed #legendToggle .lg-toggle-ico { transform: rotate(-90deg); }
#legend.collapsed #legendBody { display: none; }
.lg-row { display: flex; align-items: flex-start; gap: 7px; margin: 3px 0; color: #9fb0cc; white-space: normal; overflow-wrap: break-word; }
#legend { max-width: min(320px, calc(100vw - 24px)); }
.lg-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: 0 0 auto; margin-top: 2px; }
.lg-red, .lg-alert { background: rgba(255,59,48,.45); border: 1px solid var(--red-soft); }
.lg-yellow { background: rgba(255,158,27,.34); border: 1px solid var(--amber); }
.lg-clear { background: rgba(125,139,171,.12); border: 1px solid #3a4763; }
.lg-note { color: #7d8cab; font-size: 10.5px; line-height: 1.28; margin-top: 6px; }
.lg-ico { width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; color: var(--amber); flex: 0 0 auto; }
.lg-ico svg { width: 14px; height: 14px; display: block; }
.lg-ico svg path { fill: currentColor; stroke: rgba(3,6,12,.7); stroke-width: .7; paint-order: stroke; }

/* channels — розкладушка «Проєкти» у правому верхньому куті мапи */
#channels {
  position: absolute;
  right: 12px; top: 12px;
  z-index: 900;
  background: rgba(9,13,21,.86);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 11.5px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  max-width: min(260px, calc(100vw - 24px));
}
#channelsToggle {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin: 0;
  padding: 1px 2px 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: 600 11.5px/1 var(--font);
  letter-spacing: .02em;
  text-align: left;
  cursor: pointer;
  transition: color .15s;
}
#channelsToggle:hover { color: #fff; }
#channelsToggle:active { transform: scale(.985); }
#channelsToggle:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
#channelsToggle .lg-toggle-ico {
  color: var(--amber);
  font-size: 12px;
  line-height: 1;
  transition: transform .18s ease;
}
#channelsToggle .lg-toggle-txt { flex: 1; }
#channels:not(.collapsed) #channelsToggle { border-bottom: 1px solid var(--line); }
#channels.collapsed #channelsToggle { padding-bottom: 1px; }
#channels.collapsed #channelsToggle .lg-toggle-ico { transform: rotate(-90deg); }
#channels.collapsed #channelsBody { display: none; }
#channelsBody {
  pointer-events: auto;
  padding-top: 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ch-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #131c2e;
  color: var(--text);
  font: 650 11.5px/1 var(--font);
  letter-spacing: .05em;
  text-align: left;
  cursor: pointer;
  transition: .15s;
}
.ch-btn .ch-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: currentColor; }
.ch-btn:active { transform: scale(.985); }
.ch-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
/* активний канал (ви тут) — жовтий, наче натиснутий */
.ch-btn.ch-active {
  background: var(--amber);
  border-color: #ffd889;
  color: #201502;
  box-shadow: 0 0 0 1px rgba(255,176,32,.35), 0 0 14px rgba(255,176,32,.28);
}
.ch-btn.ch-active .ch-dot { background: #201502; }
/* неактивний канал — сірий */
.ch-btn.ch-muted { color: #9fb0cc; }
.ch-btn.ch-muted:hover { background: #1b2740; border-color: #2d3d5e; color: #cbd6ea; }
/* проєкт-посилання (відкривається в новій вкладці) */
.ch-btn.ch-link { color: #cbd6ea; }
.ch-btn.ch-link:hover { background: #1b2740; border-color: #2d3d5e; color: #fff; }
.ch-btn.ch-link .ch-ext {
  margin-left: auto;
  color: var(--amber);
  font-size: 11px;
  line-height: 1;
  opacity: .85;
}

#mapNote {
  position: absolute;
  right: 12px; bottom: 22px;
  z-index: 900;
  font: 400 10.5px/1.4 var(--mono);
  color: #6d7c9b;
  background: rgba(9,13,21,.8);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  max-width: 210px;
  pointer-events: none;
}

/* ---------------- side panel ---------------- */
#panel {
  width: 372px;
  flex: 0 0 372px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#aiBar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font: 400 11.5px/1.3 var(--mono);
  color: var(--muted);
  background: #0a1018;
}
.ai-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  flex: 0 0 auto;
  box-shadow: 0 0 8px rgba(53,208,127,.8);
}
.ai-dot.busy { background: var(--amber); animation: pulseDot2 1s infinite; box-shadow: 0 0 8px rgba(255,176,32,.8); }
.ai-dot.err { background: var(--red); box-shadow: 0 0 8px rgba(255,59,48,.8); }
@keyframes pulseDot2 { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

#feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
#feed::-webkit-scrollbar { width: 9px; }
#feed::-webkit-scrollbar-thumb { background: #1e2a42; border-radius: 5px; }

.feed-empty {
  color: var(--muted);
  font-size: 12.5px;
  padding: 22px 12px;
  text-align: center;
  line-height: 1.6;
}
.feed-logo {
  display: block; width: 52px; height: 52px;
  margin: 0 auto 12px; opacity: .45;
  filter: grayscale(.15);
  animation: logoGlow 3.4s ease-in-out infinite;
}

.ev {
  border: 1px solid #182238;
  border-left: 3px solid #3a4763;
  background: #0c1220;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 7px;
  cursor: default;
  transition: .15s;
}
.ev:hover { background: #101a2c; border-color: #24314d; }
.ev-uav, .ev-shahed, .ev-jet_drone, .ev-fpv, .ev-cruise_missile, .ev-ballistic, .ev-kab,
.ev-recon, .ev-explosion, .ev-launch, .ev-mig { border-left-color: var(--amber); }
.ev-alert { border-left-color: var(--red-soft); }
.ev-all_clear { border-left-color: var(--green); }
.ev-other { border-left-color: #3a4763; }

.ev-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.ev-ico {
  width: 16px; height: 16px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: #8fa0be;
}
.ev-ico svg { width: 14px; height: 14px; display: block; }
.ev-ico svg path { fill: currentColor; stroke: rgba(3,6,12,.7); stroke-width: .7; paint-order: stroke; }
.ev-glyph { font: 700 12px/1 var(--mono); }
.ev-glyph-alert { color: var(--red-soft); }
.ev-glyph-clear { color: var(--green); }
.ev-uav .ev-ico, .ev-shahed .ev-ico, .ev-jet_drone .ev-ico, .ev-fpv .ev-ico, .ev-cruise_missile .ev-ico,
.ev-ballistic .ev-ico, .ev-kab .ev-ico, .ev-recon .ev-ico, .ev-missile .ev-ico,
.ev-explosion .ev-ico, .ev-launch .ev-ico, .ev-mig .ev-ico { color: var(--amber); }
.ev-alert .ev-ico { color: var(--red-soft); }
.ev-all_clear .ev-ico { color: var(--green); }
.ev-title {
  font-size: 12.5px;
  font-weight: 650;
  color: #e6edfa;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ev-time { font: 400 10.5px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.ev-body {
  font-size: 12px;
  color: #a7b5cf;
  line-height: 1.45;
  word-break: break-word;
}
.ev-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 5px;
  font: 400 10.5px/1 var(--mono);
  color: #5f6f8e;
}
.ev-meta a { color: #5f8fd6; text-decoration: none; }
.ev-meta a:hover { text-decoration: underline; }
.ev-badge {
  border: 1px solid #26324b;
  border-radius: 4px;
  padding: 2px 4px;
  color: #7f8dab;
}
.ev-badge.ai { border-color: #1e4a3a; color: #4fd99a; background: #0c1f19; }
.ev-badge.low { border-color: #4a3a1e; color: #d9a94f; background: #201a0c; }
.ev-badge.qty {
  border-color: #6a4d12; color: #ffcf5c; background: #241a06;
  font-weight: 700; letter-spacing: .2px;
}

/* ---------------- draggable splitter ---------------- */
#splitter {
  flex: 0 0 10px;
  position: relative;
  z-index: 1000;
  cursor: col-resize;
  touch-action: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #0a0f18;
  transition: background .15s;
}
#splitter::before {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 2px; height: 30px; border-radius: 2px;
  transform: translate(-50%, -50%);
  background: #2b3a58;
  box-shadow: -4px 0 0 #2b3a58, 4px 0 0 #2b3a58;
  transition: background .15s, box-shadow .15s;
}
#splitter:hover, #splitter:focus-visible, #splitter.active { background: rgba(91,140,255,.12); outline: none; }
#splitter:hover::before, #splitter:focus-visible::before, #splitter.active::before {
  background: #5b8cff; box-shadow: -4px 0 0 #5b8cff, 4px 0 0 #5b8cff;
}
body.split-dragging { user-select: none; cursor: inherit; }

/* Згорнута стрічка: панель ховається, мапа займає весь простір. */
#layout.collapsed #panel { display: none; }

#collapseFeedBtn {
  margin-left: auto;
  flex: 0 0 auto;
  width: 24px; height: 24px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101a2b;
  color: #9fb0cc;
  font-size: 11px; line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
#collapseFeedBtn:hover { background: #1b2740; border-color: #2d3d5e; color: #fff; }

/* Таб «Стрічка новин» на мапі — видно лише коли стрічку згорнуто. */
#showFeedBtn {
  position: absolute;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  z-index: 950;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border: 1px solid #2d3d5e;
  border-radius: 999px;
  background: rgba(14, 22, 38, .93);
  color: #dbe6f7;
  font: 600 12px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  transition: background .15s, border-color .15s, transform .12s;
}
#showFeedBtn:hover { background: #16203a; border-color: #3c5580; }
#showFeedBtn:active { transform: translateX(-50%) scale(.96); }
#showFeedBtn[hidden] { display: none; }
#showFeedBtn #showFeedIco { color: var(--amber); font-size: 10px; }
#showFeedBtn b {
  min-width: 16px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #1d2a43;
  color: #cbd6ea;
  font: 700 10.5px/1.5 var(--mono);
  text-align: center;
}
#showFeedBtn b:empty { display: none; }

#disclaimer {
  padding: 9px 12px 12px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.5;
  color: #5c6a87;
  background: #0a0f18;
}

/* ---------------- tracks on map ---------------- */
.trk {
  position: relative;
  width: 34px; height: 34px;
  display: block;
}
.trk-halo {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: .55;
  animation: halo 2.2s ease-out infinite;
}
@keyframes halo {
  0% { transform: scale(.42); opacity: .8; }
  100% { transform: scale(1.15); opacity: 0; }
}
.trk-disc {
  position: absolute;
  left: 50%; top: 50%;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,9,15,.78) 0%, rgba(6,9,15,.42) 60%, rgba(6,9,15,0) 100%);
  pointer-events: none;
}
.trk-arrow {
  position: absolute;
  left: 50%; top: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  transform-origin: 50% 50%;
  display: flex; align-items: center; justify-content: center;
  color: inherit;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.9));
  will-change: transform;
}
.threat-svg { display: block; }
.threat-svg path {
  fill: currentColor;
  stroke: rgba(3,6,12,.7);
  stroke-width: .6;
  paint-order: stroke;
}
.trk-label {
  position: absolute;
  left: 50%;
  top: -4px;
  transform: translate(-50%,-100%);
  font: 600 9.5px/1 var(--mono);
  white-space: nowrap;
  color: #dbe6f7;
  background: rgba(8,11,18,.85);
  border: 1px solid #26324b;
  border-radius: 4px;
  padding: 2px 4px;
  display: none;
}
.trk:hover .trk-label { display: block; }
.trk { color: var(--amber); }
.trk-unknown { color: var(--amber); }

.trk.aging .trk-halo { animation: none; opacity: .18; }
.trk.aging .trk-arrow { opacity: .55; }
.trk.nocourse .trk-arrow { opacity: .5; }
.trk.nocourse .trk-halo { animation: none; opacity: .22; }

.oblast-active {
  animation: oblastPulse 2.8s ease-in-out infinite;
}
@keyframes oblastPulse {
  0%, 100% { stroke-width: 1.8; }
  50% { stroke-width: 2.8; }
}
.oblast-yellow {
  animation: oblastPulseYellow 3.4s ease-in-out infinite;
}
@keyframes oblastPulseYellow {
  0%, 100% { stroke-width: 1.2; }
  50% { stroke-width: 2.1; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 820px) {
  #layout { flex-direction: column; }
  #mapWrap { flex: 1 1 auto; min-height: 0; }
  #panel { width: 100%; flex: 0 0 45vh; border-left: none; border-top: 1px solid var(--line); }
  #splitter {
    flex: 0 0 12px; cursor: row-resize;
    border-left: none; border-right: none;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  }
  #splitter::before { width: 30px; height: 2px; box-shadow: 0 -4px 0 #2b3a58, 0 4px 0 #2b3a58; }
  #splitter:hover::before, #splitter:focus-visible::before, #splitter.active::before {
    box-shadow: 0 -4px 0 #5b8cff, 0 4px 0 #5b8cff;
  }
  .brand h1 { font-size: 13.5px; }
  .brand-logo { width: 24px; height: 24px; }
  .status { display: none; }
  #legend { bottom: 10px; left: 10px; font-size: 10.5px; padding: 7px 9px; }
  #channels { top: 10px; right: 10px; font-size: 10.5px; padding: 7px 9px; }
  #mapNote { display: none; }
  #topbar { gap: 8px; padding: 7px 10px; }
  .pill { font-size: 11px; padding: 5px 7px; }
  /* Таб «Стрічка» — праворуч, щоб не перекривати легенду (лівий нижній кут). */
  #showFeedBtn { left: auto; right: 12px; bottom: 12px; transform: none; }
  #showFeedBtn:active { transform: scale(.96); }
}
@media (max-width: 420px) {
  .pill-clock { display: none; }
}

/* ---------------- intro splash (5 с, «KRI RADAR» по літерах) ---------------- */
#splashEl {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  background: radial-gradient(120% 120% at 50% 42%, #0e1828 0%, #05080f 72%);
  pointer-events: none;
  animation: splashOut .9s ease 4.1s forwards;
}
.splash-logo {
  display: block; width: clamp(62px, 15vw, 100px); height: auto;
  opacity: 0; transform: scale(.82);
  animation:
    splashLogoIn .85s cubic-bezier(.2, .7, .3, 1) both,
    splashLogoGlow 2.3s ease-in-out .85s infinite;
}
@keyframes splashLogoIn {
  from { opacity: 0; transform: scale(.82); filter: blur(5px); }
  to   { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes splashLogoGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 176, 32, .25)); }
  50%      { filter: drop-shadow(0 0 24px rgba(255, 176, 32, .55)); }
}
.splash-word {
  display: flex; align-items: baseline;
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  font-weight: 800; letter-spacing: .14em;
  font-size: clamp(32px, 8.5vw, 76px);
  color: var(--amber, #ffb020);
  animation: splashGlow 1.9s ease-in-out .2s infinite;
}
.sl {
  display: inline-block; opacity: 0; transform: translateY(6px);
  animation: slIn .52s cubic-bezier(.2, .7, .3, 1) var(--d) both;
}
.sl-gap { width: .34em; }
.splash-sub {
  font-size: clamp(10px, 2.2vw, 13px);
  letter-spacing: .42em; text-transform: uppercase;
  color: #6f83a6; opacity: 0;
  animation: subIn .8s ease 2.5s both;
}
@keyframes slIn {
  0%   { opacity: 0; transform: translateY(6px); filter: blur(6px); }
  18%  { opacity: .92; }
  30%  { opacity: .12; }
  46%  { opacity: 1; filter: blur(0); }
  58%  { opacity: .35; }
  72%, 100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes subIn {
  from { opacity: 0; letter-spacing: .6em; }
  to   { opacity: 1; letter-spacing: .42em; }
}
@keyframes splashGlow {
  0%, 100% { text-shadow: 0 0 16px rgba(255, 176, 32, .45), 0 0 46px rgba(255, 176, 32, .22); }
  50%      { text-shadow: 0 0 24px rgba(255, 176, 32, .72), 0 0 70px rgba(255, 176, 32, .4); }
}
@keyframes splashOut {
  to { opacity: 0; visibility: hidden; }
}
