/* ── Golos Text — локальные шрифты ── */
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/Golos-Text/golos-text_vf.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/Golos-Text/golos-text_regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/Golos-Text/golos-text_medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/Golos-Text/golos-text_demibold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/Golos-Text/golos-text_bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/Golos-Text/golos-text_black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ── ymaps стили убраны — используем SVG ── */

/* ── Expand animation overlay ── */
#expand-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    pointer-events: none;
    background: linear-gradient(135deg, #031e7a 0%, #2f72e0 60%, #629ed7 100%);
    clip-path: circle(0% at var(--cx, 50%) var(--cy, 50%));
    opacity: 0;
    transition: none;
}

#expand-overlay.expanding {
    pointer-events: all;
    opacity: 1;
    clip-path: circle(150% at var(--cx, 50%) var(--cy, 50%));
    transition: clip-path 0.6s cubic-bezier(0.2, 0, 0.3, 1), opacity 0.05s;
}

#expand-overlay.expanding.fading {
    opacity: 0;
    transition: opacity 0.45s ease-in;
}

/* ── Design Tokens ── */
:root {
    --c-royal: #2f72e0;
    --c-medium: #204bb4;
    --c-navy: #031e7a;
    --c-sky: #629ed7;
    --c-red: #e70211;
    --c-white: #ffffff;
    --c-bg: #f0f4fb;
    --c-surface: #ffffff;
    --c-border: #e2e8f0;
    --c-text: #0f172a;
    --c-muted: #64748b;

    --font-main: 'Golos Text', 'Tilda Sans', sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(3, 30, 122, 0.08);
    --shadow-md: 0 8px 32px rgba(3, 30, 122, 0.14);
    --shadow-lg: 0 20px 60px rgba(3, 30, 122, 0.18);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--c-bg);
    color: var(--c-text);
    overflow: hidden;
    height: 100vh;
}

/* ── Preloader ── */
.preloader {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.35s ease;
}

.preloader-inner {
    text-align: center;
    color: var(--c-navy);
    font-family: var(--font-main);
}

.preloader-logo {
    width: 192px;
    height: auto;
    margin-bottom: 18px;
}

.preloader-text {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    line-height: 1.2;
}

.preloader-loading {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
}

.preloader-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2b3972;
    opacity: 0.25;
    animation: preloader-dot 1s ease-in-out infinite;
}

.preloader-loading span:nth-child(2) {
    animation-delay: 0.16s;
}

.preloader-loading span:nth-child(3) {
    animation-delay: 0.32s;
}

.preloader--hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes preloader-logo-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.92;
    }

    50% {
        transform: scale(1.04);
        opacity: 1;
    }
}

@keyframes preloader-dot {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.25;
    }

    50% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ── Map container ── */
#map {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #fff;
    display: flex;
    align-items: stretch;
}

/* SVG с округами поверх фона */
#map svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Header (absolute over map) ── */
.app-header {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.logo-block {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    cursor: pointer;
    animation: logo-glow 3s ease-in-out infinite;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.logo-block:hover {
    box-shadow: 0 0 20px rgba(47,114,224,0.5),
                0 0 50px rgba(47,114,224,0.2),
                var(--shadow-md);
    transform: translateY(-1px);
}

@keyframes logo-glow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(47,114,224,0.25),
                    0 0 20px rgba(47,114,224,0.08),
                    var(--shadow-md);
    }
    50% {
        box-shadow: 0 0 16px rgba(47,114,224,0.45),
                    0 0 40px rgba(47,114,224,0.15),
                    var(--shadow-md);
    }
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--c-navy);
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.logo-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-royal);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* ── Search (top-right) ── */
.search-block {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    width: 320px;
}

.search-inner {
    position: relative;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.search-inner svg {
    color: var(--c-muted);
    flex-shrink: 0;
}

#map-search {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 14px 10px;
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--c-text);
}

#map-search::placeholder {
    color: var(--c-muted);
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--c-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--c-border);
    max-height: 280px;
    overflow-y: auto;
    z-index: 200;
}

.search-results.hidden {
    display: none;
}

.search-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid var(--c-border);
    transition: background 0.15s;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: var(--c-bg);
}

/* ── Stats counter (bottom-left) ── */
.stats-widget {
    position: fixed;
    bottom: 30px;
    left: 20px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.stats-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--c-royal);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stats-value {
    font-size: 36px;
    font-weight: 900;
    color: var(--c-navy);
    line-height: 1;
}

.stats-unit {
    font-size: 13px;
    color: var(--c-muted);
    margin-top: 2px;
}

