:root {
    --tour-ink: #17212b;
    --tour-muted: #607080;
    --tour-line: rgba(23, 33, 43, 0.12);
    --tour-surface: rgba(250, 252, 251, 0.94);
    --tour-accent: #ec5b67;
}

.tour-page {
    min-height: 100vh;
    margin: 0;
    color: var(--tour-ink);
    background: #020617;
}

.tour-page .modal {
    display: flex;
    padding: 0;
}

.tour-page .modal-box {
    width: 100vw;
    width: 100dvw;
    height: 100dvh;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.tour-page .modal-box .topbar {
    position: absolute;
    z-index: 5;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 18px 22px;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.72), transparent);
}

.tour-page .panorama-view {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
}

.tour-page .pnlm-load-box,
.tour-page .pnlm-lbox {
    display: none !important;
}

.tour-page .pnlm-controls-container {
    top: auto;
    right: 14px;
    bottom: 14px;
    left: auto;
}

.tour-loading {
    position: absolute;
    z-index: 4;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    color: #ffffff;
    background: #020617;
    font-size: 1rem;
    opacity: 1;
    transform: scale(1);
    transform-origin: center;
    will-change: opacity, transform;
    transition: visibility 900ms ease;
}

.tour-loading.hidden {
    opacity: 0;
    transform: scale(1.02);
    visibility: hidden;
    pointer-events: none;
}

.tour-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.28);
    border-top-color: #ffffff;
    border-radius: 50%;
    transform-origin: center center;
    will-change: transform;
    animation: tour-loading-spin 900ms linear infinite;
    animation-play-state: running;
}

@keyframes tour-loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tour-page .panorama-viewer {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 0;
    height: 100%;
    min-width: 0;
    opacity: 0;
    transform: scale(1.02);
    transform-origin: center center;
    overflow: hidden;
    will-change: opacity, transform;
}

.tour-page.tour-split-view .panorama-view {
    height: 100dvh;
    background: #020617;
}
.tour-page.tour-panorama-half .panorama-viewer { height: 50%; }
.tour-page.tour-split-view .tour-mini-map {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    top: calc(100dvh - var(--expanded-map-height, 50vh));
    bottom: auto;
    height: var(--expanded-map-height, 50vh);
    border: 0;
    border-top: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 0;
    box-shadow: none;
    transition: left 520ms cubic-bezier(0.22, 1, 0.36, 1), bottom 520ms cubic-bezier(0.22, 1, 0.36, 1), width 520ms cubic-bezier(0.22, 1, 0.36, 1), height 520ms cubic-bezier(0.22, 1, 0.36, 1), border-radius 520ms ease, box-shadow 520ms ease;
    cursor: grab;
}
.tour-page.tour-split-view .tour-mini-map:hover {
    height: var(--expanded-map-height, 50vh);
    border-radius: 0;
    box-shadow: none;
}
.tour-split-divider {
    display: none;
}
.tour-page.tour-split-view .tour-split-divider {
    position: absolute;
    z-index: 30;
    top: calc(100dvh - var(--expanded-map-height, 50vh) - 10px);
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3);
    transform: translateX(-50%);
    cursor: ns-resize;
    pointer-events: auto;
}
.tour-split-divider span,
.tour-split-divider span::before,
.tour-split-divider span::after {
    display: block;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: #64748b;
    content: '';
}
.tour-split-divider span::before,
.tour-split-divider span::after {
    margin-top: 4px;
}
.tour-split-divider span::after {
    margin-top: -6px;
}
.tour-page.tour-resizing-split,
.tour-page.tour-resizing-split * {
    cursor: ns-resize !important;
    user-select: none;
}
.tour-page.tour-resizing-split .tour-mini-map {
    transition: none;
}
.tour-page.tour-resizing-split .tour-mini-map {
    transition: none;
}
.tour-page.tour-split-view .tour-loading {
    inset: 0 0 var(--expanded-map-height, 50vh) 0;
    transition: inset 520ms cubic-bezier(0.22, 1, 0.36, 1), opacity 900ms ease, transform 900ms ease, visibility 900ms ease;
}

.tour-page.tour-split-view.tour-panorama-half .panorama-viewer {
    height: calc(100% - var(--expanded-map-height, 50vh));
}

