/* Дизайн: навигатор для родителей (docs/design-concept.html).
   Бирюзовый основной, солнечный для акцентов, мятный и персиковый фоны, цвета направлений. */
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../fonts/nunito-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #fbfcfb;
  --surface: #ffffff;
  --tint: #f3f8f6;
  --border: #e3ecea;
  --text: #1b2b2a;
  --text-2: #3f4f4d;
  --muted: #5b6b69;
  --accent: #0e7c72;
  --accent-ink: #0a5f57;
  --accent-bg: #e3f3f0;
  --sun: #ffc53d;
  --sun-bg: #fff8e1;
  --sun-ink: #7c5a12;
  --success: #2e9e5b;
  --success-bg: #e6f5ec;
  --success-ink: #1f6b3f;
  --error: #b91c1c;
  --radius-s: 12px;
  --radius-m: 18px;
  --radius-l: 24px;
  --shadow: 0 6px 24px rgba(14, 124, 114, 0.12);
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* Цвет направления по умолчанию, переопределяется классами .cat-* */
  --cat: var(--accent);
  --cat-bg: var(--accent-bg);
  --cat-ink: var(--accent-ink);
}
.cat-sport { --cat: #e4572e; --cat-bg: #fdeee9; --cat-ink: #9a3412; }
.cat-dance { --cat: #d63384; --cat-bg: #fbe7f1; --cat-ink: #9d174d; }
.cat-tech  { --cat: #2f6fed; --cat-bg: #e7eefc; --cat-ink: #1e40af; }
.cat-art   { --cat: #8b5cf6; --cat-bg: #efe9fd; --cat-ink: #5b21b6; }
.cat-edu   { --cat: #2e9e5b; --cat-bg: #e6f5ec; --cat-ink: #1f6b3f; }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--bg);
}
img { max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 800; text-wrap: balance; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 0.92rem; }
.success { color: var(--success-ink); font-weight: 700; }
.error { color: var(--error); }
.hp { position: absolute; left: -9999px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container {
  max-width: 1180px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.section { padding-block: 40px 8px; display: flex; flex-direction: column; gap: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius-s); border: 2px solid transparent;
  font: 800 1rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: none; color: var(--accent); padding: 0 10px; }
.btn-lg { height: 56px; padding: 0 28px; font-size: 1.05rem; }
.btn svg { flex: 0 0 auto; }
a.button { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: var(--radius-s); background: var(--accent); color: #fff; font-weight: 800; text-decoration: none; }

/* Чипсы и теги */
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; }
.chips .label { color: var(--muted); font-size: 0.92rem; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-weight: 700; font-size: 0.92rem; text-decoration: none; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip.active { background: var(--cat); border-color: var(--cat); color: #fff; }
.chip .count { color: var(--muted); font-weight: 600; }
.chip.active .count { color: rgba(255,255,255,0.85); }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  background: var(--cat-bg); color: var(--cat-ink); text-decoration: none;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-s);
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.badge-ok { background: var(--success-bg); color: var(--success-ink); }
.badge-auto { background: var(--sun-bg); color: var(--sun-ink); }
.count { color: var(--muted); font-size: 0.88rem; font-weight: 600; }

/* Шапка */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.2rem; }
.brand:hover { color: var(--text); }
.city-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 20px;
  background: var(--tint); border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: 0.95rem; text-decoration: none;
}
.header-search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 14px;
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface); max-width: 460px;
}
.header-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: 600 0.95rem var(--font); color: var(--text); background: none; }
.header-search button { border: 0; background: none; padding: 6px; cursor: pointer; display: flex; color: var(--muted); }
.header-nav { display: flex; gap: 18px; align-items: center; margin-left: auto; font-weight: 700; font-size: 0.95rem; }
.header-nav a { text-decoration: none; }
.header-nav .btn { height: 40px; padding: 0 16px; border-color: var(--accent); color: var(--accent); background: none; font-size: 0.95rem; }

main { padding-bottom: 56px; display: block; }
.breadcrumbs { font-size: 0.88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs a { text-decoration: none; }
/* На цветной плашке раздела бирюзовый не добирает контраста 4.5:1. */
.band-text .breadcrumbs a { color: var(--accent-ink); }
.page-top { padding-block: 16px 0; }
.page-body { padding-block: 16px 0; display: flex; flex-direction: column; gap: 16px; }
.page-body > h1 { font-size: 2rem; }

/* Подвал */
.site-footer { background: var(--tint); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.footer-row { display: flex; gap: 12px 22px; flex-wrap: wrap; align-items: center; padding-block: 24px; }
.footer-row a { text-decoration: none; }
.footer-row p { flex: 1 1 100%; }

/* Страница города: первый экран */
.hero { background: var(--tint); }
.hero-inner { padding-block: 48px 40px; display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: 2.75rem; max-width: 820px; }
.hero .lead { font-size: 1.15rem; color: var(--text-2); max-width: 700px; }
.search-box {
  display: flex; flex-wrap: wrap; gap: 6px; background: var(--surface); padding: 8px; border-radius: var(--radius-m); box-shadow: var(--shadow);
}
.search-box label {
  display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; font-size: 0.75rem; font-weight: 700; color: var(--muted);
}
.search-box label + label { border-left: 1px solid var(--border); }
.search-box .grow { flex: 3 1 260px; }
.search-box .narrow { flex: 1 1 150px; }
.search-box input, .search-box select {
  border: 0; outline: 0; background: none; padding: 4px 0; font: 700 1rem var(--font); color: var(--text); width: 100%;
}
.search-box .btn { flex: 0 0 auto; height: 56px; }

/* Плитки направлений */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; min-height: 176px; border-radius: 20px;
  background: var(--cat-bg); color: var(--text); text-decoration: none; transition: transform .15s ease;
}
.tile:hover { transform: translateY(-2px); color: var(--text); }
.tile .tile-name { margin-top: auto; font-size: 1.1rem; font-weight: 800; line-height: 1.2; }
.tile .count { font-size: 0.88rem; }
.illu { color: var(--cat); display: block; }
.illu svg, .illu img { display: block; }

/* Возрастные карточки */
.ages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.age-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: var(--radius-m);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
}
.age-card:hover { border-color: var(--accent); color: var(--text); }
.age-card .age { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.age-card .hint { font-size: 0.88rem; color: var(--muted); }
.age-card .count { margin-top: auto; padding-top: 6px; color: var(--text); font-weight: 700; }

/* Популярные секции */
.subs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sub-link {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; min-width: 0;
}
.sub-link:hover { border-color: var(--cat); color: var(--text); }
.sub-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--cat-bg); color: var(--cat); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; }
.sub-icon img { width: 100%; height: 100%; object-fit: contain; }
.sub-icon:has(img) { background: none; width: 64px; }
.tile .illu img { margin: -6px 0 -6px -8px; }
.sub-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sub-text b { font-size: 1rem; }
.sub-text span { font-size: 0.82rem; color: var(--muted); }

