/* =============================================================================
   Tabanidae v Aktobe — общий стиль сайта.

   1. Шрифты         5. Шапка и подвал        9. Карточки районов
   2. Переменные     6. Хлебные крошки        10. Пустые состояния, скелетоны
   3. Основа         7. Заголовок страницы    11. Появление при прокрутке
   4. Кнопки, чипсы  8. Статистика            12. Утилиты

   Тема: светлая по умолчанию, тёмная — если так настроена система, либо
   выбрана кнопкой (атрибут data-theme="light|dark" на <html>, ставит site.js).
   Анимации — только transform и opacity.
   ========================================================================== */

/* --- 1. Шрифты (локально, с казахскими буквами) ---------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../vendor/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../vendor/fonts/inter-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../vendor/fonts/inter-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../vendor/fonts/noto-serif-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Serif";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("../vendor/fonts/noto-serif-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F;
}
@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../vendor/fonts/noto-serif-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../vendor/fonts/noto-serif-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* --- 2. Переменные ---------------------------------------------------------- */
:root {
  color-scheme: light;
  --font-serif: "Noto Serif", "PT Serif", Georgia, serif;
  --font-sans: "Inter", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Светлая: тёплая бумага, глубокий зелёно-чёрный текст, золото */
  --bg: #f5f1e6;
  --bg-elevated: #fbf8f0;
  --surface: #fffdf8;
  --surface-2: #efe9da;
  --surface-glass: rgba(255, 253, 247, 0.86);
  --fg: #1b2820;
  --fg-soft: #33443a;
  --muted: #5f6c63;
  --border: rgba(27, 40, 32, 0.12);
  --border-strong: rgba(27, 40, 32, 0.22);
  --accent: #946d10;          /* золото (тёмное — для текста на светлом) */
  --accent-bright: #c99a2e;   /* золото для заливок */
  --accent-fg: #ffffff;
  --brand: #2f5d45;           /* степной зелёный */
  --danger: #b3261e;
  --danger-bg: rgba(179, 38, 30, 0.08);
  --focus: #946d10;

  --shadow-sm: 0 1px 2px rgba(27, 40, 32, 0.06), 0 2px 8px rgba(27, 40, 32, 0.05);
  --shadow: 0 2px 6px rgba(27, 40, 32, 0.06), 0 12px 32px rgba(27, 40, 32, 0.09);
  --shadow-lg: 0 6px 16px rgba(27, 40, 32, 0.08), 0 24px 56px rgba(27, 40, 32, 0.14);

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Для карт (pulse-map.css берёт отсюда) */
  --map-bg: #e9e4d6;
  --map-region-stroke: rgba(27, 40, 32, 0.35);
}

/* Тёмная: почти чёрно-зелёный фон, кремовый текст, золотистые акценты */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b120e;
    --bg-elevated: #0f1813;
    --surface: #121c16;
    --surface-2: #19251e;
    --surface-glass: rgba(14, 22, 17, 0.84);
    --fg: #efe8d6;
    --fg-soft: #d8d1bf;
    --muted: #a3a796;
    --border: rgba(239, 232, 214, 0.1);
    --border-strong: rgba(239, 232, 214, 0.2);
    --accent: #dcb65e;
    --accent-bright: #dcb65e;
    --accent-fg: #17140a;
    --brand: #86bf9b;
    --danger: #ff8a7a;
    --danger-bg: rgba(255, 138, 122, 0.1);
    --focus: #dcb65e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.4), 0 24px 56px rgba(0, 0, 0, 0.5);
    --map-bg: #0e1712;
    --map-region-stroke: rgba(239, 232, 214, 0.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b120e;
  --bg-elevated: #0f1813;
  --surface: #121c16;
  --surface-2: #19251e;
  --surface-glass: rgba(14, 22, 17, 0.84);
  --fg: #efe8d6;
  --fg-soft: #d8d1bf;
  --muted: #a3a796;
  --border: rgba(239, 232, 214, 0.1);
  --border-strong: rgba(239, 232, 214, 0.2);
  --accent: #dcb65e;
  --accent-bright: #dcb65e;
  --accent-fg: #17140a;
  --brand: #86bf9b;
  --danger: #ff8a7a;
  --danger-bg: rgba(255, 138, 122, 0.1);
  --focus: #dcb65e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.4), 0 24px 56px rgba(0, 0, 0, 0.5);
  --map-bg: #0e1712;
  --map-region-stroke: rgba(239, 232, 214, 0.35);
}

