/* FIX153 — Header overflow menu interaction fix.
   Do not use MudPopover for the global header menu: it renders outside the app shell
   and can be intercepted by accumulated overlay/popover stacking rules. */
.app-shell .studio-topbar,
.app-shell .studio-topbar .top-actions,
.app-shell .studio-topbar .top-account-actions,
.app-shell .studio-topbar .studio-security-account {
    overflow: visible !important;
}

.app-shell .studio-topbar .top-account-actions,
.app-shell .studio-topbar .studio-security-account {
    position: relative;
    z-index: 30000 !important;
    pointer-events: auto !important;
}

.app-shell .studio-header-native-menu {
    position: relative;
    z-index: 30010;
    margin-left: 4px;
    pointer-events: auto !important;
}

.app-shell .studio-header-native-menu__trigger {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    color: var(--app-text);
    background: var(--app-control-bg);
    cursor: pointer;
    pointer-events: auto !important;
}

.app-shell .studio-header-native-menu__trigger:hover,
.app-shell .studio-header-native-menu__trigger:focus-visible {
    border-color: var(--app-primary-border);
    background: var(--app-control-hover-bg);
    outline: none;
}

.app-shell .studio-header-native-menu__trigger .mud-icon-root {
    font-size: 22px;
    pointer-events: none;
}

.app-shell .studio-header-native-menu__panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30020 !important;
    width: 224px;
    padding: 6px;
    border: 1px solid var(--dialog-border, var(--app-border));
    border-radius: 10px;
    color: var(--dialog-text, var(--app-text));
    background: var(--dialog-bg, var(--app-surface));
    box-shadow: 0 18px 48px rgba(2, 7, 13, .36);
    pointer-events: auto !important;
    isolation: isolate;
}

.app-shell .studio-header-native-menu__panel > button {
    width: 100%;
    min-height: 39px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    color: inherit;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    pointer-events: auto !important;
}

.app-shell .studio-header-native-menu__panel > button:hover,
.app-shell .studio-header-native-menu__panel > button:focus-visible {
    color: var(--ng-primary);
    background: var(--app-hover-bg);
    outline: none;
}

.app-shell .studio-header-native-menu__panel > button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.app-shell .studio-header-native-menu__panel > button .mud-icon-root {
    font-size: 21px;
    pointer-events: none;
}

.app-shell .studio-header-native-menu__panel > button > span {
    pointer-events: none;
}

.app-shell .studio-header-native-menu__divider {
    height: 1px;
    margin: 5px -6px;
    background: var(--app-divider, var(--app-border));
    pointer-events: none;
}


/* FIX154 — explicit dropdown layout. Loaded as a real stylesheet from App.razor.
   Do not place this file in a late @import: CSS @import rules after style rules are ignored. */
.app-shell .studio-topbar .studio-security-account > .studio-header-native-menu {
    display: block !important;
    position: relative !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
}
.app-shell .studio-topbar .studio-security-account > .studio-header-native-menu > .studio-header-native-menu__panel {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    width: 232px !important;
    min-width: 232px !important;
    max-width: 232px !important;
    height: auto !important;
    white-space: normal !important;
    overflow: hidden !important;
}
.app-shell .studio-topbar .studio-security-account > .studio-header-native-menu > .studio-header-native-menu__panel > button {
    display: grid !important;
    grid-template-columns: 26px minmax(0, 1fr) !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}
@media (max-width: 980px) {
    .app-shell .studio-topbar .studio-security-account > .studio-header-native-menu {
        display: block !important;
    }
}
