@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&family=Inter:wght@400;500&display=swap');

/* Заголовки карточек — длинное слово (составные немецкие/финские и т.п.) переносится на новую строку,
   а не упирается в край карточки или вылезает за него. Работает на любом языке, не только для
   конкретного случая: overflow-wrap:anywhere ломает слово ЛЮБОЙ длины, если иначе оно не влезает. */
#map-title, #genplan-title, #location-title, #house-title {
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

:root {
    --text-color: #FFFFFF;
    --text-dim: rgba(255, 255, 255, 0.6);
    --primary-gold: #D6B47C;
    --bg-dark: #0B0B0C;
    --bg-glass: rgba(21, 21, 23, 0.4);
    --border-glass: rgba(255, 255, 255, 0.1);
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --font: 'Manrope', 'Inter', sans-serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font);
    color: var(--text-color);
}

/* Premium Visual Utilities */
.glass-panel {
    background: rgba(21, 21, 23, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
}

.glass-btn {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    color: var(--text-color);
    border-radius: 40px;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.glass-btn:hover {
    background: rgba(40, 40, 45, 0.6);
}

.primary-btn {
    background: var(--primary-gold);
    color: var(--bg-dark);
    border: none;
    border-radius: 40px;
    transition: all var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.primary-btn:hover {
    background: #E8CA98;
    box-shadow: 0 4px 15px rgba(214, 180, 124, 0.4);
}

.glow-effect {
    box-shadow: 0 0 20px rgba(214, 180, 124, 0.15);
}


#app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: #000;
    overflow: hidden;
}

.scroll-wrapper {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-behavior: smooth;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.scroll-wrapper::-webkit-scrollbar {
    display: none;
}

#aspect-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    max-width: 100vw;
    overflow: hidden;
}

/* COVER: кадр 16:9 заполняет весь экран (без чёрных полос), лишнее обрезается.
   16:9 сохраняется, поэтому метки едут вместе с фоном и остаются на своих местах. */
#aspect-wrapper.aspect-16-9 {
    width: max(100vw, 177.7778vh);
    width: max(100vw, 177.7778dvh);
    height: max(100vh, 56.25vw);
    height: max(100dvh, 56.25vw);
    max-width: none;
    max-height: none;
    flex: 0 0 auto;   /* не сжиматься флексом — иначе теряется cover */
}

#aspect-wrapper.aspect-9-16 {
    aspect-ratio: 9 / 16;
    width: auto;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
}
@media (max-aspect-ratio: 9/16) {
    #aspect-wrapper.aspect-9-16 {
        width: 100vw;
        height: auto;
    }
}

#video-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease-in-out; /* Плавный переход при смене */
    pointer-events: none;
}

.video-player.active {
    opacity: 1;
    z-index: 2;
}

/* 360-панорама: активный canvas должен ловить drag для вращения */
.video-player.pano360.active { pointer-events: auto; cursor: grab; }
.video-player.pano360.active:active { cursor: grabbing; }
/* YouTube iframe: фоновый лууп — клики не перехватываем (иначе клик ставит на паузу) */
.video-player.yt-frame { border: 0; pointer-events: none; }
/* Мобильный: касания должны доходить до YouTube-плеера, чтобы 360 крутился его штатными жестами
   (наш drag-оверлей на телефоне отключён — setSphericalProperties там не работает). */
