* {
    box-sizing: border-box;
}

:root {
    --gold: #d7a538;
    --gold-dark: #b78622;
    --ink: #1f2937;
    --muted: #64748b;
    --line: #e5e7eb;
    --panel: #f8fafc;
    --sidebar-width: 280px;
    --topbar-height: 72px;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #fff;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

.app-shell {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    flex: 0 0 var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border-bottom: 1px solid #eef1f4;
    background: #fff;
    position: relative;
    z-index: 60;
}

.brand {
    font-weight: 800;
    font-size: 16px;
    text-align: center;
    line-height: 1.3;
}

.brand i {
    display: block;
    width: 82px;
    height: 3px;
    margin: 7px auto 0;
    border-radius: 10px;
    background: var(--gold);
}

.mobile-menu,
.info-button {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 24px;
}

.workspace {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    min-width: 0;
    overflow: hidden;
    border-right: 1px solid #e5e7eb;
    background: #f8f9fb;
    position: relative;
    z-index: 40;
    transition:
        width 0.3s ease,
        flex-basis 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;
}

.sidebar-inner {
    width: var(--sidebar-width);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar.is-collapsed {
    width: 0;
    flex-basis: 0;
    border-right-color: transparent;
}

.sidebar-head {
    min-height: 92px;
    padding: 25px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.sidebar-head strong,
.sidebar-head span {
    display: block;
}

.sidebar-head strong {
    font-size: 15px;
}

.sidebar-head span {
    margin-top: 2px;
    font-size: 14px;
}

.sidebar-collapse,
.sidebar-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: var(--gold);
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.sidebar-collapse {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 7px;
    font-size: 24px;
}

.sidebar-expand {
    position: absolute;
    left: 0;
    top: 22px;
    z-index: 45;
    width: 36px;
    height: 44px;
    padding: 0;
    border-radius: 0 8px 8px 0;
    font-size: 25px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-8px);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}

.sidebar-expand.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.search-wrap {
    position: relative;
    margin: 15px;
}

.search-wrap span {
    position: absolute;
    left: 13px;
    top: 8px;
    color: #475569;
    font-size: 20px;
}

.search-wrap input {
    width: 100%;
    height: 42px;
    padding: 0 15px 0 40px;
    border: 1px solid #64748b;
    border-radius: 25px;
    outline: none;
    background: white;
}

.search-wrap input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(215, 165, 56, 0.18);
}

.menu-label {
    margin: 2px 15px 10px;
    color: #4b5563;
    font-size: 12px;
}

.campus-group {
    padding: 0 10px;
}

.campus-toggle {
    width: 100%;
    padding: 12px 5px;
    display: flex;
    justify-content: space-between;
    border: 0;
    background: transparent;
    color: #263142;
}

.location-list {
    overflow: hidden;
}

.location-list.is-hidden {
    display: none;
}

.location-item {
    width: 100%;
    margin: 2px 0;
    padding: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #374151;
    text-align: left;
    font-size: 13px;
}

.location-item:hover {
    background: #eceff3;
}

.location-item.is-active {
    background: var(--gold);
    color: white;
}

.location-item[hidden] {
    display: none;
}

.dot {
    font-size: 14px;
}

.vr-note {
    margin-top: auto;
    padding: 18px 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--line);
    background: white;
}

.vr-icon {
    color: var(--gold);
    font-size: 22px;
}

.vr-note strong,
.vr-note small {
    display: block;
}

.vr-note strong {
    font-size: 12px;
}

.vr-note small {
    margin-top: 3px;
    color: #64748b;
    font-size: 10px;
    line-height: 1.35;
}

.viewer-area {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    background: #dfe6ec;
}

.panorama-viewer,
.flat-viewer {
    position: absolute;
    inset: 0;
}

.flat-viewer {
    display: none;
    overflow: hidden;
    touch-action: none;
    background: #111;
}

.flat-image {
    position: absolute;
    inset: -4% -10%;
    background-size: cover;
    background-position: center;
    transform: scale(1.08);
    will-change: transform;
    cursor: grab;
}

.flat-image:active {
    cursor: grabbing;
}

.drag-hint {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    padding: 8px 13px;
    border-radius: 99px;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    font-size: 12px;
}

.location-badge {
    position: absolute;
    top: 22px;
    left: 5.5%;
    z-index: 12;
    min-width: 150px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 7px 24px rgba(15, 23, 42, 0.12);
}

.location-badge small {
    display: block;
    margin-bottom: 6px;
    color: var(--gold-dark);
    font-size: 10px;
    letter-spacing: 1.5px;
}

.location-badge strong {
    font-size: 15px;
}

.viewer-actions {
    position: absolute;
    right: 18px;
    bottom: 20px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.viewer-actions button {
    width: 36px;
    height: 36px;
    border: 1px solid #d5dbe3;
    background: rgba(255, 255, 255, 0.94);
    color: #1f2937;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
    font-size: 19px;
}

.detail-fab {
    position: absolute;
    left: 50%;
    bottom: 22px;
    z-index: 13;
    transform: translateX(-50%);
    padding: 8px 15px 8px 8px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 99px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.22);
}

