
        :root {
            --text-color: #E0E0E0;
            --bg-dark: #222526;
            --bg-medium: #353A3E;
        }

        @font-face {
            font-family: "e-Ukraine";
            src: url("../fonts/e-UkraineHead-Regular.otf") format("e-Ukraine-Regular"), url("../fonts/e-UkraineHead-LOGO.otf") format("e-Ukraine-Logo");
            font-weight: normal;
            font-style: normal;
            font-display: swap; 
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: "e-Ukraine Head", Roboto, Arial, sans-serif;
        }

        body {
            background-color: var(--bg-dark);
            color: var(--text-color);
            overflow-x: hidden;
            overflow-y: auto;
            text-overflow: ellipsis;
        }

        header {
            background: rgba(34, 37, 38, 0.9);
            backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 2rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        header h1 {
            font-size: 1.2rem;
            color: var(--text-color);
            font-weight: 500;
        }

        button.login-btn {
            background: var(--bg-medium);
            color: var(--text-color);
            border: none;
            padding: 0.6rem 1.2rem;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s;
        }

        button.login-btn:hover {
            background: rgba(224, 224, 224, 0.2);
        }

        main {
            display: flex;
            height: calc(100vh - 70px);
        }

        .sidebar {
            width: 300px;
            background: rgba(34, 37, 38, 0.85);
            backdrop-filter: blur(12px);
            padding: 1rem;
            overflow-y: auto;
            text-overflow: ellipsis;
            border-right: 1px solid rgba(255, 255, 255, 0.1);
        }

        .sidebar h2 {
            font-size: 1rem;
            margin-bottom: 1rem;
        }

        .building-item {
            background: var(--bg);
            padding: 0.8rem 1rem;
            margin-bottom: 0.5rem;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.3s;
            text-overflow: ellipsis;
        }

        .building-item:hover {
            background: rgba(34, 37, 38, 0.6);
            text-overflow: ellipsis;
        }

        .map-container {
            flex: 1;
            position: relative;
            background: #111;
        }

        .building-info {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 400px;
            background: var(--bg);
            backdrop-filter: blur(12px);
            padding: 1rem;
            border-radius: 12px;
            color: var(--text-color);
            display: flex;
            flex-direction: column;
            gap: 1rem;
            text-overflow: ellipsis;
        }

        .audio-control {
            display: flex;
            align-items: center;
            gap: 1rem;
            background: var(--bg);
            border-radius: 10px;
            padding: 0.5rem 1rem;
        }

        .audio-control button {
            background: none;
            border: none;
            color: var(--text-color);
            cursor: pointer;
            font-size: 1.5rem;
        }
        /*  Скролбар  */
        ::-webkit-scrollbar {
            width: 12px;
        }
        /* Трек */
        ::-webkit-scrollbar-track {
            box-shadow: inset 0 0 5px grey;
            border-radius: 10px;
        }
        /* Ручка */
        ::-webkit-scrollbar-thumb {
            background: #E0E0E0;
            border-radius: 10px;
        }

        /* Ручка при наведенні */
        ::-webkit-scrollbar-thumb:hover {
            background: #E0E0E0;
        }



        :root {
            --bg: #1A1A1A;
            --paper: #222526;
            --ink: #d7d7d7;
            --muted: #90918c;
            --line: #E0E0E0;
            --accent: #E0E0E0;
            --shadow: 0 10px 30px rgba(0,0,0,.06), 0 2px 10px rgba(0,0,0,.04);
            --white-shadow: 0 0 25px rgba(215,215,215,.01), 0 10px 25px rgba(215,215,215,.4);
            --radius: 10px;
            --sb-w: 340px;
        }

        /* Кнопка входу / адміну в правому куті хедера */
        /*.user-btn {
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            width: 35px;
            height: 35px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 4px solid var(--accent);
            background: linear-gradient(#FFF, #E0E0E0);
            color: #000000;
            box-shadow: var(--shadow);
            text-decoration: none;
        }

        .user-btn:hover {
            background: linear-gradient(#E0E0E0,#FFF);
            border-color: var(--line);
            color: var(--bg-medium)
        }

        .user-btn:active {
            transform: translateY(-50%) scale(0.98);
        }

        .user-btn .material-symbols-outlined {
            font-size: 25px;
            line-height: 1;
        }
*/

        /* === Header buttons === */
        .header-buttons {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            color: #000000;
            background: linear-gradient(#FFF, #E0E0E0);
            border: 2px solid var(--accent);
            border-radius: 50%;
            width: 38px;
            height: 38px;
            box-shadow: var(--shadow);
            transition: all 0.2s ease;
        }

        .user-btn:hover {
            background: linear-gradient(#E0E0E0, #FFF);
            border-color: var(--line);
            color: var(--bg-medium);
            transform: translateY(-2px);
        }

        .user-btn:active {
            transform: translateY(0);
        }

        .user-btn .material-symbols-outlined {
            font-size: 22px;
            line-height: 1;
        }

        body.sb-collapsed {
            --sb-w: 88px;
        }

        * {
            box-sizing: border-box
        }

        html, body {
            height: 100%;
            margin: 0;
            background: var(--bg);
            color: var(--ink);
            font-family: Inter,system-ui,Arial,sans-serif
        }

        #app {
            display: grid;
            grid-template-rows: auto 1fr auto;
            min-height: 100vh
        }

        /* === LOADER === */
    .loader {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 1;                 /* сразу видно */
    pointer-events: auto;

    transition: none;           /* ? без анимации по умолчанию */
    }

    /* просто показ (без анимації) */
    .loader.show {
    opacity: 1;
    }

    /* тільки для зникнення */
    .loader.fade-out {
    transition: opacity 0.6s ease;
    opacity: 0;
    pointer-events: none;
    }


/* Контейнер по центру */
.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Логотип */
.loader-logo {
  width: 96px;
  height: auto;
  animation: loaderPulse 1.6s ease-in-out infinite;
  opacity: 0.9;
}

/* Текст */
.loader-text {
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--text-color);
  opacity: 0.8;
}

/* Анімація "дихання" */
@keyframes loaderPulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  50%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1);   opacity: 0.6; }
}

        /* === Header === */