@media (max-width: 950px) { .video-player.yt-frame.active { pointer-events: auto; } #yt-drag { display: none; } }
.video-player.yt-frame.active { pointer-events: none; }
/* Аудио-плеер внутри карточки: кнопка + плавный эквалайзер (без текста) */
.audio-player { display: flex; align-items: center; gap: 14px; margin: 4px 0 2px; }
.audio-player .ap-btn {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,0.14); color: #fff; display: grid; place-items: center;
    transition: background .2s ease, transform .1s ease; backdrop-filter: blur(6px);
}
.audio-player .ap-btn:hover { background: rgba(255,255,255,0.24); }
.audio-player .ap-btn:active { transform: scale(0.94); }
.audio-player .ap-btn svg { width: 20px; height: 20px; fill: #fff; }
/* играющее состояние — в едином стекло-стиле карточки, без «инородного» золотого фона */
.audio-player.playing .ap-btn { background: rgba(255,255,255,0.2); color: #fff; }
.audio-player.playing .ap-btn svg { fill: #fff; }
/* эквалайзер */
.audio-player .ap-eq { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.audio-player .ap-eq span {
    width: 3px; height: 100%; border-radius: 2px; transform-origin: bottom; transform: scaleY(0.22);
    background: rgba(255,255,255,0.75); transition: transform .25s ease, background .25s ease;
}
.audio-player.playing .ap-eq span { background: var(--accent-gold, #d8b878); animation: apEq 1s ease-in-out infinite; }
.audio-player.playing .ap-eq span:nth-child(1) { animation-delay: -0.0s; }
.audio-player.playing .ap-eq span:nth-child(2) { animation-delay: -0.35s; }
.audio-player.playing .ap-eq span:nth-child(3) { animation-delay: -0.15s; }
.audio-player.playing .ap-eq span:nth-child(4) { animation-delay: -0.5s; }
.audio-player.playing .ap-eq span:nth-child(5) { animation-delay: -0.25s; }
@keyframes apEq { 0%, 100% { transform: scaleY(0.28); } 50% { transform: scaleY(1); } }

/* Маршруты на карте (как Google Maps): линия прорисовывается при наведении на точку */
.map-routes { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.map-route { fill: none; stroke: var(--route-color, #ff3b30); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 1px 3px rgba(0,0,0,.55)); }
.map-route-label {
    position: absolute; transform: translate(-50%, 26px); z-index: 6;
    background: rgba(0,0,0,.78); color: #fff; padding: 5px 10px; border-radius: 10px;
    font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .3s ease; pointer-events: none;
    display: flex; gap: 10px; align-items: center; backdrop-filter: blur(6px);
}
.map-route-label.on { opacity: 1; }
/* Барабан-шкала «Стройка» */
#construction-drum {
    position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%);
    width: min(92vw, 620px); z-index: 5; pointer-events: auto; cursor: grab;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    -webkit-user-select: none; user-select: none;
}
#construction-drum:active { cursor: grabbing; }
#cd-hint { font-size: 12px; color: rgba(255,255,255,0.55); letter-spacing: .3px; }
#cd-viewport {
    position: relative; width: 100%; height: 104px; overflow: hidden;
    background: rgba(0,0,0,0.42); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 18px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
/* Горизонтальная «дорожка» временной шкалы — проходит через точки-отметки (по центру) */
#cd-viewport::before {
    content: ''; position: absolute; left: 6%; right: 6%; top: 50%; transform: translateY(-50%); height: 2px;
    background: rgba(255,255,255,0.18); pointer-events: none;
}
#cd-years { position: absolute; top: 0; left: 0; height: 100%; display: flex; align-items: center; will-change: transform; }
.cd-year {
    flex: 0 0 auto; text-align: center; color: rgba(255,255,255,0.5);
    font-weight: 600; transition: color .2s ease, opacity .2s ease;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
}
.cd-year .cd-y { font-size: 21px; line-height: 1; transition: font-size .2s ease; }
/* Точка-отметка на временной линии (вместо иконки) */
.cd-year .cd-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: rgba(255,255,255,0.55);
    box-shadow: 0 0 0 4px rgba(0,0,0,0.28);
    transition: all .2s ease;
}
.cd-year .cd-sub { font-size: 9.5px; font-weight: 500; opacity: .7; line-height: 1.2; white-space: nowrap; letter-spacing: .2px; }
.cd-year.cd-active { color: #fff; }
.cd-year.cd-active .cd-y { font-size: 30px; }
.cd-year.cd-active .cd-dot {
    width: 13px; height: 13px;
    background: var(--accent-gold,#d8b878);
    box-shadow: 0 0 0 5px rgba(216,184,120,0.22), 0 0 12px var(--accent-gold,#d8b878);
}
.cd-year.cd-active .cd-sub { opacity: 1; }
#cd-center {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 2px; height: 100%; pointer-events: none;
    background: linear-gradient(180deg, transparent, var(--accent-gold,#d8b878), transparent);
    opacity: .9;
}
.loc-link-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 11px 22px; border-radius: 40px; font-size: 14px; font-weight: 600;
    text-decoration: none; color: #fff; background: #5ad1ff; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.3); transition: transform .15s ease, filter .15s ease;
}
.loc-link-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.map-route-label .rl-item { display: inline-flex; gap: 4px; align-items: center; }
.map-route-label .rl-item svg { width: 13px; height: 13px; opacity: .9; flex: none; }
.map-route-label b { font-weight: 600; }

/* Курсор-«рука» на поле, когда доступно листание ракурсов облёта перетаскиванием */
#aspect-wrapper.can-swipe { cursor: grab; }
#aspect-wrapper.can-swipe.swiping { cursor: grabbing; }
#aspect-wrapper.can-swipe .gp-marker-btn { cursor: pointer; }

/* Прозрачный перехватчик drag для 360-роликов YouTube (крутим через IFrame API) */
#yt-drag { position: absolute; inset: 0; z-index: 3; pointer-events: none; cursor: grab; }
#yt-drag.on { pointer-events: auto; }
#yt-drag.on:active { cursor: grabbing; }

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none; /* Пропускаем клики сквозь пустые места */
}

/* Градиентные тени для премиального вида и читаемости текста */
#ui-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 15vw;
    min-height: 100px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    z-index: -1;
}

#ui-layer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vw;
    min-height: 150px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    z-index: -1;
}

/* Делаем элементы UI интерактивными */
#ui-layer > * {
    pointer-events: auto;
}

.top-info-dropdown {
    position: absolute;
    top: 30px;
    left: 30px;
    width: auto;
    max-width: 420px;
    background: rgba(20, 20, 20, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    animation: fadeInDown 0.6s ease forwards;
}

.top-info-dropdown.open {
    border-radius: 20px;
    width: 420px;
}

.top-info-header {
    display: flex;
    align-items: center;
    padding: 6px 14px 6px 6px;
    cursor: pointer;
    gap: 12px;
}

.top-info-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-info-title {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 5px;
}

.top-info-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.chevron-icon {
    transition: transform var(--transition);
}

.top-info-dropdown.open .chevron-icon {
    transform: rotate(180deg);
}

.top-info-content-wrapper {
    max-height: 0;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
}

.top-info-dropdown.open .top-info-content-wrapper {
    max-height: 60vh;
    opacity: 1;
    pointer-events: auto;
}

.top-info-content-scroll {
    padding: 0 25px 25px 25px;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Custom Scrollbar */
.top-info-content-scroll::-webkit-scrollbar {
    width: 6px;
}
.top-info-content-scroll::-webkit-scrollbar-track {
    background: transparent; 
}
.top-info-content-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 10px;
}
.top-info-content-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4); 
}

/* Drawer Content Styling */
.floating-desc-box {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
    padding-top: 15px;
    margin-bottom: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 400;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.floating-desc-box:empty {
    display: none;
}

.floating-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.floating-gallery-grid .gallery-item {
    aspect-ratio: 16 / 9;
    border-radius: 8px;
}

/* Instruction Overlay */
.instruction-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.instruction-overlay.fade-out {
    animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* Instruction Modal */
.instruction-modal {
    background: rgba(20, 20, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 35px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
}

/* Custom Scrollbar for Instruction Modal */
.instruction-modal::-webkit-scrollbar {
    width: 6px;
}
.instruction-modal::-webkit-scrollbar-track {
    background: transparent; 
}
.instruction-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 10px;
}

.instruction-modal h2 {
    margin: 0 0 5px 0;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    color: white;
    letter-spacing: 0.5px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.instruction-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.instruction-icon svg {
    width: 24px; 
    height: 24px;
}

.instruction-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.instruction-text strong {
    font-size: 15px;
    color: white;
    font-weight: 600;
}

.instruction-text span {
    font-size: 13px;
    line-height: 1.5;
    color: #a1a1aa;
}

.instruction-ok-btn {
    background: #f97316;
    color: white;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    padding: 16px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    transition: var(--transition);
}

.instruction-ok-btn:hover {
    background: #ea580c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

.genplan-back-btn {
    background: #f97316;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-family: var(--font);
    font-size: 15px;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    transition: var(--transition);
    display: flex;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.genplan-back-btn.icon-only {
    padding: 12px;
    border-radius: 50%;
    aspect-ratio: 1;
}

.genplan-back-btn:hover {
    background: #ea580c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

@keyframes eyeSlowBlink {
    0%, 75%, 100% {
        transform: translate(-50%, -50%) scaleY(1);
    }
    85% {
        transform: translate(-50%, -50%) scaleY(0.1);
    }
}

.nested-marker .marker-icon {
    transform-origin: center;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

#loading-indicator.visible {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.nav-controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
    z-index: 100;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--btn-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    color: var(--primary);
    padding: 14px 30px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 500;
    border-radius: 40px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.nav-btn .icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition);
}

.nav-btn.icon-only {
    padding: 12px;
    border-radius: 50%;
    aspect-ratio: 1;
}

.nav-btn.icon-only .icon {
    margin: 0;
}

.nav-btn:hover:not(.hidden) {
    background: var(--btn-hover);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.3);
}

.nav-btn:active:not(.hidden) {
    transform: translateY(0);
}

#btn-next:hover:not(.hidden) .icon {
    transform: translateX(4px);
}

#btn-prev:hover:not(.hidden) .icon {
    transform: translateX(-4px);
}

/* Скрываем кнопки, оставляя их в DOM */
.nav-btn.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.95);
    position: absolute; /* Убираем из потока, чтобы центрировать оставшуюся кнопку */
}

/* Когда одна скрыта, вторая должна оставаться по центру. 
   Поскольку flex container, position absolute ломает обычный поток,
   что нам и нужно для одинокой кнопки */
.nav-btn:not(.hidden) {
    position: relative;
}

.header-menu {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* ===== Region outlines (highlight areas on the master plan) ===== */
.gp-outline-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 5;
}
.gp-outline {
    fill: transparent;
    stroke-width: var(--outline-w, 2);
    vector-effect: non-scaling-stroke;
    pointer-events: all;
    cursor: pointer;
    transition: stroke-width .2s ease, filter .25s ease, fill .25s ease;
}
.gp-outline.hover {
    stroke-width: 3;
    filter: drop-shadow(0 0 5px var(--gp-glow)) drop-shadow(0 0 14px var(--gp-glow));
}
/* Живой пунктир: контур зоны — тонкий бегущий пунктир (marching ants). Только StudioLab. */
.gp-marching {
    stroke-linecap: round;
    animation: gpMarch 0.7s linear infinite;   /* [ТЕСТ] пульсацию (gpBreathe) убрали */
}
@keyframes gpMarch { to { stroke-dashoffset: -9; } }   /* 5+4 = 9, бесшовный цикл */
/* Пульс-заливка: alpha заливки мягко «дышит» (умножается на базовую прозрачность). */
@keyframes gpBreathe { 0%, 100% { fill-opacity: 0.5; } 50% { fill-opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .gp-marching { animation: none; } }
.gp-outline-label {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 7px 14px;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    z-index: 1000;   /* выше меток (20) и наведённой метки (999), чтобы название не перекрывалось */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity .2s ease;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
}
.gp-outline-label.show { opacity: 1; }

/* ===== Media playlist filmstrip (bottom popup) ===== */
.media-strip {
    position: fixed;   /* привязка к окну браузера, а не к родителю (иначе на части экранов лента обрезается) */
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: flex;
    justify-content: center;
    padding: 14px 16px 18px;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    transform: translateY(110%);
    transition: transform .35s cubic-bezier(.22,.61,.36,1);
    pointer-events: none;
}
.media-strip.show { transform: translateY(0); }
/* Барабан внутри полноэкранной галереи — поверх лайтбокса. */
.gallery-strip { z-index: 100000; }
/* Лёгкое увеличение картинки карточки при наведении — намёк на кликабельность (без «лупы»). */
#house-media { overflow: hidden; }
#house-media img, #house-media video { transition: transform .4s ease; will-change: transform; }
#house-media:hover img, #house-media:hover video { transform: scale(1.05); }
/* кликабельна только сама лента (центр), а не вся нижняя полоса — иначе перекрывает кнопки по бокам */
.media-strip-inner {
    pointer-events: auto;
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px;
    border-radius: 18px;
    background: rgba(20,20,24,0.55);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.media-arrow {
    flex: 0 0 auto;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08); color: #fff;
    display: grid; place-items: center; cursor: pointer;
    transition: background .15s, transform .15s;
}
.media-arrow:hover { background: rgba(255,255,255,0.18); transform: scale(1.06); }
.media-arrow svg { width: 18px; height: 18px; }
.media-win { display: flex; align-items: center; gap: 10px; }
.media-cell {
    position: relative; flex: 0 0 auto;
    width: 92px; height: 56px; border-radius: 10px; overflow: hidden;
    cursor: pointer; border: 2px solid transparent;
    transition: border-color .2s, transform .2s, width .2s, height .2s, opacity .2s;
    background: #000; opacity: 0.65;
}
.media-cell:hover { opacity: 1; }
.media-cell.active {
    width: 112px; height: 66px; opacity: 1;
    border-color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,0.5), 0 8px 22px rgba(0,0,0,0.55);
}
.media-cell video, .media-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-cell-num {
    position: absolute; left: 6px; top: 5px;
    font-size: 11px; font-weight: 700; color: #fff;
    background: rgba(0,0,0,0.55); border-radius: 6px; padding: 1px 6px; line-height: 1.4;
}

.sales-widget-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6) !important;
}

/* Base positioning for bottom buttons */
.mobile-lower-btn-controls {
    bottom: 60px;
}
.mobile-lower-btn-cta {
    bottom: 80px;
}

@media (max-width: 950px) {    
    .scroll-wrapper {
        justify-content: flex-start;
    }
    
    .mobile-lower-btn-controls {
        bottom: 25px !important;
    }
    
    .mobile-lower-btn-cta {
        bottom: 25px !important;
    }

    #aspect-wrapper.aspect-16-9 {
        height: 100dvh !important;
        width: calc(100dvh * (16 / 9)) !important;
        max-width: none !important;
        flex-shrink: 0;
    }
    
    .nav-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    .nav-btn.icon-only {
        padding: 8px;
    }
    .nav-controls {
        bottom: 75px;
        width: 100%;
        gap: 10px;
        padding: 0 10px;
        box-sizing: border-box;
        justify-content: center;
    }
    .top-info-dropdown {
        top: 15px;
        left: 15px;
        width: auto;
        max-width: calc(100vw - 30px);
    }
    .top-info-dropdown.open {
        width: calc(100vw - 30px);
    }
    #camera-label {
        margin: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
    .instruction-modal {
        padding: 20px;
        gap: 12px;
        border-radius: 16px;
    }
    .instruction-modal h2 {
        font-size: 18px;
    }
    .instruction-item {
        gap: 10px;
        padding: 10px;
    }
    .instruction-icon {
        width: 32px;
        height: 32px;
    }
    .gp-marker-btn {
        width: 48px;
        height: 48px;
        padding: 0;
    }
}

/* ================================= */
/*          SETUP SCREEN             */
/* ================================= */

#setup-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    overflow-y: auto;
    padding: 20px;
}

.setup-card {
    background: rgba(20, 25, 35, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 1400px;
    margin: auto;
    margin-top: 40px;
    margin-bottom: 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    animation: setupFadeIn 0.5s ease-out forwards;
}

@keyframes setupFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.setup-card h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    background: linear-gradient(90deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.setup-card p {
    color: #94a3b8;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 30px;
}

.camera-block {
    background: rgba(10, 15, 25, 0.5);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.camera-header {
    font-size: 18px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 650px) {
    .upload-grid.has-transitions {
        grid-template-columns: 1fr 1fr;
    }
    .upload-grid.has-transitions .full-width {
        grid-column: span 2;
    }
}

.upload-group {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 15px;
    transition: var(--transition);
}

.upload-group:hover {
    border-color: rgba(255,255,255,0.15);
    background: rgba(0, 0, 0, 0.4);
}

.upload-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.upload-group input[type="file"] {
    width: 100%;
    font-size: 13px;
    color: #94a3b8;
}

.upload-group input[type="file"]::file-selector-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    margin-right: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.upload-group input[type="file"]::file-selector-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.action-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.outline-btn {
    background: transparent;
    color: #a5b4fc;
    border: 2px dashed rgba(165, 180, 252, 0.3);
}

.outline-btn:hover {
    background: rgba(165, 180, 252, 0.1);
    border-color: rgba(165, 180, 252, 0.6);
}

.media-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.media-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    transition: box-shadow 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}
.media-preview-item:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    z-index: 50;
}
.media-preview-item img, .media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.media-preview-item .remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* --- Toggle Switch --- */
.loop-toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.loop-label-text {
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid rgba(255,255,255,0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.loop-camera-block {
    background: rgba(165, 180, 252, 0.05);
    border: 1px solid rgba(165, 180, 252, 0.2);
}

.setup-btn {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.setup-btn:hover {
    background: #2563eb;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
}

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

/* --- Модальное окно (Share Modal) --- */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-card h2 {
    color: #e2e8f0;
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 20px;
}

.modal-card p {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

#modal-link-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(165, 180, 252, 0.3);
    color: #a5b4fc;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-family: monospace;
    text-align: center;
    outline: none;
}

/* --- GENPLAN MARKERS --- */
.genplan-marker {
    opacity: 0.7;
    position: absolute;
    padding: 6px 14px;
    background-color: rgba(239, 68, 68, 0.9);
    border: 2px solid white;
    border-radius: 20px;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 13px;
    pointer-events: auto; /* Required for dragging */
    z-index: 10;
    white-space: nowrap;
    cursor: grab;
}

.genplan-marker:active {
    cursor: grabbing;
}

.genplan-marker:hover {
    opacity: 1;
}

.marker-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    flex-shrink: 0;
}

.nested-marker .marker-icon {
    margin: 0;
    width: 24px;
    height: 24px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Placed in viewer */
.gp-marker-btn {
    opacity: var(--mk-opacity, 0.9);
    position: absolute;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 20;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gp-marker-btn:hover,
.gp-marker-btn.touch-active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 999;
}

.gp-marker-btn .marker-container {
    width: var(--mk-size, 32px);
    height: var(--mk-size, 32px);
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    position: relative;
}

.gp-marker-btn .marker-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    animation: markerPulseLight 2s infinite cubic-bezier(0.3, 0, 0, 1);
    z-index: -1;
    pointer-events: none;
}

@keyframes markerPulseLight {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--pulse-rgb, 255, 255, 255), 0.45);
    }
    70% {
        box-shadow: 0 0 0 16px rgba(var(--pulse-rgb, 255, 255, 255), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--pulse-rgb, 255, 255, 255), 0);
    }
}

