/* Удобство карт на телефоне и в панели фильтров (js/map-ux.js). Подключается после css/map-nm.css во всех картах.
   1) крупные зоны нажатия на сенсорных экранах;
   3) «Только эта» у категорий и пресеты фильтров;
   4) переход карта ↔ база данных (полоса «Карта | База» и «← К записи»). */

/* ---------- 1. Зоны нажатия: палец ~44 px ---------- */
@media (pointer: coarse) {
    html[data-game] .filter-item { min-height: 44px; }
    html[data-game] .filter-locate, html[data-game] .bp-only { flex-basis: 44px; width: 44px; height: 44px; }
    html[data-game] .group-toggle { min-height: 36px; padding: 6px 14px; font-size: 12px; }
    html[data-game] .btn-group button, html[data-game] .add-marker-btn, html[data-game] .bp-more-btn { min-height: 44px; }
    html[data-game] .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
    html[data-game] .leaflet-bar a span, html[data-game] .leaflet-bar a svg { transform: scale(1.15); }
    html[data-game] .leaflet-popup a.leaflet-popup-close-button { width: 40px; height: 40px; top: 8px; right: 8px; }
    html[data-game] .leaflet-popup [class*="-done-btn"], html[data-game] .leaflet-popup .bp-flag { min-height: 44px; }
    /* стрелки «‹ ›» — круг 40×40 (не min-height: ширина 36 тянула их в овал); строка не заходит под крестик 40 px */
    html[data-game] .leaflet-popup .ms-btn { width: 40px; height: 40px; min-height: 0; }
    html[data-game] .leaflet-popup .ms-nav { margin-right: 38px; }
    html[data-game] .bp-more-menu button, html[data-game] .bp-more-menu .bp-keys-link { min-height: 44px; }
    html[data-game] #sidebar select, html[data-game] #sidebar input[type="search"], html[data-game] #sidebar input[type="text"] { min-height: 44px; }
}

/* ---------- 3. «Только эта» и пресеты ---------- */
html[data-game] .filter-row { align-items: center; }
html[data-game] .bp-only {
    flex: 0 0 34px; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--sp-btn); color: var(--sp-muted); box-shadow: var(--sp-btn-sh); transition: box-shadow .2s, color .2s, transform .15s;
}
html[data-game] .bp-only svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
html[data-game] .bp-only:hover { color: var(--sp-accent); box-shadow: var(--sp-btn-sh-up); transform: translateY(-1px); }
html[data-game] .bp-only:active, html[data-game] .bp-only.is-on { box-shadow: var(--sp-press); transform: none; }
html[data-game] .bp-only.is-on { color: var(--sp-accent); }
html[data-game] .bp-only:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }

.bp-presets { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 2px; }
.bp-presets[hidden] { display: none; }
.bp-presets-l { flex: 1 1 100%; margin: 0; color: var(--sp-muted); font: 600 11px/1.2 var(--font-body, inherit); letter-spacing: .08em; text-transform: uppercase; }
.bp-chip {
    min-height: 34px; padding: 6px 14px; border: 0; border-radius: var(--radius-full); cursor: pointer;
    background: var(--sp-btn); color: var(--sp-text); box-shadow: var(--sp-btn-sh); font: 600 12.5px var(--font-body, inherit);
    transition: box-shadow .2s, color .2s, transform .15s;
}
.bp-chip:hover { color: var(--sp-accent); box-shadow: var(--sp-btn-sh-up); transform: translateY(-1px); }
.bp-chip[aria-pressed="true"] { background: var(--sp-base); color: var(--sp-accent); box-shadow: var(--sp-press); transform: none; }
.bp-chip:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }
@media (pointer: coarse) { .bp-chip { min-height: 44px; padding: 8px 16px; font-size: 13.5px; } }