:root {
    --text-color: #E0E0E0;
    --bg-dark: #222526;
    --bg-medium: #353A3E;
    --bg: #1A1A1A;
    --paper: #222526;
    --ink: #d7d7d7;
    --muted: #90918c;
    --line: #E0E0E0;
    --accent: #E0E0E0;
    --shadow: 0 10px 30px rgba(0,0,0,.06), 0 2px 10px rgba(0,0,0,.04);
    --white-shadow: 0 0 25px rgba(215,215,215,.01), 0 10px 25px rgba(215,215,215,.4);
    --radius: 10px;
    --sb-w: 340px;
}

@font-face {
    font-family: "e-Ukraine";
    src: url("../fonts/e-UkraineHead-Regular.otf") format("e-Ukraine-Regular"), url("../fonts/e-UkraineHead-LOGO.otf") format("e-Ukraine-Logo");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "e-Ukraine Head", Roboto, Arial, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    overflow-x: hidden;
    overflow-y: auto;
    text-overflow: ellipsis;
}

/* === Header === */
header {
    background: rgba(34, 37, 38, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

#logo img {
    height: 45px;
    width: auto;
}

/* Вертикальна лінія між логотипом і текстом */
.divider {
    width: 2px;
    height: 40px;
    background-color: #E0E0E0;
}

.header-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* === Header buttons === */
.user-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #000000;
    background: linear-gradient(#FFF, #E0E0E0);
    border: 2px solid var(--accent);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

    .user-btn:hover {
        background: linear-gradient(#E0E0E0, #FFF);
        border-color: var(--line);
        color: var(--bg-medium);
        transform: translateY(-2px);
    }

    .user-btn:active {
        transform: translateY(0);
    }

    .user-btn .material-symbols-outlined {
        font-size: 22px;
        line-height: 1;
    }

/* Мобільна версія */
@media (max-width: 560px) {
    .header-right {
        display: none !important;
    }
}

/* Видаляємо непотрібні/зайві стилі */
body.sb-collapsed {
    --sb-w: 88px;
}

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter,system-ui,Arial,sans-serif
}

#app {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh
}

        /* === Layout === */
        .main {
            display: grid;
            grid-template-columns: var(--sb-w) 1fr;
            gap: 16px;
            padding: 16px;
            transition: grid-template-columns .25s ease;
            text-overflow: ellipsis;
        }

        @media (max-width: 960px) {
            .main {
                grid-template-columns: 1fr
            }
        }

        /* === Sidebar === */
        #sidebar {
            background: var(--paper);
            border: 0 solid var(--line);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            height: calc(100vh - 64px - 64px - 32px);
            padding: 14px;
            position: relative;
            overflow: hidden;
        }

        .sb-head {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px
        }

        .toggle {
            position: absolute;
            top: 5px;
            right: 14px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 34px;
            height: 34px;
            border-radius: 12px;
            border: 0px solid var(--line);
            background: var(--accent);
            cursor: pointer;
            box-shadow: var(--shadow)
        }

        .toggle .material-symbols-outlined {
            font-size: 20px
        }

        .search {
            display: flex;
            align-items: center;
            gap: 8px;
            background: #FFF;
            border: 0 solid var(--line);
            border-radius: 14px;
            padding: 10px 12px;
            margin: 6px 0 12px
        }

        .search input {
            border: none;
            outline: none;
            background: transparent;
            width: 100%;
            font-size: 14px;
            color: var(--ink)
        }

        .list {
            position: absolute;
            inset: 100px 14px 14px 14px;
            overflow: auto;
            border-radius: 14px;
            padding-right: 2px
        }

        .item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 12px;
            cursor: pointer;
            border: 0px solid transparent;
            transition: background .15s,border-color .15s, transform .05s
        }

        .item:hover {
            background: var(--bg-medium);
            border-color: var(--accent);
        }

        .item:active {
            transform: translateY(1px)
        }

        .item .dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--accent);
            box-shadow: 0 0 0 3px rgba(150,150,150,.15);
            flex-shrink: 0;
        }

        .item.active .dot {
            background: #ff2c2c;
            box-shadow:
            0 0 0 3px rgba(255, 196, 92, 1),
            0 0 0 4px rgb(238, 32, 32);
        }

        .item .name {
            font-size: 14px;
            font-weight: 600
        }

        .item .desc {
            font-size: 12px;
            color: var(--muted)
        }



    #sidebar.collapsed .toggle {
        position: fixed !important;
        left: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 1000;
        width: 32px !important;
        height: 32px !important;
        background: var(--accent);
        border-radius: 0 8px 8px 0;
        box-shadow: 3px 0 10px rgba(0,0,0,0.4);
    }

        #sidebar.collapsed .toggle .material-symbols-outlined {
            font-size: 18px !important;
        }

        /* === Map card === */
        .map-card {
            position: relative;
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            background: var(--paper);
            border: 0px solid var(--line);
            height: calc(100vh - 64px - 64px - 32px)
        }

        #map {
            position: absolute;
            inset: 0
        }

        /* === Footer === */
        footer {
            height: 64px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--paper);
            border-top: 0px solid var(--line);
            box-shadow: var(--shadow)
        }

        footer .foot {
            font-size: 13px;
            color: var(--muted);
            letter-spacing: .4px
        }

        /* Marker */
        .mk {
            width:18px;
            height:18px;
            border-radius:50%;
            background: var(--accent);

            /* ТЁМНЫЙ КОНТУР */
            border: 2px solid rgba(181, 11, 11, 0.65);

            /* Мягкое свечение */
            box-shadow:
                0 0 0 6px rgba(150,150,150,.18),
                0 6px 18px rgba(0,0,0,.25);

            cursor: pointer;
        }

        /* === POPUP: плавные открытия/закрытия, увеличенный размер === */
        .overlay {
            position: fixed;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(14,17,22,.56);
            backdrop-filter: saturate(110%) blur(2px);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity .55s ease, visibility 0s linear .55s;
            z-index: 20; /* аудио-виджет сверху (z:60) */
        }

        .overlay.show {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transition: opacity .70s ease;
        }

        .modal {
            position: relative;
            width: clamp(720px, 80vw, 1400px);
            max-height: 85vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            background: var(--bg-dark);
            color: var(--ink);
            border: none;

            border-radius: 24px;

            box-shadow:
                0 10px 30px rgba(0,0,0,.45),
                0 2px 10px rgba(0,0,0,.35); 
            padding: 22px 22px 18px;
            transform: translateY(14px) scale(.985);
            opacity: 0;
            transition: transform .70s cubic-bezier(.22,.61,.36,1), opacity .70s ease;
        }

        .modal-head {
            position: relative;
            padding: 0 0 14px 0;
            margin-bottom: 10px;
            border-bottom: 1px solid rgba(255,255,255,.06);
        }

        .modal-body {
            overflow-y: auto;
            padding-right: 6px;
            flex: 1;
        }

        .modal-head .close {
            position: absolute;
            right: 0;
            top: 0;
        }

        .overlay.show .modal {
            transform: none;
            opacity: 1;
        }

        .modal h2 {
            margin: 0 0 6px 0;
            font-size: 20px;
        }

        /* текст у модалі під назвою будівлі*/
        .modal .muted {
            color: var(--muted);
            font-size: 13px;
            margin-bottom: 10px;
        }

        .modal .body {
            font-size: 14px;
            line-height: 1.55;
        }


        .modal .close {
            position: absolute;
            right: 10px;
            top: 10px;
            width: 34px;
            height: 34px;
            border-radius: 12px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 2px solid var(--line);
            background: var(--accent);
            cursor: pointer;
        }

        .modal .close .material-symbols-outlined {
            font-size: 22px;
            color: var(--muted);
        }
        /* === Сховати весь контент сайдбара при згортанні === */
        /* === Sidebar width transition === */
        #sidebar {
            background: var(--paper);
            border: 0 solid var(--line);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            height: calc(100vh - 64px - 64px - 32px);
            padding: 14px;
            position: relative;
            overflow: hidden;
            width: var(--sb-w); /* Додаємо ширину */
            transition: width 0.3s ease, padding 0.3s ease; /* Плавна анімація */
        }

            /* При згортанні сайдбару */
            #sidebar.collapsed {
                width: 0 !important;
                min-width: 0 !important;
                padding: 0 !important;
                margin: 0 !important;
                border: none !important;
                background: transparent !important;
                overflow: visible !important;
            }

                /* Сховати контент при згортанні */
                #sidebar.collapsed .sb-head,
                #sidebar.collapsed .search,
                #sidebar.collapsed .list {
                    display: none !important;
                    visibility: hidden !important;
                    opacity: 0 !important;
                }

                /* Кнопка перемикача у згорнутому стані */
                #sidebar.collapsed .toggle {
                    position: fixed !important;
                    left: 0 !important;
                    top: 50% !important;
                    transform: translateY(-50%) !important;
                    z-index: 1000;
                    width: 32px !important;
                    height: 32px !important;
                    background: var(--accent);
                    border-radius: 0 8px 8px 0;
                    box-shadow: 3px 0 10px rgba(0,0,0,0.4);
                    display: flex !important;
                    align-items: center;
                    justify-content: center;
                    transition: left 0.3s ease; /* Плавне переміщення */
                }

            /* Кнопка перемикача у розгорнутому стані */
            #sidebar:not(.collapsed) .toggle {
                position: absolute;
                top: 5px;
                right: 14px;
            }

        /* Оновити .main для плавної зміни */
        .main {
            display: grid;
            grid-template-columns: var(--sb-w) 1fr;
            gap: 16px;
            padding: 16px;
            transition: grid-template-columns 0.3s ease;
            text-overflow: ellipsis;
        }

        /* Коли сайдбар згорнутий */
        body.sb-collapsed .main {
            grid-template-columns: 0 1fr; /* Сайдбар займає 0 ширини */
            gap: 0; /* Прибираємо проміжок */
        }

        /* Медіа-запит для мобільних */
        @media (max-width: 960px) {
            .main {
                grid-template-columns: 1fr;
            }

         
        }
        /* === Галерея === */
        .gallery {
            display: flex;
            flex-direction: column;
            margin-top: 8px;
            /* Убираем лишние расчеты отступов, если кнопки находятся ВНУТРИ вьюпорта */
            margin-left: 0;
            margin-right: 0;
        }

        .g-viewport {
            position: relative;
            width: 100%;
            aspect-ratio: 16/9;
            background: #0d1117;
            border-radius: 14px;
            overflow: hidden;
        }

        .g-viewport img, .g-viewport iframe {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            border: 0;
        }

        .g-prev, .g-next {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 40px;
            height: 40px;
            border-radius: 12px;
            border: 0;
            background: #ffffffda;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10;
        }

        .g-prev {
            left: 45px;
        }

        .g-next {
            right: 45px;
        }

        .g-prev .material-symbols-outlined, .g-next .material-symbols-outlined {
            font-size: 22px;
            color: #333;
        }

        .g-caption {
            font-size: 13px;
            color: var(--muted);
            margin: 4px 0; /* Только небольшие вертикальные отступы */
        }

        .g-dots {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin-top: 4px;
        }

        .g-dot {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: var(--muted);
            border: 0;
            cursor: pointer;
        }

        .g-dot.active {
            background: var(--accent);
        }

        /* === Перемикач стиля карти === */
        .style-toggle.mapboxgl-ctrl {
            background: var(--ink);
            border: 0px solid #fff;
            border-radius: 12px;
            box-shadow: var(--shadow);
        }

        .style-toggle button {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--ink);
        border: 0;
        cursor: pointer;
        border-radius: 12px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.25);
        }


        .style-toggle .material-symbols-outlined {
            font-size: 22px;
            color: #000000;
        }

        /* === Аудіо-віджет (у карті, правий кут, низ) === */
        .narration {
            position: absolute;
            right: 12px;
            bottom: 12px;
            z-index: 60;
            width: 340px;
            max-width: calc(100% - 24px);
            background: transparent;
            border: 0;
            display: none;
        }

        .narration.show {
            display: block;
        }

        /* Плеєр */
        .nar-player {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            background: #1A1A1A;
            border: 0px solid var(--line);
            border-radius: 9999px;
       
            box-shadow: 0 2px 6px rgba(0,0,0,0.25);
        }

        .nar-btn {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--bg-medium);
            color: var(--ink);
            cursor: pointer;
            border: 0px solid #353A3E;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .nar-btn .material-symbols-outlined {
            font-size: 22px;
        }

        .nar-wave-wrap {
            flex: 1;
            height: 40px;
            overflow: hidden;
            border-radius: 9999px;
        }

        #narWave {
            height: 100%;
        }

        .nar-bottom {
            display: flex;
            justify-content: flex-end;
            padding: 8px 4px 6px 4px;
        }

        .nar-trans-btn {
            border: 0px solid var(--line);
            background: var(--bg);
            color: var(--ink);
            cursor: pointer;
            border-radius: 10px;
            padding: 6px 10px;
            font-size: 12px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.25);
            z-index: 1;
        }

        .nar-transcript {
            display: none;
            padding: 10px 12px;
            line-height: 1.55;
            font-size: 13px;
            color: var(--ink);
            max-height: 160px;
            overflow: auto;
            border: 0px solid var(--line);
            border-radius: 12px;
            background: var(--bg);
            z-index: 2;
            position: relative;
            scroll-padding: 8px;
            
            box-shadow: 0 2px 6px rgba(0,0,0,0.25);
            
        }
        /* Кастомізація скроллбару для .nar-transcript */
        .nar-transcript::-webkit-scrollbar {
            width: 16px;
        }

        .nar-transcript::-webkit-scrollbar-track {
            background: transparent;
            margin: 8px 0;
            border-radius: 8px;
            box-shadow: none;
        }

        .nar-transcript::-webkit-scrollbar-thumb {
            background: var(--muted);
            border-radius: 8px;
            border: 4px solid transparent;
            background-clip: content-box;
        }

        .nar-transcript::-webkit-scrollbar-thumb:hover {
            background: var(--accent);
            background-clip: content-box;
        }

        .nar-transcript.show {
            display: block;
        }

        .nar-transcript.show {
            display: block;
        }

        @media (max-width:560px) {
            .narration {
                right: 8px;
                bottom: 8px;
                width: auto;
                left: 8px;
            }
        }

        h1 {
            text-align: left;
        }
        /* === Перемикач фонової моделі === */