/* Орбита-кольцо: тонкая светящаяся дуга крутится вокруг пина (StudioLab). */
.gp-marker-btn .marker-container::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 60%, rgba(var(--pulse-rgb, 255,255,255), 0.9) 80%, transparent 92%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
    filter: drop-shadow(0 0 3px rgba(var(--pulse-rgb, 255,255,255), 0.7));
    animation: gpOrbit 3.2s linear infinite;
    pointer-events: none;
    z-index: -1;
}
@keyframes gpOrbit { to { transform: rotate(360deg); } }
/* Появление меток «по очереди»: выскакивают с масштабом и лёгким подъёмом (StudioLab). */
.gp-marker-btn.gp-enter { animation: gpMarkerIn .5s cubic-bezier(.2,.85,.25,1) backwards; }
@keyframes gpMarkerIn {
    0%   { opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(.2); }
    60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .gp-marker-btn.gp-enter { animation: none; } }
/* Те же эффекты для ВЛОЖЕННЫХ меток (планировки/360/медиа-экраны). */
.nested-marker::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 60%, rgba(214,180,124,0.9) 80%, transparent 92%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
    filter: drop-shadow(0 0 3px rgba(214,180,124,0.6));
    animation: gpOrbit 3.2s linear infinite;
    pointer-events: none;
    z-index: -1;
}
.nested-marker.gp-enter { animation: gpNestedIn .5s cubic-bezier(.2,.85,.25,1) backwards; }
@keyframes gpNestedIn {
    0%   { opacity: 0;   transform: translate(-50%, calc(-50% + 10px)) scale(.2); }
    60%  { opacity: .9;  transform: translate(-50%, -50%) scale(1.12); }
    100% { opacity: .9;  transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .nested-marker::before { animation: none; opacity: 0; } .nested-marker.gp-enter { animation: none; } }

/* Лёгкое «парение» иконок (мягкий боб внутренней иконки) — ambient-жизнь, StudioLab. */
.gp-marker-btn .marker-container,
.nested-marker .marker-icon { animation: gpFloat 4s ease-in-out infinite; }
@keyframes gpFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
/* Десинхронизация — чтобы метки не колыхались в унисон. */
.gp-marker-btn:nth-of-type(2n) .marker-container, .nested-marker:nth-of-type(2n) .marker-icon { animation-delay: -1s; }
.gp-marker-btn:nth-of-type(3n) .marker-container, .nested-marker:nth-of-type(3n) .marker-icon { animation-delay: -2.2s; }
.gp-marker-btn:nth-of-type(5n) .marker-container, .nested-marker:nth-of-type(5n) .marker-icon { animation-delay: -3.1s; }
@media (prefers-reduced-motion: reduce) { .gp-marker-btn .marker-container, .nested-marker .marker-icon { animation: none; } }

/* Старый пульс (расходящееся кольцо) временно отключён — иконки и так крутятся и парят (StudioLab). */
.gp-marker-btn .marker-container::after,
.nested-marker::after { animation: none !important; box-shadow: none !important; }

/* Фокус-подсветка: при наведении на метку остальные слегка притухают (StudioLab). */
.gp-has-focus .gp-marker-btn:not(.gp-focused),
.gp-has-focus .nested-marker:not(.gp-focused) {
    opacity: 0.35 !important;
    filter: blur(0.5px);
    transition: opacity .25s ease, filter .25s ease;
}
.gp-has-focus .gp-focused { transition: opacity .25s ease; }

/* «Выцветание области» — обесцвечиваем+осветляем реальное содержимое зоны, обрезано по её форме (StudioLab). */
.gp-wash {
    position: absolute; inset: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 1;
    opacity: 0; transition: opacity .25s ease;
}
.gp-wash.show { opacity: 1; }

/* [ТЕСТ StudioLab] 3D-орбита облёта — домик + наклонённая орбита + точка-камера (замена стрелкам). */
#gp-spindial {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
    width: 96px; height: 96px; display: none; z-index: 56; cursor: grab; touch-action: none;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.45));
}
#gp-spindial:active { cursor: grabbing; }
#gp-spindial svg { width: 100%; height: 100%; overflow: visible; display: block; }
/* Кнопки вперёд/назад — второй способ управления, рядом с домиком по бокам */
#gp-spindial .sd-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(0,0,0,0.45); color: #f3ead9; font-size: 15px; line-height: 1;
    display: flex; align-items: center; justify-content: center; pointer-events: auto;
    transition: background .15s ease;
}
#gp-spindial .sd-nav:hover { background: rgba(0,0,0,0.65); }
#gp-spindial .sd-prev { left: -30px; }
#gp-spindial .sd-next { right: -30px; }
/* домик — кремовый лайн-арт, как в референсе */
#gp-spindial .sd-house path { fill: none; stroke: #f3ead9; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
/* орбита: задняя половина (за домом) тусклее, передняя ярче — эффект 3D */
#gp-spindial .sd-arc-back { fill: none; stroke: rgba(243,234,217,0.28); stroke-width: 2; stroke-linecap: round; }
#gp-spindial .sd-arc-front { fill: none; stroke: rgba(243,234,217,0.6); stroke-width: 2.4; stroke-linecap: round; }
/* остановки-точки: дальние мельче/тусклее, ближние крупнее/ярче */
#gp-spindial .sd-dot { fill: rgba(243,234,217,0.5); transition: fill .2s ease; }
#gp-spindial .sd-dot.bk { fill: rgba(243,234,217,0.3); }
#gp-spindial .sd-dot.focus { fill: rgba(243,234,217,0.9); }
#gp-spindial .sd-dot.cur { fill: var(--primary-gold, #D6B47C); filter: drop-shadow(0 0 4px var(--primary-gold, #D6B47C)) drop-shadow(0 0 9px rgba(214,180,124,0.7)); }
/* Указатель «здесь» — золотая точка снизу орбиты (к ней прилипает текущая остановка). */
#gp-spindial .sd-cursor { fill: var(--primary-gold, #D6B47C); filter: drop-shadow(0 0 5px var(--primary-gold, #D6B47C)) drop-shadow(0 0 10px rgba(214,180,124,0.7)); pointer-events: none; }
/* Запрет выделения текста и «синих» подсветок при вращении сцены. */
body.gp-scrubbing, body.gp-scrubbing * { user-select: none !important; -webkit-user-select: none !important; }
/* Компас во время вращения следует мгновенно (без инерции .6s). */
body.gp-scrubbing #gp-compass .gp-compass-dial { transition: none !important; }

/* Карточки на мобиле (в т.ч. АЛЬБОМ, где @media max-width:950 не срабатывает) — раскладка + сворачивание через класс. */
html.gp-mobile #ui-state-genplan, html.gp-mobile #ui-state-location,
html.gp-mobile #ui-state-layout-ext, html.gp-mobile #ui-state-map {
    position: fixed !important;   /* привязка к ВЬЮПОРТУ, а не к #ui-layer/#aspect-wrapper (cover) —
                                     иначе при повороте экрана карточка улетает вверх за пределы экрана */
    left: 10px !important; top: 58px !important; bottom: auto !important;
    transform: none !important;   /* привязка СВЕРХУ, под кнопкой Back — без перекрытия */
    width: calc(100% - 20px) !important; max-width: 300px !important;
    padding: 12px 15px !important; box-sizing: border-box !important;
    overflow: visible !important;   /* прокрутку берёт на себя внутренний .gp-card-scroll, язычок остаётся снаружи и не скроллится */
    text-align: left !important; overflow-wrap: break-word !important; word-break: break-word !important;
}
/* Внутренний контейнер: только он скроллится; язычок — сосед снаружи, фикс по центру карточки. */
html.gp-mobile #ui-state-genplan > .gp-card-scroll, html.gp-mobile #ui-state-location > .gp-card-scroll,
html.gp-mobile #ui-state-layout-ext > .gp-card-scroll, html.gp-mobile #ui-state-map > .gp-card-scroll {
    max-height: calc(100dvh - 90px) !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
}
/* Описание: убираем пустые строки (pre-wrap давал гигантские пробелы) */
html.gp-mobile #genplan-desc, html.gp-mobile #location-desc, html.gp-mobile #house-desc {
    white-space: normal !important;
}
/* Метрики: убираем огромные inline-отступы (было margin-bottom 45px); значения выравниваем по верху ряда. */
html.gp-mobile #genplan-metrics, html.gp-mobile #location-metrics, html.gp-mobile #house-metrics {
    margin: 0 0 10px !important; gap: 10px 16px !important; row-gap: 8px !important;
    align-items: flex-start !important;   /* числа в ряду на одной линии, даже если подпись переносится */
}
/* Каждый показатель: число над подписью, всё по центру и выровнено. */
html.gp-mobile #genplan-metrics > div, html.gp-mobile #location-metrics > div, html.gp-mobile #house-metrics > div {
    margin: 0 !important; align-items: center !important; text-align: center !important;
}
html.gp-mobile #genplan-metrics strong, html.gp-mobile #location-metrics strong, html.gp-mobile #house-metrics strong {
    margin: 0 0 1px !important; text-align: center !important; width: 100% !important;
}
html.gp-mobile #genplan-metrics span, html.gp-mobile #location-metrics span, html.gp-mobile #house-metrics span {
    text-align: center !important;
}
/* Язычок фиксирован по центру карточки и торчит наружу справа — НЕ скроллится вместе с текстом (текст в .gp-card-scroll). */
html.gp-mobile .mobile-drawer-handle { top: 50% !important; right: 0 !important; transform: translate(100%, -50%) !important; }
/* Метрики переносятся, не вылезают вбок */
html.gp-mobile #genplan-metrics, html.gp-mobile #location-metrics, html.gp-mobile #house-metrics {
    flex-wrap: wrap !important;
}
/* Заголовок переносится, не обрезается */
html.gp-mobile #genplan-title, html.gp-mobile #location-title,
html.gp-mobile #house-title, html.gp-mobile #map-title { white-space: normal !important; overflow-wrap: break-word !important; }

