/* PUHLIVE — стилі головної сторінки.
   Сітка відступів 8 px (8/12/16/24), три радіуси (--r-sm/--r-md/--r-lg), одна палітра.
   Телефон (≤ 899 px) — головний пристрій; комп'ютер (≥ 900 px) — рейка ліворуч + пілюлі в шапці. */
:root {
  --font-head: 'Golos Text', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-logo: 'Unbounded', 'Golos Text', system-ui, sans-serif;
  --font-body: 'Onest', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Нейтральна палітра: сірий фон, білі картки, один чорний акцент. Кольори лише там, де вони несуть зміст (цілі, тривоги, «наживо»). */
  --bg: #eef0f3;
  --glass: #ffffff;
  --glass-2: #f6f7f9;
  --glass-3: #ffffff;
  --glass-line: rgba(17, 17, 17, 0.08);
  --line: rgba(17, 17, 17, 0.08);
  --line-2: rgba(17, 17, 17, 0.14);
  --txt: #141414;
  --mut: #6b6f76;
  --dim: #9a9ea6;
  --ink: #141414;
  --ink-txt: #ffffff;
  --hover: rgba(17, 17, 17, 0.05);
  --shadow: none;
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.04);
  --acc: #141414;
  --acc-soft: rgba(17, 17, 17, 0.07);
  --ok: #1f9d63;
  --ok-soft: #dff5e8;
  --warn: #b7791f;
  --warn-soft: #fbeccc;
  --bad: #d64545;
  --bad-soft: #fbe0e0;
  --vio: #6b6f76;
  --vio-soft: rgba(17, 17, 17, 0.07);
  --gray-soft: rgba(17, 17, 17, 0.06);
  --me: #1f9d63;
  --al-red: #d64545;
  --al-yellow: #e0a92a;
  --al-other: #7a7e86;
  --al-red-a: 0.22;
  --al-yellow-a: 0.26;
  --al-other-a: 0.2;
  --map-bg: #e4e6ea;
  --map-mask: rgba(238, 240, 243, 0.72);
  --map-border: rgba(20, 20, 20, 0.4);
  --map-border2: rgba(20, 20, 20, 0.16);
  --map-label: rgba(20, 20, 20, 0.45);
  --map-label-halo: rgba(255, 255, 255, 0.9);
  --sil-stroke: rgba(14, 14, 14, 0.8);
  --k-new: #2f6fdb;
  --k-type: #7a7e86;
  --k-oblast: #b7791f;
  --k-fade: #9a9ea6;
  --k-lost: #6b6f76;
  --k-alert: #d64545;
  --k-alert-end: #1f9d63;
  --k-notice: #c2410c;
  --k-system: #6b6f76;
  --chart-bar: #e0a92a;
  --chart-grid: rgba(17, 17, 17, 0.08);
  --bar-1: #141414;
  --bar-2: #7a7e86;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --gap: 16px;
  --rail: 84px;
  --top: 96px;
  --bnav: 0px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #111111;
  --glass: #181818;
  --glass-2: #1f1f1f;
  --glass-3: #222222;
  --glass-line: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --txt: #f2f2f2;
  --mut: #a3a6ad;
  --dim: #6f737a;
  --ink: #f2f2f2;
  --ink-txt: #111111;
  --hover: rgba(255, 255, 255, 0.06);
  --shadow: none;
  --shadow-sm: none;
  --acc: #f2f2f2;
  --acc-soft: rgba(255, 255, 255, 0.08);
  --ok: #4cc38a;
  --ok-soft: rgba(76, 195, 138, 0.16);
  --warn: #e0b35a;
  --warn-soft: rgba(224, 179, 90, 0.16);
  --bad: #ef6b6b;
  --bad-soft: rgba(239, 107, 107, 0.16);
  --vio: #a3a6ad;
  --vio-soft: rgba(255, 255, 255, 0.08);
  --gray-soft: rgba(255, 255, 255, 0.07);
  --me: #4cc38a;
  --al-red: #ef6b6b;
  --al-yellow: #e0b35a;
  --al-other: #8b8f97;
  --al-red-a: 0.3;
  --al-yellow-a: 0.28;
  --al-other-a: 0.26;
  --map-bg: #161616;
  --map-mask: rgba(17, 17, 17, 0.7);
  --map-border: rgba(255, 255, 255, 0.38);
  --map-border2: rgba(255, 255, 255, 0.14);
  --map-label: rgba(255, 255, 255, 0.45);
  --map-label-halo: rgba(0, 0, 0, 0.9);
  --sil-stroke: rgba(0, 0, 0, 0.85);
  --k-new: #6ea1ff;
  --k-type: #a3a6ad;
  --k-oblast: #e0b35a;
  --k-fade: #8b8f97;
  --k-lost: #6f737a;
  --k-alert: #ef6b6b;
  --k-alert-end: #4cc38a;
  --k-notice: #f0894f;
  --k-system: #a3a6ad;
  --chart-bar: #e0b35a;
  --chart-grid: rgba(255, 255, 255, 0.08);
  --bar-1: #f2f2f2;
  --bar-2: #8b8f97;
  color-scheme: dark;
}

/* ===================== База ===================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; color: var(--txt); font-family: var(--font-body); font-size: 14px; line-height: 1.45;
  background-color: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: clip;
}
h1, h2, h3, h4 { font-family: var(--font-head); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--mut); }
/* Картка: рівна біла (темно-сіра) поверхня, тонка межа, без тіней і скла */
.glass { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-lg); }
.calc { display: inline-block; font-size: 10.5px; font-weight: 500; color: var(--mut); background: var(--gray-soft);
  padding: 1px 7px; border-radius: 999px; white-space: nowrap; vertical-align: 2px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ===================== Рейка (комп'ютер) ===================== */
.rail {
  position: fixed; left: 12px; top: 12px; bottom: 12px; width: 62px; z-index: 1300;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; border-radius: 32px;
}
.rail .logo { width: 40px; height: 40px; border-radius: var(--r-sm); overflow: hidden; margin-bottom: 4px; }
.rail .logo svg { width: 100%; height: 100%; display: block; }
.rbtn {
  position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--mut);
  border: 1px solid var(--line-2); background: transparent; transition: background .2s, color .2s, border-color .2s;
}
.rbtn:hover { color: var(--txt); background: var(--hover); }
.rbtn.on { background: var(--ink); color: var(--ink-txt); border-color: var(--ink); }
.rbtn .tip {
  position: absolute; left: 56px; top: 50%; transform: translate(-6px, -50%); opacity: 0; pointer-events: none; white-space: nowrap;
  background: var(--ink); color: var(--ink-txt); font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 8px; transition: opacity .2s, transform .2s;
}
.rbtn:hover .tip { opacity: 1; transform: translate(0, -50%); }
.dotb { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--glass-3); display: none; }
.dotb.on { display: block; }
.rail .sp { flex: 1; }
.themes { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 30px; background: var(--gray-soft); }
.themes button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--mut); transition: background .2s, color .2s; }
.themes button svg { width: 18px; height: 18px; }
.themes button:hover { color: var(--txt); }
.themes button.on { background: var(--ink); color: var(--ink-txt); }

.app { padding-left: calc(var(--rail) + 8px); padding-right: 16px; min-height: 100vh; }

/* ===================== Шапка ===================== */
.top { position: sticky; top: 0; z-index: 1200; padding: 12px 0 8px; }
.top::before { content: ''; position: absolute; left: -16px; right: -16px; top: 0; bottom: 0; z-index: -1; pointer-events: none; background: var(--bg); }
.topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo-m { width: 36px; height: 36px; flex: none; display: block; border-radius: 10px; overflow: hidden; }
.brand .logo-m svg { width: 100%; height: 100%; display: block; }
.brand .bt { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand h1 { font-family: var(--font-logo); font-size: 16px; font-weight: 500; letter-spacing: .06em; white-space: nowrap; }
.brand .bt small { font-size: 11px; font-weight: 500; color: var(--mut); white-space: nowrap; }
.logo-m .beam { transform-box: view-box; animation: beam 9s linear infinite; opacity: .9; }
@keyframes beam { to { transform: rotate(360deg); } }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); flex: none; position: relative; color: var(--dim); }
.live-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; }
[data-conn="sse"] .live-dot { background: var(--ok); color: var(--ok); }
[data-conn="sse"] .live-dot::after { animation: ring 1.8s ease-out infinite; }
[data-conn="poll"] .live-dot { background: var(--warn); color: var(--warn); }
[data-conn="down"] .live-dot { background: var(--bad); color: var(--bad); }
@keyframes ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
.conn { font-size: 12px; font-weight: 500; color: var(--mut); white-space: nowrap; }
[data-conn="down"] .conn { color: var(--bad); }
.pills { display: flex; gap: 4px; padding: 4px; border-radius: 999px; }
.pill-nav { padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 13.5px; color: var(--mut); white-space: nowrap; transition: background .25s var(--ease), color .2s; }
.pill-nav:hover { color: var(--txt); }
.pill-nav.on { background: var(--ink); color: var(--ink-txt); font-weight: 700; }
.tright { display: flex; justify-content: flex-end; gap: 8px; }
.cbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--glass);
  transition: background .2s, transform .15s var(--ease); color: var(--txt); flex: none; }