/* ── Bottom nav ── */
.bottom-nav {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
    padding: 6px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.7);
    display: flex;
    gap: 4px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 40px;
    border: none;
    background: none;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    color: var(--c-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--c-navy);
    background: var(--c-bg);
}

.nav-btn.active {
    background: var(--c-royal);
    color: #fff;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

/* ── Hover Tooltip ── */
#map-tooltip {
    position: fixed;
    z-index: 500;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    max-width: 280px;
}

#map-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-card {
    background: var(--c-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--c-border);
    padding: 16px 18px;
    min-width: 220px;
}

.tooltip-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.tooltip-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-navy);
    line-height: 1.2;
}

.tooltip-badge {
    background: var(--c-royal);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tooltip-desc {
    font-size: 13px;
    color: var(--c-muted);
    line-height: 1.4;
    margin-bottom: 12px;
}

.tooltip-progress {
    height: 4px;
    background: var(--c-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.tooltip-progress-bar {
    height: 100%;
    background: var(--c-royal);
    border-radius: 4px;
    transition: width 0.3s;
}

.tooltip-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-royal);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ── District Modal ── */
.district-modal {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.district-modal.active {
    pointer-events: all;
    opacity: 1;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 30, 122, 0.25);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.district-modal.active .modal-backdrop {
    opacity: 1;
}

.modal-inner {
    position: relative;
    background: var(--c-surface);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 1180px;
    margin: auto;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
    box-shadow:
        inset 0 0 0 4px #2f72e050,
        inset 0 0 0 8px #ffffff;
}

/* Традиционная кайма из бесшовного XY-паттерна */
.modal-inner {
    --modal-border-size: 32px;
    --modal-border-bleed: 220px;
}

.modal-border {
    position: absolute;
    inset: calc(-1 * var(--modal-border-bleed));
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    background-image: url('../img/border-bg.svg');
    background-repeat: no-repeat;
    background-size: 1500px;
}

.modal-border__top,
.modal-border__right,
.modal-border__bottom,
.modal-border__left {
    display: none;
}

/* Белый фон под контентом внутри орнамента */
.modal-inner::after {
    content: '';
    position: absolute;
    inset: var(--modal-border-size);
    border-radius: calc(var(--radius-lg) - 6px);
    background: #ffffff;
    box-shadow:
        inset 0 0 0 4px #fff,
        inset 0 0 0 8px #2f72e050;
    z-index: 0;
    pointer-events: none;
}

/* Контент поверх рамки */
.modal-inner> :not(.modal-border) {
    position: relative;
    z-index: 2;
}

.district-modal.active .modal-inner {
    transform: translateY(0);
}

/* Modal header */
.modal-head {
    padding:
        calc(20px + var(--modal-border-size)) calc(20px + var(--modal-border-size)) calc(20px + var(--modal-border-size));
    /*border-bottom: 1px solid var(--c-border);*/
    position: relative;
}

.modal-close {
    position: absolute;
    top: calc(20px + var(--modal-border-size));
    right: calc(24px + var(--modal-border-size));
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--c-bg);
    color: var(--c-navy);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--c-navy);
    margin-bottom: 12px;
    padding-right: 50px;
    line-height: 1.1;
}

/* Строка с гербом + названием */
.modal-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.modal-title-row .modal-title {
    margin-bottom: 0;
}

.modal-meta {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.modal-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-meta-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-muted);
}

.modal-meta-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-navy);
}