/* Компас — в правый нижний угол на мобиле (не перекрывает карточку слева). */
html.gp-mobile #gp-compass { left: auto !important; right: 18px !important; bottom: 18px !important; }

/* Ещё плотнее контент карточек на мобиле — чтобы всё влезало без обрезки сверху. */
html.gp-mobile #ui-state-genplan, html.gp-mobile #ui-state-location,
html.gp-mobile #ui-state-layout-ext, html.gp-mobile #ui-state-map { padding: 12px 15px !important; }
html.gp-mobile #genplan-title, html.gp-mobile #location-title,
html.gp-mobile #house-title, html.gp-mobile #map-title { font-size: 17px !important; margin: 0 0 5px !important; }
html.gp-mobile #genplan-desc, html.gp-mobile #location-desc, html.gp-mobile #house-desc {
    font-size: 11.5px !important; line-height: 1.3 !important; margin-bottom: 9px !important;
}
html.gp-mobile #genplan-metrics, html.gp-mobile #location-metrics, html.gp-mobile #house-metrics {
    gap: 12px 18px !important; margin-bottom: 10px !important; row-gap: 8px !important;
}
html.gp-mobile #ui-state-genplan strong, html.gp-mobile #ui-state-location strong,
html.gp-mobile #ui-state-layout-ext strong { font-size: 16px !important; margin-bottom: 0 !important; }
html.gp-mobile #ui-state-genplan .primary-btn, html.gp-mobile #ui-state-location .primary-btn,
html.gp-mobile #ui-state-layout-ext .primary-btn { padding: 9px 18px !important; font-size: 12.5px !important; margin-top: 4px !important; }
/* Аудио-плеер локации на мобиле прячем, чтобы не растягивал карточку */
html.gp-mobile #ui-state-location #location-audio, html.gp-mobile #ui-state-genplan #genplan-audio { display: none !important; }
html.gp-mobile #ui-state-genplan.mobile-collapsed, html.gp-mobile #ui-state-location.mobile-collapsed,
html.gp-mobile #ui-state-layout-ext.mobile-collapsed, html.gp-mobile #ui-state-map.mobile-collapsed {
    transform: translateX(calc(-100% + 26px)) !important;   /* уезжает влево, у края остаётся язычок для возврата */
}
/* При сворачивании прячем весь контент (текст/кнопки не должны торчать из полоски) — виден только язычок. */
html.gp-mobile .mobile-collapsed > .gp-card-scroll {
    opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
}
/* …и вообще всё содержимое свёрнутой карточки (заголовки, текст, кнопки — у разных карточек оно не в .gp-card-scroll) */
html.gp-mobile .mobile-collapsed > *:not(.mobile-drawer-handle) {
    opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
}
/* Картинка виллы/этажа на мобиле — ниже, чтобы карточка не была слишком высокой. */
/* Медиа в карточке «о проекте»/вилле: ограничиваем сам элемент (а не контейнер с overflow:hidden),
   object-fit:contain — видео/картинка показывается целиком, без обрезки. */
html.gp-mobile #house-media { max-height: none !important; overflow: visible !important; border-radius: 12px !important; }
html.gp-mobile #house-media video, html.gp-mobile #house-media img,
html.gp-mobile #ui-state-layout-ext img {
    max-height: 150px !important; width: 100% !important; height: auto !important;
    object-fit: contain !important; display: block !important; border-radius: 12px !important;
}
/* Язычок-ручка сворачивания карточек — под КЛАСС gp-mobile (работает и в альбоме, где @media не срабатывает). */
html.gp-mobile .mobile-drawer-handle {
    display: flex !important; align-items: center; justify-content: center;
    position: absolute; top: 50%; right: 0; transform: translate(100%, -50%);
    width: 24px; height: 64px; background: rgba(0,0,0,0.55);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2); border-left: none; border-radius: 0 8px 8px 0;
    cursor: pointer; z-index: 100; box-shadow: 5px 0 15px rgba(0,0,0,0.3);
}
html.gp-mobile .handle-arrow { width: 14px; height: 14px; color: rgba(255,255,255,0.9); transition: transform .3s ease; }
html.gp-mobile .mobile-collapsed .handle-arrow { transform: rotate(180deg); }

/* Вертикальная день/ночь-перемотка справа — КРИВАЯ дуга, точка снизу вверх (мобайл). */
html.gp-mobile #gp-timearc.ta-vert {
    left: auto !important; right: 8px !important; top: 54% !important; bottom: auto !important;
    width: 42px !important; height: 180px !important; transform: translateY(-50%) !important;
    pointer-events: auto !important;   /* тянем в любом месте дуги */
}
#gp-timearc.ta-vert > svg:not(.ta-svg-v) { display: none; }   /* прячем горизонтальную дугу */
#gp-timearc .ta-svg-v { display: none; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#gp-timearc.ta-vert .ta-svg-v { display: block; }
#gp-timearc .ta-track-v { fill: none; stroke: rgba(243,234,217,0.28); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
#gp-timearc .ta-hit-v { fill: none; stroke: transparent; stroke-width: 30; pointer-events: stroke; }
html.gp-mobile #map-title, html.gp-mobile #genplan-title,
html.gp-mobile #location-title, html.gp-mobile #house-title {
    font-size: 19px !important; line-height: 1.15 !important; margin: 0 0 8px !important;
}
html.gp-mobile #genplan-desc, html.gp-mobile #location-desc, html.gp-mobile #house-desc {
    font-size: 12px !important; line-height: 1.35 !important; margin-bottom: 14px !important;
}
html.gp-mobile #genplan-metrics, html.gp-mobile #location-metrics, html.gp-mobile #house-metrics {
    gap: 16px !important; margin-bottom: 16px !important;
}
html.gp-mobile #ui-state-genplan strong, html.gp-mobile #ui-state-location strong,
html.gp-mobile #ui-state-layout-ext strong { font-size: 18px !important; }
html.gp-mobile #ui-state-genplan .primary-btn, html.gp-mobile #ui-state-location .primary-btn,
html.gp-mobile #ui-state-layout-ext .primary-btn { padding: 11px 20px !important; font-size: 13px !important; }

/* Маркеры на мобиле — мельче (ближе к десктопным пропорциям, не гигантские), но не мельче
   рекомендованного минимума тач-цели (~44pt) — в маленьких комнатах на плане иначе тяжело попасть. */
html.gp-mobile .nested-marker { width: 48px !important; height: 48px !important; }
html.gp-mobile .gp-marker-btn .marker-container { width: 34px; height: 34px; }
html.gp-mobile .nested-marker::before, html.gp-mobile .gp-marker-btn .marker-container::before { inset: -4px; }
/* Убираем задержку/двойной-тап-зум браузера на самих метках — на мелких иконках эта задержка
   ощущается как «плохо срабатывает тач», особенно у края экрана. */
html.gp-mobile .nested-marker, html.gp-mobile .gp-marker-btn { touch-action: manipulation; }

/* «Поверните телефон» — тур только в альбоме (показываем в портрете на мобиле). */
#gp-rotate-overlay {
    position: fixed; inset: 0; z-index: 100000; display: none;
    flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    background: #0b0b0c; color: #f3ead9; text-align: center; padding: 24px;
}
@media (orientation: portrait) { html.gp-mobile #gp-rotate-overlay { display: flex; } }
/* На мобиле главный экран жёстко фиксируем — никакой горизонтальной прокрутки/панорамы. */
html.gp-mobile #scroll-wrapper { overflow: hidden !important; justify-content: center !important; align-items: center !important; }
html.gp-mobile, html.gp-mobile body { overflow: hidden !important; overscroll-behavior: none !important; }
#gp-rotate-overlay .rot-icon { width: 62px; height: 62px; color: var(--primary-gold, #D6B47C); animation: gpRotHint 2.2s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes gpRotHint { 0%, 35% { transform: rotate(0deg); } 55%, 100% { transform: rotate(-90deg); } }
#gp-rotate-overlay .rot-txt { font-size: 16px; font-weight: 600; }
#gp-rotate-overlay .rot-sub { font-size: 13px; opacity: 0.65; }
/* ===== Встроенный браузер соцсетей (Instagram и т.п.) в портрете: живой предпросмотр тура + подсказка ===== */
#gp-inapp { position: fixed; inset: 0; z-index: 200000; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 22px; padding: 18px 12px calc(18px + env(safe-area-inset-bottom));
    background: radial-gradient(120% 80% at 50% 0%, #1b1d22 0%, #0b0b0c 60%); color: #f3ead9; overflow-y: auto; }
#gp-inapp .ia-name { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: rgba(243,234,217,.55); }
#gp-inapp .ia-frame { position: relative; border-radius: 14px; overflow: hidden; flex: none; background: #000;
    box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 0 1px rgba(214,180,124,.22); }
#gp-inapp .ia-frame iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; }
#gp-inapp .ia-head { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: -8px; }
#gp-inapp .ia-live { display: flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(243,234,217,.45); }
#gp-inapp .ia-live i { width: 6px; height: 6px; border-radius: 50%; background: #D6B47C; animation: iaPulse 1.6s ease-in-out infinite; }
@keyframes iaPulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
#gp-inapp .ia-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
    padding: 22px 20px 20px; border-radius: 22px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08); }
#gp-inapp .ia-phone { width: 46px; height: 46px; color: #D6B47C; animation: iaRot 2.6s ease-in-out infinite; }
@keyframes iaRot { 0%, 30% { transform: rotate(0deg); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }
#gp-inapp .ia-title { font-size: 17px; font-weight: 600; }
#gp-inapp .ia-text { font-size: 13px; line-height: 1.5; color: rgba(243,234,217,.65); max-width: 320px; }
#gp-inapp .ia-step { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px 14px; border-radius: 14px;
    background: rgba(214,180,124,.08); border: 1px solid rgba(214,180,124,.18); font-size: 13px; line-height: 1.4; text-align: left; }