.cbtn:hover { background: var(--glass-3); }
.cbtn:active { transform: scale(.94); }
.cbtn.on { background: var(--ink); color: var(--ink-txt); border-color: var(--ink); }
.cbtn b { font-family: var(--font-head); font-weight: 600; font-size: 17px; }
/* Крихітний рядок стану під шапкою (телефон) */
.status { display: none; align-items: center; gap: 6px; padding: 6px 12px 0; font-size: 11px; font-weight: 500; color: var(--mut); white-space: nowrap; overflow: hidden; }
.status b { color: var(--txt); font-variant-numeric: tabular-nums; }
.status.stale { color: var(--warn); } .status.stale b { color: var(--warn); }
.status .sep { color: var(--dim); }

/* Рядок заголовка розділу (комп'ютер) */
.titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 4px 12px; }
.titlebar h2 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.titlebar p { color: var(--mut); font-weight: 400; margin-top: 2px; font-size: 13.5px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chipm { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-line);
  font-size: 12.5px; font-weight: 500; color: var(--mut); white-space: nowrap; }
.chipm b { color: var(--txt); font-weight: 600; font-variant-numeric: tabular-nums; }
.chipm svg.i { width: 15px; height: 15px; }
.chipm.stale { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chipm.stale b { color: var(--warn); }

/* ===================== Розділи, картки, кнопки ===================== */
.view { display: none; padding-bottom: 24px; }
.view.on { display: block; animation: viewin .4s var(--ease); }
@keyframes viewin { from { opacity: 0; transform: translateY(8px); } }
.card-xl { padding: 16px; min-width: 0; }
.ch { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ch h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.ch .sp { flex: 1; }
.ch .sub { color: var(--mut); font-size: 12.5px; font-weight: 400; width: 100%; margin-top: -6px; }
.cnt { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--gray-soft); font-weight: 600; font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 999px; font-weight: 500; font-size: 13px; min-height: 36px;
  border: 1px solid var(--line-2); background: var(--glass-2); transition: background .2s, transform .15s; white-space: nowrap; }
.btn:hover { background: var(--glass-3); }
.btn:active { transform: scale(.97); }
.btn.dark { background: var(--ink); color: var(--ink-txt); border-color: var(--ink); }
.btn svg.i { width: 16px; height: 16px; }
.empty { color: var(--mut); padding: 20px 8px; text-align: center; font-weight: 400; }
.code { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 12px;
  font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--c, var(--acc)) 18%, transparent);
  color: var(--txt); border: 1px solid color-mix(in srgb, var(--c, var(--acc)) 55%, transparent); white-space: nowrap; }
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.st::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.live { background: var(--ok-soft); color: var(--ok); }
.st.fade { background: var(--warn-soft); color: var(--warn); }
.st.gone { background: var(--gray-soft); color: var(--mut); }
.st.red { background: var(--bad-soft); color: var(--bad); }
.st.yellow { background: var(--warn-soft); color: var(--warn); }
.st.other { background: var(--vio-soft); color: var(--vio); }
/* Акордеон: на комп'ютері завжди відкритий, на телефоні — згортається */
.acc-h { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; }
.acc-h h3 { font-size: 17px; font-weight: 600; }
.acc-h .chev { display: none; margin-left: auto; width: 32px; height: 32px; border-radius: 50%; place-items: center; background: var(--gray-soft); color: var(--mut); }
.acc-h .chev svg.i { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.acc.open .acc-h .chev svg.i { transform: rotate(180deg); }
.acc-h .btn, .acc-h a.btn { margin-left: auto; }

/* ===================== Мапа ===================== */
.mapcard { position: relative; padding: 0; overflow: hidden; }
.map-slot { position: absolute; inset: 0; }
#parking { position: fixed; left: -10000px; top: 0; width: 800px; height: 600px; visibility: hidden; }
#mapHost { position: absolute; inset: 0; }
#map { position: absolute; inset: 0; background: var(--map-bg); }
.leaflet-container { font-family: var(--font-body); background: var(--map-bg); }
.sat-tiles { filter: saturate(.85) brightness(.92); }
.base-tiles { filter: grayscale(1) brightness(1.02); }
[data-theme="dark"] .base-tiles { filter: grayscale(1) brightness(.72) contrast(1.05); }
[data-theme="dark"] .sat-tiles { filter: saturate(.7) brightness(.62) contrast(1.1); }
.leaflet-control-zoom { border: 1px solid var(--glass-line) !important; border-radius: var(--r-sm) !important; overflow: hidden; box-shadow: var(--shadow-sm) !important; }
.leaflet-control-zoom a { background: var(--glass-3) !important; color: var(--txt) !important; border-color: var(--line) !important; width: 36px !important; height: 36px !important; line-height: 34px !important; }
.leaflet-control-attribution { background: var(--glass-2) !important; color: var(--dim) !important; border-radius: 8px 0 0 0; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--mut) !important; }
.leaflet-tooltip.tt { background: var(--glass-3); color: var(--txt); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  font-family: var(--font-body); font-weight: 400; box-shadow: var(--shadow-sm); padding: 8px 11px; font-size: 12.5px; line-height: 1.4; }
.leaflet-tooltip.tt::before { display: none; }
.tt .st { margin-top: 4px; }
.tt small { color: var(--mut); font-weight: 400; display: block; }
.tgt-m { transition: transform .7s linear; }
.noanim .tgt-m { transition: none !important; }
.ti { position: relative; width: 100%; height: 100%; cursor: pointer; }
.ti svg { overflow: visible; display: block; }
.ti.fading { opacity: .55; }
.ti.sel::before { content: ''; position: absolute; left: 50%; top: 50%; width: calc(100% + 10px); height: calc(100% + 10px); transform: translate(-50%, -50%);
  border-radius: 50%; border: 2px solid var(--c); opacity: .85; pointer-events: none; }   /* тонке кільце рівно навколо обраної цілі */
@keyframes selpulse { 50% { transform: scale(1.12); opacity: .55; } }
.tpill { position: absolute; left: 74%; top: 66%; pointer-events: none; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 1.35;
  background: var(--glass-3); color: var(--txt); border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); white-space: nowrap; }
.obl-lbl { color: var(--map-label); font-weight: 600; font-size: 10.5px; letter-spacing: .1em; white-space: nowrap; transform: translate(-50%, -50%); pointer-events: none;
  text-shadow: 0 0 4px var(--map-label-halo), 0 0 2px var(--map-label-halo); }
.lowzoom .obl-lbl, .hizoom .obl-lbl { display: none; }
.plc { transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; color: var(--map-label); font-family: var(--font-body);
  font-weight: 500; font-size: 11px; text-shadow: 0 0 3px var(--map-label-halo), 0 0 2px var(--map-label-halo), 0 0 1px var(--map-label-halo); }