/* Modal tabs */
.modal-tabs {
    display: flex;
    gap: 0;
    padding: 0 40px;
    border-bottom: 1px solid var(--c-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.modal-tab {
    padding: 14px 20px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    color: var(--c-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-tab:hover {
    color: var(--c-navy);
}

.modal-tab.active {
    color: var(--c-royal);
    border-bottom-color: var(--c-royal);
}

/* Modal projects grid */
.modal-body {
    padding:
        calc(24px + var(--modal-border-size)) calc(28px + var(--modal-border-size)) calc(30px + var(--modal-border-size));
    max-height: 55vh;
    overflow-y: auto;
}

/* Десктоп: скролл и карточки — внутри белого поля, без налезания на орнаментальную кайму */
@media (min-width: 768px) {
    .modal-body {
        box-sizing: border-box;
        /* +12px к кайме — полоса прокрутки глубже внутри белого */
        margin-left: calc(var(--modal-border-size) + 12px);
        margin-right: calc(var(--modal-border-size) + 12px);
        /* +14px к отступу от нижней каймы — карточки не заходят на орнамент */
        margin-bottom: calc(var(--modal-border-size) + 14px);
        /* сверху без лишнего «воздуха»; снизу запас до нижней каймы */
        padding:
            12px
            18px
            calc(28px + var(--modal-border-size));
        scrollbar-gutter: stable;
        overflow-x: hidden;
        /* Обрезка контента по скруглению внутреннего белого поля */
        border-radius: 0 0 calc(var(--radius-lg) - var(--modal-border-size) - 2px) calc(var(--radius-lg) - var(--modal-border-size) - 2px);
    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--c-sky);
}

.project-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, #e0e8ff, #c7d9f5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.project-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.project-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-navy);
    line-height: 1.3;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-completed {
    background: #dcfce7;
    color: #15803d;
}

/* alias для данных из API */
.status-in_progress,
.status-progress {
    background: #e0e7ff;
    color: #4338ca;
}

/* Фото-обложка в карточке проекта */
.project-img--photo {
    display: block;
    object-fit: cover;
}

/* ── Project Gallery (mouse-tracking) ── */
.pg {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    cursor: crosshair;
    background: #e0e8ff;
}

.pg__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .12s ease;
    pointer-events: none;
}

/* Dots */
.pg__dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.pg__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transition: background .12s, transform .12s;
    flex-shrink: 0;
}

.pg__dot--on {
    background: #fff;
    transform: scale(1.3);
}

.status-planned {
    background: #fef9c3;
    color: #854d0e;
}

.project-desc {
    font-size: 13px;
    color: var(--c-muted);
    line-height: 1.5;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--c-muted);
    margin-top: auto;
    padding-top: 8px;
}

.project-completion {
    font-weight: 700;
    color: var(--c-royal);
}

/* Progress bar */
.progress-bar-wrap {
    height: 3px;
    background: var(--c-bg);
    border-radius: 3px;
    margin: 8px 0 12px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--c-royal);
    border-radius: 3px;
}

/* Modal footer stats */
.modal-footer {
    background: var(--c-royal);
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-stats {
    display: flex;
    gap: 40px;
}

.footer-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px;
}

.footer-stat-value {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
}

.btn-report {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-report:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Utilities ── */
.hidden {
    display: none !important;
}

/* ── Modal district description ── */
.modal-district-desc {
    padding: 14px 0 18px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--c-muted);
    border-bottom: 1px solid var(--c-border);
    min-height: 0;
}

.modal-district-desc:empty {
    display: none;
}

/* ── ER Logo (bottom-right) ── */
.er-logo-block {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md, 12px);
    padding: 10px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.er-logo-img {
    height: 96px;
    width: auto;
    display: block;
}

/* ── Zoom controls (скрыты на десктопе) ── */
.zoom-controls {
    display: none;
}

/* ── Project loading spinner ── */
.pg-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 60px 20px;
    color: var(--c-muted);
    font-size: 14px;
}

.pg-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(47, 114, 224, 0.2);
    border-top-color: var(--c-royal);
    border-radius: 50%;
    animation: pg-spin .7s linear infinite;
}