#gp-inapp .ia-dots { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(214,180,124,.18); color: #D6B47C; font-size: 18px; font-weight: 700; line-height: 1; }
#gp-inapp .ia-copy { margin-top: 6px; padding: 12px 24px; border-radius: 40px; border: none; background: #D6B47C; color: #14160F;
    font: 600 14px/1.2 inherit; cursor: pointer; }

/* Убрать голубую подсветку/выделение при тапе по иконкам и кнопкам (StudioLab). */
html { -webkit-tap-highlight-color: transparent; }
.gp-marker-btn, .nested-marker, .glass-btn, .primary-btn, button, [role="button"],
#gp-spindial, #gp-compass, #gp-spin-hint, .media-arrow, .media-cell,
.info-collapse-tab, .mobile-drawer-handle, #aspect-wrapper {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none;
}
.gp-marker-btn:focus, .nested-marker:focus, button:focus, [role="button"]:focus { outline: none; }

/* Подсказка «зажми и веди» при входе в 360 (StudioLab). */
#gp-spin-hint {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-14px);
    display: flex; align-items: center; gap: 16px; z-index: 57; pointer-events: none;
    padding: 9px 20px; border-radius: 999px; white-space: nowrap;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    opacity: 0; transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
#gp-spin-hint.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#gp-spin-hint .sh-chev { color: var(--primary-gold, #D6B47C); font-size: 20px; line-height: 1; opacity: .75; }
#gp-spin-hint .sh-hand { display: inline-flex; color: var(--primary-gold, #D6B47C); width: 26px; height: 26px; animation: shHand 1.7s ease-in-out infinite; filter: drop-shadow(0 0 5px rgba(214,180,124,0.6)); }
#gp-spin-hint .sh-hand svg { width: 100%; height: 100%; }
@keyframes shHand {
    0%, 100% { transform: translateX(-22px) rotate(-10deg); }
    50%      { transform: translateX(22px) rotate(10deg); }
}
@media (prefers-reduced-motion: reduce) { #gp-spin-hint .sh-hand { animation: none; } }
/* Подсказка вращения на мобиле: компактнее (≈ как кнопка Back) и по центру на ОДНОЙ линии с Back. */
html.gp-mobile #gp-spin-hint {
    font-size: 12px; top: 15px;            /* та же линия, что и Back (top:15) — центры совпадают */
    padding: 6px 14px; gap: 10px;
}
html.gp-mobile #gp-spin-hint .sh-hand { width: 18px; height: 18px; }
html.gp-mobile #gp-spin-hint .sh-chev { font-size: 15px; }
/* Canvas сцены для скраба кадров облёта (поверх видео, под интерфейсом). */
#gp-orbit-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; display: none; }
#gp-orbit-canvas.show { display: block; }
#gp-spindial .sd-label {
    position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
    white-space: nowrap; font-size: 12px; font-weight: 600; color: #fff;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); padding: 4px 10px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15); pointer-events: none;
}
/* Мобильный — крупнее и в зоне большого пальца. */
html.gp-mobile #gp-spindial { width: 96px; height: 96px; bottom: 8px; }   /* маленький, у самого низа — не лезет в центр */

/* №4 — тонкая световая кромка у стекла: по верхнему краю панели мягкий блик (StudioLab). */
.glass-panel { position: relative; }
.glass-panel::before {
    content: '';
    position: absolute;
    left: 14px; right: 14px; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    pointer-events: none;
    z-index: 1;
}

/* №5 — живой блик по золотым кнопкам: при наведении пробегает мягкий свет (StudioLab). */
.primary-btn { position: relative; overflow: hidden; }
.primary-btn::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: -70%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-18deg);
    pointer-events: none;
}
.primary-btn:hover::after { animation: gpBtnShine .75s ease; }
@keyframes gpBtnShine { from { left: -70%; } to { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .primary-btn:hover::after { animation: none; } }

/* №3 — каскадный вход карточки: дети мягко «поднимаются» по очереди (StudioLab). */
@keyframes gpRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* №2 — компас на 360-облёте (StudioLab). */
#gp-compass {
    position: fixed; left: 24px; bottom: 24px; width: 54px; height: 54px;
    display: none; align-items: center; justify-content: center; z-index: 55; pointer-events: none;
}
#gp-compass .gp-compass-dial {
    width: 54px; height: 54px; border-radius: 50%; position: relative;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(0,0,0,0.4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    transition: transform .6s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
#gp-compass .gp-compass-n {
    position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
    font-size: 11px; font-weight: 700; letter-spacing: .5px; color: var(--primary-gold, #D6B47C);
}
#gp-compass .gp-compass-needle {
    position: absolute; top: 50%; left: 50%; width: 0; height: 0;
    border-left: 5px solid transparent; border-right: 5px solid transparent;
    border-bottom: 16px solid var(--primary-gold, #D6B47C);
    transform: translate(-50%, -100%);
    filter: drop-shadow(0 0 3px rgba(214,180,124,0.9));
}
/* Южный «хвост» стрелки — серый треугольник вниз, чтобы читалась ось. */
#gp-compass .gp-compass-needle::after {
    content: ''; position: absolute; left: -5px; top: 16px;
    border-left: 5px solid transparent; border-right: 5px solid transparent;
    border-top: 12px solid rgba(255,255,255,0.28);
}
#gp-compass .gp-compass-dial::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; border-radius: 50%;
    background: var(--primary-gold, #D6B47C); transform: translate(-50%, -50%);
}

/* Солнечная дуга: скраб день/ночь по мастер-видео (StudioLab). */
#gp-timearc {
    position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
    width: min(340px, 62vw); height: 84px; display: none; z-index: 54; pointer-events: none;
}
#gp-timearc svg { width: 100%; height: 100%; overflow: visible; display: block; }
#gp-timearc .ta-track { fill: none; stroke: rgba(255,255,255,0.22); stroke-width: 2; stroke-linecap: round; }
#gp-timearc .ta-fill { fill: none; stroke: var(--primary-gold, #D6B47C); stroke-width: 2.6; stroke-linecap: round; opacity: .9; transition: stroke .5s ease; }
#gp-timearc.night .ta-fill { stroke: #9db4d6; }
#gp-timearc .ta-hit { fill: none; stroke: transparent; stroke-width: 26; pointer-events: stroke; cursor: pointer; }
#gp-timearc .ta-orb {
    position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #fff, var(--primary-gold, #D6B47C));
    box-shadow: 0 0 10px var(--primary-gold, #D6B47C), 0 0 22px rgba(214,180,124,0.6);
    cursor: grab; pointer-events: auto; touch-action: none;
    transition: box-shadow .5s ease, background .5s ease;   /* без transition на transform — позиция мгновенная */
    will-change: transform;
}
#gp-timearc.night .ta-orb {
    background: radial-gradient(circle at 40% 35%, #fff, #9db4d6);
    box-shadow: 0 0 10px #9db4d6, 0 0 20px rgba(157,180,214,0.6);
}
#gp-timearc.dragging .ta-orb { cursor: grabbing; }
/* Пока кэш кадров собирается — орб мягко пульсирует, дуга приглушена. */
#gp-timearc.preparing .ta-orb { animation: taPrep 1s ease-in-out infinite; }
@keyframes taPrep {
    0%, 100% { box-shadow: 0 0 8px var(--primary-gold, #D6B47C), 0 0 16px rgba(214,180,124,0.5); }
    50%      { box-shadow: 0 0 15px var(--primary-gold, #D6B47C), 0 0 32px rgba(214,180,124,0.95); }
}
#gp-timearc.preparing .ta-track, #gp-timearc.preparing .ta-fill { opacity: 0.4; }
html.gp-mobile #gp-timearc { bottom: 74px; width: 230px; height: 62px; }
/* Низкие/альбомные экраны — ещё компактнее, чтобы не перекрывать план (специфичность выше mobile-правила). */
@media (max-height: 560px) { html #gp-timearc, html.gp-mobile #gp-timearc { width: 190px; height: 50px; bottom: 50px; } }
html.gp-mobile #gp-timearc .ta-orb { width: 22px; height: 22px; }   /* крупный хват под палец */
/* Canvas-оверлей для плавного скраба (показывает подтверждённые кадры видео). */
#gp-ta-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; display: none; }
#gp-ta-canvas.show { display: block; }

@media (prefers-reduced-motion: reduce) { .gp-marker-btn .marker-container::before { animation: none; opacity: 0; } }

.marker-inner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.marker-icon-custom {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.gp-marker-btn.has-custom-icon .marker-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
/* Прямоугольная/свободная форма иконки вместо круга. */
.gp-marker-btn.ic-rect .marker-container,
.gp-marker-btn.ic-rect .marker-icon-custom { border-radius: 14% !important; }
.gp-marker-btn.ic-rect .marker-icon-custom { object-fit: contain !important; }

/* Spinner Type */
.gp-marker-btn.type-spinner .marker-container {
    border: 1px solid rgba(214, 180, 124, 0.5);
    box-shadow: 0 0 20px rgba(214, 180, 124, 0.4), inset 0 0 10px rgba(214, 180, 124, 0.2);
}
.gp-marker-btn.type-spinner .marker-inner-dot {
    background: var(--accent-gold);
    box-shadow: 0 0 8px var(--accent-gold);
}

/* Location Type */
.gp-marker-btn.type-media .marker-container {
    border: 1px solid rgba(165, 180, 252, 0.5);
    box-shadow: 0 0 20px rgba(100, 150, 255, 0.4), inset 0 0 10px rgba(100, 150, 255, 0.2);
}
.gp-marker-btn.type-media .marker-inner-dot {
    background: #eff6ff;
    box-shadow: 0 0 8px #a5b4fc;
}

/* Layout Type */
.gp-marker-btn.type-layout .marker-container {
    border: 1px solid rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4), inset 0 0 10px rgba(168, 85, 247, 0.2);
}
.gp-marker-btn.type-layout svg {
    width: 14px !important;
    height: 14px !important;
    color: #e9d5ff;
    filter: drop-shadow(0 0 4px #c084fc);
}

/* Custom tooltip for descriptions */
.marker-tooltip {
    position: fixed !important;
    top: 50% !important;
    left: 80px !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 350px !important;
    max-width: 350px !important;
    text-align: left !important;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    z-index: 5000 !important;
}

.marker-tooltip img, .marker-tooltip video {
    margin: 0;
}

.marker-tooltip::after {
    display: none !important;
}

/* Hover rules are consolidated at the bottom of the file */

/* --- SIDEBAR LAYOUT (For 9:16 format with Genplan) --- */
#app-container.with-sidebar {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 20px;
    box-sizing: border-box;
}

#app-container.with-sidebar #aspect-wrapper {
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

#sidebar-panel {
    width: 400px;
    max-width: 100%;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: rgba(20, 25, 35, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    position: relative;
    font-family: var(--font);
    overflow: hidden;
}

.sidebar-header {
    padding: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.3);
}

#sidebar-title {
    font-size: 20px;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: 0.5px;
}

.sidebar-content {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-desc-box {
    font-size: 15px;
    line-height: 1.6;
    color: #cbd5e1;
    white-space: pre-wrap;
}

#sidebar-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.gallery-item {
    aspect-ratio: 1;
    background: rgba(0,0,0,0.5);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.4);
}

.gallery-item img, .gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- LIGHTBOX MODAL --- */
#lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

#lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox-content img {
    width: 50vw;
    max-width: 950px;
    max-height: 70vh;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    background: #000;
    border: 1px solid rgba(255,255,255,0.1);
}

.custom-video-wrapper {
    position: relative;
    display: flex;
    overflow: hidden;
    width: 50vw;
    max-width: 950px;
    max-height: 70vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    background: #000;
    border: 1px solid rgba(255,255,255,0.1);
}

.custom-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.custom-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-video-wrapper:hover .custom-video-controls {
    opacity: 1;
}

.custom-play-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.custom-play-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.custom-play-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    stroke: currentColor;
}