/* ---------- 4. Карта ↔ база данных ---------- */
.bp-seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-full); background: var(--sp-base); box-shadow: var(--sp-press); }
.bp-seg a, .bp-seg span {
    flex: 1 1 0; min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--radius-full);
    font: 600 13px var(--font-body, inherit); text-decoration: none; color: var(--sp-muted);
}
.bp-seg a:hover, .bp-seg a:focus-visible { color: var(--sp-accent); }
.bp-seg [aria-current="page"] { background: var(--sp-btn); color: var(--sp-text); box-shadow: var(--sp-btn-sh); }
.bp-seg svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 10px; color: var(--sp-muted); font: 500 12px/1.3 var(--font-body, inherit); }
.bp-crumbs a { color: var(--sp-muted); text-decoration: none; }
.bp-crumbs a:hover, .bp-crumbs a:focus-visible { color: var(--sp-accent); }
.bp-crumbs b { color: var(--sp-text); font-weight: 600; }
@media (pointer: coarse) { .bp-crumbs a { padding: 8px 2px; } }
#sidebar .bp-nav { padding: 14px 16px 0; margin: 0; }

/* «← К записи» — возврат в базу после «На карте» */
.bp-back-db {
    position: fixed; z-index: 1099; left: 50%; top: 62px; transform: translateX(-50%); max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 8px 16px; border-radius: var(--radius-full); background: var(--sp-btn); color: var(--sp-text); box-shadow: var(--sp-btn-sh), var(--sp-float-lift);
    font: 600 13px var(--font-body, inherit); text-decoration: none; white-space: nowrap;
}
.bp-back-db span { overflow: hidden; text-overflow: ellipsis; }
.bp-back-db:hover, .bp-back-db:focus-visible { color: var(--sp-accent); }
.bp-back-db button { all: unset; cursor: pointer; padding: 4px 6px; margin-right: -6px; color: var(--sp-muted); font-size: 16px; line-height: 1; }
@media (min-width: 1101px) { .bp-back-db { left: calc(50% + var(--sidebar-width, 380px) / 2); } }
.bp-focus .bp-back-db { display: none; }
/* положение кнопок над картой — в css/map-base.css */

/* ---------- 5. Компактная панель (js/map-ux.js, compactSidebar; класс html.bp-sb) ----------
   Шапка — компактный логотип; выбор карты сверху; поиск закреплён; прогресс одной строкой;
   действия в одну строку; наборы — одной прокручиваемой строкой; категории «иконка · название · найдено/всего». */
/* единый каркас: панель не прокручивается, прокрутка — только .scroll-body (js оборачивает, где его не было) */
html.bp-sb[data-game] #sidebar { display: flex; flex-direction: column; overflow: hidden; }
html.bp-sb[data-game] #sidebar > .scroll-body {
    flex: 1 1 auto; min-height: 0; margin: 0; padding: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--sp-text) 22%, transparent) transparent;
}
html.bp-sb[data-game] #sidebar > .scroll-body::-webkit-scrollbar { width: 8px; }
html.bp-sb[data-game] #sidebar .scroll-body > * { flex-shrink: 0; } /* колонка с прокруткой не сжимает блоки (наборы с overflow-x) */

