/* MudMenu popovers render outside component CSS isolation, so these menu styles must be global. */
:is(html, body).portal-dark-mode .mud-menu.appbar-user-menu-root,
:is(html, body).portal-dark-mode .mud-menu.appbar-user-menu-root .mud-button-root,
:is(html, body).portal-dark-mode .mud-menu.appbar-user-menu-root .mud-icon-button,
:is(html, body).portal-dark-mode .mud-menu.appbar-user-menu-root .mud-menu-activator {
    background-color: transparent;
    border: 0;
    box-shadow: none;
}

.appbar-user-menu-popover {
    width: min(268px, calc(100vw - 24px));
    margin-top: 10px;
    padding: 0;
    overflow: hidden;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-surface);
    border: 1px solid var(--portal-divider-color);
    border-radius: 14px;
    box-shadow: var(--portal-auth-card-shadow);
}

.appbar-user-menu-panel {
    width: 100%;
    padding: 16px;
    color: var(--mud-palette-text-primary);
}

.appbar-user-menu-identity {
    padding: 0 0 8px;
}

.appbar-user-menu-name {
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appbar-user-menu-email {
    overflow: hidden;
    margin-top: 2px;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--mud-palette-text-secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appbar-user-menu-form {
    margin: 0;
}

.appbar-user-menu-item {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: center;
    width: 100%;
    min-height: 36px;
    column-gap: 12px;
    padding: 7px 8px;
    color: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: 8px;
}

.appbar-user-menu-item:hover,
.appbar-user-menu-item:focus-visible {
    color: inherit;
    text-decoration: none;
    background: var(--portal-settings-tab-hover-background);
    outline: none;
}

.appbar-user-menu-item span {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}

.appbar-user-menu-item .mud-icon-root {
    width: 19px;
    height: 19px;
    font-size: 19px;
    color: currentColor;
    justify-self: center;
}

.appbar-user-menu-submit {
    cursor: pointer;
    font-family: inherit;
}

:is(html, body).portal-dark-mode .appbar-user-menu-popover {
    box-shadow: var(--portal-settings-tab-active-shadow);
}
