/* ==========================================================================
   MyKyiv · Тривоги — production styles
   ========================================================================== */

:root {
  --ink:        #0e0e0f;
  --ink-2:      #1b1b1d;
  --ink-3:      #2b2b2e;
  --paper:      #faf7f0;
  --paper-2:    #f2ecdd;
  --paper-3:    #e8e0cb;
  --paper-tint: #fffaf0;
  --line:       rgba(14,14,15,.10);
  --line-2:     rgba(14,14,15,.16);
  --line-strong:rgba(14,14,15,.28);
  --muted:      #6b6458;
  --muted-2:    #8a8378;

  --yellow:      #ffd400;
  --yellow-soft: #fff4a8;
  --yellow-deep: #f4c100;
  --red:         #e5322a;
  --red-soft:    #ffe1de;
  --red-deep:    #b3261e;
  --green:       #2a7b3a;
  --green-soft:  #d8efdc;

  --sig-air:        #e5322a;
  --sig-air-bg:     #fff0ee;
  --sig-air-glow:   rgba(229,50,42,.18);
  --sig-artillery:  #8a1410;
  --sig-urban:      #5b1d8a;
  --sig-chemical:   #b08400;
  --sig-nuclear:    #7a3a00;
  --sig-persist:    #b07b00;
  --sig-calm:       #2a7b3a;
  --sig-calm-bg:    #ecf6ee;

  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  --r-1: 6px;  --r-2: 10px;  --r-3: 14px;  --r-4: 20px;  --r-5: 28px;
  --r-pill: 999px;

  --sh-1: 0 1px 0 rgba(14,14,15,.04), 0 2px 6px rgba(14,14,15,.05);
  --sh-2: 0 4px 18px rgba(14,14,15,.08);
  --sh-3: 0 12px 40px rgba(14,14,15,.10);
  --sh-alarm: 0 0 0 6px var(--sig-air-glow), 0 16px 50px rgba(229,50,42,.18);

  --ease-out: cubic-bezier(.2,.7,.2,1);
}

/* ============================ resets ===================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: transparent; padding: 0; }

/* Headings — Unbounded everywhere */
h1, h2, h3, h4, h5, h6, .font-display {
  font-family: var(--font-display);
  letter-spacing: -.02em;
  margin: 0;
}
.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ============================ keyframes ================================== */