@keyframes pg-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════════
   МОБИЛЬНАЯ ВЕРСИЯ  (max-width: 767px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

.preloader-logo {
    width: 100px;
    height: auto;
    margin-bottom: 18px;
}

.preloader-text {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    line-height: 1.2;
}

    /* ── Шапка ─────────────────────────────────────────────────── */
    .app-header {
        top: 12px;
        left: 12px;
        right: auto;
    }

    .logo-title {
        font-size: 13px;
    }

    .logo-sub {
        font-size: 10px;
    }

    /* ── Поиск: иконка-лупа → разворачивается при клике ─────── */
    .search-block {
        top: 12px;
        right: 12px;
        left: auto;
        width: 42px;
        height: 42px;
        /* НЕТ overflow:hidden — иначе выпадающий список обрезается */
        border-radius: 50%;
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            border-radius 0.25s ease;
    }

    .search-block.open {
        width: calc(100vw - 24px);
        border-radius: 12px;
    }

    .search-inner {
        /* Убираем десктопный padding:0 16px */
        padding: 0;
        width: 42px;
        min-height: 42px;
        justify-content: center;
        border-radius: 50%;
        overflow: hidden;  /* здесь обрезаем input в пилюлье, а не в .search-block */
        transition: border-radius 0.25s ease,
            width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            padding 0.2s ease;
    }

    .search-block.open .search-inner {
        width: 100%;
        padding: 0 12px;
        border-radius: 12px;
        justify-content: flex-start;
    }

    /* Скрываем input пока не открыт */
    .search-block:not(.open) #map-search {
        width: 0;
        padding: 0;
        opacity: 0;
    }

    .search-block.open #map-search {
        width: auto;
        flex: 1;
        opacity: 1;
        padding: 0;
        font-size: 14px;
    }

    .search-inner svg {
        cursor: pointer;
        min-width: 18px;
        flex-shrink: 0;
        margin: 0 0 0 11px;
    }

    /* ── Статы — убираем на мобиле ─────────────────────────────── */
    .stats-widget {
        display: none;
    }

    /* ── ER-лого: влево внизу, 12px от края ───────────────────── */
    .er-logo-block {
        bottom: 12px;
        left: 12px;
        right: auto;
        transform: none;
    }

    .er-logo-img {
        height: 52px;
    }

    /* ── Zoom +/− кнопки ──────────────────────────────────────── */
    .zoom-controls {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 12px;
        right: 12px;
        z-index: 100;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 24px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.7);
        overflow: hidden;
    }

    .zoom-btn {
        width: 37px;
        height: 37px;
        border: none;
        background: none;
        font-size: 22px;
        font-weight: 600;
        color: var(--c-navy);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s;
        -webkit-tap-highlight-color: transparent;
    }

    .zoom-btn:active {
        background: rgba(47, 114, 224, 0.12);
    }

    .zoom-btn+.zoom-btn {
        border-top: 1px solid var(--c-border);
    }

    /* ── Тултип — скрываем (нет hover) ────────────────────────── */
    #map-tooltip {
        display: none !important;
    }

    /* ══════════════════════════════════════════════════════════════
       НИЖНИЙ ЛИСТ (bottom sheet) вместо центрированного модала
       ══════════════════════════════════════════════════════════════ */
    .modal-inner {
        position: fixed;
        inset: auto 0 0 0;
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        border-radius: 20px 20px 0 0;
        background: var(--c-surface);
        transform: translateY(100%);
        transition: transform 0.38s cubic-bezier(0.32, 0, 0.15, 1);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    /* Отключаем десктопные псевдоэлементы-орнаменты */
    .modal-inner::before,
    .modal-inner::after {
        display: none;
    }

    .district-modal.active .modal-inner {
        transform: translateY(0);
    }

    /* Полоска-ручка для свайпа */
    .modal-head::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 2px;
        margin: 0 auto 14px;
    }

    .modal-head {
        padding: 14px 20px 12px;
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--c-surface);
        /* белый, как на десктопе */
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-close {
        top: 14px;
        right: 14px;
        font-size: 22px;
        width: 32px;
        height: 32px;
    }

    .modal-district-desc {
        padding: 10px 0px 14px;
        font-size: 13px;
    }

    /* body — карусель горизонтальная, вертикальная прокрутка у modal-inner */
    .modal-body {
        padding: 0;
        max-height: none;
        overflow-y: visible;
        overflow-x: visible;
        touch-action: pan-x pan-y;
    }

    /* Скрываем декоративную рамку на мобиле */
    .modal-border {
        display: none;
    }

    /* ══════════════════════════════════════════════════════════════
       КАРУСЕЛЬ ПРОЕКТОВ
       ══════════════════════════════════════════════════════════════ */

    /* Трек */
    .ms-track {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        /* паддинг: 11vw слева + 78vw карточка + 11vw пик справа = 100vw */
        padding: 16px 11vw 20px;
        scroll-padding-left: 11vw;
        scrollbar-width: none;
        box-sizing: border-box;
    }

    .ms-track::-webkit-scrollbar {
        display: none;
    }

    /* Слайд */
    .ms-slide {
        flex: 0 0 78vw;
        scroll-snap-align: start;
        filter: grayscale(65%) brightness(0.8);
        transition: filter 0.3s ease;
    }

    .ms-slide.ms-slide-active {
        filter: none;
    }

    /* Отключаем hover-эффекты внутри слайда на тач-устройствах */
    .ms-slide .project-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* Счётчик */
    .ms-counter {
        text-align: center;
        font-size: 13px;
        font-weight: 600;
        color: rgb(0 0 0 / 40%);
        padding: 4px 0 16px;
        font-variant-numeric: tabular-nums;
        letter-spacing: 0.5px;
    }

    /* Карточки занимают всю ширину слайда */
    .ms-slide .project-card {
        width: 100%;
    }

    /* pg-gallery на мобиле — чуть ниже */
    .ms-slide .pg {
        height: 180px;
    }
}

/* ── Очень маленькие экраны ─────────────────────────────────── */
@media (max-width: 380px) {
    .ms-slide {
        flex: 0 0 85vw;
    }

    .ms-track {
        padding: 16px 7.5vw 20px;
        scroll-padding-left: 7.5vw;
    }
}