/* шапка: одна высота логотипа во всех играх (56 px), картинки и текст вписаны по высоте */
html.bp-sb[data-game] #sidebar .sidebar-header {
    display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 8px 16px 4px; border: 0; background: none;
}
html.bp-sb[data-game] #sidebar .sidebar-header::before, html.bp-sb[data-game] #sidebar .sidebar-header::after { display: none; }
html.bp-sb[data-game] #sidebar .sidebar-header > * { flex-shrink: 0; }
html.bp-sb[data-game] #sidebar .header-top-row { display: flex; height: 48px; gap: 10px; align-items: center; justify-content: flex-start; overflow: hidden; }
html.bp-sb[data-game] #sidebar .header-top-row h1 {
    display: flex; flex-direction: row; align-items: center; gap: 8px; height: 100%; min-width: 0; margin: 0; line-height: 1.1;
}
html.bp-sb[data-game] #sidebar .header-top-row h1 > a, html.bp-sb[data-game] #sidebar .header-top-row .brand { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; margin: 0; height: 100%; min-width: 0; }
html.bp-sb[data-game] #sidebar .header-top-row :is(.logo-top, .logo-sub), html.bp-sb[data-game] #sidebar .header-top-row h1 > span:not([class]),
html.bp-sb[data-game] #sidebar .header-top-row .brand > span { display: none; }
html.bp-sb[data-game] #sidebar .header-top-row .logo-main { font-size: 22px; line-height: 1.1; margin: 0; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.bp-sb[data-game] #sidebar .header-top-row :is(img, .logo-title, .header-banner) {
    display: block; height: auto; max-height: 40px; width: auto; max-width: 100%; aspect-ratio: auto; object-fit: contain; object-position: left center; margin: 0;
}
html.bp-sb[data-game] #sidebar .header-top-row .logo-medal { transform: scale(.6); transform-origin: left center; margin: -12px -14px -12px 0; }
/* «Карта | База данных» — всегда сразу под логотипом, одной высоты */
html.bp-sb[data-game] #sidebar .bp-nav { padding: 4px 16px 0; margin: 0; }
html.bp-sb[data-game] #sidebar .bp-seg a, html.bp-sb[data-game] #sidebar .bp-seg span { min-height: 32px; font-size: 12.5px; }
@media (pointer: coarse) { html.bp-sb[data-game] #sidebar .bp-seg :is(a, span) { min-height: 44px; } }

/* выбор карты и зоны — одинаковые выпадающие списки 44 px */
html.bp-sb[data-game] #sidebar .bp-sb-maps { display: grid; gap: 6px; padding: 8px 16px 0; }
html.bp-sb[data-game] #sidebar :is(.bp-sb-maps .section-label:not(.bp-sb-label), .bp-zone-src) { display: none; }
html.bp-sb[data-game] #sidebar .bp-sb-maps :is(.map-switch, #zone-block) { position: static; display: block; margin: 0; padding: 0; min-height: 0; }
html.bp-sb[data-game] #sidebar .bp-sb-maps #zone-block[hidden] { display: none; }
html.bp-sb[data-game] #sidebar .bp-sb-maps .map-switch::after { display: none; }
html.bp-sb[data-game] #sidebar .bp-sb-maps select {
    -webkit-appearance: none; appearance: none; display: block; box-sizing: border-box; width: 100%; height: 44px; min-height: 44px; margin: 0;
    padding: 0 40px 0 14px; border: 0; border-radius: var(--sp-r-sm, 12px); cursor: pointer; text-align: left; text-transform: none; letter-spacing: 0;
    color: var(--sp-text); font: 600 14px/1.2 var(--font-body, inherit); box-shadow: var(--sp-btn-sh);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3b5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 16px 16px no-repeat, var(--sp-btn);
}
html.bp-sb[data-game] #sidebar .bp-sb-maps select:hover { color: var(--sp-accent); }
html.bp-sb[data-game] #sidebar .bp-sb-maps select:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }
html.bp-sb[data-game] #sidebar .bp-sb-maps .bp-zone-select { font-weight: 500; }

/* поиск: закреплён у верхнего края прокрутки, поле 44 px */
html.bp-sb[data-game] #sidebar .bp-sb-search {
    position: sticky; top: 0; z-index: 6; margin: 0; padding: 8px 16px 6px;
    background: var(--sp-base);
}
html.bp-sb[data-game] #sidebar .bp-sb-search input { display: block; width: 100%; box-sizing: border-box; height: 44px; min-height: 44px; margin: 0; }
html.bp-sb[data-game] #sidebar .section { padding: 2px 16px 8px; gap: 8px; }

