/* UI03 - Final responsive shell contract.
   Loaded last to consolidate legacy shell/mobile rules without changing the
   desktop fixed-shell behavior. */

@media (max-width: 1120px) {
    :root {
        --na-effective-topbar-height: 0px;
    }

    .na-shell {
        display: block;
        width: 100%;
        min-width: 0;
        padding-left: 0;
    }

    .na-main {
        width: 100%;
        min-width: 0;
        padding-top: 0 !important;
    }

    .na-topbar {
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        min-width: 0;
        margin: 0 !important;
    }

    .na-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .na-content > * {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 760px) {
    .na-sidebar.na-sidebar-compact {
        position: sticky;
        top: 0;
        z-index: 1200;
        width: 100%;
        height: 68px;
        max-height: none;
        min-height: 68px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        overflow: hidden;
        padding: 8px 10px;
        border-right: 0;
        border-bottom: 1px solid var(--na-line);
        background: rgba(7, 7, 12, .94);
    }

    .na-sidebar .na-brand {
        flex: 0 0 44px;
        width: 44px;
        overflow: hidden;
    }

    .na-sidebar .na-brand-logo {
        width: 44px;
        height: 44px;
        max-height: 44px;
        object-fit: contain;
    }

    .na-sidebar .na-nav.na-nav-grouped {
        flex: 1 1 auto;
        min-width: 0;
        height: 52px;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 4px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        padding: 0 2px;
    }

    .na-sidebar .na-nav.na-nav-grouped::-webkit-scrollbar {
        display: none;
    }

    .na-sidebar .na-nav-group {
        flex: 0 0 auto;
    }

    .na-sidebar .na-nav-group-items {
        height: 100%;
        align-items: stretch;
    }

    .na-sidebar-compact .na-nav-link {
        min-height: 44px;
        max-width: 150px;
        gap: 7px;
        padding: 6px 10px;
        border-radius: 12px;
    }

    .na-sidebar-compact .na-nav-copy strong {
        overflow: hidden;
        font-size: .75rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .na-sidebar-footer {
        display: none;
    }

    .na-topbar {
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 10px 12px 12px;
    }

    .na-topbar > div:first-child {
        min-width: 0;
    }

    .na-topbar .na-eyebrow {
        font-size: .58rem;
        letter-spacing: .12em;
    }

    .na-topbar h1 {
        overflow: hidden;
        margin-top: 2px;
        font-size: 1.08rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .na-topbar-actions {
        width: auto;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        flex-wrap: wrap;
    }

    .na-topbar .na-theme-trigger {
        width: 44px;
        height: 44px;
        justify-content: center;
        padding: 0;
    }

    .na-topbar .na-theme-chevron {
        display: none;
    }

    .na-topbar .na-status-pill,
    .na-topbar .na-user-chip,
    .na-topbar .na-auth-logout,
    .na-topbar .na-auth-button {
        width: auto;
        min-height: 44px;
    }

    .na-topbar .na-status-pill {
        max-width: 150px;
        overflow: hidden;
        padding: 0 10px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .na-topbar .na-user-chip {
        max-width: 190px;
        padding-right: 8px;
    }

    .na-topbar .na-user-meta strong {
        max-width: 110px;
    }

    .na-topbar .na-auth-logout {
        padding: 0 10px;
    }

    .na-content {
        overflow-x: clip;
        padding: 14px 10px;
    }

    .na-footer {
        width: 100%;
        padding: 16px 12px;
    }
}

@media (max-width: 480px) {
    .na-topbar {
        grid-template-columns: 1fr;
    }

    .na-topbar > div:first-child {
        display: none;
    }

    .na-topbar-actions {
        justify-content: flex-start;
    }

    .na-topbar .na-status-pill {
        flex: 1 1 128px;
        max-width: none;
    }

    .na-topbar .na-user-chip {
        flex: 1 1 150px;
        max-width: none;
    }

    .na-topbar .na-user-meta {
        flex: 1;
    }

    .na-topbar .na-user-meta strong {
        max-width: 100%;
    }
}
