
.se3d-viewer-container {
    position: relative;
    width: 100%;
    background: transparent;
    overflow: hidden;
    z-index: 1;
    pointer-events: auto;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0;
    display: block;
    height: 100%;
    min-height: 320px;
    flex: 1 1 auto;
    align-self: stretch;
}

/* Interaction overlay - covers the container (red border removed) */
.se3d-interaction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    cursor: grab;
    z-index: 2;
    border: none !important;
    outline: none !important;
}

.se3d-interaction-overlay.dragging {
    cursor: grabbing !important;
}

.se3d-viewer-container.dragging::before {
    cursor: grabbing;
}

.se3d-viewer-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: transparent !important;
    z-index: 1;
    pointer-events: none;
}

/* Fullscreen button (top-right inside the shortcode container) */
.se3d-fullscreen-btn {
    position: absolute;
    top: 0;
    left: auto;
    right: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    /* Keep the hit-area large; we pin the SVG via absolute positioning */
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    pointer-events: auto;
    z-index: 20;
    padding: 0;
    outline: none;
    text-decoration: none;
    overflow: visible;
    --se3d-fs-icon-size: 30px;
    --se3d-fs-icon-inset: 4px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Mobile/tablet: give breathing room from the screen edge and hide the tooltip label */
@media (max-width: 1024px) {
    .se3d-fullscreen-btn {
        right: 12px;
        top: 8px;
    }
    .se3d-fullscreen-label {
        display: none !important;
    }
}

/* Touch devices: never show the hover label; also prevent any theme focus background */
@media (hover: none), (pointer: coarse) {
    .se3d-fullscreen-btn:hover .se3d-fullscreen-label,
    .se3d-fullscreen-btn:focus .se3d-fullscreen-label,
    .se3d-fullscreen-btn:focus-visible .se3d-fullscreen-label {
        opacity: 0 !important;
        transform: translateY(-50%) translateX(0) !important;
    }
    .se3d-fullscreen-btn:active,
    .se3d-fullscreen-btn:focus {
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
        outline: none !important;
    }
}

.se3d-fullscreen-btn:hover { opacity: 0.96; }
.se3d-fullscreen-btn:active { opacity: 0.85; }
.se3d-fullscreen-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.se3d-fullscreen-btn svg,
.se3d-fullscreen-btn .se3d-fullscreen-icon {
    width: var(--se3d-fs-icon-size);
    height: var(--se3d-fs-icon-size);
    fill: none;
    stroke: rgba(0, 0, 0, 0.78);
    stroke-width: 2;
    position: absolute;
    top: var(--se3d-fs-icon-inset);
    right: var(--se3d-fs-icon-inset);
    z-index: 1;
    filter: none;
}

.se3d-fullscreen-label {
    position: absolute;
    top: calc(var(--se3d-fs-icon-inset) + (var(--se3d-fs-icon-size) / 2));
    /* Place label relative to the icon, not the button box */
    right: calc(var(--se3d-fs-icon-inset) + var(--se3d-fs-icon-size) + 4px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.82);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-50%) translateX(0);
    transition: opacity 180ms ease, transform 240ms ease;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.45);
    pointer-events: none;
}

.se3d-fullscreen-btn:hover .se3d-fullscreen-label,
.se3d-fullscreen-btn:focus-visible .se3d-fullscreen-label {
    opacity: 1;
    transform: translateY(-50%) translateX(-6px);
}

/* Fullscreen modal */
.se3d-modal-backdrop {
    position: fixed;
    inset: 0;
    /* Lightly darken behind the window (no blur) */
    background: rgba(0, 0, 0, 0.18);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Keep modal away from notches / rounded corners on mobile */
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-right: calc(12px + env(safe-area-inset-right));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    padding-left: calc(12px + env(safe-area-inset-left));
}

.se3d-modal {
    position: relative;
        width: min(1472px, calc(100vw - 24px));
        height: min(1200px, calc(100vh - 24px));
    /* Fallback glass (also works if glassy-container submodule is disabled) */
    background: rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(28px) saturate(130%);
    -webkit-backdrop-filter: blur(28px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 16px;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

/* When using the global glassy container class, keep canvas clipped */
.se3d-modal.glassy1,
.se3d-modal.se-liquid-glass {
    overflow: hidden;
}

/* Match search-results glass intensity knobs (optional overrides) */
.se3d-modal.glassy1 {
    --se-lg-container-blur: 40px;
    --se-lg-container-bg: rgba(255, 255, 255, 0.32);
}

.se3d-modal .se3d-viewer-container {
    width: 100%;
    height: 100%;
}

.se3d-modal-actions {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
    left: auto;
    display: inline-flex;
    gap: 10px;
    padding: 0;
    z-index: 40;
    align-items: center;
}

/* When set (by JS via visualViewport), this pushes actions below browser UI overlays (Chrome URL bar). */
.se3d-modal {
    --se3d-ui-top: 0px;
}

@media (max-width: 1024px) {
    .se3d-modal-actions {
        top: calc(14px + env(safe-area-inset-top) + var(--se3d-ui-top, 0px) + 40px);
        right: calc(14px + env(safe-area-inset-right));
    }
}

/* Glassy container module sets `.glassy1 > * { position: relative; }`.
   Ensure our overlay controls stay absolutely positioned in the modal. */
.se3d-modal.glassy1 > .se3d-modal-actions,
.se3d-modal.se-liquid-glass > .se3d-modal-actions {
    position: absolute !important;
    z-index: 40 !important;
}

.se3d-modal-btn {
    height: 44px;
    padding: 0 14px;
    /* Some themes override button layout; enforce perfect centering */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    box-sizing: border-box;

    /* Visual styling comes from the glassy submodule via `.glassy-btn1` */
    border-radius: 10px !important; /* fallback if glassy CSS isn't loaded */
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    /* Some themes force white button text; override strongly */
    color: rgba(0, 0, 0, 0.92) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1 !important;
    text-transform: none;
    white-space: nowrap;
}

.se3d-modal-btn > span {
    display: block;
    line-height: 1 !important;
}

.se3d-modal-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.95);
    outline-offset: 2px;
}

.se3d-modal-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    flex: 0 0 auto;
    fill: none;
    stroke: rgba(0, 0, 0, 0.78) !important;
    stroke-width: 2;
}


.se3d-viewer-container.hovering { cursor: grab; }
.se3d-viewer-container.dragging { cursor: grabbing !important; }

/* Loading indicator - centered in container with model offset (applied via JS) */
.se3d-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.se3d-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: se3d-spin 0.8s linear infinite;
}

@keyframes se3d-spin {
    to { transform: rotate(360deg); }
}

.se3d-loading-text {
    font-size: 14px;
    color: #555;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
