/* ═══════════════════════════════════════════════════════════════════════════
 *  mgorka-timber — CSS architecture (рефакторинг v2.0)
 *
 *  ## Подход
 *  Mobile-first: базовые правила = безопасный мобильный, апгрейд через
 *  @media (min-width: X) или @container (min-width: X).
 *
 *  ## Структурные брейкпойнты (используем редко)
 *  - 680px — appeals-sec в строку
 *  - 880px — page-body sidebar появляется (1fr → 1fr 300px)
 *  - 980px — full navigation (CTA, поиск) через @container header
 *
 *  ## Container query roots
 *  - .site-header (header) — управляет .h-nav, .nav-cta-wrap, .nav-search
 *  - .news-grid / .services-grid (inline-size)
 *  - .leader-grid / .about-tiles / .department-single__internal-list
 *  - .responsive-table-wrap (через .prices-section)
 *
 *  ## Дизайн-токены (см. :root ниже)
 *  - Spacing: --space-3xs..2xl, --wrap-gutter (fluid через clamp)
 *  - Typography: --fs-xs..hero (fluid через clamp)
 *  - Colors: --gov-dark, --primary, --accent, --gold, etc.
 *  - Radius/shadows: --r, --r-sm, --shadow-xs/sm/md
 *
 *  ## Использовать ТОКЕНЫ вместо px:
 *    ❌ padding: 16px        ✅ padding: var(--space-sm)
 *    ❌ font-size: 22px     ✅ font-size: var(--fs-xl)
 *    ❌ padding: 0 32px     ✅ padding: 0 var(--wrap-gutter)
 *
 *  ## Уроки (см. memory)
 *  - feedback-grid-auto-fit-mobile: minmax(Xpx, 1fr) распирает контейнер на mobile
 *  - feedback-hyphenopoly-v6: правильная конфигурация для русского переноса
 * ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* === Синтез gov.by (#063462) + медицинский (#1a5276) === */
  --gov-dark:      #063462;   /* pukhovichi.gov.by основной */
  --gov-mid:       #0e3a56;   /* переходный */
  --gov-deep:      #041e3a;   /* нижний край градиента футера */
  --primary:       #1a5276;   /* медицинский синий */
  --primary-light: #1f6391;   /* затемнён до AA: 6.46:1 на белом (текст ссылок) */
  --primary-dark:  #0a2d46;   /* фон dropdown-подменю */
  --accent:        #d4e8f5;
  --accent-soft:   #eaf4fb;
  --gold:          #c9980a;
  --gold-light:    #fef8e7;
  --gold-text:     #8a6700;   /* тёмное золото для текста/кнопок на светлом (AA) */
  --green:         #1e8449;
  --green-light:   #eafaf1;
  --green-text:    #1b6e3c;   /* тёмно-зелёный для текста на светлом (AA) */
  --red:           #c0392b;
  --white:         #ffffff;
  --bg:            #f2f6fa;
  --bg-alt:        #f0f4f8;
  --text:          #1c2e3e;
  --text-mid:      #3d5166;
  --text-muted:    #50637a;   /* затемнён до AA ≥4.5:1 на белом и на --bg */
  --border:        #cad5e0;
  --border-light:  #e4ecf3;
  --shadow-xs:     0 1px 2px rgba(6,52,98,.06);
  --shadow-sm:     0 2px 8px rgba(6,52,98,.09);
  --shadow-md:     0 4px 16px rgba(6,52,98,.13);
  --r:             8px;
  --r-sm:          5px;

  /* Отступ для sticky thead таблиц-прейскурантов: высота compact-header (~67px
   * на десктопе) + запас, чтобы шапка таблицы парковалась ПОД липким меню, а не
   * за ним. На ≤820px thead .prc прячется (карточный режим) — оффсет не мешает. */
  --thead-sticky-top: 72px;

  /* z-index — единая лестница вместо ad-hoc значений (было 999 рядом с 1000).
   * Локальные стэки внутри компонентов (карта z:5/10, шапка дровера z:1) — сырыми. */
  --z-header:      200;   /* липкая шапка, её дропдауны, результаты поиска */
  --z-sticky:      500;   /* compact-header при скролле */
  --z-dropdown:    600;   /* плавающее: дропдаун поиска, scroll-top */
  --z-backdrop:    999;   /* затемнение под дровером */
  --z-drawer:      1000;  /* off-canvas дровер + skip-link поверх всего */

  /* Длительности transition: единый набор вместо разнобоя .15/.18/.2/.25/.3s
   * (.18s и .2s были почти-дубли). Бесшовные анимации/слайды (spinner .7s,
   * fade-in .45s, слайд хедера .32s, scroll-top .28s, cardFadeIn .22s) — НЕ
   * токенизированы: это намеренно подобранный тайминг под конкретный эффект. */
  --dur-fast:      .15s;  /* микровзаимодействия (иконки, мелкие hover) */
  --dur:           .2s;   /* стандартный hover/состояние (цвет/фон/бордер/тень) */
  --dur-slow:      .3s;   /* заметные переходы (раскрытия, opacity) */

  /* === Design system (фаза 0 рефакторинга) ===
   * Spacing scale — fluid через clamp(MIN, BASE + Xvw, MAX).
   * Имена: 3xs..2xl, от ~4px до ~40px на mobile, расширяются на desktop.
   * Использовать вместо hardcoded px значений во всех новых правилах. */
  --space-3xs: clamp(0.25rem,  0.20rem + 0.25vw, 0.375rem);   /*  4 -  6 */
  --space-2xs: clamp(0.5rem,   0.40rem + 0.50vw, 0.75rem);    /*  8 - 12 */
  --space-xs:  clamp(0.625rem, 0.50rem + 0.625vw, 0.875rem);  /* 10 - 14 */
  --space-sm:  clamp(0.75rem,  0.60rem + 0.75vw, 1rem);       /* 12 - 16 */
  --space-md:  clamp(1rem,     0.80rem + 1vw,    1.5rem);     /* 16 - 24 */
  --space-lg:  clamp(1.25rem,  1.00rem + 1.25vw, 2rem);       /* 20 - 32 */
  --space-xl:  clamp(1.5rem,   1.20rem + 1.5vw,  2.5rem);     /* 24 - 40 */
  --space-2xl: clamp(2rem,     1.50rem + 2.5vw,  3.5rem);     /* 32 - 56 */

  /* Container gutter — основной горизонтальный padding для .wrap.
   * Плавно от 10px (mobile) до 32px (desktop). Снимает «прыжки» padding на breakpoint'ах. */
  --wrap-gutter: clamp(0.625rem, 1.5vw + 0.25rem, 2rem);     /* 10 - 32 */

  /* Fluid typography — clamp(MIN, PREFERRED, MAX).
   * AA-доступно: MAX >= 2*MIN для зум-устойчивости. */
  --fs-xs:   clamp(0.6875rem, 0.65rem + 0.15vw, 0.75rem);    /* 11 - 12 */
  --fs-sm:   clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);   /* 13 - 14 */
  --fs-base: clamp(0.9375rem, 0.90rem + 0.15vw, 1rem);       /* 15 - 16 */
  --fs-md:   clamp(1rem,      0.95rem + 0.25vw, 1.125rem);   /* 16 - 18 */
  --fs-lg:   clamp(1.125rem,  1.05rem + 0.35vw, 1.375rem);   /* 18 - 22 */
  --fs-xl:   clamp(1.375rem,  1.20rem + 0.80vw, 1.75rem);    /* 22 - 28 */
  --fs-2xl:  clamp(1.5rem,    1.30rem + 1.00vw, 2rem);       /* 24 - 32 */
  --fs-hero: clamp(1.5rem,    1.10rem + 2.00vw, 2.5rem);     /* 24 - 40 */
  /* Бренд-заголовок шапки: одна строка слева от эмблемы. Потолок 28px — органично
   * крупнее прежних ~21px, но < h1 страницы (32px). Замер (chrome-devtools): текст
   * «Марьиногорская центральная районная больница» влезает в строку до ~960px вьюпорта. */
  --fs-brand: clamp(1.125rem, 0.5rem + 2vw, 1.75rem);        /* 18 - 28 */

  /* Line-height scale — единый набор вместо разнобоя 1.2..1.75 вручную.
   * tight: заголовки/цифры · snug: подзаголовки/карточки · base: body (глобально)
   * · loose: длинный читаемый текст (статьи, текстовые блоки). */
  --lh-tight: 1.2;
  --lh-snug:  1.35;
  --lh-base:  1.6;
  --lh-loose: 1.75;
}

/* Системный шрифтовой стек (без веб-шрифта/Node-сборки): нативный вид ОС,
 * 0 доп. запросов. Раньше тут стоял 'Inter', который нигде не подгружался —
 * все видели системный фолбэк, а подобранная шкала --fs-* рендерилась наугад. */
body { font-family:'Golos Text','Golos Text Fallback',system-ui,-apple-system,'Segoe UI',Roboto,'Liberation Sans','Noto Sans',Arial,sans-serif; color:var(--text); background:var(--bg); font-size:var(--fs-base); line-height:1.6; }
a { color:inherit; text-decoration:none; }

/* Пресеты размера шрифта блок-редактора (slug'и WP → токены темы).
 * global-styles на фронте срезаны (functions.php, perf), поэтому правила
 * .has-*-font-size, которые WP обычно печатает в global-styles, дублируем тут —
 * иначе выбранный в редакторе размер на фронт не доезжает (класс есть, правила нет).
 * Значения держать синхронно с settings.typography.fontSizes (functions.php). */
.has-small-font-size    { font-size: var(--fs-sm); }
.has-medium-font-size   { font-size: var(--fs-base); }
.has-large-font-size    { font-size: var(--fs-lg); }
.has-x-large-font-size  { font-size: var(--fs-xl); }
.has-xx-large-font-size { font-size: var(--fs-2xl); }

/* Перенос строк: заголовки балансируем (ровные строки), абзацы — pretty
   (без висячих слов в конце). Progressive enhancement — старые браузеры игнорируют. */