.bg-toggle.mapboxgl-ctrl {
    background: var(--ink);
    border: 0px solid #000000;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 8px; /* Відступ від кнопки стилю карти */
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.bg-toggle button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    border: 0;
    cursor: pointer;
    border-radius: 12px;
}

.bg-toggle .material-symbols-outlined {
    font-size: 22px;
    color: #000000;
}




/* === BG TOGGLE: OFF STATE (ЗАЧЕРКИВАНИЕ) === */
.bg-toggle {
  position: relative;
}

.bg-toggle.off .material-symbols-outlined {
  opacity: 0.35;
}

.bg-toggle.off::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 2px;
  background: #000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 2px;
  opacity: 0.8;
  pointer-events: none;
}

.mk-img {
  width: 32px;
  height: 32px;
  display: block;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 1;

  /* базовая тень */
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.35));
}

.mk-wrap {
  position: relative;
  width: 32px;
  height: 32px;
}

.mk-img {
  width: 32px;
  height: 32px;
  display: block;
  transform-origin: center bottom;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.35));
}

/* ПУЛЬС ТОЛЬКО КАРТИНКИ */
.mk-wrap.focus-blink .mk-img {
  animation: imgPulse 0.6s ease-in-out 6;
}


@keyframes imgPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.mk-wrap.active .mk-img {
  content: url("media/marker_active.png");
}