/* Блок карты на странице города */
.map-band { display: flex; gap: 24px; flex-wrap: wrap; background: var(--sun-bg); border-radius: var(--radius-l); padding: 24px; }
.map-band-text { flex: 1 1 280px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.map-band-text p { color: var(--text-2); }
.map-band .mini-map { flex: 2 1 420px; height: 380px; margin: 0; min-width: 0; }

/* Блок доверия */
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.trust-item { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius-m); border: 1px solid var(--border); background: var(--surface); }
.trust-item b { display: block; margin-bottom: 4px; }
.trust-item p { font-size: 0.92rem; color: var(--muted); }
.trust-icon { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }

/* Заголовок раздела */
.band { background: var(--cat-bg); }
.band-inner { padding-block: 24px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.band-text { flex: 1 1 520px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.band h1 { font-size: 2.2rem; }
.band .lead { font-size: 1.05rem; color: var(--text-2); }
.band-illu { flex: 0 0 200px; height: 160px; border-radius: var(--radius-l); background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--cat); overflow: hidden; }
.band-illu img { width: 100%; height: 100%; object-fit: contain; }
.intro { color: var(--text-2); max-width: 820px; }
.intro p + p { margin-top: 10px; }

/* Строка фильтров */
.filter-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-block: 12px; }
.filters .field {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius-s); background: var(--surface); font-size: 0.88rem; color: var(--muted);
}
.filters select, .filters input[type=number] {
  border: 0; outline: 0; background: none; font: 700 0.95rem var(--font); color: var(--text); height: 100%;
}
.filters input[type=number] { width: 90px; }
.filters .check { display: flex; align-items: center; gap: 8px; height: 42px; font-weight: 700; font-size: 0.95rem; color: var(--text); }
.filters .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.filters .btn { height: 42px; }
.filters .reset { font-weight: 700; font-size: 0.92rem; }
.filters .found { margin-left: auto; color: var(--muted); font-size: 0.92rem; }

/* Список и карта раздела */
.listing { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; padding-block: 24px; }
.listing-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.listing-aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 8px; }
.listing-aside .mini-map { height: calc(100vh - 140px); max-height: 640px; min-height: 360px; margin: 0; }
.aside-close { display: none; }