/* --- 3. Основа -------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main {
  flex: 1;
}
h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--fg); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection { background: color-mix(in srgb, var(--accent-bright) 35%, transparent); }
.latin, i.latin { font-family: var(--font-serif); font-style: italic; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 1000;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-fg);
}
.skip-link:focus { top: 8px; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- 4. Кнопки, чипсы ---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em 1.2em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font: 600 0.95rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s;
}
.btn:hover {
  color: var(--accent-fg);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--fg);
}
.btn--ghost:hover { color: var(--fg); background: var(--surface); }
.btn svg { width: 1.1em; height: 1.1em; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.7em;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg-soft);
  font: 500 0.8rem/1.4 var(--font-sans);
  white-space: nowrap;
}
.dot {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--c, var(--accent));
  flex: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn svg { width: 20px; height: 20px; }

/* --- 5. Шапка и подвал --------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1100; /* выше элементов Leaflet (до 1000) */
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--fg); }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name {
  font: 600 1.15rem/1 var(--font-serif);
  letter-spacing: -0.01em;
}
.brand__name em { font-style: italic; color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.site-nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--fg-soft);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.site-nav a:hover { color: var(--fg); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--fg); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-bright);
}
.site-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Язык: «RU | ҚАЗ» */
.lang-switch {
  display: inline-flex;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang-switch button {
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 0.78rem/1 var(--font-sans);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--fg); }
.lang-switch button[aria-current="true"] {
  background: var(--fg);
  color: var(--bg);
  cursor: default;
}

/* Тема: показываем луну в светлой и солнце в тёмной */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .site-header__inner { gap: 12px; }
  .nav-toggle { display: inline-grid; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 12px var(--gutter) 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s 0.2s;
  }
  .site-nav.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .site-nav a { padding: 12px 14px; font-size: 1.05rem; }
  .site-nav a[aria-current="page"] { background: var(--surface-2); }
  .site-nav a[aria-current="page"]::after { display: none; }
  .site-tools { margin-left: auto; }
}
@media (max-width: 480px) {
  .site-header__inner { gap: 8px; }
  .site-tools { gap: 6px; }
  .brand { gap: 8px; min-width: 0; }
  .brand__mark { width: 28px; height: 28px; }
  .brand__name {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
  }
  .icon-btn { width: 36px; height: 36px; }
  /* Узкий экран: в переключателе языка только кнопка «на другой язык» */
  .lang-switch button[aria-current="true"] { display: none; }
  .lang-switch button { padding: 6px 9px; }
}

.site-footer {
  margin-top: 72px;
  padding: 40px 0 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
}
.site-footer__title {
  margin: 0 0 4px;
  font: 600 1.05rem/1.3 var(--font-serif);
  color: var(--fg);
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--fg-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* --- 6. Хлебные крошки ---------------------------------------------------- */
.breadcrumbs {
  padding-top: 20px;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumbs li + li::before {
  content: "/";
  margin-right: 4px;
  color: var(--border-strong);
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] { color: var(--fg-soft); }

/* --- 7. Заголовок страницы ------------------------------------------------ */
.page-head {
  padding: 28px 0 32px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--accent);
  font: 600 0.78rem/1 var(--font-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}
.page-head h1 { max-width: 20ch; margin-bottom: 0.35em; }
.lead {
  max-width: 62ch;
  color: var(--fg-soft);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.15rem);
}

/* --- 8. Статистика ---------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--border);
}
.stats > div {
  padding: 18px 20px;
  background: var(--surface);
}
.stats dt {
  color: var(--muted);
  font-size: 0.82rem;
}
.stats dd {
  margin: 2px 0 0;
  font: 600 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1.1 var(--font-serif);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--fg);
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div { padding: 14px 16px; }
}

/* --- 9. Карточки районов --------------------------------------------------- */
.districts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: 32px;
  align-items: start;
  margin-top: 32px;
}
.districts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.districts-aside {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}
@media (max-width: 960px) {
  .districts-layout { grid-template-columns: 1fr; gap: 20px; }
  .districts-aside { position: static; order: -1; }
}
@media (max-width: 560px) {
  .districts-grid { grid-template-columns: 1fr; }
}