@keyframes alarm-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,50,42,.55); }
  50%      { box-shadow: 0 0 0 14px rgba(229,50,42,0); }
}
@keyframes alarm-ring {
  0%   { transform: scale(.7); opacity: .9; }
  80%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes alarm-glow {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}
@keyframes blink {
  0%, 49%  { opacity: 1; }
  50%, 100%{ opacity: .15; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================ layout ===================================== */

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

/* ----- header ----- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,247,240,.86);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  max-width: 1700px; margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
}
.brand-icon {
  height: 36px; width: auto; flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.02em;
  line-height: 1;
  white-space: nowrap;
}
.brand-divider {
  width: 1px; height: 22px;
  background: var(--line-strong);
  margin: 0 4px;
}
.brand-service {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: lowercase;
  color: var(--muted);
}
.brand-service::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--sig-air);
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: 1px;
  animation: alarm-pulse 2.4s var(--ease-out) infinite;
}

.nav-tabs {
  display: flex; gap: 4px; justify-content: center;
}
.nav-tabs a {
  padding: 7px 12px; border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid transparent;
  font-weight: 500;
  font-family: var(--font-body);
  transition: color .12s, background .12s, border-color .12s;
}
.nav-tabs a:hover { color: var(--ink); }
.nav-tabs a.is-active {
  color: var(--ink); background: #fff;
  border-color: var(--line-2);
  font-weight: 700;
}

.nav-right { display: flex; align-items: center; gap: 10px; }
.live {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sig-calm);
}
.live::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sig-calm);
  animation: alarm-glow 1.8s ease-in-out infinite;
}
.live[data-state="stale"] { color: var(--muted-2); }
.live[data-state="stale"]::before { background: var(--muted-2); animation: none; }
.live[data-state="off"]   { color: var(--muted-2); opacity: .6; }
.live[data-state="off"]::before { background: var(--muted-2); animation: none; }

.idx-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
}

/* ----- page wrapper (header + map-row + SEO sections) ----- */
.page {
  flex: 1;
  max-width: 1700px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Breadcrumbs (тільки на регіональних/міських/інфо) */
.breadcrumbs {
  font-size: 12.5px;
  color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 2px 0 0;
}
.breadcrumbs a { color: var(--muted); border-bottom: 1px dotted var(--line); }
.breadcrumbs a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }
.breadcrumbs .bc-sep { color: var(--muted-2); }

/* H1 + lead над картою — компактний рядок, щоб не з'їдати висоту над мапою */
.page-head {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding-top: 0;
}
.page-h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(18px, 1.9vw, 24px);
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0;
}
.page-lead {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 80ch;
  margin: 0;
}

/* ----- map row (grid map+sidebar) ----- */
.map-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 12px;
  min-height: 0;
  transition: grid-template-columns .22s cubic-bezier(.4,.14,.3,1);
}
.map-row > .map-card {
  min-width: 0;
  min-height: 620px;
  height: min(82vh, 820px);
}
.map-row > .sidebar  {
  display: flex; flex-direction: column; gap: 12px;
  min-width: 0; min-height: 0;
  height: min(82vh, 820px);
  overflow: hidden;
  transition: opacity .18s ease;
}

/* Sidebar-hide при 0 активних не-PERSIST тривог: карта займає всю ширину,
   sidebar лишається у DOM (display не змінюємо — Google потім бачить текст
   живих тривог), але візуально стискається до нуля. Anchor-таргет (#list)
   все одно скролить — тому min-height не зануляємо, опускаємо лише opacity. */
body:not(.has-alerts) .map-row { grid-template-columns: 1fr; }
body:not(.has-alerts) .map-row > .sidebar {
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  margin: 0;
}
@media (max-width: 980px) {
  /* На мобільному sidebar показуємо ВЖЕ як таб під картою — стиснення
     не застосовуємо, бо пропадає UX-доступ до hero/Список. */
  body:not(.has-alerts) .map-row > .sidebar {
    opacity: 1; max-height: none; overflow: visible; pointer-events: auto;
  }
}

/* ----- SEO blocks (під map-row) ----- */
.seo-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 26px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  scroll-margin-top: 80px;
}
.seo-block h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: -.015em;
  margin: 0 0 12px;
  color: var(--ink);
}
.seo-block p { margin: 0 0 12px; max-width: 75ch; }
.seo-block p:last-child { margin-bottom: 0; }
.seo-block a { color: var(--ink); border-bottom: 1px dotted var(--line-strong); }
.seo-block a:hover { border-bottom-color: var(--ink); }

.signal-types {
  list-style: none; padding: 0; margin: 14px 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 14px;
  font-size: 13.5px;
}

/* Факти регіону/міста — список з підкресленням */
.region-facts {
  list-style: none; padding: 0; margin: 14px 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 14px;
  font-size: 13.5px;
}
.region-facts li {
  display: block;
  padding: 6px 10px;
  background: var(--paper-tint);
  border-radius: 8px;
}
.region-facts li strong { color: var(--ink); margin-right: 4px; }
.signal-types li { display: flex; align-items: center; gap: 10px; }
.signal-dot {
  width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.15);
}

.region-grid, .city-grid {
  list-style: none; padding: 0; margin: 8px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px 10px;
}
.region-grid li, .city-grid li { display: block; }
.region-grid a, .city-grid a {
  display: block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
  transition: border-color .12s, transform .08s, background-color .12s;
}
.region-grid a:hover, .city-grid a:hover {
  border-color: var(--ink);
  background: var(--paper-tint);
}

/* ----- FAQ ----- */
.faq-block { padding: 22px 26px 18px; }
.faq-item {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.faq-item:first-of-type { border-top: 1px solid var(--line); margin-top: 6px; }
.faq-item summary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.005em;
  cursor: pointer;
  list-style: none;
  display: flex; align-items: flex-start; gap: 12px;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+";
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 18px;
  line-height: 1;
  width: 18px; flex-shrink: 0;
  color: var(--muted);
  transition: transform .18s ease;
}
.faq-item[open] summary::before { content: "−"; }
.faq-item p {
  margin: 10px 0 0 30px;
  color: var(--muted);
  font-size: 14px;
  max-width: 75ch;
  line-height: 1.6;
}

