html,
body {
    background: #f5f7fb;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-weight: 800;
    letter-spacing: 0;
}

.page-subtitle {
    max-width: 54rem;
}

.surface-card {
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.kpi-card {
    height: 100%;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.kpi-card:hover {
    border-color: #b8c9ea;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
    cursor: pointer;
    transform: translateY(-1px);
}

.kpi-accent-blue {
    border-left: 4px solid #2457a6;
}

.kpi-accent-teal {
    border-left: 4px solid #0e7490;
}

.kpi-accent-red {
    border-left: 4px solid #c53030;
}

.kpi-accent-amber {
    border-left: 4px solid #b7791f;
}

.drop-zone {
    border-color: #b8c9ea;
    background: #f8fbff;
    color: #3b455a;
}

.gallery-card {
    height: 100%;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.gallery-card .mud-card-actions {
    flex-wrap: wrap;
    gap: 0.25rem;
    padding-top: 0;
}

.table-panel {
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.membership-hero {
    height: 100%;
    border: 1px solid #d8e2f2;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 58%, #eef7f5 100%);
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
    padding: 1.5rem;
}

.membership-plan-title {
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 0.35rem;
}

.membership-status-chip {
    align-self: flex-start;
}

.membership-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.membership-summary-panel {
    height: 100%;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.85rem;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    padding: 1rem;
}

.membership-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #edf1f7;
}

.membership-summary-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.membership-summary-row span {
    color: #667085;
    font-size: 0.875rem;
}

.membership-summary-row strong {
    color: #172033;
    font-size: 0.95rem;
    text-align: right;
}

.membership-side-card {
    height: 100%;
}

.subscription-search {
    min-width: 260px;
}

.subscription-table .mud-table-toolbar {
    min-height: 76px;
    align-items: center;
    gap: 1rem;
}

.tour-workspace {
    align-items: stretch;
}

.tour-search {
    min-width: 260px;
}

.tour-empty-state {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    text-align: center;
}

.tour-table-actions {
    flex-wrap: nowrap;
}

.tour-detail-panel {
    min-height: 100%;
}

.tour-detail-title {
    font-weight: 800;
    letter-spacing: 0;
}

.tour-detail-empty {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
}

.tour-detail-meta {
    display: grid;
    gap: 0.75rem;
}

.tour-detail-meta div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #edf1f7;
}

.tour-detail-meta div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.tour-detail-meta span {
    color: #667085;
    font-size: 0.875rem;
}

.tour-detail-meta strong {
    color: #172033;
    font-size: 0.95rem;
    text-align: right;
}

.tour-scene-list {
    display: grid;
    gap: 0.75rem;
}

.tour-scene-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #fff;
}

.tour-scene-row-invalid {
    border-color: #d99b28;
    background: #fffaf0;
}

.tour-scene-main {
    min-width: 0;
}

.tour-scene-main .mud-input-control {
    margin-top: 0;
}

.tour-scene-actions {
    flex-wrap: nowrap;
}

.tour-add-scene-row {
    align-items: flex-start;
}

.tour-editor-scene-list {
    display: grid;
    gap: 1rem;
}

.tour-editor-scene-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #fff;
}

.tour-editor-scene-content {
    min-width: 0;
    display: grid;
    gap: 0.35rem;
}

.tour-preview-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #f8fafc;
}

.tour-preview-frame img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.tour-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: #667085;
    font-size: 0.85rem;
    text-align: center;
}

.tour-panorama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.tour-panorama-card {
    overflow: hidden;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #fff;
}

.tour-panorama-card-content {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem;
}

.tour-hotspot-viewer {
    position: relative;
    width: 100%;
    min-height: 420px;
    overflow: hidden;
    border: 1px solid #d8dee9;
    border-radius: 8px;
    background: #111827;
    touch-action: none;
    cursor: crosshair;
}

.tour-hotspot-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: #fff;
    background: #172033;
}

.tour-hotspot-viewer-ready .tour-hotspot-loading {
    display: none;
}

.tour-hotspot-panorama {
    width: 100%;
    height: 100%;
    min-height: 420px;
    display: block;
    object-fit: cover;
    user-select: none;
}