/* «Дополнительные фильтры» (особые фильтры игры) */
html.bp-sb[data-game] #sidebar .bp-sb-more { border-radius: var(--sp-r-sm, 12px); background: var(--sp-card); box-shadow: var(--sp-card-sh); }
html.bp-sb[data-game] #sidebar .bp-sb-more[hidden] { display: none; }
html.bp-sb[data-game] #sidebar .bp-sb-more > summary {
    display: flex; align-items: center; min-height: 40px; padding: 0 12px; cursor: pointer; list-style: none; color: var(--sp-text); font: 600 12.5px var(--font-body, inherit);
}
html.bp-sb[data-game] #sidebar .bp-sb-more > summary::-webkit-details-marker { display: none; }
html.bp-sb[data-game] #sidebar .bp-sb-more > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border: solid var(--sp-muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
html.bp-sb[data-game] #sidebar .bp-sb-more[open] > summary::after { transform: rotate(-135deg); }
html.bp-sb[data-game] #sidebar .bp-sb-more > :not(summary) { margin: 0 12px 10px; }
html.bp-sb[data-game] #sidebar .bp-sb-more .search-hint { font-size: 11.5px; }
@media (pointer: coarse) { html.bp-sb[data-game] #sidebar .bp-sb-more > summary { min-height: 44px; } }

/* прогресс одной строкой и тонкая полоса */
html.bp-sb[data-game] #sidebar .bp-sb-prog { padding: 8px 12px; display: grid; gap: 6px; }
html.bp-sb[data-game] #sidebar .bp-sb-prog :is(.progress-head, .progress-count) { display: none; }
html.bp-sb[data-game] #sidebar .bp-prog-line { color: var(--sp-text); font: 600 13px/1.3 var(--font-body, inherit); font-variant-numeric: tabular-nums; }
html.bp-sb[data-game] #sidebar .bp-sb-prog .progress-track { height: 4px; margin: 0; }
html.bp-sb[data-game] #sidebar .bp-prog-note { color: var(--sp-muted); font: 500 11.5px/1.3 var(--font-body, inherit); }
html.bp-sb[data-game] #sidebar .bp-prog-note[hidden] { display: none; }
html.bp-sb[data-game] #sidebar .region-progress > summary { min-height: 34px; padding-block: 6px; font-size: 12.5px; }

/* действия: [Показать/Скрыть все] [Скрыть найденные] [＋] [⋯] */
html.bp-sb[data-game] #sidebar .btn-group.bp-sb-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
html.bp-sb[data-game] #sidebar .bp-sb-actions > button { box-sizing: border-box; flex: 1 1 0; min-width: 0; height: 40px; min-height: 40px; padding: 6px 8px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.bp-sb[data-game] #sidebar .bp-sb-actions > button[hidden] { display: none; }
html.bp-sb[data-game] #sidebar .bp-sb-actions .bp-act-row { display: contents; }
html.bp-sb[data-game] #sidebar .bp-sb-actions .add-marker-btn:not(.active) { flex: 0 0 40px; width: 40px; min-height: 40px; padding: 0; font-size: 0; letter-spacing: 0; position: relative; overflow: hidden; } /* значок — абсолютно по центру: скрытый текст кнопки (интервалы, строки) его не сдвигает */
/* значки рисуются маской/SVG, а не символом шрифта: геометрический центр кнопки, без сдвига метриками шрифта */
html.bp-sb[data-game] #sidebar .bp-sb-actions .add-marker-btn:not(.active)::before { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v16M4 12h16' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v16M4 12h16' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
html.bp-sb[data-game] #sidebar .bp-sb-actions :is(.add-marker-btn:not(.active), .bp-more-btn) { line-height: 0; padding: 0; }
html.bp-sb[data-game] #sidebar .bp-sb-actions .bp-more { display: flex; }
html.bp-sb[data-game] #sidebar .bp-sb-actions .bp-more-btn svg { display: block; margin: 0; }
html.bp-sb[data-game] #sidebar .bp-sb-actions .add-marker-btn.active { order: 9; flex: 1 1 100%; height: auto; min-height: 40px; font-size: 12.5px; }
html.bp-sb[data-game] #sidebar .bp-sb-actions .bp-more { flex: 0 0 40px; }
html.bp-sb[data-game] #sidebar .bp-sb-actions .bp-more-btn { width: 40px; height: auto; min-height: 40px; flex: 1 1 auto; }
html.bp-sb[data-game] #sidebar .bp-sb-actions > button { white-space: normal; line-height: 1.15; text-overflow: clip; } /* длинная подпись переносится, а не обрезается */
@media (pointer: coarse) {
    html.bp-sb[data-game] #sidebar .bp-sb-actions > button, html.bp-sb[data-game] #sidebar .bp-sb-actions .bp-more-btn { height: 44px; min-height: 44px; }
    html.bp-sb[data-game] #sidebar .bp-sb-actions .add-marker-btn:not(.active), html.bp-sb[data-game] #sidebar .bp-sb-actions .bp-more { flex-basis: 44px; width: 44px; }
    html.bp-sb[data-game] #sidebar .bp-sb-actions .bp-more-btn { width: 44px; }
}

/* быстрые наборы: одна строка с прокруткой; «Сбросить фильтры» — первой */
html.bp-sb[data-game] .bp-presets { flex-shrink: 0; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 6px 16px 2px; scrollbar-width: none; overscroll-behavior-x: contain; }
html.bp-sb[data-game] .bp-presets::-webkit-scrollbar { display: none; }
html.bp-sb[data-game] .bp-presets .bp-chip { flex: 0 0 auto; min-height: 30px; padding: 4px 12px; font-size: 12px; white-space: nowrap; }
html.bp-sb[data-game] .bp-presets .bp-chip-reset { color: var(--sp-accent); }
@media (pointer: coarse) { html.bp-sb[data-game] .bp-presets .bp-chip { min-height: 40px; } }

/* категории: иконка → название → найдено/всего; «Подсветить» и «Только эта» — в меню «⋯» */
html.bp-sb[data-game] #filters-container .filter-group-title { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
html.bp-sb[data-game] #filters-container .bp-gcol {
    all: unset; flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--sp-muted); cursor: pointer;
}
html.bp-sb[data-game] #filters-container .bp-gcol svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
html.bp-sb[data-game] #filters-container .bp-gcol:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 1px; }
html.bp-sb[data-game] #filters-container .filter-group.is-collapsed .bp-gcol svg { transform: rotate(-90deg); }
html.bp-sb[data-game] #filters-container .filter-group.is-collapsed .filter-row { display: none; }
html.bp-sb[data-game] #sidebar:has(#search-input:not(:placeholder-shown)) .filter-group.is-collapsed .filter-row { display: flex; } /* при поиске видно всё */
html.bp-sb[data-game] #filters-container .filter-row { flex-wrap: wrap; gap: 4px; position: relative; }
html.bp-sb[data-game] #filters-container .filter-item { flex: 1 1 0; min-width: 0; min-height: 36px; padding-block: 5px; }
html.bp-sb[data-game] #filters-container .filter-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.bp-sb[data-game] #filters-container .filter-name > i { flex-shrink: 0; } /* иконка категории не сжимается (пустые <i> с фоном схлопывались в 0) */
html.bp-sb[data-game] #filters-container .filter-row > .bp-ra { display: none; }
html.bp-sb[data-game] #filters-container .filter-row > .bp-ra.is-on { display: grid; flex: 0 0 28px; width: 28px; height: 28px; } /* включённая подсветка/«только эта» видна всегда */
html.bp-sb[data-game] #filters-container .bp-rm {
    all: unset; order: 3; flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--sp-muted); cursor: pointer; opacity: .55;
}
html.bp-sb[data-game] #filters-container .bp-rm svg { width: 16px; height: 16px; fill: currentColor; }
html.bp-sb[data-game] #filters-container .filter-row:hover .bp-rm, html.bp-sb[data-game] #filters-container .bp-rm:focus-visible, html.bp-sb[data-game] #filters-container .bp-rm[aria-expanded="true"] { opacity: 1; color: var(--sp-accent); }
html.bp-sb[data-game] #filters-container .bp-rm:focus-visible { outline: 2px solid var(--sp-accent); }
@media (pointer: coarse) {
    html.bp-sb[data-game] #filters-container .bp-rm { flex-basis: 44px; width: 44px; height: 44px; opacity: .8; }
    html.bp-sb[data-game] #filters-container .bp-gcol { flex-basis: 44px; width: 44px; height: 44px; margin: -11px 0 -11px -11px; } /* зона касания 44 px без роста заголовка */
    html.bp-sb[data-game] #filters-container .filter-row.is-menu > .filter-item { flex-basis: calc(100% - 48px); }
    html.bp-sb[data-game] #filters-container .filter-row.is-menu > .bp-ra { height: 44px; min-height: 44px; }
}
/* открытое меню строки: две подписанные кнопки под строкой */
html.bp-sb[data-game] #filters-container .filter-row.is-menu > .filter-item { flex-basis: calc(100% - 40px); }
html.bp-sb[data-game] #filters-container .filter-row.is-menu > .bp-ra {
    display: flex; order: 5; flex: 1 1 0; width: auto; height: 32px; min-height: 32px; gap: 6px; padding: 0 10px; border-radius: 10px; justify-content: center; align-items: center;
    font: 600 12px var(--font-body, inherit); color: var(--sp-text);
}
html.bp-sb[data-game] #filters-container .filter-row.is-menu > .filter-locate::after { content: "Подсветить"; }
html.bp-sb[data-game] #filters-container .filter-row.is-menu > .bp-only::after { content: "Только эта категория"; }
html.bp-sb[data-game] #filters-container .filter-row.is-menu > .bp-ra.is-on { color: var(--sp-accent); }
html.bp-sb[data-game] #filters-container .filters-note { font-size: 11px; opacity: .7; }