/* ----- map card ----- */
.map-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(180deg, var(--paper-tint) 0%, var(--paper) 100%);
  box-shadow: var(--sh-1);
}
.map-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(14,14,15,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,14,15,.025) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.map-card svg { width: 100%; height: 100%; display: block; }

.map-legend {
  position: absolute; left: 16px; bottom: 16px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex; gap: 14px; align-items: center;
  font-size: 11px;
  box-shadow: var(--sh-1);
  z-index: 2;
}
.map-legend .item { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .swatch {
  width: 10px; height: 10px; border-radius: 2px;
}

.map-tick {
  position: absolute; right: 16px; top: 16px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  box-shadow: var(--sh-1);
  z-index: 2;
  max-width: calc(100% - 32px);
  text-align: right;
  line-height: 1.35;
}
.map-tick::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sig-calm);
  animation: alarm-glow 1.8s ease-in-out infinite;
}

/* ----- map zoom controls ----- */
.map-controls {
  position: absolute;
  right: 16px; top: 56px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 3;
}
.map-ctrl {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--sh-1);
  padding: 0;
  transition: background-color .12s ease, transform .08s ease;
}
.map-ctrl:hover { background: #fff; }
.map-ctrl:active { transform: scale(.94); }
.map-ctrl:focus-visible {
  outline: 2px solid var(--sig-air, #2272d6);
  outline-offset: 2px;
}
@media (max-width: 768px) {
  .map-controls { right: 10px; top: 48px; }
  .map-ctrl { width: 36px; height: 36px; } /* більший touch-target */
}

/* ----- hero card (alarm/calm) ----- */
.hero {
  position: relative;
  border-radius: 18px;
  padding: 20px 22px 18px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-tint) 0%, var(--paper) 100%);
}
.hero[data-state="alarm"] {
  background: linear-gradient(180deg, #fff5f3 0%, #ffe6e2 60%, #ffd9d3 100%);
  border-color: rgba(229,50,42,.22);
  box-shadow: var(--sh-1), 0 0 0 4px rgba(229,50,42,.06);
}
.hero-halo {
  position: absolute; right: -120px; top: -120px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(229,50,42,.30), transparent 70%);
  filter: blur(8px);
  animation: alarm-glow 3.2s ease-in-out infinite;
  pointer-events: none;
  display: none;
}
.hero[data-state="alarm"] .hero-halo { display: block; }

.hero-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero .hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.02em;
  font-size: 26px;
  line-height: 1.1;
  margin: 8px 0 12px;
  color: var(--ink);
}
.hero[data-state="alarm"] .hero-title em {
  font-style: normal; color: var(--red-deep);
}
.hero-bottom {
  display: flex; align-items: flex-end; gap: 16px;
  flex-wrap: wrap;
}
.hero-timer {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--red-deep);
}
.hero[data-state="calm"] .hero-timer { color: var(--ink-2); }
.hero-timer .colon { display: inline-block; animation: blink 1.6s steps(1, end) infinite; }
.hero-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex; flex-direction: column; gap: 3px;
  padding-bottom: 4px;
}
.hero-meta strong { color: var(--ink); }
.hero-actions {
  margin-left: auto;
  display: flex; gap: 8px;
  padding-bottom: 4px;
  flex-wrap: wrap;
}