.plc.r1 { font-size: 13px; font-weight: 600; color: var(--txt); }
.plc.r2 { font-size: 12px; font-weight: 600; color: var(--txt); }
.plc.r3 { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.plc.r4, .plc.r5, .plc.r6 { font-size: 10.5px; }
.geo-btn.busy, .cbtn.busy { opacity: .6; pointer-events: none; }
.rmark { pointer-events: none; }
.rmark i { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--glass-3); border: 3px solid var(--c); }
.rmark.end i { border-style: dashed; }
.rmark span { position: absolute; left: 13px; top: -12px; white-space: nowrap; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--glass-3); color: var(--txt); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.ping { pointer-events: none; }
.ping i { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--c); animation: ping 1.4s ease-out 2 forwards; }
@keyframes ping { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.mui { position: absolute; z-index: 800; }
.mui.glass { border-radius: var(--r-md); }
.m-tr { top: 12px; right: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.layers-btn, .legend-btn { display: none; }
.layers { display: none; padding: 12px 14px; width: 224px; }
[data-view="map"] .layers { display: block; }
[data-view="map"] .layers-btn, [data-view="overview"] .layers-btn { display: grid; }
[data-view="overview"] .layers.show { display: block; }
.layers h4, .legend h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); font-weight: 600; margin-bottom: 6px; }
.tg { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-weight: 500; font-size: 13px; cursor: pointer; user-select: none; }
.tg input { position: absolute; opacity: 0; pointer-events: none; }
.tg .sw { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .2s; }
.tg .sw::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1px solid rgba(0,0,0,.08); transition: transform .2s var(--ease); }
.tg input:checked + .sw { background: var(--ink); }
.tg input:checked + .sw::after { transform: translateX(14px); }
/* Темна тема: увімкнений перемикач — світла доріжка з темним кружечком, щоб не зливався */
[data-theme="dark"] .tg input:checked + .sw { background: #e6e6e6; }
[data-theme="dark"] .tg input:checked + .sw::after { background: #151515; border-color: #151515; }
.tg input:focus-visible + .sw { outline: 2px solid var(--acc); outline-offset: 2px; }
.tg small { margin-left: auto; color: var(--dim); font-weight: 500; }
.lay-hint { max-height: 0; overflow: hidden; opacity: 0; margin: 0; color: var(--mut); font-size: 12px; font-weight: 400; line-height: 1.4;
  transition: max-height .3s var(--ease), opacity .3s, margin .3s; }
.lay-hint.on { max-height: 90px; opacity: 1; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.leaflet-heatmap-layer { opacity: .85; }
.legend { left: 12px; bottom: 12px; padding: 12px 14px; max-width: 250px; font-size: 12.5px; font-weight: 400; max-height: calc(100% - 24px); overflow: auto; overscroll-behavior: contain; }
.legend .row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.legend .row b { margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.legend .row.zero { color: var(--dim); }
.legend .sq { width: 14px; height: 10px; border-radius: 3px; flex: none; }
.legend .sep { height: 1px; background: var(--line); margin: 6px 0; }
.legend .al-row { display: flex; gap: 10px; flex-wrap: wrap; color: var(--mut); font-size: 11.5px; }
.legend .al-row span { display: inline-flex; align-items: center; gap: 5px; }
/* Пояснення позначок у легенді */
.leg-help { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.leg-help summary { cursor: pointer; font-weight: 600; font-size: 12px; color: var(--acc); list-style: none; display: flex; align-items: center; gap: 6px; }
.leg-help summary::-webkit-details-marker { display: none; }
.leg-help summary::before { content: '?'; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; border: 1px solid currentColor; flex: none; }
.leg-help[open] summary { margin-bottom: 4px; }
.leg-help dl { margin: 0; }
.leg-help dt { font-weight: 600; font-size: 12px; margin-top: 6px; }
.leg-help dd { margin: 1px 0 0; color: var(--mut); font-size: 11.5px; line-height: 1.4; }
.empty-map { left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 18px; pointer-events: none; transition: opacity .4s;
  width: max-content; max-width: min(460px, calc(100% - 120px)); text-align: center; display: flex; flex-direction: column; gap: 2px;
  font-size: 14px; line-height: 1.3; white-space: normal; }
.empty-map b { font-weight: 700; }
.empty-map small { font-size: 12px; color: var(--mut); }
@media (max-width: 640px) { .empty-map { padding: 8px 14px; font-size: 13px; max-width: calc(100% - 104px); } .empty-map small { font-size: 11.5px; } }
.empty-map.hide { opacity: 0; }
/* попередження — вгорі по центру, щоб не закривати цілі */
.empty-map.warn { top: 12px; transform: translateX(-50%); border: 1px solid var(--warn);
  background: linear-gradient(var(--warn-soft), var(--warn-soft)), var(--glass); }
/* Картка цілі поверх мапи */
.tcard { top: 12px; left: 12px; width: 340px; max-height: calc(100% - 24px); overflow: auto; padding: 16px; border-radius: var(--r-lg);
  opacity: 0; transform: translateX(-12px); pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease); scrollbar-width: thin; }
.tcard.open { opacity: 1; transform: none; pointer-events: auto; }
.tcard .hd { display: flex; align-items: center; gap: 12px; position: sticky; top: -16px; z-index: 2; margin: -16px -16px 0; padding: 16px 16px 10px;
  background: inherit; border-radius: var(--r-lg) var(--r-lg) 0 0; }   /* шапка з хрестиком лишається видимою при прокрутці */
.tcard .hd h3 { font-size: 17px; font-weight: 600; line-height: 1.2; }
.tcard .x { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-soft); flex: none; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.kv div { background: var(--glass-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 11px; }
.kv small { display: block; color: var(--mut); font-size: 11px; font-weight: 500; }
.kv b { font-size: 14.5px; font-weight: 600; }
.tcard h4 { margin: 12px 0 6px; font-size: 11px; color: var(--mut); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.chips-ro { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.chips-ro span { padding: 3px 9px; border-radius: 999px; background: var(--gray-soft); font-weight: 500; font-size: 12.5px; }
.chips-ro em { color: var(--dim); font-style: normal; }
.tchg { font-size: 13px; line-height: 1.6; }
.tchg time { color: var(--mut); margin-right: 6px; }
.dist-help { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
/* Модальні вікна */
.modal { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 24px; background: rgba(17, 17, 17, .45);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-box { position: relative; width: min(1180px, 100%); height: min(780px, 100%); padding: 0; overflow: hidden; transform: scale(.98) translateY(8px); transition: transform .3s var(--ease); }
.modal.open .modal-box { transform: none; }
.modal-x { position: absolute; z-index: 900; top: 12px; right: 12px; }
.gdlg .modal-box { height: auto; width: min(480px, 100%); padding: 24px; }
.gdlg h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.gdlg p { color: var(--mut); font-weight: 400; margin: 8px 0; }
.gdlg p b { color: var(--txt); }
.gdlg .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.gdlg .msg { display: none; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--txt); font-weight: 400; margin-top: 8px; }
.gdlg .msg.on { display: block; }
/* Місце вручну (у вікні «Цілі біля мене») */
.gdlg .modal-box { max-height: 100%; overflow: auto; overscroll-behavior: contain; }
.geo-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; color: var(--mut); font-size: 12.5px; font-weight: 400; }
.geo-or::before, .geo-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gm-find .search { min-width: 0; }
.gm-find .pl-res { position: static; width: 100%; max-height: 230px; margin-top: 6px; }
.gm-pick { width: 100%; justify-content: center; margin-top: 8px; gap: 8px; }
.gm-pick svg.i { width: 17px; height: 17px; }
.gdlg p.gm-note { font-size: 12.5px; margin-top: 10px; }
body.gm-picking .leaflet-container { cursor: crosshair; }
.mecard .me-man { align-self: flex-start; }
/* FAQ «Як користуватись» */
.faq .modal-box { height: auto; max-height: 100%; width: min(640px, 100%); padding: 24px; overflow: auto; scrollbar-width: thin; }
.faq h3 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 4px; padding-right: 48px; }
.faq .lead { color: var(--mut); font-weight: 400; margin-bottom: 12px; }
.fq { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--glass-2); margin-top: 8px; }
.fq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 600; font-size: 14.5px; }
.fq summary::-webkit-details-marker { display: none; }
.fq summary .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); font-size: 12px; font-weight: 600; flex: none; }
.fq summary svg.i { margin-left: auto; width: 16px; height: 16px; color: var(--mut); transition: transform .25s var(--ease); }
.fq[open] summary svg.i { transform: rotate(180deg); }
.fq .fb { padding: 0 14px 14px 50px; color: var(--mut); font-weight: 400; font-size: 13.5px; line-height: 1.55; }
.fq .fb p + p, .fq .fb ul { margin-top: 6px; }
.fq .fb ul { padding-left: 18px; }
.fq .fb b { color: var(--txt); }
.fq .fb .sil-row { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 6px 0; }
.fq .fb .sil-row span { display: inline-flex; align-items: center; gap: 6px; color: var(--txt); font-weight: 500; }
.fq .fb .st { vertical-align: 1px; }
.faq .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.faq .foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.faq .foot .sp { flex: 1; }
.faq-theme { display: none; align-items: center; gap: 8px; font-weight: 500; color: var(--mut); font-size: 13px; }
.faq-theme .themes { flex-direction: row; }
.faq-theme .themes button { width: 34px; height: 34px; }

/* ===================== Огляд ===================== */
.sky { padding: 12px 16px; margin-bottom: var(--gap); border-radius: var(--r-md); }
.sky-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sky-n { font-family: var(--font-head); font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.sky-l { font-weight: 500; font-size: 14px; color: var(--mut); display: flex; flex-direction: column; line-height: 1.2; }
.sky-l small { font-weight: 400; font-size: 12px; color: var(--dim); }
.sky-pills { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.sky-pills::-webkit-scrollbar { display: none; }
.sky-p { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; flex: none;
  background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.sky-p b { font-weight: 600; }
.sky-p small { color: var(--mut); font-weight: 400; font-size: 11.5px; }
/* Ноутбук: пілюлі не влазять — «· N уточнюються» прибираємо (загальне число вже під «у небі») */
@media (min-width: 900px) and (max-width: 1600px) { .sky-p small { display: none; } }
.sky-al { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 400; color: var(--mut); }
.sky-al b { color: var(--txt); font-weight: 600; }
.sky-al b.al { color: var(--bad); }
.sky-al .sep { color: var(--dim); }
.sky-al .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sky-al .dot.red { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.sky-al .dot.yellow { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.sky-al .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.mecard { display: none; padding: 12px 16px; margin-bottom: var(--gap); border-radius: var(--r-md); }
.mecard .me-off { display: flex; flex-direction: column; gap: 8px; }
.mecard .me-off small { color: var(--mut); font-weight: 400; font-size: 12.5px; }
.mecard .me-on { display: flex; flex-direction: column; gap: 6px; }
.mecard .me-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mecard .me-row .txt { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mecard .me-row .txt small { font-weight: 500; } .mecard .appr { color: var(--bad); } .mecard .away { color: var(--ok); } .mecard .side { color: var(--warn); }
.mecard .me-al { font-size: 13px; font-weight: 500; color: var(--mut); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mecard .me-x { display: none; margin-top: 4px; border-top: 1px solid var(--line); padding-top: 6px; }
.mecard.open .me-x { display: block; }
.mecard .chev { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-soft); flex: none; }
.mecard .chev svg.i { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.mecard.open .chev svg.i { transform: rotate(180deg); }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); height: clamp(460px, calc(100vh - var(--top) - 24px), 820px); }
.air { display: flex; flex-direction: column; min-height: 0; }
.air-list { flex: 1; min-height: 0; overflow: auto; margin: 0 -8px; padding: 0 8px; scrollbar-width: thin; }
.agrp { margin-bottom: 8px; }
.agrp-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; padding: 6px 4px; }
.agrp-h .cnt { margin-left: auto; height: 22px; min-width: 22px; font-size: 11.5px; }
.arow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; transition: background .2s; }
.arow:hover { background: var(--hover); }
.arow.sel { background: var(--acc-soft); }
.arow .nm { font-weight: 500; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow .nm small { display: block; color: var(--mut); font-weight: 400; font-size: 12px; }
.arow .tm { text-align: right; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.arow .tm small { display: block; font-weight: 400; font-size: 11px; color: var(--mut); }
.arow.fading .nm, .arow.fading .tm { opacity: .65; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.kpi { padding: 16px; border-radius: var(--r-md); min-width: 0; }
.kpi small { color: var(--mut); font-weight: 500; font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi .v { font-size: 32px; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .v.sm { font-size: 22px; }
.kpi .v span { font-size: 14px; font-weight: 500; color: var(--mut); letter-spacing: 0; }
.kpi .s { margin-top: 6px; color: var(--mut); font-size: 12px; font-weight: 400; display: flex; flex-wrap: wrap; gap: 3px 10px; }
.kpi .s i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.ov-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--gap); margin-top: var(--gap); align-items: start; }
.obl-chips { display: flex; flex-direction: column; gap: 6px; }
.oc { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--glass-2); border: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.oc:hover { background: var(--glass-3); }
.oc.red { background: color-mix(in srgb, var(--bad) 8%, var(--glass-2)); }
.oc.yellow { background: color-mix(in srgb, var(--warn) 9%, var(--glass-2)); }
.oc .nm { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc .nm small { color: var(--mut); font-weight: 400; margin-left: 6px; }
.tcount { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--gray-soft); color: var(--mut); white-space: nowrap; }
.tcount.hot { background: var(--acc-soft); color: var(--acc); }
.summ { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ovmore { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--acc); padding: 6px 10px; border-radius: 999px; align-self: flex-start; }
.ovmore:hover { background: var(--acc-soft); }
.ovmore svg.i { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.ovmore.up svg.i { transform: rotate(180deg); }
.oc-x { display: flex; flex-direction: column; gap: 6px; }
.jlink { display: flex; justify-content: flex-end; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.jlink a { font-weight: 600; color: var(--acc); padding: 6px 12px; border-radius: 999px; }
.jlink a:hover { background: var(--acc-soft); }
.oc:focus-visible, .ev.click:focus-visible, .arow:focus-visible, .nrow:focus-visible, .ar:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
/* Рядок події */
.ev { display: grid; grid-template-columns: 58px 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); transition: background .2s; position: relative; }
.ev.click { cursor: pointer; }
.ev.click:hover { background: var(--hover); }
.ev time { font-size: 12.5px; color: var(--mut); font-weight: 500; font-variant-numeric: tabular-nums; }
.ev-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.ev-ic svg.i { width: 14px; height: 14px; stroke-width: 2.2; }
.ev-b { min-width: 0; }
.ev-k { font-size: 11.5px; font-weight: 600; color: var(--c); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ev-x { font-size: 13.5px; font-weight: 400; overflow-wrap: anywhere; }
.ev.lv-red { box-shadow: inset 3px 0 0 var(--bad); }
.ev.lv-yellow { box-shadow: inset 3px 0 0 var(--warn); }
.ev .st { font-size: 10.5px; padding: 1px 8px; }
.ev.enter { animation: evin .5s var(--ease); }
@keyframes evin { from { opacity: 0; transform: translateY(-8px); background: var(--acc-soft); } }

/* ===================== Мапа на весь екран + панель ===================== */
.mapfull { height: calc(100vh - var(--top) - 24px); min-height: 420px; }
.mapgrid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--gap); transition: grid-template-columns .3s var(--ease); }
.mapgrid.collapsed { grid-template-columns: minmax(0, 1fr) 0px; gap: 0; }
.mapgrid.collapsed .spanel { opacity: 0; pointer-events: none; padding: 0; border-width: 0; }
.spanel { display: flex; flex-direction: column; min-height: 0; min-width: 0; height: calc(100vh - var(--top) - 24px); min-height: 420px; padding: 12px 12px 8px; transition: opacity .2s; }
.sp-top { flex: none; }
.sp-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sp-h .tabs { flex: 1; }
.sp-h .tab { flex: 1; justify-content: center; }
.sp-x { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-soft); flex: none; }
.sp-body { flex: 1; min-height: 0; overflow: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.sp-grip { display: none; }
.sp-pane .notices { grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }
.sp-pane .notice { padding: 10px 12px; border-radius: var(--r-md); background: var(--glass-2); border: 1px solid var(--line); }
.sp-pane .notice .ic { width: 34px; height: 34px; }
.sp-pane .notice b { font-size: 13.5px; }
.ar.sel, .ob-g.sel { background: var(--acc-soft); border-radius: var(--r-sm); }
.panel-btn { display: none; }
[data-view="map"] .panel-btn { display: grid; }
.notices { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }
.notices:empty { display: none; }
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); }
.notice .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--k-notice) 16%, transparent); color: var(--k-notice); flex: none; }
.notice b { font-size: 14.5px; font-weight: 600; display: block; }
.notice small { color: var(--mut); font-weight: 400; }
.ob-g { border-radius: var(--r-md); background: var(--glass-2); border: 1px solid var(--line); padding: 12px; margin-bottom: 8px; }
.ob-g.red { box-shadow: inset 4px 0 0 var(--bad); }
.ob-g.yellow { box-shadow: inset 4px 0 0 var(--warn); }
.ob-g.other { box-shadow: inset 4px 0 0 var(--vio); }
.ob-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.ob-h b { font-size: 14.5px; font-weight: 600; margin-right: auto; }
.ob-h:hover b, .ar:hover .ar-n { color: var(--acc); }
.ar { padding: 6px 0 6px 8px; border-top: 1px dashed var(--line-2); margin-top: 6px; cursor: pointer; }
.ar-n { font-weight: 500; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ar-r { font-size: 12.5px; color: var(--mut); font-weight: 400; margin-top: 2px; }
.ar-s { font-size: 11.5px; color: var(--dim); font-weight: 500; margin-top: 1px; }
.sublbl { font-size: 10.5px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; margin: 8px 0 0; }
.sec-lbl { font-size: 12px; font-weight: 600; color: var(--mut); text-transform: uppercase; letter-spacing: .07em; margin: 12px 4px 8px; }
.leaflet-popup.rpop .leaflet-popup-content-wrapper { background: var(--glass-3); color: var(--txt); border: 1px solid var(--glass-line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.leaflet-popup.rpop .leaflet-popup-content { margin: 12px 34px 12px 14px; font-family: var(--font-body); font-size: 12.5px; line-height: 1.45; min-width: 170px; }
.leaflet-popup.rpop .leaflet-popup-tip { background: var(--glass-3); box-shadow: none; }
.leaflet-popup.rpop a.leaflet-popup-close-button { top: 7px; right: 7px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font: 700 17px/1 var(--font-body); color: var(--mut); background: var(--gray-soft); }
.rpop b { font-size: 13.5px; font-weight: 600; display: block; }
.rpop small { color: var(--mut); font-weight: 400; display: block; margin-top: 2px; }
.rpop .st { margin-top: 6px; }
.leaflet-interactive { cursor: pointer; }

/* ===================== Журнал ===================== */
.journal { display: flex; flex-direction: column; height: calc(100vh - var(--top) - 24px); min-height: 520px; padding-bottom: 8px; }
.jtop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jsrow { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.jsrow .search { min-width: 0; }
.jfbtn { display: none; flex: none; }
.jfbtn.on { background: var(--ink); color: var(--ink-txt); border-color: var(--ink); }
.jfbtn b { font-weight: 600; }
/* усі активні тривоги — у власній прокрутці, щоб довгий список не розтягував сторінку */
#aAlLong { max-height: 430px; overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }
#aAlN { color: var(--dim); font-weight: 500; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--gray-soft); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 7px 13px; border-radius: 999px; font-weight: 500; font-size: 13px; color: var(--mut); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; transition: background .2s, color .2s; }
.tab:hover { color: var(--txt); }
.tab sup { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px; background: var(--gray-soft); line-height: 18px; vertical-align: 0; }
.tab.on { background: var(--ink); color: var(--ink-txt); font-weight: 700; }
.tab.on sup { background: rgba(127, 127, 127, .25); }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 40px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line-2); }
.search:focus-within { border-color: var(--acc); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-weight: 400; font-size: 16px; }
.search svg.i { width: 17px; height: 17px; color: var(--mut); }
.jfilters { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.jfilters:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips:empty { display: none; }
.chips .lbl { font-size: 11px; font-weight: 600; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.chip { padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--glass-2); border: 1px solid var(--line-2); color: var(--mut); transition: all .2s; display: inline-flex; gap: 6px; align-items: center; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--ink-txt); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.feedwrap { position: relative; flex: 1; min-height: 0; margin-top: 8px; }
.feed { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: thin; padding: 0 2px 8px; }
.day h4 { position: sticky; top: 0; z-index: 2; padding: 10px 10px 8px; font-size: 12.5px; font-weight: 600; color: var(--txt);
  background: var(--glass); border-radius: var(--r-sm); }
.day h4 span { color: var(--mut); font-weight: 500; margin-left: 6px; }
.newbtn { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); z-index: 5; padding: 8px 16px; border-radius: 999px; background: var(--ink); color: var(--ink-txt);
  font-weight: 600; font-size: 12.5px; box-shadow: var(--shadow-sm); animation: evin .4s var(--ease); }
.more { display: flex; justify-content: center; padding: 12px; }

/* ===================== Цілі ===================== */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--gray-soft); }
.seg button { padding: 7px 13px; border-radius: 999px; font-weight: 500; font-size: 13px; color: var(--mut); transition: background .2s, color .2s; }
.seg button.on { background: var(--ink); color: var(--ink-txt); font-weight: 700; }
.tt-head, .tr { display: grid; grid-template-columns: 74px minmax(150px, 1.2fr) 110px 110px 104px minmax(160px, 1.6fr) 130px; gap: 12px; align-items: center; padding: 10px 12px; }
.tt-head { font-size: 11.5px; font-weight: 600; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.tgrp-h { display: flex; align-items: center; gap: 8px; padding: 16px 12px 6px; font-weight: 600; font-size: 14px; }
.tgrp-h .cnt { height: 22px; font-size: 11.5px; }
.tr { border-radius: var(--r-sm); cursor: pointer; transition: background .2s; font-weight: 400; }
.tr:hover { background: var(--hover); }
.tr .c { justify-self: start; display: flex; align-items: center; gap: 8px; }
.tr .ty { display: flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
.tr .ty span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .num { font-variant-numeric: tabular-nums; }
.tr .ob { color: var(--mut); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .ob em { font-style: normal; color: var(--dim); margin: 0 4px; }
.tr .mob, .tr .c .st { display: none; }

/* ===================== Аналітика ===================== */
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; margin-bottom: var(--gap); }
.ana3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
#hourly { position: relative; }
#hourly svg { display: block; width: 100%; }
#hourly text { fill: var(--mut); font-size: 11px; font-family: var(--font-body); font-weight: 500; }
#hourly .ttl { fill: var(--txt); font-weight: 600; font-size: 12px; }
#hourly .grid { stroke: var(--chart-grid); }
#hourly .bar { fill: var(--chart-bar); }
.htip { position: absolute; pointer-events: none; padding: 8px 11px; border-radius: var(--r-sm); background: var(--glass-3); border: 1px solid var(--glass-line); box-shadow: var(--shadow-sm);
  font-size: 12px; font-weight: 400; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.htip.on { opacity: 1; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.br { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 40px; gap: 10px; align-items: center; font-size: 13px; font-weight: 500; }
.br-l { display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-l svg { flex: none; }
.br-t { height: 10px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.br-t i { display: block; height: 100%; border-radius: 999px; width: 0; transition: width .8s var(--ease); }
.br b { text-align: right; font-variant-numeric: tabular-nums; }
.al-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.al-kpis > div { padding: 12px 14px; border-radius: var(--r-md); background: var(--glass-2); border: 1px solid var(--line); }
.al-kpis small { display: block; color: var(--mut); font-weight: 500; font-size: 12px; }
.al-kpis b { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.al-kpis .red b { color: var(--bad); } .al-kpis .yellow b { color: var(--warn); } .al-kpis .other b { color: var(--vio); }
.ana2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--gap); }
/* Період аналітики */
.ana-per { display: flex; align-items: center; gap: 8px; margin-bottom: var(--gap); flex-wrap: wrap; }
.ana-date { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px; background: var(--gray-soft); color: var(--mut); cursor: pointer; }
.ana-date.on { background: var(--ink); color: var(--ink-txt); }
.ana-date svg.i { width: 16px; height: 16px; flex: none; }
.ana-date input { border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 500; outline: none; min-width: 0; width: 118px; color-scheme: light dark; }
.ana-note { color: var(--mut); font-size: 12.5px; font-weight: 400; }
.seg.sm button { padding: 5px 10px; font-size: 12.5px; }
.al-kpis b.sm, .pl-k b.sm { font-size: 18px; display: block; line-height: 1.3; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-kpis .s { margin-top: 4px; color: var(--mut); font-size: 12px; font-weight: 400; display: flex; flex-wrap: wrap; gap: 3px 10px; }
.al-kpis .s i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.al-kpis small span { text-transform: none; }
/* Моє місто */
.pl-find { position: relative; }
.pl-find .search { max-width: 520px; }
.pl-res { display: none; position: absolute; left: 0; top: calc(100% + 6px); width: min(520px, 100%); z-index: 40; max-height: 340px; overflow-y: auto;
  border-radius: var(--r-md); background: var(--glass-3); border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 4px; }
.pl-res.show { display: block; }
.pl-res button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 9px 12px; border-radius: var(--r-sm); text-align: left; }
.pl-res button:hover, .pl-res button:focus-visible { background: var(--gray-soft); }
.pl-res b { font-weight: 600; font-size: 14px; }
.pl-res small { color: var(--mut); font-size: 12px; font-weight: 400; }
.pl-k { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pl-list { display: flex; flex-direction: column; gap: 4px; }
.pl-r { display: grid; grid-template-columns: 92px auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: var(--r-sm); background: var(--glass-2); border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.pl-r time { color: var(--mut); font-variant-numeric: tabular-nums; font-weight: 400; }
.pl-r span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-r b { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.pl-more { margin-top: 8px; }
.pl-note { margin-top: 12px; color: var(--dim); font-size: 12px; font-weight: 400; line-height: 1.45; }
/* Смуга доби з тривогами */
.tl { position: relative; height: 12px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.tl i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.tl i.r, .tl-leg i.r { background: var(--bad); }
.tl i.y, .tl-leg i.y { background: var(--warn); }
.tl-ticks { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; font-weight: 400; margin-top: 4px; font-variant-numeric: tabular-nums; }
#alDay { display: flex; flex-direction: column; gap: 8px; }
.tlr { display: grid; grid-template-columns: minmax(96px, 20%) minmax(0, 1fr) 96px; gap: 12px; align-items: center; font-size: 13px; font-weight: 500; }
.tlr > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlr > b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.tl-head .tl-ticks { margin: 0; }
.tl-leg { display: flex; gap: 16px; color: var(--mut); font-size: 12px; font-weight: 400; margin-top: 4px; }
.tl-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
/* Щільність маршрутів */
.dens canvas { display: block; width: 100%; }
.dens-leg { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--mut); font-size: 12px; font-weight: 400; flex-wrap: wrap; }
.dens-leg i { display: inline-block; width: 110px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #b6c4ff, #6d87f5, #3d63f0, #14237a); }
:root[data-theme="dark"] .dens-leg i { background: linear-gradient(90deg, #24357f, #3d63f0, #8aa2ff, #ffffff); }
.dens-leg .sp { flex: 1; }
.longl { display: flex; flex-direction: column; gap: 6px; }
.longl .lr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--r-sm); background: var(--glass-2); border: 1px solid var(--line); font-weight: 500; font-size: 13px; cursor: pointer; }
.longl .lr:hover { background: var(--glass-3); }
.longl .lr span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.longl .lr small { display: block; color: var(--mut); font-weight: 400; font-size: 11.5px; white-space: normal; }
.longl .lr b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===================== Футер ===================== */
/* Підвал — окрема картка в стилі шапки */
footer.foot { padding: 8px 0 24px; }
.foot-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 28px; background: var(--glass); border: 1px solid var(--glass-line); }
/* посилання — точно по центру картки, соцмережі — праворуч (ліва колонка — порожня противага) */
.foot-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.foot-top::before { content: ""; }
.flinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; }
.flinks a { color: var(--mut); font-weight: 500; font-size: 13px; padding: 6px 12px; border-radius: 999px; }
.flinks a:hover { color: var(--txt); background: var(--hover); }
.fsoc { display: flex; gap: 6px; justify-content: flex-end; }
.fsoc .cbtn svg.i { width: 18px; height: 18px; }
.fnote { margin: 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; font-weight: 400; line-height: 1.5; text-align: center; }
.fnote a { color: var(--mut); font-weight: 500; }

/* ===================== Моє місце ===================== */
.me-m { pointer-events: none; }
.me-m i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--me); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.me-m i::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; background: var(--me); opacity: .35; animation: mepulse 2s ease-out infinite; z-index: -1; }
@keyframes mepulse { 0% { transform: scale(.4); opacity: .55; } 100% { transform: scale(2.1); opacity: 0; } }
.me-m span { position: absolute; left: 14px; top: -11px; white-space: nowrap; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--glass-3); color: var(--txt); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.near { left: 12px; bottom: 12px; width: 320px; padding: 10px 12px; border-radius: var(--r-md); opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease); }
.near.open { opacity: 1; transform: none; pointer-events: auto; }
.near.hot { border-color: var(--bad); }
.near .nh { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; }
.near .nh h4 { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.near .nh .one { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 12.5px; color: var(--mut); display: none; }
.near .nh .chev { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-soft); margin-left: auto; flex: none; }
.near .nh .chev svg.i { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.near.col .nh .chev svg.i { transform: rotate(180deg); }
.near.col .nh .one { display: block; }
.near.col .nb { display: none; }
.near .nb { margin-top: 6px; }
.nrow { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; }
.nrow:hover { background: var(--hover); }
.nrow .nm { font-weight: 500; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nrow .nm small { display: block; font-size: 11.5px; font-weight: 500; color: var(--mut); }
.nrow .nm small.appr { color: var(--bad); } .nrow .nm small.away { color: var(--ok); } .nrow .nm small.side { color: var(--warn); }
.nrow .d { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nrow.close .d { color: var(--bad); }
.near .foot { margin-top: 4px; font-size: 11px; font-weight: 400; color: var(--dim); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.near .foot .btn { margin-left: auto; padding: 4px 10px; min-height: 28px; font-size: 12px; }
.near .none { color: var(--mut); font-weight: 400; padding: 6px 4px; }
.tcard.open ~ .near { opacity: 0; pointer-events: none; }
.has-near .legend:not(.show) { display: none !important; }
.legend.show { z-index: 900; }   /* легенда за кнопкою «i» — поверх плашки «Найближчі цілі» */

/* Звук при наближенні */
.sndrow { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 8px; border-radius: var(--r-sm); background: var(--glass-2); border: 1px solid var(--line); flex-wrap: wrap; }
.sndrow .tg { padding: 2px 0; flex: 1; min-width: 0; font-size: 13px; }
select.sel { font: inherit; font-weight: 500; font-size: 12.5px; color: var(--txt); background: var(--glass-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 8px; }
.qb { width: 28px; height: 28px; border-radius: 50%; background: var(--glass-3); border: 1px solid var(--line-2); font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--acc); flex: none; }
.banner { position: fixed; z-index: 1600; left: 50%; top: 12px; transform: translate(-50%, -24px); width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md); background: var(--glass-3); border: 2px solid var(--bad); font-size: 14px; font-weight: 400; opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease); }
.banner.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.banner > span { flex: 1; min-width: 0; } .banner > span > small { display: block; color: var(--mut); font-weight: 400; font-size: 12px; }
.banner > svg { flex: none; }
.banner .bx { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-soft); flex: none; }
.banner .bx svg.i { width: 16px; height: 16px; }

/* ===================== Нижня панель (телефон) ===================== */
.bnav { display: none; }

/* ===================== Менші екрани (комп'ютер, вузький) ===================== */
@media (max-width: 1320px) {
  .pill-nav { padding: 8px 11px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .tt-head, .tr { grid-template-columns: 70px minmax(130px, 1.2fr) 96px 96px 92px minmax(120px, 1.4fr) 120px; }
}
@media (max-width: 1120px) and (min-width: 900px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; border-radius: 28px; padding: 10px 10px 10px 16px; }
  .topbar .pills { grid-column: 1 / -1; grid-row: 2; justify-self: start; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .ov-grid { grid-template-columns: 1fr; height: auto; }
  .ov-grid .mapcard { height: 60vh; min-height: 380px; }
  .air { max-height: 520px; }
  .ov-bottom, .ana3, .ana2 { grid-template-columns: 1fr; }
}

/* ===================== Телефон ===================== */
@media (max-width: 899px) {
  :root { --gap: 12px; --bnav: calc(80px + env(safe-area-inset-bottom)); }
  .rail, .titlebar, .pills, .conn, .brand .bt small { display: none; }
  .app { padding: 0 12px calc(var(--bnav) + 8px); }
  .top { padding: 8px 0; }
  main { padding-top: 8px; }
  #v-analytics.on { display: flex; flex-direction: column; gap: var(--gap); }
  #v-analytics > * { margin: 0 !important; }
  .top::before { left: -12px; right: -12px; }
  .topbar { display: flex; gap: 8px; padding: 6px 6px 6px 12px; height: 52px; }
  .brand { flex: 1; }
  .brand .logo-m { width: 32px; height: 32px; }
  .brand h1 { font-size: 16px; }
  .cbtn { width: 40px; height: 40px; }
  .status { display: flex; }
  .card-xl { padding: 14px; border-radius: var(--r-lg); }
  .ch h3, .acc-h h3 { font-size: 16px; }
  /* Нижня панель */
  .bnav { position: fixed; z-index: 1300; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); height: 64px; display: flex; justify-content: space-around; align-items: stretch; padding: 4px; border-radius: 24px; background: var(--glass); border: 1px solid var(--glass-line); }
  .bn { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mut); font-size: 10.5px; font-weight: 500; border-radius: var(--r-md); }
  .bn i { display: grid; place-items: center; width: 44px; height: 26px; border-radius: 999px; transition: background .2s; }
  .bn svg.i { width: 22px; height: 22px; }
  .bn.on { color: var(--txt); font-weight: 700; }
  .bn.on i { background: var(--ink); color: var(--ink-txt); }
  .bn .dotb { top: 4px; right: calc(50% - 22px); }
  /* Огляд: порядок рядок-стан → Моє місце → мапа → KPI → акордеони */
  #v-overview.on { display: flex; flex-direction: column; gap: var(--gap); }
  #v-overview > * { margin: 0 !important; }
  .ov-grid, .ov-bottom { display: contents; }
  .sky { order: 1; }
  .sky-top { gap: 10px; }
  .sky-pills { flex-basis: 100%; margin: 0 -16px; padding: 2px 16px; }
  .sky-al { font-size: 13px; }
  .mecard { order: 2; display: block; }
  .ov-grid .mapcard { order: 3; height: 55vh; min-height: 300px; }
  #v-overview .kpis { order: 4; }
  .air { order: 5; }
  .ov-bottom > :first-child { order: 6; }
  .ov-bottom > :last-child { order: 7; }
  .seo { order: 8; }   /* текст для пошуку — завжди в самому кінці, після мапи й карток */
  .ov-grid { height: auto; }
  .air { max-height: none; }
  .air-list { max-height: 60vh; }
  .acc-h .chev { display: grid; }
  .acc-h .btn { display: none; }
  .acc:not(.open) .acc-b { display: none; }
  .acc.open .acc-h { margin-bottom: 10px; }
  .acc .acc-h { margin-bottom: 0; }
  .kpis, .kpis.k4 { display: flex; gap: 8px; overflow-x: auto; margin: 0 -12px !important; padding: 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: none; width: auto; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { flex: 0 0 46%; scroll-snap-align: start; padding: 12px 14px; }
  .kpi .v { font-size: 26px; }
  .kpi .v.sm { font-size: 18px; }
  .ov-bottom .card-xl { width: auto; }
  .oc { flex-wrap: wrap; row-gap: 4px; }
  .oc .nm { flex-basis: 100%; order: -1; white-space: normal; }
  .oc .tcount { margin-left: auto; }
  /* Мапа на весь екран */
  [data-view="map"] footer { display: none; }
  #v-map { padding-bottom: 0; }
  .mapfull { height: calc(100dvh - var(--top) - var(--bnav) - 8px); min-height: 360px; }
  .leaflet-control-zoom { display: none; }
  [data-view="map"] .leaflet-bottom { bottom: 60px; }
  .m-tr { top: 8px; right: 8px; gap: 6px; }
  .legend-btn { display: grid; }
  .legend { display: none; left: 8px; bottom: 8px; max-width: calc(100% - 16px); }
  .legend.show { display: block; }
  [data-view="map"] .legend { bottom: 68px; }
  .layers { width: 210px; }
  [data-view="map"] .layers { display: none; }
  [data-view="map"] .layers.show { display: block; }
  .mapgrid, .mapgrid.collapsed { grid-template-columns: 1fr; gap: 0; }
  .spanel { --sheet: calc(100dvh - var(--top) - var(--bnav) - 8px); position: fixed; z-index: 1250; left: 8px; right: 8px; bottom: calc(var(--bnav) + 8px); height: 60px; min-height: 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
    transition: height .35s var(--ease); padding: 0 12px 8px; opacity: 1; pointer-events: auto; border-bottom: 0; background: var(--glass); overflow: hidden; }
  .spanel.drag { transition: none; }
  .spanel[data-state="half"] { height: calc(var(--sheet) / 2); }
  .spanel[data-state="full"] { height: var(--sheet); }
  .mapgrid.collapsed .spanel { opacity: 1; pointer-events: auto; padding: 0 12px 8px; border-width: 1px; border-bottom: 0; }
  .sp-top { touch-action: none; cursor: grab; }
  .sp-grip { display: block; width: 40px; height: 5px; border-radius: 999px; background: var(--line-2); margin: 8px auto 6px; }
  .sp-h { margin-bottom: 6px; }
  .sp-x { transform: rotate(-90deg); }
  .spanel[data-state="full"] .sp-x { transform: rotate(90deg); }
  .spanel[data-state="peek"] .sp-body { overflow: hidden; }
  [data-view="map"] .panel-btn { display: none; }
  .tcard { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 62%; transform: translateY(12px); }
  [data-view="map"] .tcard { bottom: 68px; }
  .near { left: 8px; right: 8px; bottom: 8px; width: auto; }
  [data-view="map"] .near { bottom: 68px; }
  /* Журнал */
  .jtop { flex-direction: column; align-items: stretch; }
  .jsrow { min-width: 0; width: 100%; }
  .jsrow .search { flex: 1 1 0; min-width: 0; }
  .jsrow .search input { width: 100%; }
  .jfbtn { display: inline-flex; padding: 8px 12px; }
  /* журнал: одна прокрутка — сторінки, без вкладеної стрічки */
  .journal { height: auto; min-height: 0; }
  .feedwrap { flex: none; }
  .feed { position: static; overflow: visible; }
  .newbtn { position: fixed; top: calc(var(--top) + 6px); }
  /* підвал на телефоні: бренд і соцмережі вгорі, посилання — сіткою 2×2 */
  .foot-card { padding: 14px; border-radius: 24px; }
  .foot-top { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .foot-top::before { display: none; }
  .flinks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .fsoc { justify-content: center; }
  .flinks a { text-align: center; background: var(--gray-soft); padding: 9px 8px; font-size: 12.5px; }
  .jfilters:not(.open) { display: none !important; }
  .jfilters .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
  .jfilters .chips::-webkit-scrollbar { display: none; }
  .jfilters .chip, .jfilters .lbl { flex: none; }
  #aAlLong { max-height: 360px; }
  .tabs { flex-wrap: wrap; overflow: visible; border-radius: var(--r-md); }
  .tab { flex: 1 1 auto; justify-content: center; padding: 7px 10px; }
  .search { min-width: 0; width: 100%; height: 40px; }
  .ev { grid-template-columns: 28px minmax(0, 1fr); grid-template-areas: "i k" "i x"; padding: 7px 6px; row-gap: 1px; }
  .ev > time { display: none; }
  .ev .ev-ic { grid-area: i; align-self: start; }
  .ev .ev-b { grid-area: k / k / x / x; }
  .ev > .code { position: absolute; right: 6px; top: 6px; }
  .ev .ev-k time { display: inline; }
  .ev .ev-k { padding-right: 56px; min-height: 20px; }
  .ev-x { font-size: 13px; }
  .day h4 { padding: 8px 8px 6px; }
  /* Цілі — картки */
  .tt-head { display: none; }
  .tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "c c" "t t" "m m" "o o"; gap: 4px 8px; padding: 10px 12px; margin-bottom: 6px; background: var(--glass-2); border: 1px solid var(--line); }
  .tr .c { grid-area: c; justify-content: space-between; }
  .tr .c .st { display: inline-flex; }
  .tr .ty { grid-area: t; font-size: 14px; }
  .tr .ty span { white-space: normal; }
  .tr .num, .tr .stc { display: none; }
  .tr .mob { grid-area: m; display: block; color: var(--mut); font-size: 12.5px; font-variant-numeric: tabular-nums; }
  .tr .ob { grid-area: o; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; }
  .tgrp-h { padding: 12px 4px 6px; }
  /* Аналітика */
  .ana3, .ana2 { grid-template-columns: 1fr; }
  .al-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ana-per { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px var(--gap); padding: 2px 12px; scrollbar-width: none; }
  .ana-per::-webkit-scrollbar { display: none; }
  .ana-per .seg, .ana-date { flex: none; }
  .ana-note { flex: none; white-space: nowrap; }
  .pl-k { grid-template-columns: 1fr; }
  .pl-r { grid-template-columns: 74px auto minmax(0, 1fr) auto; gap: 8px; }
  .tlr { grid-template-columns: 86px minmax(0, 1fr) 70px; gap: 8px; font-size: 12px; }
  #place .ch .seg { order: 5; }
  /* Модальні */
  .modal { padding: 0; }
  .modal-box { width: 100%; height: 100%; border-radius: 0; }
  .gdlg { padding: 16px; } .gdlg .modal-box { border-radius: var(--r-lg); height: auto; }
  .faq { align-items: end; }
  .faq .modal-box { width: 100%; height: auto; max-height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(30px); }
  .faq-theme { display: flex; }
  .banner { top: calc(8px + env(safe-area-inset-top)); }
  .fq .fb { padding-left: 14px; }
}
@media (min-width: 900px) { .ev .ev-k time { display: none; } }
@media (max-width: 380px) {
  .kpi { flex-basis: 60%; }
  .bn { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Перемикач теми в шапці — лише на телефоні (на комп'ютері він у лівій рейці) */
.th-btn { display: none; }
@media (max-width: 899px) { .th-btn { display: grid; } }

/* Телефон: картка цілі — не вище половини мапи, хрестик завжди видно */
@media (max-width: 899px) { .tcard { max-height: 55%; } .tcard .x { width: 38px; height: 38px; } }

/* Хрестик у «Як користуватись» не прокручується разом з текстом */
.faq .modal-x { position: sticky; top: 0; float: right; margin: -6px -6px 0 8px; }

/* Телефон: картка цілі — нижня шторка над панеллю навігації, з ручкою; тап по шапці розгортає/згортає */
@media (max-width: 899px) {
  .tcard { position: fixed; z-index: 1300; left: 8px; right: 8px; top: auto; bottom: calc(var(--bnav) + 8px); width: auto;
    max-height: 34dvh; padding-top: 22px; transition: max-height .3s var(--ease), opacity .25s var(--ease), transform .25s var(--ease); }
  .tcard.big { max-height: calc(100dvh - var(--bnav) - 90px); }
  .tcard::before { content: ''; position: sticky; display: block; top: -18px; margin: -14px auto 0; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); z-index: 3; }
  .tcard .hd { top: -22px; padding-top: 10px; cursor: pointer; }
  .tcard .hd::after { content: 'Торкніться, щоб розгорнути'; position: absolute; left: 16px; bottom: -2px; font-size: 10.5px; color: var(--dim); font-weight: 500; }
  .tcard.big .hd::after { content: 'Торкніться, щоб згорнути'; }
  .tcard .hd { padding-bottom: 18px; }
}

/* Комп'ютер: «N у небі» і «Цілі біля мене» — одним рядком над мапою; тривоги в тому ж рядку, без окремої смуги */
@media (min-width: 900px) {
  #v-overview.on { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--gap); align-items: stretch; }
  #v-overview > * { grid-column: 1 / -1; }
  #v-overview > #sky { grid-column: 1; display: flex; align-items: center; gap: 8px 16px; padding: 10px 16px; flex-wrap: wrap; }
  #v-overview > #meCard { grid-column: 2; display: flex; align-items: center; padding: 10px 14px; max-width: 360px; }
  /* вузьке вікно: пілюлі переносяться рядком нижче, а «Тривога у N областях» — під них, замість того щоб ховатись одна під одну */
  .sky-top { flex: 1 1 360px; min-width: 0; flex-wrap: nowrap; }
  .sky-pills { flex-wrap: wrap; overflow: visible; }
  .sky-n { font-size: 28px; }
  .sky-al { margin: 0; padding: 0 0 0 16px; border-top: 0; border-left: 1px solid var(--line); flex: none; white-space: nowrap; }
  .mecard .me-off { flex-direction: row; align-items: center; gap: 10px; }
  .mecard .me-off small { display: none; }
  .mecard .me-off .btn { flex: none; }
  /* увімкнено: один рядок — найближча ціль · звук; тривогу в області вже видно в рядку ліворуч */
  .mecard .me-on { flex-direction: row; align-items: center; gap: 12px; min-width: 0; }
  .mecard .me-al { display: none; }
  .mecard .me-row { flex: none; }
  .mecard .sndrow { margin: 0; padding: 0 0 0 12px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: none; }
  .mecard.open { position: relative; }
  .mecard .me-x { position: absolute; top: calc(100% + 6px); right: 0; width: 360px; z-index: 950; padding: 10px 12px; border-radius: var(--r-md);
    background: var(--glass-3); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
  #v-overview > #meCard { max-width: none; }
}

/* Джерело (офіційна мапа) тимчасово не віддає цілі */
.sky-n.dim { color: var(--mut); }
.sky-src { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 9px 12px; border-radius: var(--r-md); font-size: 13px; line-height: 1.35; font-weight: 500;
  background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.sky-src .i, .sky-src svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ===== Назва і H1 у шапці (SEO, 2026-10-22): назва — як було, H1 — дрібний підпис під нею. На телефоні теж видно, бо Google читає мобільну версію ===== */
.brand .bname { font-family: var(--font-logo); font-size: 16px; font-weight: 500; letter-spacing: .06em; white-space: nowrap; }
.brand h1.tag { font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--mut); margin-top: 3px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* На телефоні: та сама «пілюля» в один ряд, підпис коротка (до 2 рядків під назвою) — довгі формулювання живуть у title/description */
@media (max-width: 899px) {
  .brand .bt { min-width: 0; flex: 1; }
  .brand h1.tag { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; text-overflow: clip; font-size: 10.5px; line-height: 1.25; margin-top: 2px; }
  .topbar { height: auto; min-height: 52px; }
}
}

/* ===== Текст під мапою для пошуку: в самому низу «Огляду», питання згорнуті — карті не заважає ===== */
.seo { margin-top: var(--gap); padding: 18px 20px; font-size: 14px; line-height: 1.55; color: var(--txt); }
.seo h2 { font-family: var(--font-head); font-size: 17px; font-weight: 600; margin: 16px 0 6px; }
.seo h2:first-child { margin-top: 0; }
.seo p, .seo ul { margin: 0 0 8px; color: var(--mut); }
.seo .seo-live { color: var(--txt); font-weight: 600; }
.seo ul { padding-left: 18px; }
.seo li { margin: 2px 0; }
.seo a { color: var(--txt); text-decoration: underline; text-underline-offset: 2px; }
.seo b { color: var(--txt); font-weight: 600; }
.seo details { border-top: 1px solid var(--glass-line); padding: 8px 0; }
.seo details:last-child { padding-bottom: 0; }
.seo summary { cursor: pointer; font-weight: 600; color: var(--txt); list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.seo summary::-webkit-details-marker { display: none; }
.seo summary::after { content: '+'; color: var(--mut); font-size: 18px; line-height: 1; flex: none; }
.seo details[open] summary::after { content: '–'; }
.seo details p { margin: 6px 0 0; }
@media (max-width: 899px) { .seo { padding: 14px 16px; font-size: 13.5px; } .seo h2 { font-size: 16px; } }
/* Логотип і назва — посилання на головну (SEO-сторінки /kyiv, /odeska… мають вертати на /) */
.rail a.logo, .brand a.logo-m, .brand a.bname { color: inherit; text-decoration: none; cursor: pointer; }
.brand a.logo-m:hover, .rail a.logo:hover { opacity: .85; }
/* Перемикач мови (EN / UA) у шапці */
.lang-btn { text-decoration: none; font-family: var(--font-head); font-size: 12px; letter-spacing: .04em; }
@media (max-width: 380px) { .tright .cbtn { width: 36px; height: 36px; } }