/* совпавшие категории в выпадающем поиске */
.bp-cat-hits { display: grid; gap: 2px; padding: 6px 6px 8px; border-bottom: 1px solid color-mix(in srgb, var(--sp-muted) 25%, transparent); }
.bp-cat-hits-l { margin: 0 6px 2px; color: var(--sp-muted); font: 600 10.5px/1.2 var(--font-body, inherit); letter-spacing: .08em; text-transform: uppercase; }
.bp-cat-hit {
    all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 8px; border-radius: 8px; cursor: pointer;
    color: var(--sp-text); font: 600 13px var(--font-body, inherit);
}
.bp-cat-hit i { flex: 0 0 10px; height: 10px; border-radius: 50%; }
.bp-cat-hit span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-cat-hit em { font-style: normal; color: var(--sp-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.bp-cat-hit:hover, .bp-cat-hit:focus-visible { background: var(--sp-btn); color: var(--sp-accent); }
@media (pointer: coarse) { .bp-cat-hit { min-height: 44px; } }

/* тест двух колонок: ?sb=2col → панель 460 px, категории в две колонки (только широкие экраны) */
@media (min-width: 1101px) {
    html.bp-sb-2col[data-game] { --sidebar-width: 460px; }
    html.bp-sb-2col[data-game] #filters-container .filter-group { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 6px; }
    html.bp-sb-2col[data-game] #filters-container .filter-group > :not(.filter-row) { grid-column: 1 / -1; }
    html.bp-sb-2col[data-game] #filters-container .filter-group.is-collapsed .filter-row { display: none; }
}

/* ---------- 5б. Общий шаблон панели (web/components/map/map-sidebar.ts, #sidebar[data-bp-sb="2"]) ---------- */
/* логотип — одна ссылка «к началу карты» одинакового размера во всех играх */
html.bp-sb[data-game] #sidebar .bp-sb-brand { flex: 1 1 auto; min-width: 0; height: 100%; margin: 0; padding: 0; }
html.bp-sb[data-game] #sidebar .bp-sb-logo { display: flex; align-items: center; gap: 8px; height: 100%; min-width: 0; color: inherit; text-decoration: none; border-radius: var(--sp-r-sm, 12px); }
html.bp-sb[data-game] #sidebar .bp-sb-logo:hover { opacity: .85; }
html.bp-sb[data-game] #sidebar .bp-sb-logo:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }
/* поля «Карта» и «Область»: подпись с иконкой над выпадающим списком; без выбора поле не показывается */
html.bp-sb[data-game] #sidebar .bp-sb-field { display: grid; gap: 4px; margin: 0; padding: 0; }
html.bp-sb[data-game] #sidebar .bp-sb-field:is([hidden], .bp-sb-none) { display: none; }
html.bp-sb[data-game] #sidebar .bp-sb-field > .bp-sb-label {
    display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; color: var(--sp-muted); font: 600 11px/1.2 var(--font-body, inherit); letter-spacing: .08em; text-transform: uppercase;
}
html.bp-sb[data-game] #sidebar .bp-sb-label svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html.bp-sb[data-game] #sidebar .bp-sb-field .zone-switch { margin: 0; }
/* особая возможность поиска игры — подсказка прямо под полем */
html.bp-sb[data-game] #sidebar .bp-sb-hint { margin: 6px 2px 0; color: var(--sp-muted); font: 500 11.5px/1.35 var(--font-body, inherit); }
/* активные фильтры и сброс — всегда на виду над категориями */
html.bp-sb[data-game] #sidebar .bp-sb-active { display: grid; gap: 8px; padding: 0 16px 8px; }
html.bp-sb[data-game] #sidebar .bp-sb-active:not(.is-on):not(:has(.focus-banner:not([hidden]))) { display: none; }
html.bp-sb[data-game] #sidebar .bp-sb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
html.bp-sb[data-game] #sidebar .bp-sb-chips:empty { display: none; }
html.bp-sb[data-game] #sidebar .bp-chip-on { cursor: default; color: var(--sp-text); }
html.bp-sb[data-game] #sidebar .bp-chip-on:hover { color: var(--sp-text); box-shadow: none; transform: none; }
html.bp-sb[data-game] #sidebar .bp-sb-active .focus-banner { margin: 0; }
/* пустые категории текущей карты и группы без них скрыты; общая кнопка группы — как у игр */
html.bp-sb[data-game] #filters-container :is(.filter-row, .filter-group)[hidden] { display: none !important; }
html.bp-sb[data-game] #filters-container .bp-gt { margin-left: auto; }
html.bp-sb[data-game] #sidebar .bp-sb-logo { max-width: 100%; overflow: hidden; }
html.bp-sb[data-game] #sidebar .header-top-row .bp-sb-logo :is(img, .logo-title, .header-banner) { flex: none; height: 40px; max-height: 40px; width: auto; max-width: none; }
html.bp-sb[data-game] #filters-container .filter-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
html.bp-sb[data-game] #filters-container .filter-group-head .filter-group-title { margin: 0; flex: 1 1 auto; min-width: 0; }
/* одинаковое скругление карточек панели во всех играх (внутренние панели — 12 px, §15): прогресс, «По регионам/картам», доп. фильтры */
html.bp-sb[data-game] #sidebar :is(.progress-card, .region-progress, .bp-sb-more) { border-radius: 12px; }
html.bp-sb[data-game] #sidebar .region-progress > summary { border-radius: inherit; }
/* текстовый логотип (map-sidebar.ts → wordmark): полное название, размер по ширине строки; --n — число знаков названия */
html.bp-sb[data-game] #sidebar .header-top-row .bp-sb-brand { flex: 1 1 0; width: 100%; }
html.bp-sb[data-game] #sidebar .bp-sb-logo:has(.bp-wm) { flex: 1 1 0; width: 100%; container-type: inline-size; }
html.bp-sb[data-game] #sidebar .bp-wm { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; width: 100%; }
html.bp-sb[data-game] #sidebar .bp-wm-top {
    color: var(--sp-muted); font: 600 10.5px/1.1 var(--font-body, inherit); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.bp-sb[data-game] #sidebar .bp-wm-main {
    color: var(--sp-text); font-family: var(--font-display, inherit); font-weight: 700; line-height: 1.05; letter-spacing: .01em; white-space: nowrap;
    font-size: clamp(13px, calc(100cqi / (var(--n) * .66)), 22px);
    text-shadow: 0 0 18px color-mix(in srgb, var(--sp-accent) 35%, transparent);
}
html.bp-sb[data-game] #sidebar .bp-wm.has-top .bp-wm-main { font-size: clamp(13px, calc(100cqi / (var(--n) * .66)), 19px); }
html.bp-sb[data-game] #sidebar .bp-wm-main::first-letter { color: var(--sp-accent); }
