.thv-tour {
    height: calc(100vh - var(--thv-header-height));
    min-height: 420px;
}

.thv-tour__body {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.thv-viewer {
    position: absolute;
    inset: 0;
    background: #05070d;
}

/* Title + scene-list toggle float directly on top of the panorama instead
   of taking their own header strip, so the viewer uses the full page. */
.thv-tour__overlay-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(to bottom, rgba(6, 10, 20, 0.65) 0%, rgba(6, 10, 20, 0) 100%);
    pointer-events: none;
}

.thv-tour__overlay-top .thv-tour__heading,
.thv-tour__overlay-top .thv-scene-toggle {
    pointer-events: auto;
}

.thv-tour__heading {
    min-width: 0;
}

.thv-tour__title {
    font-size: 1.15rem;
    margin: 0;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thv-tour__tagline {
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thv-btn--overlay {
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.thv-btn--overlay:hover,
.thv-btn--overlay:focus-visible {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

/* Scene list panel (open/closeable on every breakpoint) */
.thv-scene-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(320px, 85vw);
    background: var(--thv-color-bg);
    border-left: 1px solid var(--thv-color-border);
    box-shadow: var(--thv-shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 30;
}

.thv-scene-panel.is-open {
    transform: translateX(0);
}

.thv-scene-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--thv-color-border);
    flex-shrink: 0;
}

.thv-scene-panel__header h2 {
    font-size: 1rem;
    margin: 0;
}

.thv-scene-panel__close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--thv-color-text-muted);
    padding: 4px 10px;
    border-radius: var(--thv-radius-sm);
}

.thv-scene-panel__close:hover,
.thv-scene-panel__close:focus-visible {
    background: var(--thv-color-bg-alt);
    color: var(--thv-color-text);
}

.thv-scene-list {
    list-style: none;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.thv-scene-list__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    margin-bottom: 4px;
    border: none;
    background: none;
    border-radius: var(--thv-radius-sm);
    font-size: 0.95rem;
    color: var(--thv-color-text);
    cursor: pointer;
}

.thv-scene-list__item:hover,
.thv-scene-list__item:focus-visible {
    background: var(--thv-color-bg-alt);
}

.thv-scene-list__item.is-active {
    background: var(--thv-color-accent);
    color: #fff;
    font-weight: 600;
}

/* Info modal */
.thv-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thv-modal[hidden] {
    display: none;
}

.thv-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.thv-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: var(--thv-radius);
    max-width: 480px;
    width: calc(100% - 40px);
    max-height: 80vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: var(--thv-shadow-lg);
}

.thv-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--thv-color-bg-alt);
    font-size: 1.1rem;
    cursor: pointer;
}

.thv-modal__close:hover,
.thv-modal__close:focus-visible {
    background: var(--thv-color-border);
}

.thv-modal__title {
    font-size: 1.2rem;
    padding-right: 24px;
    margin-bottom: 0.4em;
}

.thv-modal__desc {
    white-space: pre-line;
    color: var(--thv-color-text-muted);
    margin: 0;
}

@media (max-width: 720px) {
    .thv-scene-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: min(60vh, 480px);
        border-left: none;
        border-top: 1px solid var(--thv-color-border);
        border-radius: var(--thv-radius) var(--thv-radius) 0 0;
        transform: translateY(100%);
    }

    .thv-scene-panel.is-open {
        transform: translateY(0);
    }

    .thv-tour__overlay-top {
        padding: 12px 14px;
    }

    .thv-tour__title {
        font-size: 1rem;
    }

    .thv-tour__tagline {
        display: none;
    }

    .thv-scene-toggle .thv-btn__label {
        display: none;
    }
}