.detail-fab span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
}

.detail-fab strong {
    font-size: 12px;
}

.custom-hotspot {
    width: 52px;
    height: 52px;
}

.hotspot-pin {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-radius: 50% 50% 50% 0;
    background: var(--gold);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.25);
    transform: rotate(-45deg);
}

.hotspot-pin::after {
    content: "";
    width: 17px;
    height: 17px;
    border: 3px solid white;
    border-radius: 50%;
    transform: rotate(45deg);
}

.hotspot-label {
    position: absolute;
    left: 50%;
    bottom: 64px;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-shadow: 0 2px 5px #000;
}

.hotspot-popup {
    position: absolute;
    left: 50%;
    top: 64px;
    width: 210px;
    padding: 12px;
    display: none;
    transform: translateX(-50%);
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    text-align: center;
}

.custom-hotspot:hover .hotspot-popup {
    display: block;
}

.hotspot-popup strong {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
}

.hotspot-popup p {
    margin: 0;
    color: #4b5563;
    font-size: 10px;
    line-height: 1.45;
}

.sidebar-overlay {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    padding: 24px;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    width: min(1000px, 100%);
    max-height: min(760px, 92vh);
    padding: 28px;
    overflow: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.modal-close {
    position: absolute;
    right: 18px;
    top: 16px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    font-size: 25px;
}

.modal-kicker {
    color: var(--gold-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.modal-heading h2 {
    margin: 7px 45px 7px 0;
    font-size: 28px;
}

.modal-heading p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.modal-content {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.8fr);
    gap: 25px;
}

.modal-content h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.gallery-main {
    position: relative;
    height: 380px;
    overflow: hidden;
    border-radius: 14px;
    background: #e5e7eb;
}

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

.gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    font-size: 28px;
}

.gallery-nav.prev {
    left: 12px;
}

.gallery-nav.next {
    right: 12px;
}

.gallery-thumbs {
    margin-top: 10px;
    padding-bottom: 4px;
    display: flex;
    gap: 9px;
    overflow: auto;
}

.gallery-thumbs button {
    width: 82px;
    height: 58px;
    flex: 0 0 auto;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #eee;
}

.gallery-thumbs button.is-active {
    border-color: var(--gold);
}

.gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.around-panel {
    padding: 20px;
    border: 1px solid #e8edf2;
    border-radius: 14px;
    background: #f8fafc;
}

.around-panel ul {
    margin: 0;
    padding-left: 20px;
}

.around-panel li {
    margin: 0 0 12px;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}

.around-tip {
    margin-top: 22px;
    padding: 13px;
    border-left: 4px solid var(--gold);
    background: #fff;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.pnlm-container {
    background: #1f2937;
}

.pnlm-controls-container {
    display: none;
}

.pnlm-load-box {
    background: rgba(0, 0, 0, 0.55);
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 290px;
        --topbar-height: 60px;
    }

    .topbar {
        justify-content: space-between;
    }

    .brand {
        font-size: 13px;
    }

    .mobile-menu,
    .info-button {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: var(--topbar-height);
        bottom: 0;
        width: var(--sidebar-width);
        flex-basis: var(--sidebar-width);
        transform: translateX(-102%);
        box-shadow: 12px 0 32px rgba(15, 23, 42, 0.16);
    }

    .sidebar.is-collapsed {
        width: var(--sidebar-width);
        flex-basis: var(--sidebar-width);
        border-right-color: #e5e7eb;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-collapse {
        transform: rotate(180deg);
    }

    .sidebar-expand {
        display: none !important;
    }

    .sidebar-overlay {
        position: fixed;
        inset: var(--topbar-height) 0 0;
        z-index: 35;
        background: rgba(15, 23, 42, 0.48);
    }

    .sidebar-overlay.is-open {
        display: block;
    }

    .location-badge {
        left: 14px;
        top: 14px;
        min-width: 130px;
        padding: 11px 13px;
    }

    .viewer-actions {
        right: 12px;
        bottom: 15px;
    }

    .detail-fab {
        bottom: 15px;
    }

    .modal {
        padding: 12px;
    }

    .modal-card {
        padding: 22px 16px;
    }

    .modal-content {
        grid-template-columns: 1fr;
    }

    .gallery-main {
        height: 330px;
    }
}

@media (max-width: 600px) {
    .brand {
        font-size: 11px;
    }

    .brand i {
        width: 60px;
    }

    .gallery-main {
        height: 250px;
    }

    .modal-heading h2 {
        font-size: 22px;
    }

    .detail-fab {
        left: 16px;
        padding: 6px;
        transform: none;
    }

    .detail-fab strong {
        display: none;
    }

    .drag-hint {
        bottom: 68px;
    }
}