/* ----- status pills ----- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}
.pill .dot { width: 9px; height: 9px; border-radius: 50%; }
.pill[data-state="alarm"] {
  background: var(--sig-air-bg);
  color: var(--red-deep);
  border-color: rgba(229,50,42,.22);
}
.pill[data-state="alarm"] .dot {
  background: var(--sig-air);
  animation: alarm-pulse 2.4s var(--ease-out) infinite;
}
.pill[data-state="calm"] {
  background: var(--sig-calm-bg);
  color: var(--sig-calm);
  border-color: rgba(42,123,58,.22);
}
.pill[data-state="calm"] .dot { background: var(--sig-calm); }
.pill[data-state="stale"] {
  background: var(--paper-2);
  color: var(--muted);
  border-color: var(--line-2);
}
.pill[data-state="stale"] .dot { background: var(--muted-2); }

/* ----- type chips ----- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.chip[data-type="AIR"]        { background: var(--sig-air-bg); color: var(--red-deep); border-color: rgba(229,50,42,.22); }
.chip[data-type="ARTILLERY"]  { background: #fde7e4; color: var(--sig-artillery); border-color: rgba(138,20,16,.22); }
.chip[data-type="URBAN_FIGHTS"]{ background: #eee0fb; color: var(--sig-urban); border-color: rgba(91,29,138,.22); }
.chip[data-type="CHEMICAL"]   { background: var(--yellow-soft); color: var(--sig-chemical); border-color: rgba(176,132,0,.32); }
.chip[data-type="NUCLEAR"]    { background: #f5e0c5; color: var(--sig-nuclear); border-color: rgba(122,58,0,.30); }
.chip[data-type="PERSIST"]    { background: #fff0d4; color: var(--sig-persist); border-color: rgba(176,123,0,.32); }

/* ----- buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-body);
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--ink);
  transition: background .12s, color .12s, border-color .12s, transform .12s;
}
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.is-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.is-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.is-danger { background: var(--sig-air); color: #fff; border-color: var(--sig-air); }
.btn.is-danger:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn.is-ghost { background: transparent; }

.btn-icon {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--ink);
  transition: background .12s, color .12s, border-color .12s;
}
.btn-icon:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-icon.is-on { background: var(--sig-air); color: #fff; border-color: var(--sig-air); }
.btn-icon.is-on:hover { background: var(--red-deep); border-color: var(--red-deep); }

/* ----- surface card ----- */
.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--sh-1);
  flex-shrink: 0;
}
.card.is-flex { display: flex; flex-direction: column; min-height: 0; flex: 1 1 0; }

.kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker::before {
  content: ""; width: 18px; height: 1px; background: var(--line-strong);
}

/* ----- neighbor strip ----- */
.neighbors { padding: 16px 16px 14px; }
.neighbors-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.neighbors-head .meta { font-size: 11px; color: var(--muted-2); }
.neighbors-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(3, 1fr);
}
.neighbor-cell {
  padding: 10px 12px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 8px;
  min-height: 92px;
}
.neighbor-cell .dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.neighbor-cell .stage-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.neighbor-cell h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.neighbor-cell .time-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.neighbor-cell[data-stage="0"] { background: #fff; border-color: var(--line-2); }
.neighbor-cell[data-stage="0"] .dot { background: var(--sig-calm); }
.neighbor-cell[data-stage="1"] { background: #fff7ef; border-color: rgba(176,123,0,.30); }
.neighbor-cell[data-stage="1"] .dot { background: var(--yellow-deep); }
.neighbor-cell[data-stage="2"] { background: #ffe9e3; border-color: rgba(229,50,42,.32); }
.neighbor-cell[data-stage="2"] .dot { background: var(--sig-air); animation: alarm-pulse 2.4s var(--ease-out) infinite; }
.neighbor-cell[data-stage="3"] { background: #ffd6cf; border-color: rgba(179,38,30,.55); }
.neighbor-cell[data-stage="3"] .dot { background: var(--red-deep); animation: alarm-pulse 2.4s var(--ease-out) infinite; }

/* ----- active alerts list ----- */
.list-head {
  padding: 14px 18px 10px;
  display: flex; align-items: baseline; justify-content: space-between;
  flex-shrink: 0;
}
.list-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.02em;
  margin-top: 6px;
}
.list-count .muted { color: var(--muted); font-weight: 500; font-size: 14px; }
.list-body { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.list-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.list-foot a { color: var(--ink); font-weight: 600; }

.alert-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 14px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}
.alert-row[data-persist="true"] { background: rgba(176,123,0,.04); }
.alert-row .indicator {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px;
  align-self: flex-start;
  background: var(--sig-air);
  animation: alarm-pulse 2.4s var(--ease-out) infinite;
}
.alert-row[data-persist="true"] .indicator {
  background: var(--sig-persist);
  animation: none;
}
.alert-row .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -.01em;
}
.alert-row .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.alert-row .right { text-align: right; }
.alert-row .duration {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--red-deep);
}
.alert-row[data-persist="true"] .duration { color: var(--sig-persist); }
.alert-row .since {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 2px;
}

/* ----- toolbar ----- */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  margin: 14px 24px 0;
  max-width: 1700px;
}
@media (min-width: 1700px) {
  .toolbar { margin: 14px auto 0; }
}
.toolbar-spacer { flex: 1; }