.district-card {
  --c: var(--accent-bright);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
/* цветная полоса сверху */
.district-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  height: 5px;
  background: var(--c);
}
.district-card:hover,
.district-card.is-highlighted {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--c) 45%, var(--border));
  color: inherit;
}
.district-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: color-mix(in srgb, var(--c) 22%, var(--surface-2));
}
.district-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.district-card:hover .district-card__media img { transform: scale(1.06); }
/* Заглушка без фото: «топографические» линии в цвет района */
.district-card__placeholder {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--c) 55%, transparent), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, var(--surface-2)), color-mix(in srgb, var(--c) 8%, var(--surface)));
  transition: transform 0.6s var(--ease);
}
.district-card__placeholder svg {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  color: color-mix(in srgb, var(--c) 70%, var(--fg));
  opacity: 0.22;
}
.district-card:hover .district-card__placeholder { transform: scale(1.06); }
.district-card__badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--fg);
  font: 600 0.75rem/1.3 var(--font-sans);
}
.district-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}
.district-card__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.district-card__arrow {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--c);
  transition: transform 0.3s var(--ease);
}
.district-card:hover .district-card__arrow { transform: translateX(4px); }
.district-card__desc {
  display: -webkit-box;
  margin: 0 0 16px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.92rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.district-card__stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: 8px;
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
}
.district-card__stats dt {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}
.district-card__stats dd {
  margin: 0;
  font: 600 1.05rem/1.3 var(--font-sans);
  font-variant-numeric: tabular-nums;
}

/* Мини-карта области */
.minimap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.minimap__map {
  height: 420px;
  background: var(--map-bg);
}
.minimap__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.minimap__caption strong { color: var(--fg); font-weight: 600; }
@media (max-width: 960px) {
  .minimap__map { height: 300px; }
}
@media (max-width: 560px) {
  .minimap__map { height: 240px; }
}
.leaflet-tooltip.minimap-label {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--fg);
  font: 600 12px/1.2 var(--font-sans);
  text-shadow: 0 0 3px var(--bg), 0 0 6px var(--bg);
  white-space: nowrap;
}
.leaflet-tooltip.minimap-label::before { display: none; }

.minimap { margin: 0; }
.district-card__empty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Элементы Leaflet в цветах темы (кнопки масштаба, подсказки, подписи) */
.leaflet-container {
  background: var(--map-bg);
  font-family: var(--font-sans);
}
.leaflet-bar {
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: var(--shadow-sm) !important;
}
.leaflet-bar a,
.leaflet-bar a:hover {
  background: var(--surface);
  color: var(--fg);
  border-bottom-color: var(--border);
}
.leaflet-bar a:hover { background: var(--surface-2); }
.leaflet-control-attribution {
  background: var(--surface-glass) !important;
  color: var(--muted);
}
.leaflet-control-attribution a { color: var(--fg-soft); }

/* --- 10. Пустые состояния, скелетоны, загрузка --------------------------------- */
.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}
.empty-state__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
}
.empty-state__icon svg { width: 30px; height: 30px; }
.empty-state h2,
.empty-state h3 { margin: 0; font-size: 1.2rem; }
.empty-state p { max-width: 42ch; margin: 0; }
.empty-state--compact { padding: 24px 16px; }

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  to { transform: translateX(100%); }
}
/* Слой-заглушка поверх карты/диаграммы, пока она грузится (убирает JS: .is-loaded) */
.loading-cover {
  position: absolute;
  inset: 0;
  z-index: 900; /* выше слоёв Leaflet, пока карта грузится */
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  transition: opacity 0.4s var(--ease), visibility 0s 0.4s;
}
.is-loaded > .loading-cover {
  opacity: 0;
  visibility: hidden;
}
.loading-cover span {
  position: relative;
  z-index: 1;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-glass);
}

/* --- 11. Появление при прокрутке ------------------------------------------------ */
/* Только если JS работает (класс js на <html>) — иначе блоки просто видны */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { transform: none; }
}

/* --- 12. Утилиты ------------------------------------------------------------ */
.section { margin-top: 56px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Контакты в подвале (заполняются в админке: «Настройки сайта») */
.site-footer__contacts { font-style: normal; display: grid; gap: 2px; }
