/**
 * DropX Prime — Viewport Shell V3
 * One centered shell. The document remains the only vertical scroll surface.
 * Footer stays in normal flow; floating docks remain outside the shell.
 */
:root {
    --dx-shell-frame-gutter: clamp(100px, 8.5vw, 160px);
    --dx-shell-frame-max: 1656px;
    --dx-shell-frame-radius: 14px;
}

@media (min-width: 1201px) {
    html body .sticky-header-wrapper,
    html body .app-container {
        width: min(calc(100vw - (2 * var(--dx-shell-frame-gutter))), var(--dx-shell-frame-max));
        max-width: var(--dx-shell-frame-max);
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    /* Keep the approved rounded top edge. */
    html body .sticky-header-wrapper {
        position: sticky;
        top: 0;
        z-index: 5000;
        margin-top: 0;
        border: 1px solid var(--dx-canvas-border, rgba(190,199,209,.16));
        border-bottom: 0;
        border-radius: 0;
        background: var(--dx-canvas-bg, rgba(8,11,15,.84));
        background-clip: padding-box;
        isolation: isolate;
        box-shadow: 0 8px 26px rgba(0,0,0,.16);
    }

    html body .sticky-header-wrapper .desktop-header {
        border-radius: 0;
        background-clip: padding-box;
    }

    /* The secondary navigation is visibly subordinate to the primary nav. */
    html body .sticky-header-wrapper .landing-submenu {
        min-height: 34px;
        gap: 14px;
        padding: 3px 12px;
        border-radius: 0;
    }
    html body .sticky-header-wrapper .landing-submenu a {
        min-height: 27px;
        padding: 4px 9px;
        font-size: .72rem;
        line-height: 1.1;
        letter-spacing: .55px;
    }
    html body .sticky-header-wrapper .landing-submenu a svg,
    html body .sticky-header-wrapper .landing-submenu a i {
        width: 14px;
        height: 14px;
    }

    html body .app-container {
        position: relative;
        display: flex;
        flex-direction: column;
        min-width: 0;
        min-height: calc(100vh - 88px);
        min-height: calc(100dvh - 88px);
        margin: 0 auto 28px;
        padding: 0;
        border: 1px solid var(--dx-canvas-border, rgba(190,199,209,.16));
        border-top: 0;
        border-radius: 0 0 var(--dx-shell-frame-radius) var(--dx-shell-frame-radius);
        background: var(--dx-canvas-bg, rgba(8,11,15,.76));
        background-clip: padding-box;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: var(--dx-canvas-shadow, 0 24px 70px rgba(0,0,0,.34));
        overflow: visible;
    }

    html body .app-container > .dx-forum-global-pin,
    html body .app-container > .dx-forum-global-banner,
    html body .app-container > #main-content,
    html body .app-container > .site-footer {
        width: 100%;
        max-width: none;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
        align-self: stretch;
    }

    html body .app-container > .dx-forum-global-pin,
    html body .app-container > .dx-forum-global-banner {
        flex: 0 0 auto;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    html body .app-container > #main-content {
        flex: 1 0 auto;
        min-height: 0;
        padding-bottom: 18px;
        background: transparent;
    }

    /* Footer is in normal document flow: no fixed overlay or reserved gap. */
    html body .app-container > .site-footer {
        position: relative;
        inset: auto;
        z-index: auto;
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
        margin: auto 0 0;
        padding: 12px clamp(14px, 2vw, 28px) 14px;
        box-sizing: border-box;
        transform: none;
        border: 0;
        border-top: 1px solid var(--dx-panel-border-hover, rgba(214,165,43,.24));
        border-radius: 0 0 var(--dx-shell-frame-radius) var(--dx-shell-frame-radius);
        background: rgba(5,7,10,.28);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: none;
    }
    html body.light-mode .app-container > .site-footer {
        background: rgba(239,234,225,.30);
    }

    html body .app-container > .site-footer > .footer-legal {
        gap: 7px;
        margin: 0 0 6px;
        padding: 0 0 6px;
        font-size: .68rem;
    }
    html body .app-container > .site-footer .footer-grid {
        padding-top: 8px;
        font-size: .68rem;
    }
    html body .app-container > .site-footer .footer-badge,
    html body .app-container > .site-footer .designer-badge {
        padding: 3px 8px;
        font-size: .62rem;
    }
    html body .app-container > .site-footer .service-tag {
        font-size: .62rem;
        letter-spacing: 1px;
    }

    /* Floating chat/user/DeckSA dock remains outside the content shell. */
    html body #dx-chat-minimized-dock { right: 68px; }
}

@media (min-width: 1201px) and (max-height: 760px) {
    html body .app-container {
        min-height: calc(100vh - 78px);
        min-height: calc(100dvh - 78px);
    }
    html body .app-container > .site-footer { padding-top: 8px; padding-bottom: 9px; }
    html body .app-container > .site-footer > .footer-legal {
        margin-bottom: 3px;
        padding-bottom: 3px;
    }
    html body .app-container > .site-footer .footer-grid { padding-top: 5px; }
}

@media (min-width: 769px) and (max-width: 1200px) {
    html body .sticky-header-wrapper,
    html body .app-container {
        width: calc(100% - 36px);
        max-width: none;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }
    html body .app-container {
        min-height: calc(100vh - 88px);
        min-height: calc(100dvh - 88px);
        padding: 0;
    }
    html body .app-container > .site-footer {
        position: relative;
        inset: auto;
        width: 100%;
        transform: none;
        margin-top: auto;
        border-radius: 0 0 12px 12px;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* Tablet/mobile retain native document/PWA scrolling. */
@media (max-width: 768px) {
    html body .app-container > .site-footer {
        position: relative;
        inset: auto;
        left: auto;
        bottom: auto;
        width: 100%;
        transform: none;
        border-radius: 0;
        padding: 16px 12px;
    }
    html body .app-container {
        padding-bottom: 0;
        min-height: calc(100dvh - var(--dx-mobile-header-height, 90px));
    }
}