/* ----- footer ----- */
.footer {
  margin-top: 24px;
  padding: 24px 24px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 13px; color: var(--muted);
  max-width: 1700px;
  width: 100%;
  margin-left: auto; margin-right: auto;
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.footer-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
}
.footer-section > strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink);
  margin-bottom: 10px;
}
.footer-section > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.footer-section > summary::-webkit-details-marker { display: none; }
.footer-section > summary::after {
  content: "▾";
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  transition: transform .15s ease;
}
.footer-section[open] > summary::after { transform: rotate(180deg); }
.footer-section .region-grid,
.footer-section .city-grid,
.footer-section .info-list {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  font-size: 12.5px;
}
.footer-section .region-grid a,
.footer-section .city-grid a {
  padding: 6px 10px;
  font-size: 12.5px;
}
.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.info-list a {
  display: block;
  padding: 6px 8px;
  color: var(--ink);
  border-radius: 6px;
  font-size: 13px;
}
.info-list a:hover { background: var(--paper-tint); }

.footer-bottom {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}
.footer-bottom .center { text-align: center; }
.footer-bottom .center a { border-bottom: 1px dotted var(--line-strong); color: var(--ink); }
.footer-bottom .brand { color: var(--ink); }
@media (max-width: 700px) {
  .footer-bottom { grid-template-columns: 1fr; text-align: center; gap: 10px; }
}

/* ============================ map svg internals ========================== */

#ukraineMap {
  width: 100%; height: 100%; display: block;
}

/* RAION layer — зверху над областями (ловить кліки); напівпрозорі межі дають
   видиму розбивку; заливка лише коли райoн активний (тоді частково перекриває
   тінт області). */
.raion {
  fill: rgba(0,0,0,0);            /* прозоро, але pointer-events ловить */
  stroke: rgba(14,14,15,.18);
  stroke-width: .55;
  vector-effect: non-scaling-stroke;
  transition: fill .25s, stroke .15s, stroke-width .15s;
  cursor: pointer;
  pointer-events: all;
}
.raion:hover {
  fill: rgba(14,14,15,.06);
  stroke: var(--ink);
  stroke-width: 1.5;
}
.raion.is-selected {
  stroke: var(--ink);
  stroke-width: 2;
  fill: rgba(14,14,15,.04);
}
.raion[data-alert="AIR"]          { fill: rgba(229,50,42,.78); }
.raion[data-alert="ARTILLERY"]    { fill: rgba(138,20,16,.85); }
.raion[data-alert="URBAN_FIGHTS"] { fill: rgba(91,29,138,.85); }
.raion[data-alert="CHEMICAL"]     { fill: rgba(176,132,0,.85); }
.raion[data-alert="NUCLEAR"]      { fill: rgba(122,58,0,.85); }
.raion[data-alert="AIR"].is-selected,
.raion[data-alert="ARTILLERY"].is-selected,
.raion[data-alert="URBAN_FIGHTS"].is-selected,
.raion[data-alert="CHEMICAL"].is-selected,
.raion[data-alert="NUCLEAR"].is-selected {
  stroke: #fff;
  stroke-width: 2.4;
}

/* OBLAST layer — outline зверху, прозорі. Активна тривога на State-рівні
   (вся область) — заливка-тон знизу + видимі межі зверху. */