.custom-progress-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.custom-progress-filled {
    height: 100%;
    background: var(--accent);
    width: 0%;
    border-radius: 3px;
    pointer-events: none;
    box-shadow: 0 0 10px var(--accent);
}

.custom-time-display {
    color: white;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

/* Кнопка «на весь экран» — тот же стиль, что play-кнопка. */
.custom-fs-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.custom-fs-btn:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.05); }
.custom-fs-btn svg { width: 20px; height: 20px; }

/* На мобиле нет hover — контролы (в т.ч. кнопка фуллскрина) всегда видимы. */
html.gp-mobile .custom-video-controls { opacity: 1 !important; }

@media (max-width: 950px) {
    #lightbox-content img, .custom-video-wrapper {
        width: 90vw;
        max-height: 50vh;
    }
}

#btn-lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-family: var(--font);
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1001;
}

#btn-lightbox-close.icon-only {
    padding: 12px;
    border-radius: 50%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#btn-lightbox-close:hover {
    background: #ef4444;
    border-color: #ef4444;
}

/* Floor Plan CTA Button */
.floorplan-cta-btn {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.6);
    color: #e9d5ff;
    font-size: 16px;
    padding: 18px 45px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition, all 0.3s ease);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), inset 0 0 10px rgba(168, 85, 247, 0.1);
    text-shadow: 0 0 4px rgba(192, 132, 252, 0.5);
}

.floorplan-cta-btn:hover {
    background: rgba(20, 20, 25, 0.95);
    border-color: rgba(168, 85, 247, 0.9);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6), inset 0 0 15px rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
    color: #fff;
    text-shadow: 0 0 8px rgba(192, 132, 252, 0.8);
}

/* Spinner Arrow Button (Gold) */
.spinner-arrow-btn {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(214, 180, 124, 0.5);
    color: #d6b47c;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), inset 0 0 10px rgba(214, 180, 124, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-arrow-btn svg {
    filter: drop-shadow(0 0 2px rgba(214, 180, 124, 0.5));
    transition: all 0.3s ease;
}

.spinner-arrow-btn:hover {
    background: rgba(20, 20, 25, 0.95);
    border-color: rgba(214, 180, 124, 0.9);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6), inset 0 0 15px rgba(214, 180, 124, 0.4);
    transform: translateY(-2px);
    color: #fff;
}

.spinner-arrow-btn:hover svg {
    filter: drop-shadow(0 0 6px #d6b47c);
    color: #d6b47c;
}

/* ================================= */
/* ================================= */
/*          INFO DROPDOWN            */
/* ================================= */
/* Base styles updated at the top of the file */


#aspect-wrapper.aspect-9-16 .floating-open-btn,
#aspect-wrapper.aspect-9-16 .floating-panel {
    display: none !important;
}

/* --- Вложенные и Скрытые маркеры --- */
.genplan-marker.hidden-marker {
    opacity: 0.3;
    pointer-events: none; /* In editor, maybe they should be clickable to re-drag? We let them be clickable in editor by overriding later if needed */
}

.nested-marker {
    opacity: 0.9;
    position: absolute;
    background: var(--btn-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    color: var(--primary);
    width: 48px;
    height: 48px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: var(--transition);
    z-index: 50;
    cursor: grab;
    pointer-events: auto;
}

.nested-marker::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    animation: markerPulseLight 2s infinite cubic-bezier(0.3, 0, 0, 1);
    z-index: -1;
    pointer-events: none;
}

.nested-marker:active {
    cursor: grabbing;
}

.nested-marker:hover,
.nested-marker.touch-active {
    opacity: 1;
    background: var(--btn-hover);
    border-color: rgba(255,255,255,0.4);
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 15px 25px rgba(0,0,0,0.3);
    z-index: 999;
}


.mobile-enter-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font);
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.mobile-enter-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.url-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    margin-top: 8px;
}
.url-input:focus {
    outline: none;
    border-color: #38bdf8;
    background: rgba(0,0,0,0.5);
}

.nav-btn-bottom { background: transparent; color: rgba(255,255,255,0.6); padding: 10px 24px; border-radius: 30px; border: none; font-size: 14px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: all 0.3s ease; }
.nav-btn-bottom:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-btn-bottom.active { background: rgba(255,255,255,0.1); color: white; }

/* Сворачиваемое меню фильтров — симметричное раскрытие от центра */
.filter-items { display: flex; align-items: center; overflow: hidden; flex: 0 0 auto; white-space: nowrap; transition: width .45s cubic-bezier(.4,0,.2,1), opacity .35s ease; opacity: 1; }
.filter-items .nav-btn-bottom { flex: 0 0 auto; white-space: nowrap; }
.filter-items.filter-left { justify-content: flex-end; }
.filter-items.filter-right { justify-content: flex-start; }
.filter-items.collapsed { opacity: 0; }
.nav-btn-bottom.filter-toggle { padding: 10px 13px; flex: 0 0 auto; }
.nav-btn-bottom.filter-toggle svg { transition: transform .4s ease; }
.nav-btn-bottom.filter-toggle.is-open svg { transform: rotate(180deg); }

/* Подсветка меток выбранной группы её цветом */
.gp-marker-btn.group-lit .marker-icon-custom { filter: drop-shadow(0 0 5px var(--grp-glow)) drop-shadow(0 0 11px var(--grp-glow)); }
.gp-marker-btn.group-lit .marker-inner-dot { background: var(--grp-glow); box-shadow: 0 0 9px var(--grp-glow), 0 0 18px var(--grp-glow); }
.gp-marker-btn.group-lit svg { filter: drop-shadow(0 0 6px var(--grp-glow)); }

/* Инфо-карточка: сворачивание в «язычок» */
#ui-state-genplan, #ui-state-map { transition: transform .45s cubic-bezier(.4,0,.2,1); }
/* При сворачивании прячем содержимое карточки — виден только язычок, текст не торчит */
#ui-state-genplan.info-collapsed > *:not(.info-collapse-tab),
#ui-state-map.info-collapsed > *:not(.info-collapse-tab) {
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.info-collapse-tab { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 52px; border-radius: 13px; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.85); cursor: pointer; z-index: 5; transition: background .25s ease; }
.info-collapse-tab:hover { background: rgba(255,255,255,0.22); }
/* В карточке виллы даём место справа под язычок, чтобы он не перекрывал картинку/контент. */
#ui-state-layout-ext { padding-right: 46px !important; }
.info-collapse-tab svg { transition: transform .4s ease; }
.info-collapse-tab.is-collapsed svg { transform: rotate(180deg); }
@media (max-width: 950px) { .info-collapse-tab { display: none; } }

/* Custom Webkit Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(214, 180, 124, 0.4);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(214, 180, 124, 0.8);
}
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(214, 180, 124, 0.4) transparent;
}

#btn-explore-project:hover, .glass-btn:hover, .nav-btn-bottom:hover {
    background: rgba(214, 180, 124, 0.15) !important;
    box-shadow: 0 0 20px rgba(214, 180, 124, 0.4) !important;
    border-color: rgba(214, 180, 124, 0.6) !important;
    color: #fff !important;
}

#btn-explore-project:hover, .glass-btn:hover {
    transform: translateY(-2px);
}

/* =========================================
   MOBILE RESPONSIVENESS OVERRIDES
========================================= */
.mobile-drawer-handle {
    display: none;
}

@media screen and (max-width: 950px) {
    /* Global Headers */
    #global-header {
        padding: 15px !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    #header-left {
        width: 100%;
        justify-content: space-between;
    }
    
    #header-right {
        position: absolute !important;
        top: 15px !important;
        right: 15px !important;
        width: auto !important;
    }
    
    #btn-genplan-back, #btn-guided-tour, .top-info-dropdown {
        left: 15px !important;
        top: 15px !important;
    }
    
    .top-info-dropdown.open {
        width: calc(100vw - 30px) !important;
    }
    
    /* Hamburger Menu Overrides */
    #btn-hamburger {
        display: flex !important;
    }
    
    #hamburger-menu {
        display: none; /* JS toggles to flex */
        position: absolute;
        top: 50px;
        right: 0;
        flex-direction: column;
        background: rgba(21, 21, 23, 0.6);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        padding: 15px;
        gap: 12px;
        min-width: 180px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        z-index: 1000;
        align-items: stretch !important;
    }
    
    #btn-guided-tour {
        width: 100%;
        justify-content: center;
        position: relative !important;
        left: auto !important;
        top: auto !important;
    }

    /* Force Horizontal Panorama Scroll on Mobile */
    #scroll-wrapper {
        align-items: flex-start; /* Keep at top */
    }
    
    #aspect-wrapper {
        height: 100vh !important;
        width: calc(100vh * (16 / 9)) !important;
        max-width: none !important;
        max-height: none !important;
        flex-shrink: 0 !important;
    }
    
    /* Floating UI Panels (Map, Genplan, Location, Layout) - SLIDE OUT EFFECT */
    #ui-state-map, #ui-state-genplan, #ui-state-location, #ui-state-layout-ext {
        left: 0 !important;
        top: 45% !important;
        transform: translate(0, -50%) !important; /* Visible position by default */
        transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);

        width: calc(100% - 40px) !important;
        max-width: 350px !important;
        padding: 25px !important;
        text-align: center;
        box-sizing: border-box;
    }

    /* The toggled hidden state */
    #ui-state-map.mobile-collapsed, #ui-state-genplan.mobile-collapsed, #ui-state-location.mobile-collapsed, #ui-state-layout-ext.mobile-collapsed {
        transform: translate(calc(-100% + 24px), -50%) !important;
    }
    
    /* Pull Handle UI */
    .mobile-drawer-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        right: 0;
        transform: translate(100%, -50%);
        width: 24px;
        height: 64px;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-left: none;
        border-radius: 0 8px 8px 0;
        cursor: pointer;
        z-index: 100;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
    }
    .handle-arrow {
        width: 14px;
        height: 14px;
        color: rgba(255, 255, 255, 0.9);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* When collapsed (hidden), arrow points right to open */
    .mobile-collapsed .handle-arrow {
        transform: rotate(180deg);
    }
    
    #map-title, #genplan-title, #location-title, #house-title {
        font-size: 26px !important;
    }
    
    #genplan-metrics, #location-metrics, #house-metrics {
        justify-content: center !important;
        gap: 15px !important;
        flex-wrap: wrap !important;
    }
    
    #btn-explore-project, #btn-location-details {
        margin: 0 auto;
        width: 100%;
        justify-content: center;
    }

    /* Bottom Filters */
    #genplan-nav-bottom {
        bottom: 15px !important;
        width: 95%;
        z-index: 95; /* ensure under modals */
    }
    
    #genplan-nav-bottom .glass-panel {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-btn-bottom {
        padding: 10px !important;
        font-size: 11px !important;
        flex-direction: column;
        gap: 4px;
        flex: 1;
        justify-content: center;
        text-align: center;
    }
    
    #nav-label-1, #nav-label-2, #nav-label-3 {
        display: none !important;
    }
    
    #nav-icon-spinner, #nav-icon-media, #nav-icon-layout {
        transform: scale(1.6);
        margin: 4px 0;
    }
    
    #btn-filter-toggle {
        font-size: 10px !important;
    }

    /* Floorplan & Controls */
    #ui-bottom-controls {
        bottom: 75px !important;
    }
    
    #btn-enter-floorplan {
        bottom: 60px !important;
    }

    /* Sales Widget - Move to hamburger menu */
    #btn-sales-widget {
        position: relative !important;
        top: auto !important; 
        bottom: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100%;
        padding: 12px 20px !important;
        border-radius: 30px !important;
        font-size: 14px !important;
    }

    /* Modals (Onboarding & Sales) */
    .instruction-modal, .sales-modal-content {
        padding: 20px !important;
        width: 95% !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        gap: 20px !important;
    }
    
    #btn-instruction-close-x, #btn-sales-close {
        top: 10px !important;
        right: 10px !important;
    }
    
    .sales-form-grid, .sales-contact-grid {
        grid-template-columns: 1fr !important;
    }
    
    .sales-feature {
        align-items: flex-start !important;
    }
}

