/* Shared navigation: progressive enhancement without changing page layouts. */
.shell-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    transform: translateY(-160%);
    border: 2px solid var(--nmf-cinematic-gold, #c9a24d);
    border-radius: 5px;
    padding: 12px 16px;
    background: #ffffff;
    color: #101820;
    font-weight: 700;
}

.skip-link:focus {
    transform: translateY(0);
}

.app-frame :focus-visible,
.public-shell :focus-visible,
.skip-link:focus-visible {
    outline: 3px solid var(--nmf-cinematic-gold, #c9a24d);
    outline-offset: 3px;
}

.app-frame .global-bar {
    grid-template-columns: 44px minmax(180px, 240px) minmax(180px, 1fr) auto;
    height: auto;
    min-height: 72px;
}

.app-frame [data-menu-control],
.app-frame [data-menu-search] {
    display: none;
}

.app-frame:not([data-shell-ready]) .brand {
    grid-column: 1 / 3;
}

.app-frame:not([data-shell-ready]) .global-actions {
    grid-column: 4;
}

.app-frame[data-shell-ready] .app-launcher {
    display: grid;
    width: 44px;
    height: 44px;
}

.app-frame[data-shell-ready] .menu-search {
    display: flex;
    height: 40px;
    min-width: 0;
}

.menu-search input {
    min-width: 0;
}

.menu-search kbd {
    flex: 0 0 auto;
    font: inherit;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0.8;
}

.app-frame .global-actions {
    min-width: 0;
    flex-wrap: wrap;
    gap: 8px;
}

.app-frame .notification-button,
.app-frame .logout-button {
    min-width: 44px;
    min-height: 44px;
}

.app-frame .user-menu {
    display: block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 30px;
}

.app-frame .sidebar .side-item,
.app-frame .sidebar .side-item span {
    white-space: normal;
    overflow-wrap: anywhere;
}

.app-frame .sidebar .side-item {
    min-height: 44px;
    padding-block: 9px;
}

.app-frame[data-shell-ready] .collapse-button {
    display: flex;
    flex: 0 0 auto;
    height: auto;
    min-height: 44px;
    margin-top: 16px;
    padding: 10px 8px;
}

.app-frame.menu-closed .app-body {
    grid-template-columns: minmax(0, 1fr);
}

.app-frame .sidebar[hidden],
.app-frame .sidebar [hidden] {
    display: none !important;
}

.app-frame.menu-filtered .sidebar-divider {
    display: none;
}

.menu-empty-state {
    margin: 8px;
    color: var(--nmf-warm-ivory, #fff8dc);
    font-size: 13px;
    line-height: 1.6;
}

.command-disclosure {
    position: sticky;
    top: 72px;
    z-index: 20;
}

.command-disclosure > .quick-actions-summary {
    display: none;
    min-height: 44px;
    padding: 12px 16px;
    color: var(--nmf-warm-ivory, #fff8dc);
    background: var(--nmf-projection-blue-black, #101820);
    font-weight: 700;
    cursor: pointer;
}

.command-disclosure .command-ribbon {
    position: static;
    top: auto;
}

.command-disclosure:not([open]) > .command-ribbon {
    display: none;
}

@media (max-width: 1023px) {
    .command-disclosure {
        position: static;
    }

    .command-disclosure > .quick-actions-summary {
        display: list-item;
        list-style-position: inside;
    }

    .app-frame .global-bar {
        position: static;
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px;
    }

    .app-frame .menu-search,
    .app-frame .global-actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .app-frame .global-actions {
        justify-content: flex-end;
    }

    .app-frame:not([data-shell-ready]) .global-actions {
        grid-column: 1 / -1;
    }

    .app-frame .app-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-frame .sidebar {
        padding: 12px;
    }

    .app-frame .sidebar .sidebar-section:first-of-type,
    .app-frame .sidebar-divider {
        display: none;
    }

    .app-frame .sidebar .sidebar-section:last-of-type {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .app-frame .sidebar .sidebar-section:last-of-type p {
        grid-column: 1 / -1;
    }

    .app-frame .sidebar .side-item {
        margin: 0;
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .app-frame .command-ribbon {
        top: 0;
        flex-wrap: wrap;
        overflow: visible;
    }

    .app-frame .command-button {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