.oblast {
  fill: rgba(255,255,255,.45);  /* легка завіса для не-активних */
  stroke: rgba(14,14,15,.32);
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill .3s, stroke .15s;
  pointer-events: all;
}
.oblast:hover { stroke: var(--ink); stroke-width: 1.8; }
.oblast.is-active-state[data-alert="AIR"]        { fill: rgba(229,50,42,.62); }
.oblast.is-active-state[data-alert="ARTILLERY"]  { fill: rgba(138,20,16,.78); }
.oblast.is-active-state[data-alert="URBAN_FIGHTS"]{ fill: rgba(91,29,138,.78); }
.oblast.is-active-state[data-alert="CHEMICAL"]   { fill: rgba(176,132,0,.78); }
.oblast.is-active-state[data-alert="NUCLEAR"]    { fill: rgba(122,58,0,.78); }
.oblast.is-active-state[data-alert="PERSIST"]    { fill: url(#hatch); stroke: rgba(176,123,0,.55); }
.oblast.is-active-state[data-alert="AIR"] {
  animation: oblast-pulse 2.4s ease-out infinite;
}
@keyframes oblast-pulse {
  0%, 100% { fill: rgba(229,50,42,.55); }
  50%      { fill: rgba(229,50,42,.78); }
}

/* Тонке стилізоване підсвічування при ескалації — є тривога в районах
   області, але не на State-рівні. Жовтий тон. */
.oblast.has-children-active { fill: rgba(244,193,0,.20); }

.oblast.is-selected { stroke: var(--ink); stroke-width: 2.5; }

/* Labels (зверху всього) */
.oblast-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 9px;
  fill: var(--ink-2);
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(255,255,255,.85);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.oblast-label.is-on-alarm {
  fill: #fff;
  stroke: rgba(14,14,15,.45);
  stroke-width: 2;
}

/* Kyiv City overlay (small bullseye on top of Київська обл.) */
.kyiv-marker .ring  { fill: none; stroke: rgba(229,50,42,.65); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.kyiv-marker .ring.is-on { animation: alarm-ring 2.6s ease-out infinite; }
.kyiv-marker .glow { fill: url(#alarmGlow); }
.kyiv-marker .glow.is-on { animation: alarm-glow 3s ease-in-out infinite; }
.kyiv-marker .glow:not(.is-on) { display: none; }
.kyiv-marker .ring:not(.is-on) { display: none; }
.kyiv-marker .body {
  fill: #fff; stroke: var(--ink); stroke-width: 2.2;
  cursor: pointer; transition: fill .2s;
}
.kyiv-marker .body.is-on { fill: var(--sig-air); }
.kyiv-marker .core {
  fill: var(--ink); pointer-events: none;
}
.kyiv-marker .core.is-on { fill: #fff; }
.kyiv-marker .label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  fill: var(--ink);
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(255,255,255,.9);
  stroke-width: 3;
}
.kyiv-marker .connector {
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-dasharray: 2 2;
  opacity: .5;
}

/* ============================ responsive ================================= */

@media (max-width: 1100px) {
  .map-row { grid-template-columns: 1fr; padding: 0; }
  .map-row > .map-card { min-height: 420px; height: 60vh; }
  .map-row > .sidebar { height: auto; overflow: visible; }
  .toolbar { margin: 12px 16px 0; }
  .page { padding: 12px 16px 18px; gap: 18px; }
  .seo-block { padding: 18px 18px; }
  .footer { padding: 18px 16px 22px; }
}

@media (max-width: 720px) {
  .nav-row { padding: 0 14px; gap: 12px; }
  .nav-tabs { display: none; }
  .brand-name { font-size: 18px; }
  .brand-icon { height: 30px; }
  .idx-mono { display: none; }
  .hero-timer { font-size: 44px; }
  .hero .hero-title { font-size: 22px; }
  .neighbors-grid { grid-template-columns: repeat(2, 1fr); }
  .page-head { flex-direction: column; align-items: stretch; gap: 6px; }
  .page-lead { font-size: 13px; max-width: none; }
}

/* ============================ scrollbar (subtle) ========================= */

.list-body::-webkit-scrollbar { width: 8px; }
.list-body::-webkit-scrollbar-thumb { background: rgba(14,14,15,.16); border-radius: 4px; }
.list-body::-webkit-scrollbar-track { background: transparent; }

/* ============================ skeleton (loading) ========================= */

.skeleton {
  position: relative; overflow: hidden;
  background: var(--paper-2);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: skel 1.4s infinite;
}
@keyframes skel { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============================ a11y ====================================== */

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--sig-air); outline-offset: 2px; border-radius: 4px; }

/* HTML5 hidden — гарантовано перебиває компонентні `display: inline-flex` */
[hidden] { display: none !important; }

/* ============================ history page ============================== */

/* Scoped to history-page page-head (contains .page-title), щоб не перекривати
   .page-head на головній /alerts/, що використовує .page-h1. */
.page-head:has(.page-title) {
  max-width: 1700px;
  margin: 0 auto;
  padding: 24px 24px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -.02em;
  line-height: 1.05;
  margin-top: 6px;
}
.page-title .muted { color: var(--muted); font-weight: 500; }
.period-switch { display: flex; gap: 6px; }

.history-wrap {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.stat-cell {
  background: #fff;
  padding: 14px 16px;
}
.stat-cell .kicker { margin-bottom: 6px; }
.stat-cell .value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.02em;
}
.stat-cell .value.is-red { color: var(--red-deep); }
.stat-cell .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

.charts-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}
@media (max-width: 1100px) {
  .charts-row { grid-template-columns: 1fr; }
}

.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--sh-1);
}
.chart-card .kicker { margin-bottom: 4px; }
.chart-card .desc { color: var(--muted); font-size: 12px; margin-bottom: 14px; }

/* heatmap grid 28×24 */
.heatmap {
  display: grid;
  grid-template-columns: 36px repeat(24, 1fr);
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-2);
}
.heat-row-label {
  padding-right: 6px;
  text-align: right;
  align-self: center;
  line-height: 1;
}
.heat-col-label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-2);
  padding-bottom: 4px;
}
.heat-cell {
  height: 14px;
  border-radius: 2px;
  background: rgba(14,14,15,.04);
  cursor: default;
}
.heatmap-legend {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
}
.heatmap-legend .swatch { width: 18px; height: 10px; border-radius: 2px; }