/* ============================================================
   Фильтр-док: по центру экрана, раскрытие симметрично в обе стороны.
   Цвета не трогаем — их задаёт пользователь (группы/обводки/маршрут).
   ============================================================ */
#genplan-nav-bottom {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 30px !important;
    transform: translateX(-50%) !important;
}
/* Кнопка «Стройка» теперь живёт в доке рядом с фильтром — плавающую верхнюю прячем всегда. */
#btn-construction { display: none !important; }

/* Карточка товара (клик по точке типа «product») */
#gp-product-card {
    position: fixed; inset: 0; z-index: 2200; display: none;
    align-items: center; justify-content: center; padding: 24px;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .25s ease; pointer-events: auto;
}
#gp-product-card.show { opacity: 1; }
#gp-product-card .gp-pc-card {
    position: relative; width: min(92vw, 420px); max-height: 88vh; overflow: auto;
    background: rgba(20,20,22,0.92); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    transform: translateY(12px) scale(.98); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
#gp-product-card.show .gp-pc-card { transform: translateY(0) scale(1); }
/* Картинку показываем целиком (не режем); фон прозрачный → под PNG без фона видна
   та же полупрозрачная подложка карточки, что и в описании ниже. */
#gp-product-card .gp-pc-img { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: 20px 20px 0 0; background: transparent; padding: 16px 16px 0; }
#gp-product-card .gp-pc-body { padding: 22px 24px 26px; }
#gp-product-card .gp-pc-title { font-size: 22px; font-weight: 600; color: #fff; line-height: 1.2; }
#gp-product-card .gp-pc-price { margin-top: 8px; font-size: 16px; font-weight: 600; color: var(--primary-gold, #D6B47C); }
#gp-product-card .gp-pc-desc { margin-top: 14px; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.8); white-space: pre-wrap; }
#gp-product-card .gp-pc-metrics { display: flex; gap: 35px; flex-wrap: wrap; margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
#gp-product-card .gp-pc-metrics > div { display: flex; flex-direction: column; }
#gp-product-card .gp-pc-metrics strong { font-size: 24px; font-weight: 500; color: #fff; margin-bottom: 2px; }
#gp-product-card .gp-pc-metrics span { font-size: 13px; color: rgba(255,255,255,0.6); }
#gp-product-card .gp-pc-close {
    position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
    border: none; cursor: pointer; font-size: 22px; line-height: 1; color: #fff;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 2;
    display: flex; align-items: center; justify-content: center; transition: background .2s ease;
}
#gp-product-card .gp-pc-close:hover { background: rgba(0,0,0,0.75); }

/* Карточка «Информация о проекте» (кнопка «i») — прямоугольная */
#gp-info-card {
    position: fixed; inset: 0; z-index: 2200; display: none;
    align-items: center; justify-content: center; padding: 24px;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .25s ease;
}
#gp-info-card.show { opacity: 1; }
#gp-info-card .gp-ic-card {
    position: relative; width: min(94vw, 620px); max-height: 90vh; overflow: auto;
    background: rgba(20,20,22,0.94); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 22px; box-shadow: 0 24px 70px rgba(0,0,0,0.6);
    transform: translateY(14px) scale(.98); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
#gp-info-card.show .gp-ic-card { transform: translateY(0) scale(1); }
#gp-info-card .gp-ic-media { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 22px 22px 0 0; overflow: hidden; }
#gp-info-card .gp-ic-media iframe,
#gp-info-card .gp-ic-media video,
#gp-info-card .gp-ic-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: none; }
#gp-info-card .gp-ic-media.gp-ic-empty { display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.4); font-size: 13px; background: rgba(255,255,255,0.04); }
#gp-info-card .gp-ic-body { padding: 22px 26px 18px; }
#gp-info-card .gp-ic-title { font-size: 24px; font-weight: 600; color: #fff; line-height: 1.2; text-transform: uppercase; letter-spacing: .3px; }
#gp-info-card .gp-ic-desc { margin-top: 12px; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.82); white-space: pre-wrap; }
#gp-info-card .gp-ic-footer {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    padding: 18px 26px 24px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 4px;
}
#gp-info-card .gp-ic-logo { height: 40px; max-width: 160px; object-fit: contain; }
#gp-info-card .gp-ic-contacts { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.7); }
#gp-info-card .gp-ic-chats { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#gp-info-card .gp-ic-chat {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    padding: 11px 20px; border-radius: 40px; font-size: 14px; font-weight: 600;
    color: var(--ink, #14160F); background: var(--primary-gold, #D6B47C);
    transition: filter .15s ease, transform .15s ease;
}
#gp-info-card .gp-ic-chat:hover { filter: brightness(1.06); transform: translateY(-1px); }
#gp-info-card .gp-ic-chat svg { flex-shrink: 0; }
#gp-info-card .gp-ic-site {
    margin-left: auto; flex: 0 0 auto; text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px; border-radius: 11px; font-size: 14px; font-weight: 600;
    color: var(--ink, #14160F); background: var(--primary-gold, #D6B47C);
    transition: filter .15s ease, transform .15s ease;
}
#gp-info-card .gp-ic-site:hover { filter: brightness(1.06); transform: translateY(-1px); }
#gp-info-card .gp-ic-close {
    position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
    border: none; cursor: pointer; font-size: 22px; line-height: 1; color: #fff;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 2;
    display: flex; align-items: center; justify-content: center; transition: background .2s ease;
}
#gp-info-card .gp-ic-close:hover { background: rgba(0,0,0,0.75); }

/* Переключатель языков (строится динамически из выбранных языков) */
/* Справа, слева от кнопки «i» (info ~44px @ right:30px), чтобы не перекрывались */
#lang-switch { position: absolute; top: 30px; right: 86px; left: auto; z-index: 120; pointer-events: auto; font-family: var(--font); }
#lang-switch .lang-switch-menu { position: absolute; right: 0; }
#lang-switch .lang-switch-btn {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    padding: 9px 14px; border-radius: 40px; font-size: 13px; font-weight: 600; color: #fff;
    background: rgba(21,21,23,0.55); border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#lang-switch .lang-switch-menu {
    display: none; flex-direction: column; gap: 2px; margin-top: 6px; padding: 6px;
    min-width: 150px; border-radius: 14px;
    background: rgba(21,21,23,0.85); border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 34px rgba(0,0,0,0.45);
}
#lang-switch .lang-switch-opt {
    text-align: left; padding: 9px 12px; border-radius: 9px; border: none; cursor: pointer;
    background: transparent; color: rgba(255,255,255,0.82); font-size: 13px; font-weight: 500;
}
#lang-switch .lang-switch-opt:hover { background: rgba(255,255,255,0.08); color: #fff; }
#lang-switch .lang-switch-opt.active { background: rgba(255,255,255,0.12); color: #fff; }
@media (max-width: 950px) { #lang-switch { top: 16px; left: 16px; } }

/* ===== Мобильные доработки ===== */
/* Ландшафт телефона: cover без чёрных полос (максимум экрана) */
@media (max-width: 950px) and (orientation: landscape) {
    #aspect-wrapper.aspect-16-9 {
        width: max(100vw, 177.7778vh) !important;
        width: max(100vw, 177.7778dvh) !important;
        height: max(100vh, 56.25vw) !important;
        height: max(100dvh, 56.25vw) !important;
        max-width: none !important; max-height: none !important;
    }
    #scroll-wrapper { justify-content: center !important; align-items: center !important; }
}
/* Фильтр умещается на телефоне: не вылезает за подложку, лишнее скроллится */
@media (max-width: 950px) {
    #genplan-nav-bottom { left: 50% !important; right: auto !important; bottom: 20px !important; transform: translateX(-50%) !important; max-width: calc(100vw - 12px); }
    #genplan-nav-bottom .glass-panel { max-width: calc(100vw - 12px); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
    /* Кнопки, уехавшие в бургер, — на всю ширину меню */
    #hamburger-menu #btn-info-toggle, #hamburger-menu #lang-switch { width: 100% !important; border-radius: 12px !important; }
    #hamburger-menu #lang-switch { position: static !important; }
    #hamburger-menu #lang-switch .lang-switch-btn { width: 100%; justify-content: space-between; }
    #hamburger-menu #lang-switch .lang-switch-menu { position: static; margin-top: 4px; }
    #hamburger-menu #btn-info-toggle { width: 100% !important; height: auto !important; border-radius: 12px !important; padding: 10px 20px !important; font-style: normal; }
}
/* Кнопка «Полный экран» — только на телефоне/узких экранах */
#btn-fullscreen { display: none; }
@media (max-width: 950px) { #btn-fullscreen { display: inline-flex; } }


/* ===== Мобилка: полный экран + принудительный ландшафт + уменьшенный интерфейс ===== */
/* Экран «Поверните телефон» — виден только в портрете на телефоне */
#rotate-prompt { display: none; }
@media (max-width: 950px) and (orientation: portrait) {
    #rotate-prompt {
        display: flex; position: fixed; inset: 0; z-index: 3000;
        align-items: center; justify-content: center; text-align: center;
        background: #0b0b0c; color: #fff; padding: 24px;
    }
    #rotate-prompt .rot-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
    #rotate-prompt .rot-title { font-size: 20px; font-weight: 600; }
    #rotate-prompt .rot-sub { font-size: 13px; color: rgba(255,255,255,.6); max-width: 260px; }
    #rotate-prompt .rot-fs { margin-top: 12px; padding: 13px 24px; border-radius: 40px; border: none;
        background: var(--primary-gold, #D6B47C); color: #14160F; font-weight: 600; font-size: 15px; cursor: pointer; }
    #rotate-prompt svg { color: var(--primary-gold, #D6B47C); animation: rotHint 2.4s ease-in-out infinite; }
    @keyframes rotHint { 0%,55%,100% { transform: rotate(0deg); } 28% { transform: rotate(90deg); } }
}
/* Плавающая кнопка «во весь экран» (видна на телефоне, не спрятана) */
#btn-fs-float { display: none; }
@media (max-width: 950px) {
    #btn-fs-float { display: inline-flex; position: fixed; z-index: 130;
        align-items: center; justify-content: center; border-radius: 50%;
        border: 1px solid rgba(255,255,255,.16); background: rgba(21,21,23,.6);
        backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; cursor: pointer; pointer-events: auto; }
}
/* Уменьшаем интерфейс на мобильном ~на 30% */
@media (max-width: 950px) {
    #genplan-nav-bottom { transform: translateX(-50%) scale(0.72) !important; transform-origin: bottom center; }
    #btn-genplan-back { transform: scale(0.8); transform-origin: top left; }
    #btn-construction { transform: scale(0.8); }
}

