/*
   UI05 · Mobile-first application shell
   This file is intentionally loaded last. Several legacy surfaces still ship
   their own responsive rules; these shared constraints keep the final layout
   predictable without changing their route-specific visual language.
*/

:root {
    --ui05-mobile-gutter: clamp(12px, 3.5vw, 28px);
    --ui05-touch: 44px;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* UI05 · compact role navigation.
   The runtime returns one role projection with a short primary rail. Secondary
   actions live behind a single More surface so desktop and mobile share the
   same information architecture. */
.na-sidebar.na-sidebar-compact {
    /* Desktop positioning belongs to layout-shell-fixed.css. Mobile/tablet
       positioning is scoped below so the compact rail never reserves a second
       column in the desktop shell. */
}

.na-sidebar-context {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px 6px;
    border: 1px solid rgba(0, 212, 255, .18);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(0, 212, 255, .08), rgba(143, 92, 246, .08));
}

.na-sidebar-context-mark {
    display: grid;
    flex: 0 0 28px;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 45, 141, .42);
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 45, 141, .72), rgba(70, 90, 255, .72));
    font-size: .56rem;
    font-weight: 950;
    letter-spacing: .03em;
}

.na-sidebar-context-copy,
.na-nav-copy {
    min-width: 0;
}

.na-sidebar-context-copy {
    display: grid;
    gap: 2px;
}

.na-sidebar-context-copy strong,
.na-sidebar-context-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.na-sidebar-context-copy strong {
    color: #fff;
    font-size: .72rem;
}

.na-sidebar-context-copy small {
    color: var(--na-muted-2);
    font-size: .58rem;
}

.na-nav-compact-primary {
    display: grid;
    gap: 5px;
    min-height: 0;
}

.na-nav-compact-primary .na-nav-link {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.na-nav-compact-primary .na-nav-link:focus-visible,
.na-navigation-more-panel .na-nav-link:focus-visible,
.na-mobile-bottom-link:focus-visible {
    outline: 2px solid var(--na-accent);
    outline-offset: 2px;
}

.na-nav-primary-link,
.na-nav-more-trigger {
    min-height: 48px;
}

.na-nav-primary-link .na-nav-copy,
.na-nav-more-trigger .na-nav-copy,
.na-nav-more-link .na-nav-copy {
    display: grid;
    gap: 2px;
}

.na-nav-primary-link .na-nav-copy small,
.na-nav-more-trigger .na-nav-copy small,
.na-nav-more-link .na-nav-copy small {
    overflow: hidden;
    color: var(--na-muted-2);
    font-size: .59rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.na-nav-primary-link em,
.na-nav-more-link em {
    min-width: 20px;
    padding: 2px 5px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 212, 255, .14);
    font-size: .63rem;
    font-style: normal;
    text-align: center;
}

.na-nav-more-trigger {
    border-color: rgba(255, 45, 141, .26) !important;
    background: linear-gradient(135deg, rgba(255, 45, 141, .11), rgba(143, 92, 246, .1)) !important;
}

.na-nav-more-chevron {
    margin-left: auto;
    color: var(--na-accent);
    font-size: 1rem;
}

.na-navigation-more-panel {
    position: fixed;
    top: 82px;
    left: calc(var(--na-sidebar-width) + 12px);
    z-index: 1500;
    width: min(330px, calc(100vw - var(--na-sidebar-width) - 28px));
    max-height: calc(100dvh - 104px);
    overflow: auto;
    padding: 12px;
    border: 1px solid rgba(255, 45, 141, .38);
    border-radius: 18px;
    background: rgba(8, 12, 31, .97);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .52), 0 0 40px rgba(255, 45, 141, .1);
    backdrop-filter: blur(20px);
}

.na-navigation-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.na-navigation-more-header > div {
    display: grid;
    gap: 3px;
}

.na-navigation-more-header strong {
    color: #fff;
    font-size: .92rem;
}

.na-navigation-more-close {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, .05);
    cursor: pointer;
    font-size: 1.1rem;
}

.na-navigation-more-list {
    display: grid;
    gap: 4px;
    padding-top: 8px;
}

.na-navigation-more-panel .na-nav-more-link {
    min-height: 48px;
    border-radius: 12px;
}