.bar-row { display: flex; align-items: flex-end; gap: 3px; height: 84px; }
.bar-row > div {
  flex: 1; min-height: 3px; border-radius: 3px;
  background: var(--paper-3);
}

/* daily journal table */
.journal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--sh-1);
}
.journal-grid {
  display: grid;
  grid-template-columns: 130px 70px 1fr 100px;
  gap: 0;
  margin-top: 10px;
}
.journal-grid > .h {
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.journal-grid > .c {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.journal-grid > .c:nth-last-child(-n+4) { border-bottom: 0; }
.journal-grid .c.right { text-align: right; }
.journal-grid .c.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.journal-grid .c.bold-red { color: var(--red-deep); font-weight: 600; }
.day-timeline {
  position: relative;
  height: 14px;
  background: var(--paper-2);
  border-radius: 3px;
  overflow: hidden;
}
.day-timeline > .blk {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--sig-air);
  border-radius: 2px;
  opacity: .85;
}
.day-night {
  position: absolute;
  top: -2px; bottom: -2px;
  border-left: 1px dashed var(--line-2);
  border-right: 1px dashed var(--line-2);
  pointer-events: none;
}

/* loading skeleton for history */
.history-loading {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.history-loading::before {
  content: "";
  display: inline-block;
  width: 24px; height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--sig-air);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: -7px;
  margin-right: 10px;
}
.history-error {
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.history-error strong { color: var(--ink); display: block; margin-bottom: 6px; font-family: var(--font-display); }

/* ============================ events page =============================== */

.ticker-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--paper-tint) 0%, var(--paper) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
}
.ticker-pulse {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
}
.ticker-dot {
  width: 12px; height: 12px;
  background: var(--sig-calm);
  border-radius: 50%;
  flex-shrink: 0;
  animation: alarm-glow 1.8s ease-in-out infinite;
}
.ticker-card.is-fresh .ticker-dot {
  background: var(--sig-air);
  animation: alarm-pulse 1.6s ease-out infinite, alarm-glow 1.6s ease-in-out infinite;
}
.ticker-card.is-fresh {
  background: linear-gradient(180deg, #fff5f3 0%, #ffe6e2 100%);
  border-color: rgba(229,50,42,.22);
}
.ticker-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.filter-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-strip .btn {
  padding: 6px 12px;
  font-size: 12px;
}

/* event-row — компактний рядок події */
.event-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  transition: background .2s;
}
.event-row:first-child { border-top: 0; }
.event-row.is-new {
  background: rgba(229,50,42,.06);
  animation: event-flash 1.6s var(--ease-out);
}
@keyframes event-flash {
  from { background: rgba(229,50,42,.18); }
  to   { background: rgba(229,50,42,.06); }
}
.event-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.event-row[data-type="alert_started"] .event-icon {
  background: var(--sig-air-bg);
  color: var(--red-deep);
}
.event-row[data-type="alert_ended"] .event-icon {
  background: var(--sig-calm-bg);
  color: var(--sig-calm);
}