.tour-mini-map {
    position: absolute;
    z-index: 5;
    left: 24px;
    bottom: 24px;
    width: clamp(132px, 17vw, 230px);
    height: clamp(64px, 8.1vw, 110px);
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 10px;
    background: #dfe9e4;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    touch-action: none;
    cursor: grab;
    transition: left 520ms cubic-bezier(0.22, 1, 0.36, 1), bottom 520ms cubic-bezier(0.22, 1, 0.36, 1), width 520ms cubic-bezier(0.22, 1, 0.36, 1), height 520ms cubic-bezier(0.22, 1, 0.36, 1), border-radius 520ms ease, box-shadow 520ms ease;
}
.tour-page.tour-map-collapsing .tour-mini-map:hover {
    height: clamp(64px, 8.1vw, 110px);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.tour-mini-map:hover {
    z-index: 20;
    height: clamp(145px, 18vw, 220px);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.48);
}
.tour-mini-map.dragging { cursor: grabbing; }
.tour-mini-map-canvas { position: absolute; top: 0; left: 0; width: 100%; height: auto; transform-origin: 0 0; }
.tour-mini-map-canvas img { display: block; width: 100%; height: auto; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.tour-mini-map-marker { display: none; width: 16px; height: 16px; background: #2563eb; border: 2px solid #ffffff; border-radius: 50% 50% 50% 0; box-shadow: 0 2px 5px rgba(15,23,42,0.32), 0 0 0 2px rgba(37,99,235,0.2); transform-origin: center; transition: left 520ms ease, top 520ms ease, transform 160ms ease; will-change: transform; z-index: 2; }
.tour-mini-map-marker.has-position { display: block; }
.tour-mini-map-controls { position: absolute; left: 6px; bottom: 6px; display: grid; gap: 3px; z-index: 2; }
.tour-mini-map-controls button { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: #FFFFFF; color: #5E5E5E; cursor: pointer; font-size: 20px; font-weight: 700; line-height: 1; position: relative; }
.tour-mini-map-controls button:hover { background: #FFFFFF; color: #5E5E5E; }
#tour-mini-map-reset::after { content: attr(data-tooltip); position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 8px; background: #000000; color: #FFFFFF; padding: 4px 8px; border-radius: 3px; font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 160ms ease, visibility 160ms ease; z-index: 10; }
#tour-mini-map-reset:hover::after { opacity: 1; visibility: visible; }
.tour-mini-map-zoom-controls { position: absolute; right: 6px; bottom: 6px; display: grid; z-index: 2; overflow: hidden; border-radius: 5px; box-shadow: 0 2px 6px rgba(0,0,0,0.22); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 160ms ease, visibility 160ms ease; }
.tour-mini-map:hover .tour-mini-map-zoom-controls { opacity: 1; visibility: visible; pointer-events: auto; }
.tour-page.tour-split-view .tour-mini-map-zoom-controls { opacity: 1; visibility: visible; pointer-events: auto; }
.tour-mini-map-zoom-controls button { width: 28px; height: 28px; padding: 0; border: 0; background: #FFFFFF; color: #5E5E5E; cursor: pointer; font-size: 22px; font-weight: 500; line-height: 1; }
.tour-mini-map-zoom-controls button + button { border-top: 1px solid #D9D9D9; }
.tour-mini-map-zoom-controls button:hover { background: #F2F2F2; color: #5E5E5E; }
@media (max-width: 600px) {
    .tour-mini-map { left: 12px; bottom: 12px; width: 132px; }
    .tour-mini-map:hover { height: 140px; }
}

.tour-page .panorama-viewer.ready {
    opacity: 1;
    transform: scale(1);
}

.tour-page .pnlm-hotspot-base {
    opacity: 0 !important;
}

.tour-page .hotspots-ready .pnlm-hotspot-base {
    opacity: 1 !important;
}

.tour-page .smartnav-tour-transitioning-out .pnlm-hotspot-base {
    opacity: 0 !important;
}

.tour-page .pnlm-hotspot.pnlm-custom {
    background: none;
    background-image: none;
    display: block;
    overflow: visible;
    width: auto;
    height: auto;
}

.tour-page .pnlm-hotspot.pnlm-custom .admin-tour-hotspot-image {
    display: block !important;
    width: var(--hotspot-width) !important;
    height: var(--hotspot-height) !important;
    transform-style: preserve-3d;
    max-width: none;
    max-height: none;
}

.tour-page .pnlm-hotspot.pnlm-custom .admin-tour-hotspot-label {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    max-width: 220px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f3f3f3;
    font-size: 13px;
    line-height: 1.25;
    white-space: pre;
    overflow: visible;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 2;
}

.tour-page .pnlm-hotspot.pnlm-custom .admin-tour-hotspot-label.is-hover-only {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.tour-page .pnlm-hotspot.pnlm-custom .admin-tour-hotspot-label.is-hover-only.is-visible {
    opacity: 1;
    visibility: visible;
}

.tour-page .pnlm-hotspot.pnlm-custom .admin-tour-hotspot-motion.hotspot-animation-bounce {
    animation: tour-hotspot-bounce 1.2s ease-in-out infinite;
}

.tour-page .pnlm-hotspot.pnlm-custom .admin-tour-hotspot-motion.hotspot-animation-pulse {
    animation: tour-hotspot-pulse 1.4s ease-in-out infinite;
}

.tour-page .pnlm-hotspot.pnlm-custom .admin-tour-hotspot-motion.hotspot-animation-wave {
    animation: tour-hotspot-wave 1.6s ease-in-out infinite;
}

@keyframes tour-hotspot-bounce {
    0%, 100% { transform: translateY(0); }
    20% { transform: translateY(-8px); }
    40% { transform: translateY(0); }
    60% { transform: translateY(-4px); }
    80% { transform: translateY(0); }
}

@keyframes tour-hotspot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.18); opacity: 0.85; }
}

@keyframes tour-hotspot-wave {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-6px) scale(1.04); }
    50% { transform: translateY(0) scale(1.1); }
    75% { transform: translateY(-3px) scale(1.04); }
}

.tour-page .pnlm-fullscreen-toggle-button {
    display: none !important;
}

.tour-layout {
    width: min(1500px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 0;
}

.tour-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.tour-header h1 {
    margin: 8px 0 4px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
}

.tour-header p {
    margin: 0;
    color: var(--tour-muted);
}

.tour-back-link {
    color: var(--tour-accent);
    font-weight: 700;
    text-decoration: none;
}

.tour-status {
    color: var(--tour-muted);
    font-size: 0.95rem;
}

.tour-workspace {
    display: grid;
    grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
    min-height: min(720px, calc(100vh - 150px));
    overflow: hidden;
    border: 1px solid var(--tour-line);
    border-radius: 16px;
    background: var(--tour-surface);
    box-shadow: 0 20px 60px rgba(38, 50, 56, 0.18);
}

.tour-scenes-panel {
    padding: 18px;
    border-right: 1px solid var(--tour-line);
    overflow-y: auto;
}

.tour-scenes-panel h2 {
    margin: 0 0 14px;
    font-size: 1rem;
}

.tour-scenes {
    display: grid;
    gap: 8px;
}

.tour-scene-button {
    display: block;
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--tour-line);
    border-radius: 10px;
    color: var(--tour-ink);
    background: rgba(255, 255, 255, 0.52);
    cursor: pointer;
    text-align: left;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.tour-scene-button:hover,
.tour-scene-button.active {
    border-color: var(--tour-accent);
    background: #fff;
    transform: translateX(2px);
}

.tour-scene-name {
    display: block;
    font-weight: 700;
}

.tour-scene-meta {
    display: block;
    margin-top: 3px;
    color: var(--tour-muted);
    font-size: 0.8rem;
}

.tour-viewer-panel {
    min-width: 0;
    min-height: 0;
    padding: 12px;
}

.tour-viewer {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 520px;
    overflow: hidden;
    border-radius: 10px;
    background: #17212b;
}

@media (max-width: 760px) {
    .tour-layout {
        width: min(100% - 18px, 1500px);
        padding: 16px 0;
    }

    .tour-header {
        display: block;
    }

    .tour-status {
        margin-top: 12px;
    }

    .tour-workspace {
        grid-template-columns: 1fr;
    }

    .tour-scenes-panel {
        max-height: 190px;
        border-right: 0;
        border-bottom: 1px solid var(--tour-line);
    }

    .tour-scenes {
        display: flex;
        overflow-x: auto;
    }

    .tour-scene-button {
        min-width: 150px;
    }

    .tour-viewer {
        min-height: 62vh;
    }
}