/* ================== Единые мобильные правила (класс gp-mobile) ================== */
html.gp-mobile #btn-hamburger { display: flex !important; }

/* Фильтр: строго по центру, свёрнут (панель по контенту, кнопки не растягиваются) */
html.gp-mobile #genplan-nav-bottom {
    left: 50% !important; right: auto !important; bottom: 16px !important;
    transform: translateX(-50%) scale(0.8) !important; transform-origin: bottom center;
    width: auto !important; max-width: none !important;
}
html.gp-mobile #genplan-nav-bottom .glass-panel {
    width: auto !important; justify-content: center !important;
    max-width: calc(100vw - 20px); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
}
html.gp-mobile #genplan-nav-bottom .nav-btn-bottom { flex: 0 0 auto !important; flex-direction: row !important; }

/* Бургер-меню: компактное, кнопки на всю ширину, без гигантизма */
html.gp-mobile #hamburger-menu { min-width: 168px !important; max-width: 230px !important; padding: 8px !important; gap: 6px !important; }
html.gp-mobile #hamburger-menu > button,
html.gp-mobile #hamburger-menu > #lang-switch { width: 100% !important; font-size: 13px !important; padding: 10px 14px !important; border-radius: 12px !important; }
html.gp-mobile #hamburger-menu #btn-info-toggle { height: auto !important; font-style: normal !important; justify-content: center !important; }
html.gp-mobile #hamburger-menu #lang-switch { position: static !important; }
html.gp-mobile #hamburger-menu #lang-switch .lang-switch-btn { width: 100% !important; justify-content: space-between !important; padding: 10px 14px !important; font-size: 13px !important; }
html.gp-mobile #hamburger-menu #lang-switch .lang-switch-menu { position: static !important; margin-top: 4px !important; }

/* Лайтбокс на мобиле: видео/картинка на весь экран, без отступов; крупный видимый крестик
   ниже плавающей адресной строки Safari (safe-area). */
html.gp-mobile #lightbox-overlay { padding: 0 !important; }
html.gp-mobile #lightbox-content { width: 100vw !important; height: 100dvh !important; max-width: none !important; max-height: none !important; padding: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important; }
html.gp-mobile #btn-lightbox-close {
    top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
    right: 10px !important;
    padding: 10px !important;
    width: 46px !important; height: 46px !important;
    display: flex !important; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.6) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    border-radius: 50% !important;
    z-index: 1010 !important;
}
html.gp-mobile #btn-lightbox-close svg { width: 26px !important; height: 26px !important; }

/* Уменьшаем элементы интерфейса */
html.gp-mobile #btn-genplan-back { transform: scale(0.82); transform-origin: top left; }
html.gp-mobile #btn-construction { transform: scale(0.82); }
/* Барабан-шкала «Стройка» на мобильном был в полный «десктопный» размер и перекрывал экран —
   уменьшаем вдвое, якорь остаётся по центру снизу (там же, где и был). */
html.gp-mobile #construction-drum { transform: translateX(-50%) scale(0.5); transform-origin: center bottom; }

/* Инфо-карточка: прячем десктопный язычок, показываем мобильный хендл как аккуратный
   прямоугольник со стрелкой (не «хвост»); окно уезжает целиком по клику. */
html.gp-mobile .info-collapse-tab { display: none !important; }
html.gp-mobile .mobile-drawer-handle {
    display: flex !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    border-radius: 12px !important;
    background: rgba(0,0,0,0.55) !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4) !important;
    width: 26px !important; height: 52px !important;
}
/* Карточка виллы: контент в .gp-card-scroll, ручка снаружи справа по центру и не скроллится. */
html.gp-mobile #ui-state-layout-ext .mobile-drawer-handle { top: 50% !important; right: 0 !important; transform: translate(100%, -50%) !important; }

/* Карточка товара в ЛАНДШАФТЕ: картинка слева, текст справа, всё влезает без прокрутки страницы */
@media (orientation: landscape) {
    html.gp-mobile #gp-product-card .gp-pc-card {
        display: flex; flex-direction: row; align-items: stretch;
        width: min(94vw, 780px); max-height: 90vh;
    }
    html.gp-mobile #gp-product-card .gp-pc-img {
        width: 46%; max-height: none; height: auto; align-self: stretch;
        object-fit: contain; border-radius: 20px 0 0 20px; padding: 14px;
    }
    html.gp-mobile #gp-product-card .gp-pc-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
    html.gp-mobile #gp-info-card .gp-ic-card { width: min(94vw, 820px); max-height: 92vh; }
    html.gp-mobile #gp-info-card .gp-ic-media { aspect-ratio: auto; height: 40vh; }
}


/* Бургер: язык-меню раскрывается ВНУТРИ меню (не уходит за край), всё умещается */
html.gp-mobile #hamburger-menu { right: 10px !important; max-height: calc(100dvh - 62px); max-height: calc(100vh - 62px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
html.gp-mobile #hamburger-menu #lang-switch { position: static !important; }
html.gp-mobile #hamburger-menu #lang-switch .lang-switch-menu {
    position: static !important; right: auto !important; left: auto !important;
    width: 100% !important; min-width: 0 !important; margin-top: 4px !important;
    box-shadow: none !important; background: rgba(0,0,0,0.25) !important;
}
html.gp-mobile #hamburger-menu #lang-switch .lang-switch-opt { padding: 8px 10px !important; font-size: 13px !important; }
/* Пункт «Полный экран» в бургере не показываем (кнопка отдельная плавающая) */
#btn-fullscreen { display: none !important; }

/* Плавающая кнопка fullscreen — по классу мобилки (независимо от размера на загрузке).
   Одинаковый размер с компасом (54px) и РЯДОМ с ним слева; компас остаётся в самом углу. */
#btn-fs-float { display: none; }
html.gp-mobile #btn-fs-float {
    display: inline-flex !important;
    position: fixed !important; z-index: 130 !important;
    right: 82px !important; bottom: 18px !important;   /* слева от компаса: 18 + 54 (компас) + 10 (зазор) */
    width: 54px !important; height: 54px !important;
    align-items: center; justify-content: center; border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    background: rgba(0,0,0,0.4) !important;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35) !important;
    color: #fff !important;
}
html.gp-mobile #btn-fs-float svg { width: 22px !important; height: 22px !important; }

/* ЯЗЫК В БУРГЕРЕ — компактная кнопка, список выпадает ПОД ней (без овала слева) */
html.gp-mobile #hamburger-menu #lang-switch {
    display: block !important; width: 100% !important; padding: 0 !important;
    position: static !important;
}
html.gp-mobile #hamburger-menu #lang-switch .lang-switch-btn {
    display: flex !important; width: 100% !important; height: auto !important;
    align-items: center !important; justify-content: space-between !important;
    border-radius: 12px !important; padding: 11px 14px !important; font-size: 13px !important;
    background: rgba(0,0,0,0.35) !important; border: 1px solid rgba(255,255,255,0.14) !important;
}
html.gp-mobile #hamburger-menu #lang-switch .lang-switch-menu {
    position: static !important; left: auto !important; right: auto !important; top: auto !important;
    width: 100% !important; min-width: 0 !important; margin-top: 4px !important;
    flex-direction: column !important; box-shadow: none !important;
    background: rgba(0,0,0,0.25) !important; border: 1px solid rgba(255,255,255,0.08) !important;
}
html.gp-mobile #hamburger-menu #lang-switch .lang-switch-opt { text-align: left !important; padding: 9px 12px !important; font-size: 13px !important; }

/* ===== CRM sync: бейджи статуса юнита на метках + таймстамп «обновлено» ===== */
.gp-marker-btn .gp-unit-badge {
    position: absolute; top: -3px; right: -3px; width: 10px; height: 10px;
    border-radius: 50%; border: 2px solid rgba(20,20,20,0.85);
    box-shadow: 0 0 4px rgba(0,0,0,0.5); pointer-events: none; z-index: 2;
}
.gp-marker-btn.gp-unit-sold .marker-container { filter: grayscale(0.6) brightness(0.75); }
.gp-marker-btn.gp-unit-stale .gp-unit-badge { opacity: 0.45; }

/* Фильтр по статусу CRM — полупрозрачная заливка иконки цветом выбранного статуса. */
.gp-marker-btn.status-lit .marker-container { background: var(--status-fill) !important; }

.gp-crm-updated-bar {
    /* Убрано по просьбе клиента — таймстамп синка больше не показываем на сайте. */
    display: none !important;
}
.gp-crm-updated-bar.stale { color: rgba(240,169,62,0.85); }