.na-mobile-bottom-nav {
    display: none;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button,
a {
    touch-action: manipulation;
}

@media (max-width: 1120px) {
    .na-main,
    .na-content,
    .na-page,
    .na-page-shell,
    .beta-dashboard,
    .participant-dashboard,
    .creator-dashboard,
    .platform-dashboard {
        min-width: 0;
        max-width: 100%;
    }

    .na-content {
        padding-inline: var(--ui05-mobile-gutter);
    }

    .na-page-header,
    .na-hero,
    .na-section-head,
    .participant-hero,
    .na-club-discord-hero,
    .na-plays-hero,
    .na-staff-hero,
    .owner-clubs-hero,
    .owner-workbench-hero,
    .workspace-admin-hero {
        min-width: 0;
    }

    .na-page-header > *,
    .na-hero > *,
    .participant-hero > *,
    .na-club-discord-hero > *,
    .na-plays-hero > *,
    .na-staff-hero > *,
    .owner-clubs-hero > *,
    .owner-workbench-hero > *,
    .workspace-admin-hero > * {
        min-width: 0;
    }

    .na-page-header p,
    .na-hero p,
    .participant-hero p,
    .na-club-discord-hero p,
    .na-plays-hero p,
    .na-staff-hero p,
    .owner-clubs-hero p,
    .owner-workbench-hero p,
    .workspace-admin-hero p {
        overflow-wrap: anywhere;
    }

    .na-page-header-actions,
    .na-page-actions,
    .na-hero-actions,
    .participant-hero-actions,
    .workspace-admin-actions,
    .owner-workbench-actions {
        min-width: 0;
        max-width: 100%;
        flex-wrap: wrap;
    }

    .na-data-table-wrap,
    .na-admin-table-wrap,
    .na-table-wrap,
    .table-wrap,
    .data-table-wrap {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 760px) {
    .na-content {
        padding-block: 16px 32px;
    }

    .na-page-header,
    .na-hero,
    .participant-hero,
    .na-club-discord-hero,
    .na-plays-hero,
    .na-staff-hero,
    .owner-clubs-hero,
    .owner-workbench-hero,
    .workspace-admin-hero,
    .na-workbench-hero,
    .na-workbench-boundary,
    .na-workbench-launch {
        display: grid;
        gap: 14px;
        align-items: start;
    }

    .na-page-header h1,
    .na-hero h1,
    .participant-hero h1,
    .na-club-discord-hero h1,
    .na-plays-hero h1,
    .na-staff-hero h1,
    .owner-clubs-hero h1,
    .owner-workbench-hero h1 {
        font-size: clamp(1.9rem, 10vw, 3.2rem);
        line-height: .98;
        overflow-wrap: anywhere;
    }

    .na-page-header-actions,
    .na-page-actions,
    .na-hero-actions,
    .participant-hero-actions,
    .workspace-admin-actions,
    .owner-workbench-actions,
    .na-club-discord-actions,
    .na-plays-actions,
    .na-plays-step-actions,
    .na-staff-actions,
    .na-staff-actions.inline,
    .na-community-actions,
    .na-admin-toolbar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .na-page-header-actions > *,
    .na-page-actions > *,
    .na-hero-actions > *,
    .participant-hero-actions > *,
    .workspace-admin-actions > *,
    .owner-workbench-actions > *,
    .na-club-discord-actions > *,
    .na-plays-actions > *,
    .na-plays-step-actions > *,
    .na-staff-actions > *,
    .na-community-actions > *,
    .na-admin-toolbar-actions > * {
        min-width: 0;
        width: 100%;
        min-height: var(--ui05-touch);
    }

    .na-plays-layout,
    .na-club-discord-layout,
    .na-staff-overview,
    .na-staff-roster-tools,
    .owner-overview-grid,
    .owner-form-grid,
    .owner-assets-grid,
    .owner-color-grid,
    .na-community-layout-grid,
    .na-community-form-grid,
    .na-community-check-grid,
    .na-card-lab-grid,
    .na-player-activities-grid,
    .workspace-admin-grid,
    .na-platform-ready-grid,
    .na-intelligence-layout,
    .na-broadcast-grid,
    .na-broadcast-controls {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .na-plays-library,
    .na-plays-editor,
    .na-club-discord-card,
    .na-staff-card,
    .owner-overview-main,
    .owner-overview-side,
    .workspace-admin-card,
    .na-card-lab-preview,
    .na-card-lab-controls {
        min-width: 0;
    }

    .na-plays-board-shell,
    .na-plays-board,
    .na-plays-board svg,
    .na-plays-step-editor,
    .na-club-discord-form-grid,
    .na-club-discord-onboarding-form,
    .na-staff-form-grid,
    .na-player-edit-modal,
    .na-player-invite-modal {
        max-width: 100%;
        min-width: 0;
    }

    .na-plays-board-shell {
        overflow: hidden;
    }

    .na-plays-board {
        aspect-ratio: 1.48 / 1;
    }

    .na-plays-board-head,
    .na-plays-steps-head,
    .na-club-discord-card-head,
    .na-staff-section-head,
    .na-section-head,
    .owner-section-head,
    .workspace-admin-card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .na-plays-board-head small,
    .na-club-discord-muted,
    .na-staff-muted,
    .owner-section-head p,
    .workspace-admin-note {
        overflow-wrap: anywhere;
    }

    .na-plays-step-list,
    .na-club-discord-resource-grid,
    .na-club-discord-history-grid,
    .na-club-discord-managed-grid,
    .na-club-discord-media-grid,
    .na-staff-member-grid,
    .owner-kpi-grid,
    .owner-clubs-summary,
    .owner-club-metrics,
    .workspace-admin-stat-grid,
    .workspace-admin-route-grid,
    .na-role-dashboard-actions {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .na-club-discord-target-grid,
    .na-club-discord-option-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .na-club-discord-media-actions,
    .na-club-discord-roster-head-actions,
    .na-staff-member-actions,
    .na-staff-member-buttons,
    .na-plays-mobile-quick-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .na-club-discord-media-actions > *,
    .na-club-discord-roster-head-actions > *,
    .na-staff-member-actions > *,
    .na-staff-member-buttons > *,
    .na-plays-mobile-quick-actions > * {
        min-width: 0;
        min-height: var(--ui05-touch);
    }

    .na-club-discord-roster-item,
    .na-club-discord-history-item,
    .na-staff-member-card,
    .owner-club-card,
    .owner-next-action,
    .na-role-dashboard-lane,
    .na-card-lab-panel,
    .na-player-activity-card {
        overflow-wrap: anywhere;
    }

    .na-role-dashboard {
        margin-block: 0 16px;
    }

    .na-role-dashboard-header {
        display: grid;
        gap: 12px;
        align-items: start;
    }

    .na-role-dashboard-context {
        width: 100%;
    }

    .na-modal-backdrop,
    .na-staff-modal-backdrop,
    .na-workbench-modal-backdrop {
        align-items: end;
        padding: 0;
    }

    .na-modal,
    .na-staff-modal,
    .na-workbench-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: min(92dvh, 760px);
        overflow-y: auto;
        border-radius: 22px 22px 0 0;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .na-topbar {
        min-width: 0;
    }

    .na-topbar-actions,
    .na-topbar-right,
    .na-topbar-user,
    .na-topbar-status {
        min-width: 0;
        max-width: 100%;
    }

    .na-topbar-user-name,
    .na-topbar-workspace-name {
        max-width: 22vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .na-admin-table-wrap table,
    .na-data-table-wrap table,
    .na-table-wrap table,
    .table-wrap table,
    .data-table-wrap table {
        min-width: 720px;
    }
}

@media (max-width: 420px) {
    .na-content {
        padding-inline: 10px;
    }

    .na-page-header-actions,
    .na-page-actions,
    .na-hero-actions,
    .participant-hero-actions,
    .workspace-admin-actions,
    .owner-workbench-actions,
    .na-club-discord-actions,
    .na-plays-actions,
    .na-plays-step-actions,
    .na-staff-actions,
    .na-staff-actions.inline,
    .na-community-actions,
    .na-admin-toolbar-actions,
    .na-club-discord-media-actions,
    .na-club-discord-roster-head-actions,
    .na-staff-member-actions,
    .na-staff-member-buttons,
    .na-plays-mobile-quick-actions {
        grid-template-columns: 1fr;
    }

    .na-role-dashboard-action {
        grid-template-columns: 32px minmax(0, 1fr) auto;
    }

    .na-role-dashboard-action-arrow {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* The compact phone projection is rendered alongside the grouped navigation
   in the markup, but must never leak into desktop or tablet shells. */
.na-nav-mobile-scroll {
    display: none;
}

/* UI05 · delivery 2 — mobile navigation and dense workbench surfaces.
   The legacy shell has an icon-only rule at this breakpoint. The mobile
   contract is a real, labelled drawer: context stays visible and navigation
   remains usable with one hand. */
@media (max-width: 760px) {
    .na-sidebar.na-sidebar-compact {
        height: 64px;
        min-height: 64px;
        padding: 7px 10px;
        gap: 8px;
    }

    .na-sidebar.na-sidebar-compact .na-brand {
        flex: 0 0 42px;
        width: 42px;
    }

    .na-sidebar.na-sidebar-compact .na-brand-logo {
        width: 42px;
        height: 42px;
        max-height: 42px;
    }

    .na-sidebar-context {
        flex: 1 1 auto;
        min-width: 0;
        padding: 6px 8px;
    }

    .na-sidebar-context-mark {
        flex-basis: 26px;
        width: 26px;
        height: 26px;
    }

    .na-sidebar-context-copy strong {
        font-size: .68rem;
    }

    .na-sidebar-context-copy small {
        font-size: .55rem;
    }

    .na-sidebar.na-sidebar-compact .na-sidebar-toggle {
        display: none;
    }

    .na-sidebar.na-sidebar-compact .na-nav-compact-primary,
    .na-sidebar.na-sidebar-compact .na-sidebar-footer {
        display: none;
    }

    .na-mobile-bottom-nav {
        position: fixed;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        left: 8px;
        z-index: 1400;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        min-height: 64px;
        padding: 6px;
        border: 1px solid rgba(0, 212, 255, .23);
        border-radius: 18px;
        background: rgba(8, 12, 31, .94);
        box-shadow: 0 16px 42px rgba(0, 0, 0, .42);
        backdrop-filter: blur(18px);
    }

    .na-mobile-bottom-link {
        display: grid;
        min-width: 0;
        min-height: 50px;
        place-items: center;
        align-content: center;
        gap: 2px;
        padding: 4px 3px;
        border: 0;
        border-radius: 12px;
        color: var(--na-muted);
        background: transparent;
        cursor: pointer;
        font: inherit;
        text-decoration: none;
    }

    .na-mobile-bottom-link .na-nav-icon {
        color: var(--na-accent);
        font-size: .98rem;
        line-height: 1;
    }

    .na-mobile-bottom-link strong {
        max-width: 100%;
        overflow: hidden;
        font-size: .61rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .na-mobile-bottom-link.active,
    .na-mobile-bottom-link[aria-expanded="true"] {
        color: #fff;
        background: linear-gradient(135deg, rgba(255, 45, 141, .22), rgba(0, 212, 255, .12));
        box-shadow: inset 0 0 0 1px rgba(255, 45, 141, .28);
    }

    .na-navigation-more-panel {
        top: auto;
        right: 8px;
        bottom: calc(80px + env(safe-area-inset-bottom));
        left: 8px;
        width: auto;
        max-height: min(70dvh, 560px);
        border-radius: 18px;
    }

    .na-sidebar-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1250;
        border: 0;
        background: rgba(2, 6, 23, .66);
        backdrop-filter: blur(3px);
    }

    .na-main {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .na-sidebar.na-sidebar-compact {
        z-index: 1300;
    }

    .na-sidebar.na-sidebar-compact .na-sidebar-mobile-trigger {
        position: relative;
        z-index: 1330;
        min-height: var(--ui05-touch);
    }

    .na-sidebar.na-sidebar-compact .na-nav.na-nav-grouped {
        position: fixed !important;
        inset: calc(72px + env(safe-area-inset-top)) 10px auto;
        z-index: 1320;
        width: auto !important;
        max-height: calc(100dvh - 84px - env(safe-area-inset-top));
        display: none !important;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 10px !important;
        border: 1px solid var(--na-line-strong);
        border-radius: 0 0 18px 18px;
        background: rgba(7, 7, 12, .98);
        box-shadow: 0 24px 60px rgba(0, 0, 0, .48);
        backdrop-filter: blur(18px);
    }

    .na-sidebar.na-sidebar-compact .na-nav.na-nav-grouped.is-mobile-open {
        display: grid !important;
        gap: 8px;
    }

    .na-sidebar.na-sidebar-compact .na-nav-group summary {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        justify-items: start;
        min-height: 48px;
        padding: 9px 11px;
    }

    .na-sidebar.na-sidebar-compact .na-nav-group summary::after,
    .na-sidebar.na-sidebar-compact .na-nav-group-label,
    .na-sidebar.na-sidebar-compact .na-nav-group summary small {
        display: block;
    }

    .na-sidebar.na-sidebar-compact .na-nav-group summary small {
        grid-column: 2;
        color: var(--na-muted-2);
        font-size: .61rem;
        line-height: 1.2;
    }

    .na-sidebar.na-sidebar-compact .na-nav-group-items {
        display: grid;
        gap: 4px;
        padding: 4px 5px 8px;
    }

    .na-sidebar.na-sidebar-compact .na-nav-link {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr) auto;
        justify-items: start;
        width: 100% !important;
        max-width: none !important;
        min-height: var(--ui05-touch);
        padding: 8px 12px !important;
        text-align: left;
    }

    .na-sidebar.na-sidebar-compact .na-nav-link .na-nav-icon {
        width: 30px !important;
        min-width: 30px;
        text-align: center;
    }

    .na-sidebar.na-sidebar-compact .na-nav-link .na-nav-copy {
        display: grid !important;
        gap: 2px;
        min-width: 0;
    }

    .na-sidebar.na-sidebar-compact .na-nav-copy strong,
    .na-sidebar.na-sidebar-compact .na-nav-copy small {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .na-sidebar.na-sidebar-compact .na-nav-link em {
        position: static;
        align-self: center;
    }

    .na-sidebar-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1200;
        border: 0;
        background: rgba(2, 6, 23, .62);
        backdrop-filter: blur(3px);
    }

    .na-club-workbench-nav {
        top: var(--na-effective-topbar-height, 0px) !important;
    }

    .na-club-workbench-secondary {
        max-height: calc(100dvh - var(--na-effective-topbar-height, 0px) - 86px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .na-plays-page {
        padding-bottom: calc(5.25rem + env(safe-area-inset-bottom));
    }

    .na-plays-mobile-quick-actions {
        position: fixed;
        right: var(--ui05-mobile-gutter);
        bottom: calc(10px + env(safe-area-inset-bottom));
        left: var(--ui05-mobile-gutter);
        z-index: 900;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .45rem;
        padding: .55rem;
        border: 1px solid rgba(34, 211, 238, .28);
        border-radius: 16px;
        background: rgba(8, 14, 35, .94);
        box-shadow: 0 16px 36px rgba(0, 0, 0, .4);
        backdrop-filter: blur(16px);
    }

    .na-plays-mobile-quick-actions > * {
        min-width: 0;
        min-height: var(--ui05-touch);
    }

    .na-plays-mobile-quick-actions .na-voice-cancel {
        grid-column: 1 / -1;
    }

    .na-player-completion-view,
    .na-card-lab-preview,
    .na-player-invite-modal,
    .na-staff-modal {
        max-width: 100%;
        min-width: 0;
    }

    .na-player-completion-view .completion-card-wrap,
    .na-card-lab-preview .badge-identity-card {
        width: min(100%, 300px);
        max-width: 100%;
        margin-inline: auto;
    }

    .na-player-photo-preview {
        max-width: 100%;
        max-height: min(38dvh, 260px);
    }

    .na-player-invite-modal .na-player-photo-preview {
        max-height: none;
    }

    .na-club-discord-card,
    .na-staff-card,
    .na-card-lab-panel,
    .na-player-activity-card {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 420px) {
    .na-sidebar.na-sidebar-compact .na-nav.na-nav-grouped {
        inset-inline: 6px;
        padding: 8px !important;
    }

    .na-plays-mobile-quick-actions {
        grid-template-columns: 1fr 1fr;
        padding: .45rem;
    }
}

/* UI05 · phone navigation rail.
   The first mobile contract used a touch-scrollable rail. Keep every link
   visible in the same authorized projection so users can discover the whole
   menu without depending on a fragile overlay/drawer layer. */
@media (max-width: 760px) {
    .na-sidebar.na-sidebar-compact {
        position: sticky !important;
        inset: 0 auto auto !important;
        display: grid !important;
        grid-template-columns: 44px minmax(0, 1fr);
        grid-template-rows: calc(64px + env(safe-area-inset-top));
        align-items: center;
        width: 100% !important;
        height: auto !important;
        min-height: calc(64px + env(safe-area-inset-top)) !important;
        max-height: none !important;
        gap: 0 8px;
        overflow: visible !important;
        padding: max(8px, env(safe-area-inset-top)) 10px 8px !important;
    }

    .na-sidebar.na-sidebar-compact .na-brand {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        width: 44px;
    }

    .na-sidebar.na-sidebar-compact .na-sidebar-mobile-trigger {
        display: none !important;
    }

    .na-sidebar.na-sidebar-compact .na-nav.na-nav-grouped,
    .na-sidebar.na-sidebar-compact .na-nav:not(.na-nav-mobile-scroll),
    .na-sidebar.na-sidebar-compact .na-sidebar-mobile-backdrop {
        display: none !important;
    }

    .na-sidebar.na-sidebar-compact .na-nav-mobile-scroll {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        display: flex !important;
        align-items: stretch;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        min-height: 52px;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 8px;
        padding: 4px 0 2px;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        touch-action: pan-x;
    }

    .na-sidebar.na-sidebar-compact .na-nav-mobile-scroll::-webkit-scrollbar {
        display: none;
    }

    .na-sidebar.na-sidebar-compact .na-mobile-nav-group {
        display: flex;
        flex: 0 0 auto;
        align-items: stretch;
        gap: 6px;
        min-width: max-content;
        padding-right: 8px;
        border-right: 1px solid rgba(255, 255, 255, .12);
    }

    .na-sidebar.na-sidebar-compact .na-mobile-nav-group-label {
        display: grid;
        align-content: center;
        justify-items: center;
        min-width: 44px;
        padding-inline: 3px;
        color: var(--na-accent);
        font-size: .54rem;
        font-weight: 950;
        letter-spacing: .04em;
        text-align: center;
        text-transform: uppercase;
    }

    .na-sidebar.na-sidebar-compact .na-mobile-nav-group-label > span {
        display: grid;
        place-items: center;
        width: 24px;
        height: 22px;
        margin-bottom: 2px;
        border: 1px solid rgba(0, 212, 255, .28);
        border-radius: 7px;
        background: rgba(0, 212, 255, .08);
    }

    .na-sidebar.na-sidebar-compact .na-mobile-nav-group-label small {
        max-width: 70px;
        overflow: hidden;
        color: var(--na-muted-2);
        font-size: .48rem;
        line-height: 1.05;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .na-sidebar.na-sidebar-compact .na-mobile-nav-link {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        min-width: max-content;
        min-height: var(--ui05-touch);
        max-width: none;
        padding: 7px 11px;
        border: 1px solid rgba(255, 255, 255, .11);
        border-radius: 13px;
        color: var(--na-muted);
        background: rgba(255, 255, 255, .045);
        white-space: nowrap;
    }

    .na-sidebar.na-sidebar-compact .na-mobile-nav-link:hover,
    .na-sidebar.na-sidebar-compact .na-mobile-nav-link.active {
        color: white;
        border-color: rgba(0, 212, 255, .42);
        background: rgba(0, 212, 255, .12);
    }

    .na-sidebar.na-sidebar-compact .na-mobile-nav-link .na-nav-icon {
        display: inline-grid;
        place-items: center;
        width: 22px;
        min-width: 22px;
        color: var(--na-accent);
        font-size: .9rem;
    }

    .na-sidebar.na-sidebar-compact .na-mobile-nav-link strong {
        max-width: 132px;
        overflow: hidden;
        font-size: .72rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .na-sidebar.na-sidebar-compact .na-mobile-nav-link em {
        display: inline-grid;
        place-items: center;
        min-width: 18px;
        min-height: 18px;
        padding: 0 4px;
        border-radius: 999px;
        color: white;
        background: rgba(255, 45, 141, .72);
        font-size: .55rem;
        font-style: normal;
        font-weight: 950;
    }

    .na-sidebar.na-sidebar-compact .na-mobile-nav-loading {
        display: inline-flex;
        align-items: center;
        min-height: var(--ui05-touch);
        color: var(--na-muted);
        font-size: .72rem;
    }
}
/* UI05 · unified mobile shell: keep the global rail sticky while the informational topbar condenses on scroll. */
.na-navigation-shell {
    display: contents;
}

.na-topbar-theme-control,
.na-topbar-secondary-info {
    display: contents;
}

@media (max-width: 760px) {
    .na-navigation-shell {
        position: sticky !important;
        top: 0 !important;
        z-index: 1300;
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        background: rgba(7, 7, 12, .96);
        box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
    }

    .na-navigation-shell > .na-sidebar {
        position: relative !important;
        top: auto !important;
        z-index: auto;
    }

    .na-navigation-shell > .na-topbar {
        position: relative !important;
        inset: auto !important;
        z-index: auto !important;
        width: 100% !important;
        min-height: 0;
        height: auto;
        padding: 3px 10px 4px !important;
        border-top: 1px solid rgba(255, 255, 255, .08);
        border-bottom: 1px solid var(--na-line);
        background: rgba(10, 12, 24, .92);
        box-shadow: none;
    }

    .na-navigation-shell > .na-topbar .na-topbar-brand-slot {
        display: none;
    }

    .na-navigation-shell > .na-topbar .na-topbar-actions {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .na-navigation-shell .na-topbar-theme-control {
        display: flex;
        flex: 0 0 38px;
        width: 38px;
        min-width: 38px;
    }

    .na-navigation-shell .na-topbar .na-theme-control {
        width: 100%;
    }

    .na-navigation-shell .na-topbar-secondary-info {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        justify-content: flex-end;
        min-width: 0;
        max-width: 100%;
        gap: 4px;
        overflow: hidden;
        opacity: 1;
        transition: max-width .18s ease, flex-basis .18s ease, gap .18s ease, opacity .14s ease;
    }

    .na-navigation-shell .na-topbar-secondary-info > * {
        min-width: 0;
    }

    .na-navigation-shell .na-topbar .na-theme-trigger {
        width: 38px;
        min-width: 38px;
        min-height: 32px;
        height: 32px;
        justify-content: center;
        gap: 0;
        padding: 0;
        border-radius: 10px;
        font-size: .78rem;
    }

    .na-navigation-shell .na-topbar .na-theme-trigger-label,
    .na-navigation-shell .na-topbar .na-theme-chevron {
        display: none;
    }

    .na-navigation-shell .na-topbar .na-status-pill {
        flex: 1 1 76px;
        width: auto;
        max-width: 102px;
        min-height: 30px;
        height: 30px;
        padding: 0 7px;
        overflow: hidden;
        font-size: .56rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .na-navigation-shell .na-topbar .na-user-chip {
        flex: 1 1 84px;
        width: auto;
        max-width: 116px;
        min-height: 30px;
        height: 30px;
        gap: 4px;
        padding: 2px 6px 2px 3px;
    }

    .na-navigation-shell .na-topbar .na-user-avatar {
        width: 24px;
        height: 24px;
        font-size: .56rem;
    }

    .na-navigation-shell .na-topbar .na-user-meta strong,
    .na-navigation-shell .na-topbar .na-user-meta small {
        max-width: 76px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .na-navigation-shell .na-topbar .na-user-meta strong {
        font-size: .58rem;
    }

    .na-navigation-shell .na-topbar .na-user-meta small {
        font-size: .5rem;
    }

    .na-navigation-shell .na-topbar .na-auth-logout,
    .na-navigation-shell .na-topbar .na-auth-button {
        flex: 0 0 auto;
        width: auto;
        min-height: 30px;
        height: 30px;
        padding: 0 7px;
        font-size: .58rem;
    }

    .na-navigation-shell .na-theme-menu {
        position: absolute;
        top: calc(100% + 6px);
        right: auto;
        left: 0;
        width: min(284px, calc(100vw - 24px));
    }

    .na-navigation-shell.is-scrolled .na-topbar-secondary-info {
        flex-basis: 0;
        max-width: 0;
        gap: 0;
        opacity: 0;
        pointer-events: none;
    }

    .na-navigation-shell.is-scrolled > .na-topbar {
        padding-top: 2px !important;
        padding-bottom: 3px !important;
    }
}

/* Final compact-shell overrides: the legacy icon rail must not hide labels
   inside the More panel or clip that panel when it escapes the rail. */
@media (min-width: 1121px) {
    .na-sidebar.na-sidebar-compact.is-more-open {
        overflow: visible;
    }

    .na-sidebar.na-sidebar-compact .na-sidebar-context {
        justify-content: center;
        padding-inline: 3px;
    }

    .na-sidebar.na-sidebar-compact .na-sidebar-context-copy {
        display: none;
    }
}

.na-navigation-more-panel .na-nav-copy {
    display: grid !important;
}

@media (max-width: 760px) {
    .na-sidebar.na-sidebar-compact.is-more-open {
        overflow: visible;
    }
}

/* UI05 · navegación desktop refinada: cabecera ligera, filas densas y
   un único acceso contextual en la barra superior. */
@media (min-width: 1121px) {
    .na-sidebar.na-sidebar-compact.is-expanded {
        gap: 8px;
        padding: 12px 10px 10px;
        background:
            radial-gradient(circle at 10% 0%, rgba(0, 207, 255, .07), transparent 28%),
            linear-gradient(180deg, rgba(16, 22, 51, .98), rgba(7, 9, 20, .99));
    }

    .na-sidebar.na-sidebar-compact .na-sidebar-brand-row {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-sidebar-brand-row {
        min-height: 58px;
        padding: 0 2px 8px;
        border-bottom: 1px solid rgba(133, 153, 220, .16);
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-brand {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 46px;
        padding: 0;
        justify-content: flex-start;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-brand-logo {
        width: 112px;
        max-width: 100%;
        max-height: 54px;
        object-fit: contain;
        object-position: left center;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-sidebar-toggle {
        flex: 0 0 auto;
        width: auto;
        min-height: 32px;
        padding: 0 8px;
        justify-content: center;
        gap: 5px;
        border: 1px solid rgba(111, 131, 203, .2);
        border-radius: 9px;
        color: var(--na-muted);
        background: rgba(8, 12, 28, .48);
        font-size: .58rem;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-sidebar-toggle:hover {
        color: #fff;
        border-color: rgba(0, 207, 255, .45);
        background: rgba(0, 207, 255, .1);
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-sidebar-context {
        min-height: 36px;
        justify-content: flex-start !important;
        padding: 6px 8px;
        border: 1px solid rgba(111, 131, 203, .16);
        border-radius: 10px;
        background: linear-gradient(100deg, rgba(25, 35, 75, .75), rgba(20, 13, 51, .55));
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-sidebar-context-mark {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        border-radius: 7px;
        font-size: .56rem;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-sidebar-context-copy {
        display: grid !important;
        min-width: 0;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-sidebar-context-copy strong {
        font-size: .66rem;
        line-height: 1.1;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-sidebar-context-copy small {
        font-size: .52rem;
        line-height: 1.1;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-compact-primary {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        align-content: initial;
        justify-content: flex-start;
        gap: 4px;
        overflow-y: auto;
        padding: 4px 0;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-primary-link,
    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-more-trigger {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 0 10px;
        gap: 10px;
        border: 1px solid transparent;
        border-radius: 10px;
        background: transparent;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-primary-link:hover,
    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-more-trigger:hover {
        border-color: rgba(0, 207, 255, .18);
        background: rgba(31, 45, 91, .52);
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-primary-link.active {
        padding-left: 8px;
        border-left: 3px solid var(--na-accent);
        border-color: rgba(255, 45, 141, .26);
        background: linear-gradient(90deg, rgba(255, 45, 141, .18), rgba(47, 45, 115, .18));
        box-shadow: inset 0 0 22px rgba(255, 45, 141, .05);
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-primary-link .na-nav-icon,
    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-more-trigger .na-nav-icon {
        width: 20px;
        min-width: 20px;
        text-align: center;
        font-size: .9rem;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-primary-link .na-nav-copy strong,
    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-more-trigger .na-nav-copy strong {
        font-size: .7rem;
        letter-spacing: .01em;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-primary-link .na-nav-copy small,
    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-more-trigger .na-nav-copy small {
        font-size: .53rem;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-nav-more-trigger {
        margin-top: 6px;
        border-top-color: rgba(133, 153, 220, .16);
        border-radius: 10px;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-sidebar-footer {
        flex: 0 0 auto;
        min-height: 30px;
        padding: 0 8px;
        border: 1px solid rgba(111, 131, 203, .16);
        border-radius: 9px;
        background: rgba(15, 21, 48, .62);
        font-size: .54rem;
    }

    .na-sidebar.na-sidebar-compact.is-expanded .na-sidebar-footer strong {
        font-size: .54rem;
    }
}

@media (max-width: 1120px) {
    .na-sidebar.na-sidebar-compact .na-sidebar-brand-row {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .na-sidebar.na-sidebar-compact .na-sidebar-brand-row .na-brand {
        min-width: 0;
    }

    .na-sidebar.na-sidebar-compact .na-sidebar-brand-row .na-sidebar-toggle-copy {
        display: none;
    }
}

/* Keep the complete mobile/tablet navigation shell available while the page
   scrolls. The wrapper owns stickiness so the rail and topbar move together. */
@media (max-width: 1120px) {
    .na-navigation-shell {
        position: sticky !important;
        top: 0 !important;
        z-index: 1300;
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        background: rgba(7, 7, 12, .96);
        box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
    }

    .na-navigation-shell > .na-sidebar,
    .na-navigation-shell > .na-topbar {
        position: relative !important;
        inset: auto !important;
        z-index: auto;
        flex: 0 0 auto;
    }
}
/* On phones, keep the shell pinned to the viewport even when the browser
   changes the body scroll context. The reserved main offset prevents the
   first content card from sliding underneath the navigation. */
@media (max-width: 760px) {
    .na-navigation-shell {
        position: fixed !important;
        inset: 0 0 auto 0 !important;
        width: 100%;
        max-height: none;
        overflow: visible;
    }
    .na-main {
        padding-top: calc(106px + env(safe-area-inset-top)) !important;
    }
}