:is(h1, h2, h3, h4) { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* Inline SVG-иконки (набор Lucide ISC, src/icons.php) — заменяют декоративные эмодзи.
   Размер = 1em → наследует font-size контейнера (как раньше эмодзи-глиф).
   Цвет = currentColor → монохром по цвету текста. */
.mg-icon { width:1em; height:1em; display:inline-block; vertical-align:-0.125em; flex:0 0 auto; }
ul { list-style:none; }

.wrap { max-width:1280px; margin:0 auto; padding:0 var(--wrap-gutter); }

/* ── Query-container roots для контентных гридов ──────────────────────
 * ВАЖНО: грид НЕ может реагировать на @container-запрос относительно самого
 * себя. `container-type` делает элемент контейнером для ПОТОМКОВ, а запрос
 * ищет ближайшего ПРЕДКА-контейнер. Поэтому container-type объявляем на
 * родителе, а грид (.news-grid, .services-grid, …) уже на него реагирует.
 * Без этого все гриды залипали на 1-колоночной mobile-базе на всех ширинах. */
#news-section,
.services-sec .wrap,
.page-body--archive .content,
.single-post__content,
.department-single__internal { container-type: inline-size; }

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.site-header { position:relative; z-index:var(--z-header); box-shadow:0 2px 12px rgba(6,52,98,.18); }

/* ── Верхняя полоса: язык + доступность ── */
.h-top {
  background: var(--gov-dark);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.h-top .wrap { display:flex; justify-content:space-between; align-items:center; padding-top:5px; padding-bottom:5px; }
.h-top__address { font-size: var(--fs-xs); color:rgba(255,255,255,.65); display:flex; gap:20px; }
.h-top__address span { display:flex; align-items:center; gap:5px; }
.h-top__right { display:flex; align-items:center; gap:12px; }
.lang-group { display:flex; gap:2px; }
.lang-btn {
  padding:3px 9px; border-radius:3px; font-size: var(--fs-xs); font-weight:600;
  color:rgba(255,255,255,.65); cursor:pointer; transition:color var(--dur), background-color var(--dur), border-color var(--dur);
  border:1px solid transparent;
  background:none; font-family:inherit; line-height:1.4; -webkit-appearance:none; appearance:none;
}
.lang-btn { text-decoration:none; display:inline-block; }
.lang-btn.active,
.lang-btn.gt-current-lang { background:rgba(255,255,255,.18); color:#fff; border-color:rgba(255,255,255,.25); }
.lang-btn:hover { color:#fff; }
.lang-btn:disabled { opacity:.4; cursor:not-allowed; }
.lang-btn:disabled:hover { color:rgba(255,255,255,.65); }
.gt-bootstrap { display:none !important; }
.a11y-btn {
  font-size: var(--fs-xs); color:rgba(255,255,255,.72); cursor:pointer;
  display:flex; align-items:center; gap:4px; transition:color var(--dur);
  background:none; border:none; font-family:inherit; line-height:1.4;
  -webkit-appearance:none; appearance:none;
}
.a11y-btn:hover { color:#fff; }

/* Топбар на планшете (600–880): почтовый адрес скрываем, email и кнопку версии
   не даём переносить посреди слова (≤680 весь .h-top__address скрыт ниже). */
@media (max-width: 880px) {
  .h-top__address span:first-child { display: none; }
  .h-top__address span { white-space: nowrap; }
  .a11y-btn { white-space: nowrap; }
}

/* Скрыто визуально, доступно скринридерам/поисковику (для H1 главной). */
.visually-hidden {
  position:absolute !important;
  width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%);
  white-space:nowrap; border:0;
}

/* ── Доступность: видимый фокус с клавиатуры (WCAG 2.4.7) ── */
:where(a, button, input, select, textarea, summary, [tabindex], [role="button"]):focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: 2px;
}
/* На тёмных поверхностях синий outline неразличим (axe S1) — белая обводка.
   Идёт ДО правила про поля поиска: их белый фон на фокусе требует тёмной рамки. */
.site-header :focus-visible,
.site-footer :focus-visible,
.compact-header :focus-visible {
  outline-color: #fff;
}
/* поля поиска в тёмной шапке снимают свой outline:none — возвращаем рамку на фокус с клавиатуры */
.nav-search__input:focus-visible,
.ch-search__input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
main:focus { outline: none; } /* цель skip-link (tabindex=-1) без рамки */

/* ── Skip-link «Перейти к содержимому» (WCAG 2.4.1) ── */
.skip-link {
  position: absolute; left: 8px; top: -120px; z-index: var(--z-drawer);
  padding: 10px 16px; background: var(--primary); color: #fff;
  font-weight: 600; border-radius: 0 0 6px 6px; text-decoration: none;
  transition: top var(--dur-fast) ease;
}
.skip-link:focus { top: 0; }

/* ── Гербы + название ── */
.h-brand {
  background: var(--gov-dark);
  padding: 12px 0;
}
/* Раскладка: [эмблема][название] слева. Бургер (≤980px) уезжает вправо. */
.h-brand .wrap { display:flex; align-items:center; justify-content:flex-start; gap:20px; }
.h-brand__emblem { display:flex; align-items:center; flex:0 0 auto; }
.h-brand__emblem-img { height:64px; width:64px; filter:drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.h-brand__title {
  text-align:left; min-width:0;
  display:flex; flex-direction:column; align-items:flex-start; gap:2px;
}
.h-brand__title .h-brand__name {
  font-size:var(--fs-brand); font-weight:700; color:#fff;
  line-height:1.2; letter-spacing:.005em; text-wrap:balance;
}
.h-brand__title .h-brand__name a { color:#fff; text-decoration:none; }
.h-brand__title .h-brand__name a:hover { text-decoration:none; opacity:.9; }
.h-brand__sub { font-size:var(--fs-sm); color:rgba(255,255,255,.78); line-height:1.25; }

/* ── Навигация (mobile-first + container queries) ──
 * .site-header — контейнер. .h-nav реагирует на ширину контейнера,
 * не на viewport. Это значит nav ведёт себя одинаково в обычной шапке
 * и в sticky .compact-header — без двойных правил. */
.site-header { container: header / inline-size; }

.h-nav {
  background: linear-gradient(180deg, var(--gov-mid) 0%, var(--primary-dark) 100%);
  border-top: 1px solid rgba(255,255,255,.1);
  /* База — мобильное поведение: горизонтальный скролл, скрываем CTA/поиск */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Visual hint: тонкий видимый scrollbar на тач-устройствах */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.h-nav::-webkit-scrollbar { height: 3px; background: transparent; }
.h-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); border-radius: 2px; }
.h-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }
.h-nav .wrap {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  min-width: max-content;
}

/* Visual hint: статичная fade-out маска у правого края намекает, что меню
 * прокручивается дальше. Активна только когда container < 980px (меню не
 * влезает в строку). Маска постоянна — это НЕ scroll-driven; правый край
 * всегда смягчён, пока полоса прокручивается. */
@container header (max-width: 979.9px) {
  .h-nav {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, black calc(100% - 40px), transparent);
  }
}

/* Desktop-поведение: когда контейнер шапки достаточно широкий.
 * overflow-x НЕ переключаем в visible — оставляем базовый auto. Если меню+поиск+CTA
 * не влезают в строку (~980–1365px), строка горизонтально прокручивается, а не
 * обрезается глобальным html{overflow-x:clip} (раньше так пряталась кнопка
 * «Записаться на приём» на типовых ноутбучных ширинах). Когда всё влезает
 * (≥~1366px) — space-between, скролла нет. */
@container header (min-width: 980px) {
  /* На desktop поиск/CTA уже в строке — горизонтальный скролл не нужен. Снимаем
     overflow: иначе .h-nav остаётся скролл-контейнером (overflow-x:auto делает
     overflow-y тоже auto) и обрезает выпадающие подменю .nav-sub вертикальным
     скроллом. */
  .h-nav { overflow: visible; }
  .h-nav .wrap { min-width: 0; justify-content: space-between; }
}
/* Тесная полоса (laptop ~980–1320px): меню+поиск+CTA не влезают в строку. Раньше
   их прятал горизонтальный скролл .h-nav, но он же обрезал подменю. Теперь скролла
   нет, поэтому здесь переносим строку (flex-wrap), а не даём CTA уйти под обрез
   глобального html{overflow-x:clip}. На широком desktop (≥~1320px) всё в одну строку.
   margin-left:auto прижимает перенесённую CTA вправо — встаёт под поиском, а не слева. */
@container header (min-width: 980px) and (max-width: 1320px) {
  .h-nav .wrap { flex-wrap: wrap; row-gap: 4px; }
  .h-nav .nav-cta-wrap { margin-left: auto; }
}
.nav-list { display:flex; }
.nav-list a {
  display:flex; align-items:center;
  /* Горизонтальный паддинг сжимается на «тесных» desktop-ширинах (980–1400),
     чтобы меню + поиск + CTA влезали в строку без обрезки кнопки. */
  padding:13px clamp(8px, 1vw, 15px);
  font-size: var(--fs-sm); font-weight:500;
  color:rgba(255,255,255,.82);
  white-space:nowrap;
  border-bottom:3px solid transparent;
  transition:color var(--dur), border-color var(--dur);
}
.nav-list a:hover, .nav-list a.active,
.nav-list li.current-menu-item > a,
.nav-list li.current_page_item > a {
  color:#fff;
  background:rgba(255,255,255,.08);
  border-bottom-color:var(--accent);
}
.nav-list a.active,
.nav-list li.current-menu-item > a,
.nav-list li.current_page_item > a { font-weight:600; }
/* ── Dropdown submenu ── */
.nav-list li { position:relative; list-style:none; }
.nav-list .has-sub > a::after { content:'▾'; margin-left:4px; font-size: var(--fs-xs); opacity:.7; }
.nav-sub {
  display:none; position:absolute; top:100%; left:0;
  min-width:180px; background:var(--primary-dark);
  border-top:2px solid var(--accent);
  border-radius:0 0 var(--r-sm) var(--r-sm);
  box-shadow:0 6px 18px rgba(0,0,0,.3);
  z-index:var(--z-header);
  /* «Пациентам» даёт 14 подпунктов — на низких экранах дропдаун скроллится,
     а не уезжает за вьюпорт (overflow тут на самом дропдауне, absolute-детей внутри нет) */
  max-height:calc(100vh - 220px); overflow-y:auto;
}
.nav-sub a {
  display:block; padding:10px 16px;
  font-size: var(--fs-sm); font-weight:500; color:rgba(255,255,255,.82);
  border-bottom:none; white-space:nowrap;
}
.nav-sub a:hover { background:rgba(255,255,255,.1); color:#fff; border-bottom:none; }
.has-sub:hover .nav-sub,
.has-sub:focus-within .nav-sub { display:block; }
/* ── Поиск в основной навигации (скрыт на узких контейнерах) ── */
.nav-search {
  display: none;
  position: relative;
  align-items: center;
  margin-left: auto;
  margin-right: 10px;
}
@container header (min-width: 980px) {
  /* Поиск может ужиматься (до 150px), уступая место CTA «Записаться» */
  .nav-search { display: flex; flex: 0 1 200px; min-width: 150px; }
}
.nav-search__input {
  width: 100%;
  height: 34px;
  padding: 0 32px 0 12px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 17px;
  color: #fff;
  font-size: var(--fs-sm);
  outline: none;
  transition: background var(--dur), border-color var(--dur), box-shadow var(--dur);
}
.nav-search__input::placeholder { color: rgba(255,255,255,.62); }
/* Фокус — подсветка box-shadow БЕЗ расширения поля (расширение двигало макет) */
.nav-search__input:focus {
  background: rgba(255,255,255,.96);
  border-color: transparent;
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(212,232,245,.4);
}
.nav-search__input:focus::placeholder { color: var(--text-muted); }
.nav-search__icon {
  position: absolute;
  right: 10px;
  font-size: var(--fs-sm);
  pointer-events: none;
  opacity: .65;
}
/* Скрыть нативный крестик в поле search */
.nav-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* CTA «Записаться на приём» — скрыт на узких контейнерах (на mobile его дублирует полоса .h-mobile-bar) */
.nav-cta-wrap { display: none; align-items: center; padding: 6px 0; }
@container header (min-width: 980px) {
  .nav-cta-wrap { display: flex; }
}
.nav-cta {
  display:inline-flex; align-items:center; gap:6px;
  padding:9px 18px; border-radius:var(--r-sm);
  background:var(--accent); color:var(--primary);
  font-size: var(--fs-sm); font-weight:700;
  transition:background var(--dur), transform var(--dur-fast);
  white-space:nowrap;
}
.nav-cta:hover { background:#fff; transform:translateY(-1px); }

/* ── Полоса под меню (mobile/tablet): живой поиск + CTA «Записаться» ──
 * Пока контейнер шапки < 980px поиск и CTA из .h-nav скрыты — эта полоса
 * делает их доступными без скролла. На desktop полностью прячется. */
.h-mobile-bar {
  background: var(--primary-dark);
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 8px 0;
}
.h-mobile-bar .wrap { display: flex; flex-wrap: wrap; gap: 8px; }
/* Перебиваем базовый display:none и margin-left:auto обычного .nav-search */
.h-mobile-bar .nav-search { display: flex; flex: 1 1 220px; min-width: 0; margin: 0; }
.h-mobile-bar .nav-cta { flex: 1 1 auto; justify-content: center; }
@container header (min-width: 980px) {
  .h-mobile-bar { display: none; }
}

/* ── Быстрые действия ── */
.h-quick {
  background: var(--primary-dark);
  border-top:1px solid rgba(255,255,255,.07);
}
.h-quick .wrap { display:grid; grid-template-columns:repeat(5,1fr); }
.qa {
  display:flex; flex-direction:column; align-items:center; gap:7px;
  padding:12px 8px;
  border-right:1px solid rgba(255,255,255,.07);
  cursor:pointer; transition:background var(--dur); text-align:center;
  color:rgba(255,255,255,.88);
}
.qa:last-child { border-right:none; }
.qa:hover { background:rgba(255,255,255,.08); color:#fff; }
.qa__icon {
  width:34px; height:34px; border-radius:50%;
  background:rgba(255,255,255,.12);
  display:flex; align-items:center; justify-content:center;
  font-size: var(--fs-base); flex-shrink:0;
  transition:background var(--dur);
}
.qa:hover .qa__icon { background:rgba(255,255,255,.2); }
.qa span { font-size: var(--fs-xs); font-weight:500; line-height:1.3; }

/* ═══════════════════════════════════════════
   ОСНОВНОЙ LAYOUT (2 колонки)
═══════════════════════════════════════════ */
.page-body { padding:24px 0 0; }
/* Mobile-first: 1 колонка по умолчанию, sidebar появляется на >=880px */
.page-body .wrap { display:grid; grid-template-columns:1fr; gap:var(--space-md); align-items:start; }
@media (min-width: 880px) {
  .page-body .wrap { grid-template-columns: 1fr 300px; }
}

/* ═══════════════════════════════════════════
   САЙДБАР
═══════════════════════════════════════════ */
.sidebar { display:flex; flex-direction:column; gap:var(--space-sm); }

.sb-card { background:var(--white); border-radius:var(--r); box-shadow:var(--shadow-sm); overflow:hidden; }
.sb-card__hd {
  background: linear-gradient(135deg, var(--gov-dark) 0%, var(--primary) 100%);
  padding:10px 14px; font-size: var(--fs-xs); font-weight:700;
  color:#fff; display:flex; align-items:center; gap:8px;
  letter-spacing:.02em; text-transform:uppercase;
}
.sb-card__body { padding:14px; }

/* Телефоны */
.phone-list { display:flex; flex-direction:column; gap:0; }
.phone-item {
  padding:9px 0;
  border-bottom:1px solid var(--border-light);
  display:flex; flex-direction:column; gap:1px;
}
.phone-item:last-child { border-bottom:none; padding-bottom:0; }
.ph-lbl { font-size: var(--fs-xs); color:var(--text-muted); }
.ph-num { font-size: var(--fs-base); font-weight:700; color:var(--primary); }
.ph-num a { color:inherit; }
.ph-hrs { font-size: var(--fs-xs); color:var(--text-muted); }

/* Адрес */
.addr-list { display:flex; flex-direction:column; gap:11px; }
.addr-item { display:flex; gap:10px; align-items:flex-start; }
.addr-item__ico { font-size: var(--fs-base); flex-shrink:0; margin-top:2px; }
.addr-item__txt { font-size: var(--fs-sm); color:var(--text-mid); line-height:1.45; }
.addr-item__txt strong,
.contacts-info__row strong { font-size: var(--fs-sm); color:var(--text); display:block; margin-bottom:2px; }

/* Schedule */
.sched-tbl { width:100%; border-collapse:collapse; font-size: var(--fs-xs); }
.sched-tbl tr:not(:last-child) td,
.sched-tbl tr:not(:last-child) th { border-bottom:1px solid var(--border-light); }
.sched-tbl td, .sched-tbl th { padding:5px 0; color:var(--text-mid); font-weight:400; text-align:left; }
.sched-tbl td:last-child { text-align:right; font-weight:600; color:var(--text); }

/* Quick links */
.qlink-list { display:flex; flex-direction:column; }
.qlink-list a {
  display:flex; align-items:center; gap:9px;
  padding:8px 0; border-bottom:1px solid var(--border-light);
  font-size: var(--fs-sm); color:var(--text-mid);
  transition:color var(--dur);
}
.qlink-list a:last-child { border-bottom:none; }
.qlink-list a:hover { color:var(--primary); }
.qlink-list a span:first-child { font-size: var(--fs-base); }

/* ═══════════════════════════════════════════
   КОНТЕНТ
═══════════════════════════════════════════ */
.content { display:flex; flex-direction:column; gap:var(--space-lg); }

/* Section heading */
.sec-title {
  display:flex; align-items:center; gap:12px;
  font-size:var(--fs-lg); font-weight:700; color:var(--primary);
  margin-bottom:14px;
  position:relative; padding-bottom:10px;
}
.sec-title::after {
  content:''; position:absolute; left:0; bottom:0;
  width:60px; height:3px; background:var(--gold);
  border-radius:2px;
}
.sec-title--center { text-align:center; }
.sec-title--center::after { left:50%; transform:translateX(-50%); }
/* Инверсный заголовок (тёмные баннеры): белый в ЛЮБОМ контексте — !important,
 * т.к. контентные обёртки красят заголовки специфичнее (.single-post__content h2). */
.sec-title--inv { color:#fff !important; }

/* ── Объявления (announcement cards) ── */
.announce-list { display:flex; flex-direction:column; gap:10px; }
.ac {
  display:flex; background:var(--white);
  border-radius:var(--r); box-shadow:var(--shadow-xs);
  overflow:hidden; transition:box-shadow var(--dur);
}
.ac:hover { box-shadow:var(--shadow-md); }
.ac__bar { width:5px; flex-shrink:0; }
.ac__body { padding:14px 16px; flex:1; }
.ac__tag {
  font-size: var(--fs-xs); font-weight:700; text-transform:uppercase;
  letter-spacing:.7px; margin-bottom:5px;
}
.ac__title { font-size: var(--fs-base); font-weight:700; color:var(--text); line-height:1.35; margin-bottom:6px; }
.ac__text { font-size: var(--fs-base); color:var(--text-mid); line-height:1.55; }
.ac__link {
  display:inline-block; margin-top:9px;
  padding:5px 14px; border-radius:var(--r-sm);
  font-size: var(--fs-xs); font-weight:700;
  transition:opacity var(--dur);
}
.ac__link:hover { opacity:.85; }

/* Цвета для карточек */
.ac--gold .ac__bar { background:var(--gold); }
.ac--gold .ac__body { background:var(--gold-light); }
.ac--gold .ac__tag { color:var(--gold-text); }
.ac--gold .ac__link { background:var(--gold-text); color:#fff; }

.ac--green .ac__bar { background:var(--green); }
.ac--green .ac__body { background:var(--green-light); }
.ac--green .ac__tag { color:var(--green-text); }
.ac--green .ac__link { background:var(--green); color:#fff; }

.ac--blue .ac__bar { background:var(--primary); }
.ac--blue .ac__tag { color:var(--primary); }
.ac--blue .ac__link { background:var(--primary); color:#fff; }

/* Иллюстрация справа в announcement card */
.ac__img {
  width:148px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  padding:10px; overflow:hidden;
}
.ac--gold .ac__img  { background:linear-gradient(145deg,#fdf2c0,#fbdf80); }
.ac--green .ac__img { background:linear-gradient(145deg,#bdf0d0,#7ed4a0); }
.ac--blue .ac__img  { background:linear-gradient(145deg,#c2dff2,#88bede); }
.ac__img img { width:100%; height:auto; display:block; object-fit:cover; }
.ac__img svg { width:64px; height:64px; display:block; stroke-width:1.5; }
.ac--blue .ac__img svg  { color:var(--primary); }
.ac--green .ac__img svg { color:var(--green-text); }
@media(max-width:680px){ .ac__img{ display:none; } }

/* Цветовые темы для изображений карточек новостей */
.news-card__img--teal   { background:linear-gradient(135deg,#c0ede4,#72c4ae); }
.news-card__img--green  { background:linear-gradient(135deg,#bef0d0,#70cc96); }
.news-card__img--amber  { background:linear-gradient(135deg,#feefc0,#f8c84a); }
.news-card__img--slate  { background:linear-gradient(135deg,#d6dfe8,#93a6bb); }
.news-card__img--navy   { background:linear-gradient(135deg,#ccdff4,#80b0d4); }
.news-card__img svg { width:80px; height:80px; }

/* ── Инфо-блок: безбарьерная среда ── */
.info-box {
  background:var(--white); border-radius:var(--r);
  box-shadow:var(--shadow-xs);
  border-left:4px solid var(--primary-light);
  padding:16px 18px;
  display:flex; gap:14px; align-items:flex-start;
}
.info-box__ico { font-size: var(--fs-xl); flex-shrink:0; }
/* Пиктограмма не должна искажаться: без object-fit браузер растягивал
 * картинку 220×164 в квадрат 80×80 (сжатие ~26% по горизонтали). */
.info-box__ico img { width:80px; height:80px; object-fit:contain; display:block; }
.info-box__body h3 { font-size: var(--fs-base); font-weight:700; color:var(--primary); margin-bottom:5px; }
.info-box__body p { font-size: var(--fs-sm); color:var(--text-mid); line-height:1.5; }
.info-box__body a { display:inline-block; margin-top:8px; font-size: var(--fs-sm); font-weight:600; color:var(--primary-light); }
.info-box__body a:hover { text-decoration:underline; }

/* ── Вакцинация: телефон-консультация + карточки-разделы ── */
.vac-phone {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin:18px 0; padding:12px 16px;
  background:var(--accent-soft); border-left:4px solid var(--primary);
  border-radius:var(--r-sm); font-size:var(--fs-sm);
}
.vac-phone .mg-icon { width:20px; height:20px; color:var(--primary); flex-shrink:0; }
.vac-phone span { font-weight:700; color:var(--text); }
.vac-phone a { font-weight:700; color:var(--primary-light); white-space:nowrap; }
.vac-phone a:hover { text-decoration:underline; }

.vac-topics { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin:18px 0 6px; }
.vac-topic {
  display:flex; flex-direction:column; gap:7px;
  padding:16px 18px; background:var(--white);
  border:1px solid var(--border-light); border-top:3px solid var(--primary);
  border-radius:var(--r); box-shadow:var(--shadow-xs); color:var(--text);
  transition:box-shadow var(--dur), transform var(--dur-fast);
}
.vac-topic:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.vac-topic__title { font-weight:700; color:var(--primary); font-size:var(--fs-md); }
.vac-topic__txt { font-size:var(--fs-sm); color:var(--text-mid); line-height:1.5; flex:1; }
.vac-topic__more { font-size:var(--fs-sm); font-weight:600; color:var(--primary-light); }
@media (max-width:680px) { .vac-topics { grid-template-columns:1fr; } }

/* Календарь прививок: ограничиваем ширину (полный размер — по клику, лайтбокс) */
.vac-calendar { margin:18px 0; }
.vac-calendar img { max-width:560px; width:100%; height:auto; border:1px solid var(--border-light); border-radius:var(--r-sm); cursor:zoom-in; }
.vac-calendar figcaption { font-size:var(--fs-xs); color:var(--text-muted); margin-top:6px; }

/* Якорные заголовки контента не уезжают под липкую шапку */
.content :is(h2,h3)[id] { scroll-margin-top:90px; }

/* ── Рубрики новостей ── */
.news-tabs {
  display:flex; flex-wrap:wrap; gap:6px;
  margin-bottom:16px;
}
.news-tab {
  padding:5px 13px; font-size: var(--fs-sm); font-weight:600;
  border:1.5px solid var(--border);
  border-radius:20px; background:var(--white);
  color:var(--text-mid); cursor:pointer;
  transition:background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
  line-height:1.5;
}
.news-tab:hover { border-color:var(--primary-light); color:var(--primary); }
.news-tab.is-active {
  background:var(--primary); border-color:var(--primary);
  color:#fff;
}

/* ── Новости ── */
/* Mobile-first grid через container queries — 1→2→3 кол */
.news-grid {
  display:grid;
  grid-template-columns:1fr;
  gap:var(--space-sm);
}
@container (min-width: 480px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 720px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }
.news-card.is-hidden { display:none; }
.news-card.is-fade-in { animation:cardFadeIn .22s ease both; }

/* ── Сентинель бесконечной прокрутки (страница /news/) ── */
.news-sentinel {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 22px 0 6px;
  color: var(--text-muted); font-size: var(--fs-sm);
}
.news-sentinel__spinner {
  width: 22px; height: 22px; flex-shrink: 0;
  border: 2.5px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: news-spin .7s linear infinite;
}
@keyframes news-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .news-sentinel__spinner { animation: none; } }
@keyframes cardFadeIn {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Fade-in появление карточек (классы вешает theme.js, секция 6) ──
 * JS не включает эффект при prefers-reduced-motion и через 2s страховочно
 * снимает скрытие; print-правило гарантирует видимость на бумаге. */
.fade-in-ready { opacity:0; transform:translateY(18px); transition:opacity .45s ease, transform .45s ease; }
.fade-in-ready.fade-in-done { opacity:1; transform:translateY(0); }
@media print {
  .fade-in-ready { opacity:1 !important; transform:none !important; }
}
.news-card {
  background:var(--white); border-radius:var(--r);
  box-shadow:var(--shadow-xs); overflow:hidden;
  display:flex; flex-direction:column;
  transition:box-shadow var(--dur), transform var(--dur);
}
.news-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.news-card__img {
  height:148px;
  background:linear-gradient(135deg, var(--accent) 0%, #c5dff0 100%);
  display:flex; align-items:center; justify-content:center;
  font-size: var(--fs-hero); flex-shrink:0; overflow:hidden;
}
.news-card__img--photo { background:#dce8f0; padding:0; }
.news-card__img--photo img { width:100%; height:100%; object-fit:cover; display:block; transition:transform var(--dur-slow) ease; }
.news-card:hover .news-card__img--photo img { transform:scale(1.04); }
.news-card__body { padding:13px; flex:1; display:flex; flex-direction:column; }
.news-card__date { font-size: var(--fs-xs); color:var(--text-muted); margin-bottom:5px; }
.news-card__title { font-size: var(--fs-sm); font-weight:600; color:var(--text); line-height:1.4; flex:1; margin-bottom:9px; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; }
.news-card__link { font-size: var(--fs-xs); color:var(--primary-light); font-weight:600; }
.news-card__link:hover { text-decoration:underline; }

.all-news-btn {
  display:block; text-align:center; margin-top:18px;
  padding:10px 28px; background:var(--primary);
  color:#fff; border-radius:var(--r-sm);
  font-size: var(--fs-sm); font-weight:600;
  width:fit-content; margin-left:auto; margin-right:auto;
  transition:background var(--dur);
}
.all-news-btn:hover { background:var(--gov-dark); }

/* Навигация по страницам новостей главной (prev/next, HTMX-свап #news-block) */
.news-nav {
  display:flex; align-items:center; justify-content:center;
  gap:16px; margin-top:18px;
}
.news-nav__btn {
  padding:8px 18px; background:var(--primary); color:#fff;
  border:none; border-radius:var(--r-sm);
  font-size: var(--fs-sm); font-weight:600; cursor:pointer;
  transition:background var(--dur);
}
.news-nav__btn:hover:not(:disabled) { background:var(--gov-dark); }
.news-nav__btn:disabled { opacity:.45; cursor:default; }
.news-nav__status { font-size: var(--fs-sm); color:var(--text-mid); }

/* ═══════════════════════════════════════════
   УСЛУГИ
═══════════════════════════════════════════ */
.services-sec {
  background:linear-gradient(135deg, var(--gov-dark) 0%, var(--gov-mid) 60%, var(--primary) 100%);
  padding:32px 0;
  margin-top:24px;
}
.services-sec .sec-title { color:#fff; }
/* Mobile-first grid через container queries — 1→2→4 кол */
.services-grid {
  display:grid;
  grid-template-columns:1fr;
  gap:var(--space-sm);
}
@container (min-width: 380px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 720px) { .services-grid { grid-template-columns: repeat(4, 1fr); } }
.svc-btn {
  display:flex; flex-direction:column; align-items:center; gap:12px;
  padding:24px 16px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.15);
  border-radius:var(--r);
  cursor:pointer; text-decoration:none;
  transition:background var(--dur), transform var(--dur), border-color var(--dur);
}
.svc-btn:hover {
  background:rgba(255,255,255,.15);
  border-color:rgba(255,255,255,.35);
  transform:translateY(-3px);
}
.svc-btn__ico {
  width:52px; height:52px; border-radius:50%;
  background:rgba(255,255,255,.13);
  display:flex; align-items:center; justify-content:center;
  font-size: var(--fs-xl);
  transition:background var(--dur);
}
.svc-btn:hover .svc-btn__ico { background:rgba(255,255,255,.22); }
.svc-btn__label {
  font-size: var(--fs-sm); font-weight:600; color:#fff;
  text-align:center; line-height:1.35;
}
.svc-btn__arrow {
  font-size: var(--fs-md); color:rgba(255,255,255,.4);
  transition:color var(--dur), transform var(--dur);
}
.svc-btn:hover .svc-btn__arrow { color:rgba(255,255,255,.8); transform:translateX(3px); }

/* ═══════════════════════════════════════════
   ОБРАЩЕНИЯ
═══════════════════════════════════════════ */
.appeals-sec {
  background:var(--primary);
  padding:22px 0;
}
/* Mobile-first: вертикально стек по умолчанию, в строку >=680px */
.appeals-sec .wrap { display:flex; flex-direction:column; align-items:stretch; gap:var(--space-md); }
@media (min-width: 680px) {
  .appeals-sec .wrap { flex-direction:row; align-items:center; justify-content:space-between; gap:var(--space-xl); }
}
.appeals-sec__text h2 { font-size: var(--fs-lg); font-weight:700; color:var(--accent-soft); margin-bottom:5px; }
.appeals-sec__text p { font-size: var(--fs-sm); color:rgba(255,255,255,.78); max-width:540px; line-height:1.5; }
.appeals-sec__btns { display:flex; flex-direction:column; gap:8px; flex-shrink:0; }
.btn {
  display:inline-flex; align-items:center; gap:7px;
  padding:10px 22px; border-radius:var(--r-sm);
  font-size: var(--fs-sm); font-weight:700; cursor:pointer;
  transition:color var(--dur), background-color var(--dur), border-color var(--dur); white-space:nowrap; border:none;
}
.btn--accent { background:var(--accent); color:var(--primary); }
.btn--accent:hover { background:#fff; }
.btn--outline { background:transparent; border:2px solid rgba(255,255,255,.4); color:#fff; }
.btn--outline:hover { border-color:#fff; }
.btn--primary { background:var(--primary); color:#fff; }
.btn--primary:hover { background:var(--gov-dark); }
.btn--secondary { background:var(--bg-alt); color:var(--text); border:1px solid var(--border); }
.btn--secondary:hover { border-color:var(--primary); color:var(--primary); }

/* ═══════════════════════════════════════════
   РЕСУРСЫ
═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════
   КАРТА
═══════════════════════════════════════════ */
.map-sec { position:relative; }
.map-wrap {
  position:relative;
  height:380px;
  overflow:hidden;
  /* Подложка на случай недоступного iframe: нейтральный фон + SVG-пин по центру */
  background:#e6edf3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24' fill='none' stroke='%238aa4ba' stroke-width='1.6'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center no-repeat;
}
.map-wrap iframe {
  width:100%; height:100%;
  border:none; display:block;
  filter:saturate(.92);
}
.map-card-anchor {
  position:absolute;
  inset:0;
  max-width:1280px;
  margin:0 auto;
  padding:0 var(--wrap-gutter);
  pointer-events:none;
}
.map-card {
  position:absolute;
  top:24px; left:32px;
  background:#fff;
  border-radius:var(--r);
  box-shadow:0 6px 28px rgba(6,52,98,.22);
  padding:20px 22px;
  width:296px;
  z-index:10;
  pointer-events:none;
}
.map-card__title {
  font-size: var(--fs-sm); font-weight:700; color:var(--gov-dark);
  margin-bottom:3px; line-height:1.3;
}
.map-card__subtitle {
  font-size: var(--fs-xs); color:var(--text-muted);
  margin-bottom:12px;
}
.map-card__row {
  display:flex; align-items:flex-start; gap:8px;
  font-size: var(--fs-sm); color:var(--text-mid);
  margin-bottom:7px; line-height:1.4;
}
.map-card__ico { font-size: var(--fs-sm); flex-shrink:0; margin-top:1px; }
.map-card__row a { color:var(--primary-light); pointer-events:auto; }
.map-card__row a:hover { text-decoration:underline; }
.map-card__actions {
  display:flex; gap:8px; margin-top:14px;
  pointer-events:auto;
}
.map-card__btn {
  flex:1; padding:7px 10px; border-radius:var(--r-sm);
  font-size: var(--fs-xs); font-weight:600; text-align:center;
  transition:background var(--dur-fast), color var(--dur-fast);
}
.map-card__btn--primary {
  background:var(--primary); color:#fff;
}
.map-card__btn--primary:hover { background:var(--gov-dark); }
.map-card__btn--outline {
  border:1.5px solid var(--border); color:var(--text-mid);
  background:#fff;
}
.map-card__btn--outline:hover { border-color:var(--primary-light); color:var(--primary); }
.map-overlay {
  position:absolute; inset:0;
  z-index:5; cursor:pointer;
}
.map-overlay__hint {
  position:absolute; bottom:14px; right:14px;
  background:rgba(6,52,98,.72);
  color:#fff; font-size: var(--fs-xs); font-weight:500;
  padding:6px 12px; border-radius:20px;
  backdrop-filter:blur(4px);
  pointer-events:none;
  transition:opacity var(--dur);
}
.map-overlay.is-gone { display:none; }

/* На узком мобильном — подсказку наверх по центру, чтобы не налезала на нижние контролы Яндекс.Карт */
@media (max-width: 600px) {
  .map-overlay__hint { top:10px; bottom:auto; left:50%; right:auto; transform:translateX(-50%); }
}

/* «Открыть на Яндекс.Картах» — заметная кнопка-аутлайн под картой */
.map-open-link {
  display:flex; align-items:center; justify-content:center; gap:6px;
  margin:10px 14px 14px;
  padding:9px 16px;
  border:1.5px solid var(--primary-light);
  border-radius:var(--r-sm);
  color:var(--primary);
  font-size: var(--fs-sm); font-weight:600;
  transition:background var(--dur-fast), border-color var(--dur-fast);
}
.map-open-link:hover { background:var(--accent-soft); border-color:var(--primary); }

/* Карточка карты на узких экранах: фиксируем по краям контейнера (left+right+
 * width:auto), иначе фикс. ширина 296px при left:32px выезжала за вьюпорт ≤340px
 * и стояла асимметрично на ~360px. */
@media (max-width: 560px) {
  .map-card {
    left: var(--wrap-gutter); right: var(--wrap-gutter);
    width: auto; top: 12px; padding: 14px 16px;
  }
}

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.site-footer {
  background: linear-gradient(180deg, var(--gov-dark) 0%, var(--gov-deep) 100%);
  color:rgba(255,255,255,.72);
  padding:36px 0 0;
}
/* Mobile-first: 1 колонка по умолчанию, 4 колонки на desktop */
.footer-top { display:grid; grid-template-columns:1fr; gap:var(--space-lg); padding-bottom:28px; }
@media (min-width: 880px) {
  .footer-top { grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-xl); }
}

.f-col__logo { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.f-col__logo img { height:52px; width:auto; }
.f-col__logo-text h2 { font-size: var(--fs-base); font-weight:700; color:#fff; line-height:1.25; }
.f-col__logo-text p { font-size: var(--fs-xs); color:rgba(255,255,255,.7); margin-top:2px; }
.f-col p { font-size: var(--fs-sm); line-height:1.65; }
.f-col > h2 { font-size: var(--fs-xs); font-weight:700; text-transform:uppercase; letter-spacing:.7px; color:var(--accent-soft); margin-bottom:12px; }
.f-col ul { display:flex; flex-direction:column; gap:7px; }
.f-col ul a { font-size: var(--fs-sm); color:rgba(255,255,255,.65); transition:color var(--dur); }
.f-col ul a:hover { color:#fff; }

.footer-bottom {
  border-top:1px solid rgba(255,255,255,.1);
  padding:12px 0;
}
.footer-bottom .wrap { display:flex; justify-content:space-between; font-size: var(--fs-xs); color:rgba(255,255,255,.65); }

/* ── Footer на мобильных/планшете: аккуратная стопка с разделителями ── */
@media (max-width: 879.98px) {
  .footer-top { gap: 0; padding-bottom: 8px; text-align: center; }
  .f-col {
    padding: 18px 0;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .f-col:first-child { border-top: none; padding-top: 0; }
  .f-col__logo { justify-content: center; margin-bottom: 14px; }
  .f-col p { margin: 0 auto; max-width: 34ch; }
  .f-col ul { align-items: center; gap: 10px; }
  .f-col ul a { padding: 2px 0; }    /* крупнее тап-таргет */
  .f-col > h2 { margin-bottom: 10px; }
  .footer-bottom .wrap { flex-direction: column; gap: 6px; text-align: center; line-height: 1.5; }
}

/* ── Footer: важные телефоны (быстрый набор) ── */
.footer-phones { border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0; }
.footer-phones__title,
.footer-gov__title {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; color: var(--accent-soft); margin-bottom: 16px;
}
/* Mobile-first: 1 колонка, по центру (как остальной футер на узких) */
.footer-phones__list { display: grid; grid-template-columns: 1fr; gap: 14px 24px; }
.footer-phone { display: flex; flex-direction: column; gap: 3px; text-align: center; }
.footer-phone__label {
  font-size: var(--fs-xs); color: rgba(255,255,255,.65);
  text-transform: uppercase; letter-spacing: .4px; line-height: 1.3;
}
.footer-phone__num {
  font-size: var(--fs-base); font-weight: 700; color: #fff;
  letter-spacing: .3px; white-space: nowrap; transition: color var(--dur);
  font-variant-numeric: tabular-nums;
  margin-top: auto;   /* прижать номер к низу: в многоколоночном ряду номера на одной линии при разной высоте label */
}
.footer-phone__num:hover { color: #e8b318; }   /* светлее --gold для AA на тёмном */
@media (min-width: 600px) {
  .footer-phones__list { grid-template-columns: repeat(2, 1fr); }
  .footer-phone { text-align: left; }
}
@media (min-width: 880px)  { .footer-phones__list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1120px) { .footer-phones__list { grid-template-columns: repeat(5, 1fr); } }

/* ── Footer: государственные ресурсы (баннеры) ── */
.footer-gov { border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0 30px; }
.footer-gov__list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.gov-banner {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 16px; text-align: center;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r);
  height: 100%;   /* заполнить ячейку грида: ровный низ баннеров при разной длине desc в ряду */
  transition: background var(--dur), border-color var(--dur);
}
.gov-banner:hover { background: rgba(255,255,255,.1); border-color: var(--gold); }
.gov-banner__name { font-size: var(--fs-sm); font-weight: 700; color: #fff; }
.gov-banner__desc { font-size: var(--fs-xs); color: rgba(255,255,255,.65); line-height: 1.4; }
@media (min-width: 560px) {
  .footer-gov__list { grid-template-columns: repeat(2, 1fr); }   /* 8 баннеров → 4 ряда */
  .gov-banner { text-align: left; }
}
@media (min-width: 1000px) { .footer-gov__list { grid-template-columns: repeat(4, 1fr); } }  /* 4×2, ровные ряды */

/* ── Оценка качества услуг: снимок статистики качество-услуг.бел + QR ── */
.footer-quality { border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0; }
.quality-card {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r);
  transition: background var(--dur), border-color var(--dur);
}
.quality-card:hover { background: rgba(255,255,255,.1); border-color: var(--gold); }
.quality-card__qr {
  flex: 0 0 auto; width: 96px; height: 96px;
  border-radius: 6px; background: #fff; padding: 4px;
}
.quality-card__body { display: flex; flex-direction: column; gap: 8px; }
.quality-card__title { font-size: var(--fs-base); font-weight: 700; color: #fff; }
.quality-card__stats { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.quality-stat { font-size: var(--fs-sm); color: rgba(255,255,255,.7); }
.quality-stat b { font-size: var(--fs-md); font-weight: 800; color: var(--gold); margin-right: 4px; }
.quality-card__cta { font-size: var(--fs-xs); color: rgba(255,255,255,.65); line-height: 1.4; }
@media (max-width: 480px) {
  .quality-card { flex-direction: column; text-align: center; }
  .quality-card__stats { justify-content: center; }
}

/* ═══════════════════════════════════════════
   COMPACT STICKY HEADER
═══════════════════════════════════════════ */
.compact-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-sticky);
  background: linear-gradient(135deg, var(--gov-dark) 0%, var(--gov-mid) 100%);
  box-shadow: 0 3px 16px rgba(6,52,98,.28);
  transform: translateY(-100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.compact-header.is-visible { transform: translateY(0); }

.compact-header .wrap {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-top: 8px; padding-bottom: 8px;
  gap: 16px;
}

/* Логотип в компактной шапке */
.ch-logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.ch-logo__icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-md); flex-shrink: 0;
  color: #fff;
}
.ch-logo__text { font-size: var(--fs-sm); font-weight: 700; color: #fff; line-height: 1.25; white-space: nowrap; }
.ch-logo__sub { font-size: var(--fs-xs); color: rgba(255,255,255,.7); white-space: nowrap; }

/* Навигация компактная — горизонтальный скролл при нехватке ширины (как .h-nav).
 * min-width:0 КРИТИЧЕН: без него flex-элемент не сжимается ниже своего контента
 * (пункты nowrap), вся строка переполняется и правый блок (.ch-right — телефон +
 * кнопка «Записаться») выдавливается за экран. */
.ch-nav {
  display: flex; align-items: center; gap: 0;
  flex: 1; min-width: 0;
  justify-content: safe center;
  /* overflow:visible — иначе скролл-контейнер обрезал бы выпадающие .sub-menu.
   * Раньше тут был overflow-x:auto для длинного меню; теперь .ch-nav__list
   * переносится (flex-wrap), горизонтального переполнения нет. .ch-nav виден
   * только ≥980px (ниже — бургер/дровер). */
  overflow: visible;
}

/* Узкие экраны: лого + «Записаться» в строке 1, меню — отдельной строкой во всю
 * ширину (иначе меню сжимается в сливер между лого и CTA). */
@media (max-width: 980px) {
  .compact-header .wrap { flex-wrap: wrap; row-gap: 6px; }
  .ch-logo  { order: 1; }
  .ch-right { order: 2; }
  .ch-nav {
    order: 3;
    flex: 0 0 100%;
    justify-content: flex-start;
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 6px;
  }
}

.ch-nav a {
  padding: 8px 11px; font-size: var(--fs-sm); font-weight: 500;
  color: rgba(255,255,255,.80); white-space: nowrap;
  border-radius: 4px; transition: color var(--dur), background-color var(--dur);
}
.ch-nav a:hover, .ch-nav a.active { color: #fff; background: rgba(255,255,255,.1); }
.ch-nav a.active { font-weight: 600; }

/* (Компактный поиск удалён из разметки — он никогда не показывался ни на одной
 * ширине; поиск доступен в основной шапке.) */

/* ── Дропдаун результатов поиска ── */
.search-results-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 280px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(6,52,98,.18);
  z-index: var(--z-dropdown);
  overflow: hidden;
}
.search-results-drop:empty { display: none; }
.search-results-drop ul { list-style: none; margin: 0; padding: 0; }
.search-results-drop li { border-bottom: 1px solid var(--border-light); }
.search-results-drop li:last-child { border-bottom: none; }
.search-results-drop li a,
.search-results__item a { display: block; padding: 10px 14px; font-size: var(--fs-sm); color: var(--text); transition: background var(--dur-fast); }
.search-results-drop li a:hover,
.search-results__item a:hover { background: var(--accent-soft); text-decoration: none; }
.search-results-drop li p { font-size: var(--fs-xs); color: var(--text-muted); padding: 0 14px 8px; margin: 0; }
.search-results-drop p.search-results__empty { padding: 12px 14px; font-size: var(--fs-sm); color: var(--text-muted); margin: 0; }
/* Сбросить позиционирование старого .search-results внутри нового дропдауна */
.search-results-drop .search-results {
  position: static;
  border: none;
  box-shadow: none;
  border-radius: 0;
  max-height: 360px;
  overflow-y: auto;
}

/* WP-меню в компактном хедере */
.ch-nav__list { display:flex; align-items:center; flex-wrap:wrap; list-style:none; margin:0; padding:0; }
.ch-nav__list li { position:relative; }
.ch-nav__list li.current-menu-item > a,
.ch-nav__list li.current_page_item > a { color:#fff; background:rgba(255,255,255,.1); font-weight:600; }

/* Выпадающее подменю в липкой шапке (как .nav-sub в основной).
 * .ch-nav показывается только ≥980px — overflow снимаем там же (ниже бургер/дровер),
 * иначе overflow-x:auto скролл-контейнера обрезал бы absolute-дропдаун. */
.ch-nav__list .menu-item-has-children > a::after { content:'▾'; margin-left:4px; font-size: var(--fs-xs); opacity:.7; }
.ch-nav__list .sub-menu {
  display:none; position:absolute; top:100%; left:0;
  min-width:200px; list-style:none; margin:0; padding:0;
  background:var(--primary-dark);
  border-top:2px solid var(--accent);
  border-radius:0 0 var(--r-sm) var(--r-sm);
  box-shadow:0 6px 18px rgba(0,0,0,.3);
  z-index:var(--z-dropdown);
  max-height:calc(100vh - 140px); overflow-y:auto;
}
.ch-nav__list .sub-menu a { display:block; padding:9px 14px; font-size: var(--fs-sm); white-space:nowrap; border-radius:0; }
.ch-nav__list .menu-item-has-children:hover > .sub-menu,
.ch-nav__list .menu-item-has-children:focus-within > .sub-menu { display:block; }

/* Правая часть компактной шапки */
.ch-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.ch-phone { font-size: var(--fs-sm); font-weight: 700; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ch-phone a { color: inherit; }
.ch-cta {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 16px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--primary);
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap;
  transition: background var(--dur), transform var(--dur-fast);
}
.ch-cta:hover { background: #fff; transform: translateY(-1px); }

/* ═══════════════════════════════════════════
   MOBILE NAV DRAWER (off-canvas «гамбургер») — <980px при .has-js
   Заменяет горизонтальный скролл .h-nav / .ch-nav: меню и подменю
   раскрываются вертикально в выезжающей справа панели. Absolute-дропдаунам
   больше не нужен overflow:visible — клиппинг скролл-контейнером исключён.
═══════════════════════════════════════════ */

/* Гамбургер-кнопки (видны только при JS на <980; без JS — обычное меню) */
.h-burger, .ch-burger {
  display: none;
  align-items: center; justify-content: center;
  padding: var(--space-2xs);
  background: transparent; border: none; border-radius: var(--r-sm);
  color: #fff; cursor: pointer; line-height: 0;
  transition: background var(--dur);
}
.h-burger { font-size: var(--fs-xl); }
.ch-burger { font-size: var(--fs-xl); }
.h-burger:hover, .ch-burger:hover { background: rgba(255,255,255,.14); }
.h-burger:focus-visible, .ch-burger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 979.98px) {
  html.has-js .h-burger,
  html.has-js .ch-burger { display: inline-flex; }
  /* Горизонтальные меню-полосы заменены гамбургером */
  html.has-js .h-nav,
  html.has-js .ch-nav { display: none; }
  /* Узкая шапка: эмблема+название слева, бургер уезжает к правому краю */
  .h-brand .wrap { gap: var(--space-sm); }
  .h-brand .h-burger { margin-left: auto; }
}

/* Затемнение позади панели */
.nav-drawer__backdrop {
  position: fixed; inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(6,52,98,.55);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-slow), visibility var(--dur-slow);
}
.nav-drawer__backdrop.is-open { opacity: 1; visibility: visible; }

/* Выезжающая справа панель */
.nav-drawer {
  position: fixed; top: 0; right: 0;
  z-index: var(--z-drawer);
  width: min(86vw, 22rem);
  height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--gov-dark);
  box-shadow: var(--shadow-md);
  transform: translateX(100%);
  transition: transform var(--dur-slow) cubic-bezier(.4,0,.2,1);
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.nav-drawer.is-open { transform: translateX(0); }

.nav-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,.12);
  position: sticky; top: 0; z-index: 1;
  background: var(--gov-dark);
}
.nav-drawer__title { font-size: var(--fs-md); font-weight: 700; color: #fff; }
.nav-drawer__close {
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-2xs);
  background: transparent; border: none; border-radius: var(--r-sm);
  color: rgba(255,255,255,.85); cursor: pointer; font-size: var(--fs-xl); line-height: 0;
  transition: background var(--dur);
}
.nav-drawer__close:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav-drawer__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.nav-drawer__menu { flex: 1; }

.nav-drawer__cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--gold); color: var(--gov-dark);
  border-radius: var(--r-sm);
  font-weight: 700; font-size: var(--fs-base);
}
.nav-drawer__cta:hover { background: #fff; }
.nav-drawer__cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ── Аккордеон-меню внутри панели ──
   Сбрасываем десктоп-дропдаун (.nav-sub {position:absolute; display:none}) —
   в панели подменю раскрывается в потоке по кнопке-тогглу .drawer-sub-toggle. */
.drawer-menu { list-style: none; margin: 0; padding: 0; }
.drawer-menu li { position: relative; }
.drawer-menu a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: rgba(255,255,255,.9); font-size: var(--fs-md); font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.drawer-menu a:hover,
.drawer-menu a:focus-visible { background: rgba(255,255,255,.08); color: #fff; }
.drawer-menu li.current-menu-item > a,
.drawer-menu li.current_page_item > a { color: #fff; background: rgba(255,255,255,.06); font-weight: 600; }

/* Пункт с детьми: ссылка + кнопка-тоггл в одной строке */
.drawer-menu .menu-item-has-children { display: flex; flex-wrap: wrap; }
.drawer-menu .menu-item-has-children > a { flex: 1; min-width: 0; }
.drawer-menu .has-sub > a::after { content: none; }
.drawer-sub-toggle {
  flex: 0 0 auto; width: 56px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
  border-left: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.7); cursor: pointer; font-size: var(--fs-lg); line-height: 0;
  transition: background var(--dur);
}
.drawer-sub-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.drawer-sub-toggle:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.drawer-sub-toggle .mg-icon { transition: transform var(--dur-slow); }
.drawer-sub-toggle[aria-expanded="true"] .mg-icon { transform: rotate(180deg); }

/* Вложенный список — сброс десктопного .nav-sub, раскрытие по max-height */
.drawer-menu .sub-menu {
  display: block; position: static;
  flex-basis: 100%;
  list-style: none; margin: 0; padding: 0;
  background: rgba(0,0,0,.2);
  min-width: 0; box-shadow: none; border: none;
  max-height: 0; overflow: hidden;
  transition: max-height var(--dur-slow) ease;
}
.drawer-menu .menu-item-has-children.is-expanded > .sub-menu { max-height: 1400px; } /* самый длинный суб-список — 14 пунктов «Пациентам», с запасом на перенос строк */
.drawer-menu .sub-menu a {
  padding-left: var(--space-xl);
  font-size: var(--fs-base); font-weight: 400;
  color: rgba(255,255,255,.78);
}

/* Глобальное уважение prefers-reduced-motion: почти-мгновенные transition/animation
   на всём (хедер, scroll-top, карточки, fade-in, дровер). .01ms, а не 0/none —
   чтобы transitionend-события (на них завязан JS) всё же срабатывали. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════
   SCROLL TO TOP BUTTON
═══════════════════════════════════════════ */
.scroll-top {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: var(--z-dropdown);
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-lg);
  box-shadow: 0 4px 16px rgba(6,52,98,.35);
  opacity: 0;
  transform: translateY(16px) scale(.85);
  transition: opacity .28s, transform .28s;
  pointer-events: none;
}
.scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.scroll-top:hover {
  background: var(--gov-dark);
  transform: translateY(-2px) scale(1.05);
}
.scroll-top:active { transform: scale(.95); }

/* ═══════════════════════════════════════
   COMPACT HEADER на узких контейнерах (Фаза 2: CQ заменили @media)
   Sticky compact-header при скролле — скрываем nav/CTA/поиск если контейнер узкий.
   .h-nav уже использует container query (см. блок «Навигация» выше).
═══════════════════════════════════════ */
/* Safety net: предотвратить глобальный horizontal scroll если что-то выпадет */
html { overflow-x: clip; }

/* ═══════════════════════════════════════
   МОБИЛЬНЫЙ АДАПТИВ (≤680px)
═══════════════════════════════════════ */
@media (max-width: 680px) {
  /* .wrap padding убран — теперь --wrap-gutter (clamp) сам даёт 10px на mobile */

  /* --- Верхняя строка (адрес + язык + версия) --- */
  .h-top__address { display: none; }
  .h-top .wrap { justify-content: flex-end; padding-top: 4px; padding-bottom: 4px; gap: 8px; }
  .h-top__right { gap: 8px; }
  /* Укорачиваем текст кнопки версии на мобиле */
  .a11y-btn.visually-impaired { font-size: var(--fs-xs); white-space: nowrap; }

  /* --- Шапка бренда (сжата): герб + название + гамбургер в одну строку --- */
  .h-brand .wrap {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: var(--space-2xs);
    padding-top: 8px;
    padding-bottom: 8px;
  }
  /* Название ужимается (текст переносится в своей зоне), не налезая на бургер */
  .h-brand__title { flex: 1; min-width: 0; width: auto; max-width: none; }
  .h-burger { flex: 0 0 auto; }
  .h-brand__emblem-img { height: 40px; width: 40px; }
  .h-brand__title .h-brand__name { font-size: var(--fs-md); line-height: 1.2; }
  .h-brand__sub { font-size: var(--fs-xs); line-height: 1.2; margin-top: 2px; }

  /* --- Навигация: nav-list scroll + скрытие CTA/поиска уже в общем @media ≤980 выше --- */

  /* --- Быстрые действия — 3 колонки --- */
  .h-quick .wrap { grid-template-columns: repeat(3, 1fr); }
  .qa { font-size: var(--fs-xs); padding: 10px 6px; gap: 4px; }
  .qa__icon { width: 32px; height: 32px; font-size: var(--fs-base); }

  /* .page-body .wrap → mobile-first base (см. Фазу 3 выше), здесь только sidebar width */
  .sidebar { width: 100%; }

  /* .news-grid и .services-grid → container queries (Фаза 4), здесь только tweaks карточек */
  .news-card__title { font-size: var(--fs-sm); }
  .news-card__img { height: 100px; }
  .svc-btn { padding: var(--space-sm) var(--space-2xs); }
  .svc-btn__ico { width: 40px; height: 40px; font-size: var(--fs-lg); }
  .svc-btn__label { font-size: var(--fs-sm); }

  /* .appeals-sec .wrap → mobile-first base (см. Фазу 3 выше), здесь только кнопки full-width */
  .appeals-sec__btns { flex-direction: column; }
  .appeals-sec__btns .btn--accent,
  .appeals-sec__btns a { width: 100%; text-align: center; }

  /* --- Компактный заголовок при скролле --- */
  .compact-header .wrap { gap: 8px; padding: 6px 16px; }
  /* ch-search скрыт через @media ≤979.98px; nav-search/nav-cta-wrap — через @container header */
  /* Прячем телефон — место для скроллящегося меню и кнопки «Записаться» */
  .ch-phone { display: none; }

  /* .footer-top → mobile-first base (см. Фазу 3 выше), здесь только footer-bottom */
  .footer-bottom .wrap { flex-direction: column; gap: 4px; text-align: center; }

  /* overflow-x: clip уже задан глобально (Фаза 2) */
}

/* ─── Single Post ─── */
.page-body--single { padding: 32px 0 48px; }
article.single-post { max-width: 820px; background: var(--white); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 32px 40px; }
.single-post__title { font-size: var(--fs-2xl); font-weight: 700; color: var(--gov-dark); margin-bottom: 8px; line-height: 1.35; }
.single-post__date { font-size: var(--fs-sm); color: var(--text-muted); }
.single-post__cats { display: flex; flex-wrap: wrap; gap: 6px; }
.single-post__cat-tag { background: var(--accent); color: var(--primary); font-size: var(--fs-xs); padding: 2px 10px; border-radius: 30px; }
.single-post__thumbnail { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--r-sm); margin: 20px 0; }
.single-post__content { font-size: var(--fs-base); line-height: var(--lh-loose); color: var(--text); margin-top: 24px; }
.single-post__content p { margin-bottom: 1em; }
.single-post__content h2, .single-post__content h3 { color: var(--gov-dark); margin: 1.5em 0 .5em; }
.single-post__content ul,
.single-post__content ol { margin: 0 0 1em; padding-left: 1.5em; }
/* глобальный ul{list-style:none} гасит маркеры — вернуть точки в контентных списках */
.single-post__content ul { list-style: disc; }
.single-post__content ul ul { list-style: circle; }
.single-post__content li { margin-bottom: .4em; }
.single-post__content li::marker { color: var(--primary); }

/* Ссылки в тексте контента обязаны отличаться от обычного текста (WCAG 1.4.1:
 * не только цветом — поэтому подчёркивание). Скоуп по текстовым контейнерам
 * (p/li/td/th/figcaption), чтобы не зацепить карточки-плитки (h3.about-tile__title a)
 * и кнопки (.btn, .wp-block-button__link). */
.single-post__content p a:not(.btn):not(.wp-block-button__link),
.single-post__content li a:not(.btn):not(.wp-block-button__link),
.single-post__content td a:not(.btn):not(.wp-block-button__link),
.single-post__content th a:not(.btn):not(.wp-block-button__link),
.single-post__content figcaption a {
  color: var(--primary-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.single-post__content p a:not(.btn):not(.wp-block-button__link):hover,
.single-post__content li a:not(.btn):not(.wp-block-button__link):hover,
.single-post__content td a:not(.btn):not(.wp-block-button__link):hover,
.single-post__content th a:not(.btn):not(.wp-block-button__link):hover,
.single-post__content figcaption a:hover {
  color: var(--primary);
  text-decoration-thickness: 2px;
}
/* В шапке таблиц фон тёмный (--gov-dark) — синяя ссылка нечитаема */
.single-post__content thead th a:not(.btn) { color: #fff; }
.single-post__back { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-light); }

/* Таблицы в контенте страниц (графики приёма, адмпроцедуры, вакансии).
 * Скролл по X вешается на figure-обёртку, не на таблицу — внутри нет
 * position:absolute, так что overflow безопасен (см. грабли навбара). */
.single-post__content .wp-block-table { margin: 0 0 1.5em; overflow-x: auto; }
/* Когда таблица шире контейнера, theme.js вешает на figure tabindex=0
 * (скролл клавиатурой) — видимый фокус обязателен. */
.single-post__content .wp-block-table:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}
.single-post__content .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.single-post__content .wp-block-table th,
.single-post__content .wp-block-table td {
  padding: 9px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
  hyphens: auto;
}
.single-post__content .wp-block-table thead th {
  background: var(--gov-dark);
  color: var(--white);
  font-weight: 600;
  border-color: var(--gov-mid);
}
.single-post__content .wp-block-table tbody tr:nth-child(even) { background: #fafcfe; }
@media (max-width: 600px) {
  .single-post__content .wp-block-table table { font-size: var(--fs-sm); }
  .single-post__content .wp-block-table th,
  .single-post__content .wp-block-table td { padding: 7px 8px; }
}

/* ─── Хлебные крошки ─── */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  font-size: var(--fs-sm); color: var(--text-muted);
  margin-bottom: 14px;
  padding: 0;
}
.breadcrumb__item { color: var(--text-muted); transition: color var(--dur-fast); }
.breadcrumb__item:hover { color: var(--primary); }
.breadcrumb__item--current {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.breadcrumb__sep { color: var(--border); font-size: var(--fs-sm); user-select: none; }

/* ─── Кнопка «назад» (светлый фон) ─── */
.btn--back {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: var(--fs-sm);
  padding: 8px 18px;
}
.btn--back:hover { border-color: var(--primary); color: var(--primary); background: var(--accent-soft); }

/* ─── Список постов в сайдбаре ─── */
.sb-post-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.sb-post-item { padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.sb-post-item:last-child { border-bottom: none; }
.sb-post-item__link { display: block; font-size: var(--fs-sm); color: var(--text); line-height: 1.4; transition: color var(--dur-fast); }
.sb-post-item__link:hover { color: var(--primary); }
.sb-post-item__date { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 3px; }

/* ─── Мета-строка поста (дата + категории) ─── */
.single-post__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* ─── No-posts message ─── */
.no-posts { text-align: center; color: var(--text-muted); padding: 28px 0; font-size: var(--fs-sm); }

/* ─── Search results dropdown ─── */
.search-results { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); list-style: none; position: absolute; top: 100%; left: 0; right: 0; z-index: var(--z-header); max-height: 360px; overflow-y: auto; }
.search-results__item { border-bottom: 1px solid var(--border-light); }
.search-results__item:last-child { border-bottom: none; }
/* .search-results__item a (+ :hover) — объединены с .search-results-drop li a (см. дропдаун поиска) */
.search-results__item p { font-size: var(--fs-xs); color: var(--text-muted); padding: 0 14px 8px; }
.search-results__empty { padding: 12px 14px; font-size: var(--fs-sm); color: var(--text-muted); }

/* ─── Archive page ─── */
.page-body--archive { padding: 32px 0 48px; }
.archive-header { margin-bottom: 28px; padding-bottom: 16px; border-bottom: 2px solid var(--accent); }
.archive-header__title { font-size: var(--fs-xl); font-weight: 700; color: var(--gov-dark); }
.archive-header__desc { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 6px; }

/* Sidebar category list (контейнер общий с .sb-nav-list «Меню раздела») */
.sb-cat-list,
.sb-nav-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-cat-list a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text); transition: background var(--dur-fast); }
.sb-cat-list a:hover, .sb-cat-list a.is-active { background: var(--accent-soft); color: var(--primary); font-weight: 600; }
.sb-cat-count { background: var(--border); color: var(--text-mid); font-size: var(--fs-xs); padding: 1px 7px; border-radius: 30px; }

/* ─── Pagination ─── */
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; margin: 32px 0 8px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--text); background: var(--white);
  transition: color var(--dur-fast), background-color var(--dur-fast), border-color var(--dur-fast);
}
.pagination .page-numbers:hover { border-color: var(--primary); color: var(--primary); }
.pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pagination .page-numbers.dots { border: none; background: none; }

/* ─── 404 page ─── */
.page-body--404 { padding: 60px 0 80px; }
/* Сброс общей сетки .page-body .wrap — на 404 сайдбара нет, центрируем на всю ширину. */
.page-body--404 .wrap { display: block; }
.error-404 { text-align: center; max-width: 520px; margin: 0 auto; }
.error-404__code { font-size: 96px; font-weight: 900; color: var(--primary-light); line-height: 1; letter-spacing: -.04em; }
.error-404__title { font-size: var(--fs-xl); font-weight: 700; color: var(--gov-dark); margin: 12px 0 16px; }
.error-404__text { font-size: var(--fs-base); color: var(--text-muted); line-height: 1.6; margin-bottom: 32px; }
.error-404__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════
   PAGES WITH SIDEBAR (page.twig)
   общий шаблон страниц + Block Patterns mgorka
═══════════════════════════════════════════ */

.page-body--with-sidebar { padding: 32px 0 48px; }

/* Расширяем .single-post карточку до полной ширины колонки контента */
article.single-post.single-post--page { max-width: none; width: 100%; }

/* ── Sidebar: «Меню раздела» (контейнер объединён с .sb-cat-list выше) ── */
.sb-nav-list li a {
  display: block; padding: 8px 12px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--text); transition: background-color var(--dur-fast), color var(--dur-fast);
}
.sb-nav-list li a:hover { background: var(--accent-soft); color: var(--primary); }
.sb-nav-list li.is-active a { background: var(--primary); color: #fff; font-weight: 600; }
.sb-nav-list li.is-active a:hover { background: var(--primary); color: #fff; }

/* ═══════════════════════════════════════════
   BLOCK PATTERNS (mgorka/about-hospital, mgorka/hospital-leadership)
═══════════════════════════════════════════ */

/* ── About sections (text blocks) ── */
.single-post__content .about-section { padding: 24px 0; margin: 0; }
.single-post__content .about-section + .about-section { padding-top: 0; }
.about-section .sec-title {
  font-size: var(--fs-2xl); color: var(--primary); margin-bottom: 20px;
}
.about-section p { margin-bottom: 14px; font-size: var(--fs-base); line-height: var(--lh-loose); color: var(--text); }
.about-section h3 { font-size: var(--fs-md); color: var(--gov-mid); margin: 20px 0 10px; }
.about-section .wp-block-list { margin: 10px 0 14px 24px; }
.about-section .wp-block-list li { list-style: disc; margin-bottom: 5px; }

/* ── Hero (cover) ── */
.about-hero {
  min-height: 220px !important; border-radius: var(--r);
  overflow: hidden; margin: 0 0 8px !important;
  /* Фолбэк-градиент (виден, если dim-span ковера отсутствует) */
  background: linear-gradient(135deg, var(--gov-dark) 0%, var(--primary) 70%, var(--primary-light) 100%);
}
/* Вместо плоской заливки dim-span'а (inline background-color из паттерна) —
 * фирменный градиент + едва заметный медицинский узор-крест (белый, alpha .07).
 * Светлый край градиента = --primary-light (6.46:1 с белым текстом, AA). */
.about-hero .wp-block-cover__background {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M24 8h8v16h16v8H32v16h-8V32H8v-8h16z' fill='white' fill-opacity='.07'/%3E%3C/svg%3E") 0 0/56px 56px repeat,
    linear-gradient(135deg, var(--gov-dark) 0%, var(--primary) 70%, var(--primary-light) 100%) !important;
  opacity: 1;
}
.about-hero .wp-block-heading { letter-spacing: -.01em; font-size: var(--fs-hero) !important; }
.about-hero p { font-size: var(--fs-base) !important; margin-top: 8px; }

/* ── Послевоенный период (accent block) ── */
.about-postwar {
  padding: 28px 28px !important; border-radius: var(--r);
  margin: 16px 0 !important;
  /* Перекрываем inline background-color:#eaf4fb из паттерна (контент в БД). */
  background: var(--accent-soft) !important;
}

/* ── Historical directors list ── */
.directors-list {
  list-style: none !important; padding: 20px !important; margin: 0 !important;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px;
  background: var(--accent-soft); border-radius: var(--r);
}
.directors-list li {
  list-style: none !important; padding: 9px 0 !important; margin: 0 !important;
  border-bottom: 1px dashed var(--border);
  font-size: var(--fs-sm); color: var(--text);
}
.directors-list li:last-child,
.directors-list li:nth-last-child(2):nth-child(odd) { border-bottom: none; }
.directors-list li strong { color: var(--primary); margin-right: 6px; white-space: nowrap; font-size: var(--fs-sm); }
.directors-cta { margin-top: 20px; font-weight: 600; }
.directors-cta a { color: var(--primary); }

/* ── Stats banner (Настоящее время) — accent block внутри карточки ── */
.about-stats {
  padding: 36px 28px !important; border-radius: var(--r);
  margin: 24px 0 !important;
  /* Перекрываем inline background-color:#1a5276 из паттерна (контент в БД) —
   * как у .about-hero: иначе баннер не следует за токенами темы/схем. */
  background: var(--primary) !important;
}
.about-stats > p { text-align: center; color: rgba(255,255,255,.9); max-width: 720px; margin: 0 auto 24px; }
.about-stats .stats-grid { gap: 16px; margin-top: 8px; }
.about-stats .stats-grid .wp-block-column { text-align: center; padding: 6px; }
.about-stats .stats-grid h3 {
  font-size: var(--fs-hero); font-weight: 900; color: var(--gold);
  line-height: 1; margin: 0; letter-spacing: -.03em;
}
.about-stats .stats-grid p { font-size: var(--fs-sm); color: rgba(255,255,255,.85); margin-top: 4px; }

/* ── Leadership grid (mobile-first + CQ) ── */
.leader-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
@container (min-width: 520px) { .leader-grid { grid-template-columns: repeat(2, 1fr); } }

.leader-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px 16px; box-shadow: var(--shadow-sm);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  transition: box-shadow var(--dur), transform var(--dur);
}
.leader-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.leader-card .leader-photo { margin: 0 0 14px !important; }
.leader-card .leader-photo img {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--accent-soft);
}
.leader-card .wp-block-heading,
.leader-card__name {
  font-size: var(--fs-base); color: var(--primary); margin: 0 0 6px;
  line-height: 1.3; font-weight: 700;
}
.leader-card .leader-role {
  font-size: var(--fs-sm); color: var(--text-muted);
  font-style: italic; line-height: 1.4;
  margin: 0 0 10px; min-height: 34px;
}
.leader-card .leader-contact { font-size: var(--fs-sm); margin: 3px 0; }
.leader-card .leader-contact a { color: var(--primary); font-weight: 500; }
.leader-card .leader-contact a:hover { color: var(--primary-light); }
/* Вакантные карточки руководства — стилизуются в blocks/mgorka-leadership/style.css
   (там у .leader-block .leader-card выше специфичность и файл грузится позже). */

.leadership-intro {
  text-align: center; color: var(--text-mid);
  max-width: 660px; margin: 8px auto 16px;
  font-size: var(--fs-sm);
}

/* ── About hub tiles (3 плитки-ссылки на /o-bolnitse/) ── */
/* WP оборачивает wp:group в .wp-block-group__inner-container — таргетим именно его */
/* .about-tiles — CQ-контейнер (ПРЕДОК грида), а сам грид — на реальном родителе
 * плиток. WP оборачивает flow-группу в .wp-block-group__inner-container, поэтому
 * гридить надо ИМЕННО обёртку; если гридить и .about-tiles, и обёртку — выходят
 * вложенные гриды: внешний 2-кол грид с единственным ребёнком впустую съедал
 * половину ширины (пустая 2-я колонка), а плитки ютились в левой половине. */
.about-tiles {
  margin: 16px 0 8px !important;
  container-type: inline-size;
}
/* Mobile-first: 1 → 2 кол. 4 плитки встают ровно 2×2 и заполняют ширину
 * (3 колонки оставляли 4-ю плитку сиротой в новом ряду). */
.about-tiles > .wp-block-group__inner-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@container (min-width: 480px) {
  .about-tiles > .wp-block-group__inner-container { grid-template-columns: repeat(2, 1fr); }
}
.about-tile {
  position: relative;
  padding: 28px 24px !important;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: transform var(--dur), box-shadow var(--dur), border-color var(--dur);
}
.about-tile:hover,
.contacts-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.about-tile .about-tile__icon {
  font-size: 40px;
  line-height: 1;
  margin: 0 0 14px !important;
}
.about-tile .about-tile__title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px !important;
}
.about-tile .about-tile__title a { color: inherit; text-decoration: none; }
.about-tile .about-tile__title a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.about-tile .about-tile__desc {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  line-height: 1.55;
  margin: 0 !important;
}

/* ── Hub: визуальные счётчики статистики ── */
.hub-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: var(--space-sm);
  margin: 18px 0 4px;
}
.hub-stat {
  background: linear-gradient(135deg, var(--gov-dark) 0%, var(--primary) 100%);
  border-radius: var(--r);
  padding: 20px 14px;
  text-align: center;
  color: #fff;
  display: flex; flex-direction: column; gap: 4px;
}
.hub-stat__num {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  /* Светлее токена --gold: #c9980a не дотягивал по контрасту на тёмном градиенте */
  font-weight: 900; line-height: 1; color: #e8b318;
  letter-spacing: -.02em;
}
.hub-stat__label { font-size: var(--fs-xs); color: rgba(255,255,255,.85); line-height: 1.35; }

/* ── Hub: официальная информация / реквизиты ── */
.about-requisites { margin: 8px 0 0; display: flex; flex-direction: column; gap: 0; }
.about-requisites__row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
}
.about-requisites__row:last-child { border-bottom: none; }
.about-requisites dt { font-weight: 600; color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }
.about-requisites dd { margin: 0; font-size: var(--fs-sm); color: var(--text); line-height: 1.5; }
@media (max-width: 600px) {
  .about-requisites__row { grid-template-columns: 1fr; gap: 2px; padding: 9px 0; }
  .about-requisites dt { font-size: var(--fs-xs); }
}

/* ── Заказать талон: сетка учреждений + карточки ── */
/* Безопасная сетка: min(240px,100%) не даёт колонке распереть узкий контейнер
 * (грабли minmax(Xpx,1fr) на mobile). 6 карточек ложатся 1→2→3 кол по ширине. */
.talon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: var(--space-md);
  margin: 18px 0 4px;
}
/* Кап в 2 колонки — как у .about-tiles: иначе на широкой контентной колонке
 * auto-fit даёт 3-up, имена переносятся на 4–5 строк и появляется рваный
 * вертикальный воздух. CQ-контейнер — .single-post__content (предок грида). */
@container (min-width: 560px) {
  .talon-grid { grid-template-columns: repeat(2, 1fr); }
}
.talon-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 24px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: transform var(--dur), box-shadow var(--dur), border-color var(--dur);
}
.talon-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.talon-card__icon {
  display: inline-flex;
  width: 48px; height: 48px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border-light);
}
.talon-card__icon svg { width: 26px; height: 26px; }
.talon-card__name {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
  margin: 0;
}
.talon-card__btn {
  margin-top: auto;          /* прижимает кнопку к низу — выравнивает по сетке */
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
  transition: background var(--dur), transform var(--dur-fast);
}
.talon-card__btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.talon-card__btn:hover,
.talon-card__btn:focus-visible {
  background: var(--primary-light);
  color: #fff;
  transform: translateY(-1px);
}
/* Подсказка под сеткой (телефон регистратуры + внешний сервис) */
.talon-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 22px 0 0;
  padding: 14px 18px;
  background: var(--gold-light);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text-mid);
  line-height: 1.55;
}
.talon-note svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--gold-text); margin-top: 1px; }
.talon-note a { color: var(--primary); font-weight: 600; }

/* ── struktura: note под блоком departments ── */
.about-departments .struktura-note {
  margin-top: 22px;
  padding: 14px 18px;
  background: var(--accent-soft, #eaf4fb);
  border-left: 3px solid var(--primary, #1a5276);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text-mid);
  line-height: 1.55;
}

/* ═══════════════════════════════════════════
   Parent organizations cards
═══════════════════════════════════════════ */

.parent-orgs .parent-org {
  background: var(--white, #fff);
  border: 1px solid var(--border, #cad5e0);
  border-left: 4px solid var(--primary, #1a5276);
  border-radius: var(--r, 8px);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(6,52,98,.09));
  transition: box-shadow var(--dur), transform var(--dur);
}
.parent-orgs .parent-org:hover {
  box-shadow: var(--shadow-md, 0 4px 16px rgba(6,52,98,.13));
  transform: translateY(-2px);
}

.parent-orgs .parent-org__hd {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border, #cad5e0);
}
.parent-orgs .parent-org__badge {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  background: var(--accent-soft, #eaf4fb);
  border-radius: 50%;
}
.parent-orgs .parent-org__title-wrap { flex: 1; }
.parent-orgs .parent-org__title {
  margin: 0 0 4px;
  font-size: var(--fs-md);
  color: var(--primary, #1a5276);
  line-height: 1.35;
  font-weight: 700;
}
.parent-orgs .parent-org__role {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted, #5a6c80);
  font-style: italic;
  line-height: 1.4;
}

.parent-orgs .parent-org__facts {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px 18px;
  margin: 0;
}
.parent-orgs .parent-org__facts dt,
.department-single__facts dt {
  font-weight: 600;
  color: var(--text-muted, #5a6c80);
  font-size: var(--fs-sm);
}
.parent-orgs .parent-org__facts dd,
.department-single__facts dd {
  margin: 0;
  font-size: var(--fs-base);
  color: var(--text, #2c3e50);
  line-height: 1.5;
}
.parent-orgs .parent-org__facts a {
  color: var(--primary, #1a5276);
  text-decoration: none;
  font-weight: 500;
}
.parent-orgs .parent-org__facts a:hover { text-decoration: underline; }

.parent-orgs__note {
  margin-top: 18px !important;
  padding: 12px 16px;
  background: var(--accent-soft, #eaf4fb);
  border-left: 3px solid var(--primary, #1a5276);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text-mid);
  line-height: 1.55;
}

/* ═══════════════════════════════════════════
   Single Department page (single-department.twig)
═══════════════════════════════════════════ */

.department-single__type {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary, #1a5276);
  background: var(--accent-soft, #eaf4fb);
  padding: 4px 10px;
  border-radius: 4px;
  margin: 0 0 12px;
}

.department-single__contacts {
  margin: 22px 0 28px;
  padding: 20px 22px;
  background: var(--white);
  border: 1px solid var(--border, #cad5e0);
  border-radius: var(--r, 8px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(6,52,98,.09));
}
.department-single__desc {
  font-size: var(--fs-base);
  color: var(--text-mid, #5a6c80);
  font-style: italic;
  margin: 0 0 16px;
  line-height: 1.55;
}
.department-single__facts {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
  margin: 0;
}
/* .department-single__facts dt/dd — объединены с .parent-org__facts dt/dd (см. Parent organizations) */
.department-single__facts dd a {
  color: var(--primary, #1a5276);
  text-decoration: none;
  font-weight: 500;
}
.department-single__facts dd a:hover { text-decoration: underline; }
.department-single__phones {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.department-single__internal {
  margin: 24px 0;
}
.department-single__internal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xs) var(--space-md);
}
@container (min-width: 480px) {
  .department-single__internal-list { grid-template-columns: repeat(2, 1fr); }
}
.department-single__internal-list li {
  font-size: var(--fs-base);
  line-height: 1.45;
  padding: 8px 12px;
  background: var(--white);
  border: 1px solid var(--border, #cad5e0);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.department-single__internal-name {
  color: var(--primary, #1a5276);
  text-decoration: none;
  font-weight: 500;
}
.department-single__internal-name:hover { text-decoration: underline; }
.department-single__internal-phone {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* Соседние отделения того же типа — боковая навигация */
.department-single__siblings {
  margin: var(--space-lg) 0 var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}
.department-single__siblings-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.department-single__siblings-list a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px;
  background: var(--bg-alt, #f4f7fa);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--text-mid);
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.department-single__siblings-list a:hover {
  border-color: var(--primary); color: var(--primary);
  background: #fff;
}
.department-single__siblings-list .mg-icon { color: var(--primary-light); font-size: var(--fs-base); }

/* ── Responsive ── */
@media (max-width: 980px) {
  /* .page-body .wrap, .leader-grid → mobile-first + CQ (Фаза 3+4) */
  .sidebar { order: 2; }
  /* .about-tiles → mobile-first + CQ (Фаза 4) */
  /* Edge-to-edge на мобильном: убираем «карточный» вид у article (negative margins удалены — Фаза 1, --wrap-gutter сам plавно меньше) */
  article.single-post.single-post--page {
    padding: var(--space-md) var(--space-sm);
    border-radius: 0;
    box-shadow: none;
  }
  /* .department-single__internal-list → mobile-first CQ (Фаза 4) */
  .department-single__facts { grid-template-columns: 1fr; gap: 2px 0; }
  .department-single__facts dt { margin-top: 8px; }
  .department-single__facts dt:first-child { margin-top: 0; }
  .parent-orgs .parent-org__facts { grid-template-columns: 1fr; gap: 2px 0; }
  .parent-orgs .parent-org__facts dt { margin-top: 8px; }
  .parent-orgs .parent-org__facts dt:first-child { margin-top: 0; }
}
@media (max-width: 640px) {
  /* .leader-grid, .about-tiles → mobile-first + CQ (Фаза 4) */
  .directors-list { grid-template-columns: 1fr; padding: var(--space-sm) !important; }
  .directors-list li:nth-last-child(2):nth-child(odd) { border-bottom: 1px dashed var(--border); }
  /* .about-section .sec-title, .about-hero .wp-block-heading теперь fluid через var(--fs-*) — overrides не нужны */
  .about-stats { padding: var(--space-xl) var(--space-md) !important; }
  .about-stats .stats-grid h3 { font-size: var(--fs-hero); }
  .about-hero { min-height: 180px !important; }
  .about-hero p { font-size: var(--fs-sm) !important; }
}

/* ═══════════════════════════════════════════
   Prices section — аккордеоны (wp:details) + таблицы
   (пилюли .prices-tabs/.prices-tab удалены — разметка их больше не выводит)
═══════════════════════════════════════════ */

.prices-note {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 4px 0 18px;
  font-style: italic;
}

/* Аккордеон-секция (wp:details) */
.prices-section {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--r, 8px);
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(6,52,98,.09));
  scroll-margin-top: 80px;   /* compensation для sticky compact-header */
}
.prices-section > summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: var(--fs-base);
  color: var(--primary);
  background: var(--accent-soft);
  list-style: none;
  user-select: none;
  transition: background var(--dur-fast);
}
.prices-section > summary:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--primary) 6%); }
.prices-section > summary::-webkit-details-marker { display: none; }
.prices-section > summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 10px;
  font-size: var(--fs-xs);
  color: var(--primary-light);
  transition: transform var(--dur);
}
.prices-section[open] > summary::before { transform: rotate(90deg); }
.prices-section[open] > summary { border-bottom: 1px solid var(--border); }

/* Контент внутри секции — паддинги для не-таблиц */
.prices-section > :not(summary) { padding: 16px 18px; }
.prices-section > .wp-block-table,
.prices-section > figure.wp-block-table { padding: 0; }

/* Таблицы внутри prices-section: fixed-layout + перенос русских слов через Hyphenopoly */
.prices-section .wp-block-table {
  margin: 0;
  overflow: visible;
  max-width: 100%;
}
.prices-section .wp-block-table table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.prices-section .wp-block-table th,
.prices-section .wp-block-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  text-wrap: pretty;
}
/* № п/п — узкая, цифры на одной строке */
.prices-section .wp-block-table td:first-child:not([colspan]),
.prices-section .wp-block-table th:first-child {
  width: 8%;
  min-width: 68px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow-wrap: normal;
}
/* Наименование услуг — основная колонка */
.prices-section .wp-block-table td:nth-child(2):not([colspan]),
.prices-section .wp-block-table th:nth-child(2) {
  width: 42%;
}
/* Ед. измерения */
.prices-section .wp-block-table td:nth-child(3):not([colspan]),
.prices-section .wp-block-table th:nth-child(3) {
  width: 13%;
}
.prices-section .wp-block-table thead th {
  background: var(--accent-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 2px solid var(--primary-light);
  /* консистентно с .prc: липкая шапка под compact-header */
  position: sticky;
  top: var(--thead-sticky-top);
  z-index: 1;
}
.prices-section .wp-block-table tbody tr:nth-child(even) { background: #fafcfe; }
.prices-section .wp-block-table tbody tr:hover { background: var(--accent-soft); }
.prices-section .wp-block-table tbody tr:last-child td { border-bottom: 0; }
/* Числовые колонки — выравнивание вправо, моноширинные цифры. Перенос разрешён для длинных заголовков шапки */
.prices-section .wp-block-table td:nth-child(n+4):not([colspan]) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

/* Mobile portrait: хинт «поверните устройство» + аварийный скролл (общие compact-правила ниже в @media 640px) */
@media (max-width: 640px) and (orientation: portrait) {
  .prices-section .wp-block-table::before {
    content: "↻ Поверните устройство — таблица содержит много колонок";
    display: block;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: var(--accent-soft);
    border-left: 3px solid var(--primary);
    color: var(--primary);
    font-size: var(--fs-sm);
    line-height: 1.4;
    border-radius: 4px;
  }
  .prices-section .wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prices-section .wp-block-table table { min-width: 640px; }
}

/* Контактный блок для hub и payment страниц */
.prices-contacts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 14px;
}
.prices-contacts__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: var(--r, 8px);
  border-left: 3px solid var(--primary);
}
.prices-contacts__ico { font-size: var(--fs-lg); line-height: 1.2; flex-shrink: 0; }
.prices-contacts__item strong {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.prices-contacts__item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.prices-contacts__item a:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 640px) {
  .prices-section .wp-block-table { font-size: var(--fs-xs); }
  .prices-section .wp-block-table th,
  .prices-section .wp-block-table td {
    padding: 6px 8px;
    border-right: 1px solid var(--border);
  }
  .prices-section .wp-block-table tr td:last-child { border-right: 0; }
  /* Колонка номеров на мобильном — фиксированная ширина, чтобы не слипалось с наименованием */
  .prices-section .wp-block-table td:first-child:not([colspan]),
  .prices-section .wp-block-table th:first-child {
    width: 72px;
    min-width: 72px;
    padding-right: 12px;
    background: #fafcfe;
  }
  .prices-section > summary { font-size: var(--fs-sm); padding: 10px 12px; }
  .prices-section > :not(summary) { padding: 12px 10px; }
  /* Контакты бухгалтерии — на мобильном в одну колонку (auto-fit с min 240 распирает контейнер) */
  .prices-contacts__grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   WIDE PAGES (page-wide.php template) — legacy
   оставлено на будущее, активно только при выборе шаблона «Широкая страница»
═══════════════════════════════════════════ */

.page-wide { display: block; background: var(--white); }
.page-template-page-wide-php .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* ═══════════════════════════════════════════
   СТРАНИЦА КОНТАКТОВ (contacts.twig)
═══════════════════════════════════════════ */
.page-body--contacts { padding: 32px 0 48px; }
/* Сброс общей сетки .page-body .wrap (1fr 300px для контент+сайдбар) —
   на контактах сайдбара нет, секции идут на всю ширину. */
.page-body--contacts .wrap { display: block; }

.contacts-head { margin-bottom: var(--space-lg); }
.contacts-head__title { font-size: var(--fs-2xl); font-weight: 700; color: var(--gov-dark); }
.contacts-head__lead { font-size: var(--fs-md); color: var(--text-mid); margin-top: 8px; max-width: 760px; line-height: 1.55; }

/* ── Адрес-инфо + карта ── */
.contacts-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
@media (min-width: 880px) { .contacts-top { grid-template-columns: 360px 1fr; } }

.contacts-info {
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  display: flex; flex-direction: column; gap: var(--space-sm);
}
.contacts-info__row { display: flex; gap: 12px; align-items: flex-start; }
.contacts-info__ico { font-size: var(--fs-lg); flex-shrink: 0; line-height: 1.3; }
.contacts-info__row > div { font-size: var(--fs-sm); color: var(--text-mid); line-height: 1.5; }
/* .contacts-info__row strong — объединён с .addr-item__txt strong (см. сайдбар «Адрес») */
.contacts-info__row a { color: var(--primary); font-weight: 500; }
.contacts-info__row a:hover { color: var(--primary-light); text-decoration: underline; }
.contacts-sched { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); margin-top: 4px; }
.contacts-sched tr:not(:last-child) td,
.contacts-sched tr:not(:last-child) th { border-bottom: 1px solid var(--border-light); }
.contacts-sched td, .contacts-sched th { padding: 4px 0; color: var(--text-mid); font-weight: 400; text-align: left; }
.contacts-sched td:last-child { text-align: right; font-weight: 600; color: var(--text); white-space: nowrap; padding-left: 10px; }

.contacts-map {
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden;
  display: flex; flex-direction: column;
}
.contacts-map .map-wrap { height: 100%; min-height: 320px; border-radius: 0; }

/* ── Секции ── */
.contacts-sec { margin-top: var(--space-xl); }

/* ── Телефонный справочник ── */
.phone-dir {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: var(--space-sm);
}
.phone-dir__card {
  background: var(--white); border: 1px solid var(--border-light);
  border-left: 3px solid var(--primary-light);
  border-radius: var(--r-sm); padding: 12px 14px;
  transition: box-shadow var(--dur), transform var(--dur);
}
.phone-dir__card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.phone-dir__label { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 4px; }
.phone-dir__num { font-size: var(--fs-md); font-weight: 700; color: var(--primary); display: inline-block; }
.phone-dir__num:hover { color: var(--primary-light); }
.phone-dir__hrs { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }

/* ── Приём граждан (таблица) ── */
.reception-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border-light); }
.reception-tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); background: var(--white); }
.reception-tbl thead th {
  background: var(--accent-soft); color: var(--primary);
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--primary-light);
}
.reception-tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border-light); color: var(--text); vertical-align: top; }
.reception-tbl tbody tr:last-child td { border-bottom: none; }
.reception-tbl tbody tr:hover { background: var(--accent-soft); }
.reception-tbl td:first-child { font-weight: 600; }
.contacts-note { font-size: var(--fs-sm); color: var(--text-mid); margin-top: 12px; line-height: 1.55; }
.contacts-note a { color: var(--primary); font-weight: 500; }
.contacts-note a:hover { text-decoration: underline; }

/* ── Горячие линии ── */
.hotline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--space-sm);
}
.hotline-card {
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: var(--r); padding: 18px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: var(--shadow-xs);
}
.hotline-card--accent { background: var(--gold-light); border-color: var(--gold); }
.hotline-card__ico { font-size: var(--fs-xl); line-height: 1; margin-bottom: 4px; }
.hotline-card__title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-mid); line-height: 1.35; }
.hotline-card__num { font-size: var(--fs-lg); font-weight: 800; color: var(--primary); margin-top: 2px; }
.hotline-card__num--sm { font-size: var(--fs-sm); font-weight: 700; }
.hotline-card__num:hover { color: var(--primary-light); text-decoration: underline; }
.hotline-card__hrs { font-size: var(--fs-xs); color: var(--text-muted); }

/* ── Контакты подразделений (ссылки) ── */
.contacts-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-sm);
}
.contacts-link {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 18px;
  transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur);
}
/* .contacts-link:hover — объединён с .about-tile:hover (см. About hub tiles) */
.contacts-link__ico { font-size: var(--fs-xl); flex-shrink: 0; }
.contacts-link__txt { flex: 1; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.4; }
.contacts-link__txt strong { display: block; color: var(--primary); font-size: var(--fs-base); font-weight: 700; margin-bottom: 2px; }
.contacts-link__arr { color: var(--primary-light); font-size: var(--fs-md); flex-shrink: 0; }

/* ── Мобильная адаптация таблицы приёма ── */
@media (max-width: 560px) {
  .reception-wrap { overflow-x: visible; border: none; }
  .reception-tbl, .reception-tbl thead, .reception-tbl tbody, .reception-tbl tr, .reception-tbl td { display: block; }
  .reception-tbl thead { display: none; }
  .reception-tbl tr {
    background: var(--white); border: 1px solid var(--border-light);
    border-radius: var(--r-sm); margin-bottom: 10px; padding: 6px 12px;
  }
  .reception-tbl td { border: none !important; padding: 5px 0; }
  .reception-tbl td::before {
    content: attr(data-th) ': '; font-weight: 700; color: var(--text-muted); font-size: var(--fs-xs);
  }
  .reception-tbl td:first-child::before { content: ''; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Прейскурант: таблицы услуг (.prc) + хаб категорий (HTMX-подгрузка)
   Фрагмент <table class="prc"> генерит ПРЕЙСКУРАНТЫ/export_site_tables.py
   ═══════════════════════════════════════════════════════════════════════════ */
.prc { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--fs-sm); }
.prc caption { caption-side: top; text-align: left; font-weight: 700; font-size: var(--fs-lg); color: var(--primary); padding: 4px 2px 12px; line-height: 1.25; }
/* На прямой странице категории caption повторяет H1 страницы слово в слово —
   прячем визуально (скринридеру остаётся). Только прямой ребёнок (>): на хабе
   таблица лежит глубже (внутри #price-view), там caption — единственный
   заголовок таблицы и должен быть виден. */
.single-post__content > .prc caption {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.prc th, .prc td { border: 1px solid var(--border); padding: 8px 10px; vertical-align: top; text-align: left; line-height: 1.35; overflow-wrap: break-word; hyphens: auto; }
.prc thead th { background: var(--primary); color: #fff; text-align: center; font-weight: 600; font-size: var(--fs-xs); position: sticky; top: var(--thead-sticky-top); z-index: 1; }
.prc tbody tr:nth-child(even) { background: var(--accent-soft); }
.prc tbody tr:hover { background: var(--accent); }
.prc .c-unit { text-align: center; }
.prc .c-num { text-align: right; }
.prc .c-price { text-align: right; font-weight: 700; }
/* Цвет — ТОЛЬКО на ячейках-данных, не на заголовках: иначе th получает цвет
   колонки (синий на синем фоне → невидим, серый «№» → плохо виден).
   nowrap на этих колонках нельзя: код «1.1.7.16.» шире узкой колонки наезжал
   на соседнюю ячейку. Ширину держит colgroup max(P%,Nch) из конвертера;
   break-word (выше) — последний рубеж для аномально длинного содержимого. */
.prc td.c-code { color: var(--text-muted); }
.prc td.c-price { color: var(--primary); }
.prc td.c-code, .prc td.c-num, .prc td.c-price { font-variant-numeric: tabular-nums; }
.prc tr.prc-section > th { background: var(--accent-soft); color: var(--primary); font-weight: 700; text-align: left; font-size: var(--fs-sm); }
.prc tr.prc-note > td { background: var(--gold-light); color: var(--text-muted); font-size: var(--fs-xs); font-style: italic; text-align: left; line-height: 1.4; }

/* Карточный режим до 820px: в диапазоне 641–820 fixed-таблица с узкими %-колонками
 * ломала заголовки по слогам — на планшете показываем карточки «метка: значение». */
@media (max-width: 820px) {
  .prc thead { position: absolute; left: -9999px; top: -9999px; }
  .prc, .prc tbody, .prc tr, .prc td { display: block; width: 100%; }
  .prc tr { margin: 0 0 12px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
  .prc tbody tr:nth-child(even) { background: #fff; }
  .prc td { border: 0; border-bottom: 1px solid var(--bg-alt); display: flex; justify-content: space-between; gap: 14px; text-align: right; padding: 9px 12px; }
  .prc td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); text-align: left; flex: 0 0 46%; }
  .prc td.c-name { background: var(--accent-soft); color: var(--primary); font-weight: 700; font-size: var(--fs-md); text-align: left; display: block; }
  .prc td.c-name::before { content: none; }
  .prc td[data-label=""] { text-align: left; }
  .prc td[data-label=""]::before { display: none; }
  .prc td.c-price { font-size: var(--fs-md); }
  .prc td:last-child { border-bottom: 0; }
  .prc tr.prc-section > th { display: block; background: var(--primary); color: #fff; border-radius: var(--r); }
  .prc tr.prc-note { display: block; }
  .prc tr.prc-note > td { display: block; border: 1px solid #f0e6c8; border-radius: var(--r); }
}

/* Хаб прейскуранта: плитки категорий + область просмотра */
.price-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; margin: 16px 0; }
.price-tile { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-sm); background: #fff; color: var(--primary); font-weight: 600; text-decoration: none; cursor: pointer; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.price-tile:hover, .price-tile.is-active { border-color: var(--primary-light); box-shadow: var(--shadow-sm); }
.price-tile.is-active { background: var(--accent-soft); }
.price-view { margin-top: 20px; min-height: 40px; scroll-margin-top: 80px; }
.price-view.htmx-request { opacity: .55; transition: opacity var(--dur); }

/* ── Cookie-уведомление (Закон РБ № 99-З) — низ экрана, поверх контента ── */
.cookie-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: var(--z-dropdown); background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: 0 6px 24px rgba(6,52,98,.18); transform: translateY(140%); opacity: 0; transition: transform var(--dur), opacity var(--dur); }
.cookie-banner.is-shown { transform: translateY(0); opacity: 1; }
.cookie-banner__body { max-width: 1200px; margin: 0 auto; padding: 14px 18px; display: flex; align-items: center; gap: 18px; }
.cookie-banner__text { margin: 0; font-size: var(--fs-base); line-height: 1.45; color: var(--text-mid); }
.cookie-banner__text a { color: var(--primary-light); }
.cookie-banner__actions { flex: none; display: flex; gap: 10px; flex-wrap: wrap; }

/* Кнопки cookie (баннер + диалог + плейсхолдер карты) */
.cookie-btn { padding: 9px 18px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); color: var(--text); font: inherit; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; transition: background var(--dur), border-color var(--dur); }
.cookie-btn--primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.cookie-btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.cookie-btn--ghost:hover { border-color: var(--primary); color: var(--primary); }

/* Диалог настроек cookie (нативный <dialog>) */
.cookie-dialog { max-width: 520px; width: calc(100% - 24px); padding: 0; border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: 0 12px 40px rgba(6,52,98,.28); color: var(--text); }
.cookie-dialog::backdrop { background: rgba(6,52,98,.45); }
.cookie-dialog__form { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.cookie-dialog__title { margin: 0; font-size: var(--fs-lg); }
.cookie-dialog__intro { margin: 0; font-size: var(--fs-sm); color: var(--text-mid); }
.cookie-opt { display: flex; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.cookie-opt input { margin-top: 3px; flex: none; }
.cookie-opt__txt { font-size: var(--fs-sm); color: var(--text-mid); line-height: 1.4; }
.cookie-opt__txt strong { display: block; color: var(--text); font-size: var(--fs-base); margin-bottom: 2px; }
.cookie-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* Плейсхолдер несогласия в .map-wrap — карта не загружена */
.map-consent { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; text-align: center; background: var(--bg); color: var(--text); }
.map-consent[hidden] { display: none; } /* author display:flex иначе бьёт UA [hidden]{display:none} → плейсхолдер не уходит, карта остаётся скрытой */
.map-consent__txt { margin: 0; max-width: 30em; font-size: var(--fs-base); line-height: 1.45; color: var(--text-mid); }
.map-consent__link { font-size: var(--fs-sm); color: var(--primary); font-weight: 600; }

.footer-cookie-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

@media (max-width: 640px) { .cookie-banner__body { flex-direction: column; align-items: stretch; gap: 12px; text-align: left; } .cookie-banner__actions { flex-direction: column; } .cookie-btn { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .cookie-banner { transition: none; } }