/* Карточка организации */
.org-card { border: 1px solid var(--border); border-radius: 20px; padding: 20px 22px; background: var(--surface); display: flex; flex-direction: column; gap: 14px; }
.org-card-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.org-card-title { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.org-card h2, .org-card h3 { font-size: 1.3rem; }
.org-card h2 a, .org-card h3 a { color: var(--text); text-decoration: none; }
.org-card h2 a:hover, .org-card h3 a:hover { color: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fact { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-s); background: var(--tint); min-width: 0; }
.fact svg { flex: 0 0 auto; color: var(--accent); }
.fact span { display: flex; flex-direction: column; min-width: 0; }
.fact small { font-size: 0.75rem; color: var(--muted); }
.fact b { font-size: 0.95rem; line-height: 1.25; }
.prog-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 0.95rem; }
.prog-list li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 12px; }
.prog-list b { font-weight: 700; }
.prog-list span { color: var(--text-2); }
.more-link { font-weight: 700; font-size: 0.92rem; align-self: flex-start; }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.card-actions .push { margin-left: auto; }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius-m); }

.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding-block: 10px; }
.pagination a, .pagination .current {
  min-width: 42px; height: 42px; padding: 0 12px; border-radius: var(--radius-s); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700;
}
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Вопросы и ответы */
.faq { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.faq details { border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; background: var(--surface); }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin-top: 10px; color: var(--text-2); }

/* Нижняя панель на телефоне */
.mobile-bar { display: none; }

/* Страница организации */
.org-hero { padding-block: 20px 8px; display: flex; flex-direction: column; gap: 14px; }
.org-hero h1 { font-size: 2.2rem; }
.org-hero .description { color: var(--text-2); max-width: 820px; font-size: 1.05rem; }
.contact-row { display: flex; gap: 10px; flex-wrap: wrap; }
.contact-row .phone-number { font-variant-numeric: tabular-nums; }
.notice { background: var(--sun-bg); border-radius: var(--radius-s); padding: 12px 16px; font-size: 0.92rem; color: var(--sun-ink); }
.venue { border: 1px solid var(--border); border-radius: 20px; padding: 18px 20px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.venue h3 { display: flex; gap: 8px; align-items: center; }
.programs-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.programs-table th, .programs-table td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--border); vertical-align: top; }
.programs-table th { color: var(--muted); font-weight: 700; font-size: 0.85rem; border-top: 0; }
.programs-table .muted { font-size: 0.85rem; }
.nearby { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nearby a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.nearby a:hover { border-color: var(--accent); color: var(--text); }
.nearby span { font-size: 0.85rem; color: var(--muted); }
.report details { border: 1px solid var(--border); border-radius: var(--radius-m); padding: 14px 18px; background: var(--surface); }
.report summary { font-weight: 800; cursor: pointer; font-size: 1.05rem; }
.report form { margin-top: 14px; }

/* Формы */
.form, .report form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.form label, .report label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.form input, .form textarea, .form select, .report input, .report textarea, .report select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-s); font: 600 1rem var(--font); color: var(--text); background: var(--surface);
}
.form button, .report button { align-self: flex-start; height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius-s); background: var(--accent); color: #fff; font: 800 1rem var(--font); cursor: pointer; }