.tour-hotspot-viewer canvas {
    width: 100%;
    height: 100%;
    min-height: 420px;
    display: block;
}

.tour-hotspot-dialog-viewer {
    min-height: min(68vh, 720px);
}

.tour-hotspot-dialog-viewer canvas {
    min-height: min(68vh, 720px);
}

.tour-hotspot-marker-layer {
    position: absolute;
    inset: 0;
}

.tour-hotspot-marker {
    position: absolute;
    width: 34px;
    height: 34px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #2457a6;
    box-shadow: 0 6px 16px rgba(16, 24, 40, 0.28);
    transform: translate(-50%, -50%);
    cursor: grab;
    touch-action: none;
}

.tour-hotspot-marker::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 999px;
    background: #fff;
}

.tour-hotspot-marker:active {
    cursor: grabbing;
}

.tour-hotspot-marker-selected {
    background: #b7791f;
    outline: 3px solid rgba(183, 121, 31, 0.32);
}

.tour-hotspot-coordinates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: #667085;
    font-size: 0.85rem;
}

.tour-hotspot-form-actions {
    flex-wrap: wrap;
}

.public-tour-shell {
    min-height: 100vh;
    background: #0f172a;
}

.public-tour-status {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    color: #fff;
    text-align: center;
}

.public-tour-view {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 420px;
    overflow: hidden;
    background: #0f172a;
}

.public-tour-canvas {
    position: absolute;
    inset: 0;
    touch-action: none;
    cursor: grab;
}

.public-tour-canvas-loading {
    z-index: 3;
    cursor: wait;
}

.public-tour-canvas:active {
    cursor: grabbing;
}

.public-tour-canvas canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.public-tour-loading {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: #fff;
    background: rgba(15, 23, 42, 0.58);
    opacity: 1;
    pointer-events: all;
    transition: opacity 180ms ease;
}

.public-tour-canvas-ready:not(.public-tour-canvas-loading) .public-tour-loading {
    opacity: 0;
    pointer-events: none;
}

.public-tour-canvas-loading .public-tour-loading {
    opacity: 1;
    pointer-events: all;
}

.public-tour-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 999px;
    animation: public-tour-spin 0.8s linear infinite;
}

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

.public-tour-overlay {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    color: #fff;
    pointer-events: none;
}

.public-tour-overlay .mud-button-root,
.public-tour-overlay .mud-typography {
    pointer-events: auto;
}

.public-tour-scene-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    max-width: min(720px, 70vw);
}

@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .membership-hero {
        padding: 1rem;
    }

    .membership-action-row .mud-button-root,
    .subscription-search {
        width: 100%;
    }

    .subscription-table .mud-table-toolbar {
        height: auto;
        align-items: stretch;
        flex-direction: column;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .tour-search,
    .page-header .mud-button-root {
        width: 100%;
    }

    .tour-detail-empty {
        min-height: 240px;
    }

    .tour-detail-meta div {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .tour-detail-meta strong {
        text-align: left;
    }

    .tour-scene-row {
        grid-template-columns: 1fr;
    }

    .tour-scene-actions,
    .tour-add-scene-row {
        width: 100%;
    }

    .tour-add-scene-row {
        align-items: stretch;
        flex-direction: column;
    }

    .tour-add-scene-row .mud-button-root {
        width: 100%;
    }

    .tour-editor-scene-card {
        grid-template-columns: 1fr;
    }

    .tour-panorama-grid {
        grid-template-columns: 1fr;
    }

    .tour-hotspot-viewer,
    .tour-hotspot-panorama,
    .tour-hotspot-viewer canvas {
        min-height: 300px;
    }

    .tour-hotspot-dialog-viewer,
    .tour-hotspot-dialog-viewer canvas {
        min-height: 360px;
    }

    .tour-hotspot-form-actions .mud-button-root {
        width: 100%;
    }

    .public-tour-view {
        min-height: 100vh;
    }

    .public-tour-overlay {
        align-items: stretch;
        flex-direction: column;
    }

    .public-tour-scene-list {
        max-width: 100%;
        justify-content: flex-start;
    }
}

.scene-button-light {
    color: white;
    border-color: white;
}