.g-viewport {
    position: relative;
}

.g-viewport > * {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(12px);
    transition:
        opacity 0.65s ease,
        transform 0.65s ease;
}

.g-viewport > *.active {
    opacity: 1;
    transform: translateX(0);
}



  /* Мобільні версіі дві шт 560 та 960 пікселів */

@media (max-width: 560px) {

  /* === MODAL === */
  .modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 16px;
    padding: 14px;
  }

  /* === HEADER === */
  .header-text {
    font-size: 14px;
    line-height: 1.15;
    font-weight: 500;
  }

  header h1 {
    font-size: 14px;
  }

  header {
    padding: 8px 12px;
  }

  #logo img {
    height: 48px;
  }

  .divider {
    height: 40px;
  }

  /* === USER BUTTON === */
  .user-btn {
    display: none !important;
    pointer-events: none;
    visibility: hidden;
  }

  /* === GALLERY === */
  .g-prev,
  .g-next {
    display: none;
  }

  /* === LAYOUT HEIGHT === */
  main,
  .main {
    height: 92dvh;
  }

  .map-card,
  #sidebar {
    height: auto;
    min-height: 92%;
  }

}

@media (max-width: 960px) {

  /* === BODY === */
  body {
    overflow-x: hidden;
  }

  /* === MAIN GRID === */
  .main,
  body.sb-collapsed .main {
    grid-template-columns: 1fr !important;
    padding: 0 !important;
    gap: 0 !important;
  }
  

  /* === SIDEBAR OVERLAY === */
  #sidebar {
    position: fixed;
    top: 64px;
    left: -100%;
    height: calc(100vh - 64px);
    width: 86vw;
    max-width: 360px;
    z-index: 1000;
    transition: left 0.3s ease;

    box-shadow:
      0 10px 30px rgba(0,0,0,.45),
      0 2px 10px rgba(0,0,0,.35);
  }

  body.sb-collapsed #sidebar {
    left: 0;
  }

  /* === ОТКЛЮЧАЕМ DESKTOP-COLLAPSED === */
  #sidebar.collapsed {
    width: auto !important;
    min-width: auto !important;
    padding: 14px !important;
    background: var(--paper) !important;
  }

  #sidebar.collapsed .sb-head,
  #sidebar.collapsed .search,
  #sidebar.collapsed .list {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* === TOGGLE BUTTON === */
  body:not(.sb-collapsed) #sidebar .toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2000;

    width: 42px;
    height: 42px;
    border-radius: 0 12px 12px 0;
    background: var(--accent);
    box-shadow: 4px 0 14px rgba(0,0,0,.45);
  }

  body.sb-collapsed #sidebar .toggle {
    position: absolute;
    top: 8px;
    right: 8px;

    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--accent);
    box-shadow: var(--shadow);
  }

  /* === TOGGLE ICON === */
  #sidebar .toggle .material-symbols-outlined {
    color: transparent;
    position: relative;
  }

  #sidebar .toggle .material-symbols-outlined::before {
    font-family: 'Material Symbols Outlined';
    font-size: 20px;
    color: #000;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body:not(.sb-collapsed)
  #sidebar .toggle .material-symbols-outlined::before {
    content: "chevron_right";
  }

  body.sb-collapsed
  #sidebar .toggle .material-symbols-outlined::before {
    content: "chevron_left";
  }

}