/* Простые страницы и старые списки ссылок */
.prose { max-width: 760px; display: flex; flex-direction: column; gap: 12px; padding-block: 16px; }
.prose h2 { margin-top: 16px; }
.link-grid, .link-row { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.link-grid li { flex: 1 1 220px; }
.page-title { padding-block: 16px; display: flex; flex-direction: column; gap: 8px; }
/* Карта */
.map-layout { display: flex; gap: 16px; height: calc(100vh - 220px); min-height: 480px; }
.map-filters { width: 320px; min-width: 260px; border-radius: var(--radius-m); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 0.9rem; }
.map-filters fieldset { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 4px; }
.map-filters legend { font-weight: 600; margin-bottom: 4px; }
.map-filters select, .map-filters input[type=search] { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; }
#map { flex: 1; border-radius: var(--radius-m); border: 1px solid var(--border); }
.map-item { display: block; padding: 8px; border-top: 1px solid var(--border); text-decoration: none; color: var(--text); }
.map-item:hover { background: var(--bg); }
.mini-map { height: 380px; border-radius: var(--radius-m); background: var(--tint); border: 1px solid var(--border); margin: 0 0 8px; }
.listing-map { margin: 0 0 16px; }
.listing-map p { margin: 0; font-size: 0.9rem; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mini-map-city { height: 440px; }
/* Яндекс.Карты: свои метки, кластеры, попап и зум (map-yandex.js) */
.ymap-pin { position: absolute; width: 18px; height: 18px; transform: translate(-9px, -18px); cursor: pointer; }
.ymap-cluster { position: absolute; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 13px/1 var(--font); color: var(--text); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ymap-cluster-small { background: rgba(198, 231, 207, .95); }
.ymap-cluster-medium { background: rgba(255, 197, 61, .95); }
.ymap-cluster-large { background: rgba(244, 160, 120, .95); }
.ymap-popup { position: absolute; transform: translate(-50%, calc(-100% - 24px)); width: max-content; max-width: 280px; background: #fff; color: var(--text); border-radius: 8px; padding: 10px 28px 10px 12px; font-size: 0.85rem; line-height: 1.4; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.ymap-popup::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.ymap-popup-close { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }
.map-failed { background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='40'%3E%3Ctext x='100' y='25' text-anchor='middle' font-family='sans-serif' font-size='14' fill='%2364748b'%3EКарта недоступна%3C/text%3E%3C/svg%3E") center no-repeat; }
.ymap-zoom { position: absolute; top: 10px; left: 10px; z-index: 5; display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ymap-zoom button { width: 32px; height: 32px; border: 0; background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: var(--text); }
.ymap-zoom button + button { border-top: 1px solid var(--border); }
.ymap-zoom button:hover { background: var(--bg); }
.pin span { display: block; width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }


/* Адаптив */
@media (max-width: 1080px) {
  .tiles, .ages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .subs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .listing { grid-template-columns: minmax(0, 1fr); }
  /* Карта раздела на узком экране открывается поверх страницы кнопкой «Карта». */
  .listing-aside { display: none; }
  .listing-aside.open {
    display: flex; position: fixed; inset: 0; z-index: 50; background: var(--surface);
    padding: calc(env(safe-area-inset-top, 0px) + 12px) max(12px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 12px) max(12px, env(safe-area-inset-left, 0px));
  }
  .listing-aside.open .mini-map { flex: 1; height: auto; max-height: none; }
  .listing-aside.open .aside-close { display: inline-flex; align-self: flex-end; }
  .mobile-bar {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 12px) max(16px, env(safe-area-inset-left, 0px));
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .mobile-bar .btn { flex: 1; height: 48px; }
  body.has-mobile-bar main { padding-bottom: 96px; }
  .nearby { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  h1, .hero h1 { font-size: 1.8rem; }
  .band h1, .org-hero h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }
  .hero-inner { padding-block: 28px 28px; }
  .header-row { gap: 10px; }
  .header-search { order: 5; flex-basis: 100%; max-width: none; }
  .header-nav { gap: 12px; }
  .header-nav .hide-sm { display: none; }
  .search-box label + label { border-left: 0; border-top: 1px solid var(--border); }
  .search-box label { flex-basis: 100%; }
  .search-box .btn { flex-basis: 100%; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { min-height: 140px; padding: 14px; }
  .ages { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .subs, .trust, .nearby { grid-template-columns: minmax(0, 1fr); }
  .band-illu { display: none; }
  .band-inner { padding-block: 18px; }
  .chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filters .field { flex: 1 1 140px; }
  .filters .found { margin-left: 0; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .fact { padding: 8px 10px; }
  .prog-list li { grid-template-columns: minmax(0, 1fr); }
  .org-card { padding: 16px; }
  .card-actions .btn { flex: 1 1 auto; }
  .card-actions .push { margin-left: 0; }
  .map-band { padding: 16px; }
  .map-band .mini-map { height: 300px; flex-basis: 100%; }
  .programs-table thead { display: none; }
  .programs-table td { display: block; border-top: 0; padding: 2px 0; }
  .programs-table tr { display: block; border-top: 1px solid var(--border); padding: 10px 0; }
  .programs-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
  .tile:hover { transform: none; }
}

/* Админка */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--surface); }
.admin-table th, .admin-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { color: var(--muted); font-weight: 600; }
.admin-table .hidden-row { opacity: 0.55; }
.admin-form { max-width: 720px; }
.admin-form .check-row { border: 0; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.admin-form .check-row legend { font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
button.small { padding: 4px 10px; font-size: 0.85rem; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; cursor: pointer; }
button.danger { padding: 6px 12px; border: 1px solid var(--error); color: var(--error); background: var(--surface); border-radius: 6px; cursor: pointer; margin-top: 12px; }
pre.json, pre.message { white-space: pre-wrap; font-size: 0.8rem; margin: 0; font-family: inherit; }

/* ---------- Главная: карта городов, карточки городов, «Другие города» ---------- */
.hero-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero-text .search-box .narrow { flex: 1 1 140px; }
.hero-map { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hero-map .mini-map { height: 420px; margin: 0; border-radius: var(--radius-l); box-shadow: var(--shadow); }
.map-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--muted); }
.map-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

.city-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.city-card {
  display: flex; flex-direction: column; gap: 14px; padding: 20px; color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.city-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); color: var(--text); }
.city-card-head { display: flex; flex-direction: column; gap: 2px; }
.city-card-head b { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.city-card-head span { font-size: 0.88rem; color: var(--muted); }
.city-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.92rem; color: var(--text-2); }
.city-stats b { color: var(--text); font-weight: 800; }
.city-cats { display: flex; gap: 6px; }
.city-cat { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--cat-bg); color: var(--cat); }
.city-card .more-link { margin-top: auto; }

.other-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.other-head h2 { margin: 0; }
.other-head p { color: var(--text-2); max-width: 760px; }
.regions { columns: 4 220px; column-gap: 28px; }
.region { break-inside: avoid; padding-bottom: 18px; }
.region h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; font-weight: 700; }
.region ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.region li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.region a { font-weight: 700; }
.region .count { font-size: 0.85rem; color: var(--muted); }
.region .soon { color: var(--text-2); }
.region .add { font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.region .add::before { content: "+ "; }

@media (max-width: 960px) {
  .hero-split { grid-template-columns: minmax(0, 1fr); }
  .hero-map .mini-map { height: 320px; }
}
@media (max-width: 720px) {
  .regions { columns: 2 150px; column-gap: 16px; }
}

/* ---------- Телефон: меню в шапке, свёрнутые фильтры, компактные карточки, карта на первом экране ---------- */
.menu-sm { display: none; position: relative; }
.filters-toggle { display: none; }
.map-filter-box summary { display: none; }
@media (max-width: 720px) {
  .menu-sm { display: block; }
  .menu-sm summary { list-style: none; cursor: pointer; width: 40px; height: 40px; display: grid; place-content: center; gap: 4px; border-radius: var(--radius-s); }
  .menu-sm summary::-webkit-details-marker { display: none; }
  .menu-sm summary span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--text); }
  .menu-sm[open] summary { background: var(--tint); }
  .menu-sm-list {
    position: absolute; right: 0; top: 46px; z-index: 60; min-width: 220px; display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); box-shadow: var(--shadow); padding: 6px;
  }
  .menu-sm-list a { padding: 12px 14px; border-radius: var(--radius-s); color: var(--text); font-weight: 700; }
  .menu-sm-list a:hover { background: var(--tint); }

  .filters-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; border: 0; background: none;
    font: 800 0.98rem var(--font); color: var(--text); cursor: pointer; text-align: left;
  }
  .filters-toggle svg { color: var(--accent); }
  .filters-toggle .found { margin-left: auto; font-weight: 600; font-size: 0.9rem; color: var(--muted); }
  .filter-bar:not(.open) .filters { display: none; }
  .filter-bar.open .filters { padding-top: 0; }
  .filter-bar .filters .found { display: none; }
  .filters .field { flex: 1 1 100%; white-space: nowrap; }
  .header-nav { margin-left: auto; }
  .city-pill { padding-inline: 10px; }
  .filters input[type=number] { width: 100%; }
  .filters .btn { flex: 1 1 auto; }

  /* Факты карточки строками без плашек: карточка короче почти вдвое. */
  .facts { gap: 4px; }
  .fact { background: none; padding: 2px 0; gap: 8px; }
  .fact span { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
  .fact small { font-size: 0.85rem; }
  .fact small::after { content: ":"; }
  .org-card { gap: 10px; }

  /* Полная карта: поиск и свёрнутые фильтры сверху, карта на первом экране, список ниже. */
  .map-layout { display: flex; flex-direction: column; height: auto; min-height: 0; gap: 10px; }
  .map-filters { display: contents; }
  .map-filters > * { order: 1; }
  #map-search { order: 1; width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-s); margin: 0; }
  .map-filter-box { order: 2; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 0 12px; }
  .map-filter-box summary { display: flex; align-items: center; gap: 8px; min-height: 46px; font-weight: 800; cursor: pointer; list-style: none; }
  .map-filter-box summary::-webkit-details-marker { display: none; }
  .map-filter-box summary svg { color: var(--accent); }
  .map-filter-box[open] { padding-bottom: 12px; }
  #map { order: 3; height: calc(100svh - 230px); min-height: 360px; flex: none; }
  #map-count { order: 4; }
  #map-list { order: 5; }
}