.event-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -.01em;
}
.event-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.event-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.event-time .ago {
  display: block;
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 2px;
}

.event-day-label {
  padding: 14px 18px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  position: sticky;
  top: 64px;
  z-index: 5;
}
.event-day-label:first-child { border-top: 0; }

/* mini live ticker on dashboard */
.mini-ticker {
  flex-shrink: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--sh-1);
  font-size: 12px;
}
.mini-ticker .label {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}
.mini-ticker .text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-ticker .text strong[data-type="alert_started"] { color: var(--red-deep); }
.mini-ticker .text strong[data-type="alert_ended"]   { color: var(--sig-calm); }
.mini-ticker .ago {
  font-family: var(--font-mono);
  color: var(--muted-2);
  flex-shrink: 0;
}
.mini-ticker.is-fresh {
  border-color: rgba(229,50,42,.22);
  animation: event-flash 1.6s var(--ease-out);
}
.mini-ticker a {
  color: var(--ink);
  border-bottom: 1px dotted var(--line-strong);
  flex-shrink: 0;
}

/* ============================ region drawer ============================== */

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(14,14,15,.32);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease-out);
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 64px; right: 0; bottom: 0;
  width: min(460px, 100vw);
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 40px rgba(14,14,15,.10);
  z-index: 100;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .26s var(--ease-out), visibility .26s;
}
.drawer.is-open { transform: translateX(0); visibility: visible; }
.drawer-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-head-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.drawer-head-row .kicker { color: var(--muted); }
.drawer-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
}
.drawer-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.drawer-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.drawer-status-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.drawer-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}
.drawer-back-link {
  color: var(--ink);
  border-bottom: 1px dotted var(--line-strong);
  padding-bottom: 1px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.drawer-back-link:hover { border-bottom-color: var(--ink); }
.drawer-section-head {
  padding: 14px 20px 6px;
  flex-shrink: 0;
}
.drawer-body {
  flex: 1 1 0; min-height: 0; overflow-y: auto;
}
.drawer-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px;
  flex-shrink: 0;
}
.drawer-foot .btn { flex: 1; justify-content: center; }
.drawer-empty {
  padding: 24px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.drawer-empty strong { color: var(--ink); font-family: var(--font-display); display: block; margin-top: 4px; }

/* group label inside drawer body */
.drawer-group-label {
  padding: 12px 20px 6px;
  background: var(--paper-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  position: sticky; top: 0;
  border-top: 1px solid var(--line);
  z-index: 1;
}
.drawer-group-label:first-child { border-top: 0; }

@media (max-width: 720px) {
  .drawer {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100vw;
    max-height: 80vh;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -16px 40px rgba(14,14,15,.18);
  }
  .drawer.is-open { transform: translateY(0); }
}

/* ============================ "Про сервіс" modal ========================= */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(14,14,15,.45);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease-out);
  padding: 20px;
}
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  width: min(560px, 100%);
  max-height: 86vh; overflow-y: auto;
  box-shadow: var(--sh-3);
  transform: translateY(8px);
  transition: transform .22s var(--ease-out);
}
.modal-backdrop.is-open .modal { transform: translateY(0); }
.modal-head {
  padding: 20px 24px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.02em;
}
.modal-body {
  padding: 18px 24px 22px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}
.modal-body p { margin: 0 0 12px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--paper-2);
  padding: 1px 6px;
  border-radius: 4px;
}
.modal-body a { border-bottom: 1px dotted var(--line-strong); color: var(--ink); }
