.olympiac-profile-menu {
    --profile-menu-ink: #253047;
    --profile-menu-muted: #667085;
    --profile-menu-border: rgba(37, 48, 71, .1);
    --profile-menu-hover: #eef7f4;
    --profile-menu-accent: var(--bs-primary, #0d8b75);
    position: relative;
}

.olympiac-profile-menu > .dropdown-user-link,
.dropdown-user .olympiac-profile-menu__trigger-copy {
    display: flex;
    align-items: center;
}

.olympiac-profile-menu > .dropdown-user-link {
    gap: .55rem;
    min-height: 44px;
    padding: .2rem .4rem .2rem .65rem;
    border-radius: 14px;
    text-decoration: none;
    transition: background-color 170ms ease, color 170ms ease;
}

.olympiac-profile-menu > .dropdown-user-link::after {
    display: none !important;
}

.olympiac-profile-menu > .dropdown-user-link:hover,
.olympiac-profile-menu.show > .dropdown-user-link {
    background: rgba(255, 255, 255, .3);
}

.olympiac-profile-menu > .dropdown-user-link:focus-visible,
.olympiac-profile-menu__dropdown .dropdown-item:focus-visible {
    outline: 3px solid rgba(13, 139, 117, .45);
    outline-color: color-mix(in srgb, var(--profile-menu-accent) 45%, transparent);
    outline-offset: 2px;
    box-shadow: none;
}

.olympiac-profile-menu__trigger-copy {
    min-width: 0;
    flex-direction: column;
    align-items: flex-end !important;
    gap: .08rem;
    line-height: 1.2;
}

.olympiac-profile-menu__trigger-copy .user-name {
    max-width: 11rem;
    overflow: hidden;
    color: inherit;
    font-size: .84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.olympiac-profile-menu__trigger-copy .user-status {
    max-width: 11rem;
    overflow: hidden;
    color: inherit;
    font-size: .7rem;
    opacity: .72;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.olympiac-profile-menu > .dropdown-user-link > .avatar,
.olympiac-profile-menu__identity-avatar {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .76);
    border-radius: 50%;
    background: #e9f4f3;
}

.olympiac-profile-menu > .dropdown-user-link > .avatar img,
.olympiac-profile-menu__identity-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.olympiac-profile-menu .avatar-status-online {
    right: -1px;
    bottom: -1px;
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
}

.olympiac-profile-menu__caret {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    opacity: .72;
    transition: transform 170ms ease;
}

.olympiac-profile-menu.show .olympiac-profile-menu__caret {
    transform: rotate(180deg);
}

.olympiac-profile-menu__dropdown {
    width: min(240px, calc(100vw - 1rem));
    max-height: min(76vh, 560px);
    margin-top: .45rem !important;
    padding: .5rem .55rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--profile-menu-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(23, 37, 58, .16), 0 3px 10px rgba(23, 37, 58, .06);
    color: var(--profile-menu-ink);
    transform-origin: top right;
    scrollbar-color: #c8d3df transparent;
    scrollbar-width: thin;
}

.olympiac-profile-menu__dropdown.show {
    animation: olympiac-profile-menu-enter 180ms cubic-bezier(.2, .75, .25, 1) both;
}

.olympiac-profile-menu__dropdown.show.is-closing {
    animation: olympiac-profile-menu-exit 170ms cubic-bezier(.4, 0, 1, 1) both;
    pointer-events: none;
}

.olympiac-profile-menu__dropdown-header {
    min-width: 0;
    padding: .1rem .25rem .35rem;
}

.olympiac-profile-menu__mobile-identity {
    display: none;
}

.olympiac-profile-menu__section-label {
    padding: .4rem .55rem .25rem;
    color: var(--profile-menu-muted);
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.olympiac-profile-menu__section-label--spaced {
    margin-top: .35rem;
    border-top: 1px solid var(--profile-menu-border);
    padding-top: .75rem;
}

.olympiac-profile-menu__dropdown .olympiac-profile-menu__item {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: .65rem;
    margin: 1px 0;
    padding: .5rem .8rem;
    border-radius: 9px;
    color: var(--profile-menu-ink);
    font-size: .85rem;
    text-decoration: none;
    transition: background-color 170ms ease, color 170ms ease, transform 170ms ease;
}

.olympiac-profile-menu__dropdown .olympiac-profile-menu__item > svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    color: var(--profile-menu-muted);
    stroke-width: 1.8;
}

.olympiac-profile-menu__dropdown .olympiac-profile-menu__item:hover {
    background: var(--profile-menu-hover);
    color: var(--profile-menu-ink);
}

.olympiac-profile-menu__dropdown .olympiac-profile-menu__item:active {
    transform: translateY(1px);
}

.olympiac-profile-menu__language-toggle {
    width: 100%;
    text-align: left;
}

.olympiac-profile-menu__language-current {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-left: auto;
    color: var(--profile-menu-muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.olympiac-profile-menu__language-current svg {
    width: 14px;
    height: 14px;
    transition: transform 170ms ease;
}

.olympiac-profile-menu__language-toggle[aria-expanded="true"] .olympiac-profile-menu__language-current svg {
    transform: rotate(180deg);
}

.olympiac-profile-menu__language-options {
    margin: .1rem .4rem .35rem 2.1rem;
    padding: .2rem;
    border-radius: 9px;
    background: #f7f9fb;
}

.olympiac-profile-menu__language-options[hidden] {
    display: none !important;
}

.olympiac-profile-menu__language-options:not([hidden]) {
    animation: olympiac-profile-menu-submenu-enter 160ms cubic-bezier(.2, .75, .25, 1) both;
}

.olympiac-profile-menu__dropdown .olympiac-profile-menu__language-choice {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .6rem;
    border-radius: 7px;
    color: var(--profile-menu-ink);
    font-size: .82rem;
}

.olympiac-profile-menu__language-choice:hover,
.olympiac-profile-menu__language-choice.is-active {
    background: #edf5f4;
    color: var(--profile-menu-accent);
}

.olympiac-profile-menu__language-choice [data-language-active] {
    width: 15px;
    height: 15px;
}

.olympiac-profile-menu__session {
    margin-top: .45rem;
    padding-top: .45rem;
    border-top: 1px solid var(--profile-menu-border);
}

.olympiac-profile-menu__dropdown .olympiac-profile-menu__logout,
.olympiac-profile-menu__dropdown .olympiac-profile-menu__logout > svg {
    color: #a9434b;
}

.olympiac-profile-menu__dropdown .olympiac-profile-menu__logout:hover {
    background: #fff3f2;
    color: #96363e;
}

.olympiac-profile-menu__dropdown .olympiac-profile-menu__logout:hover > svg {
    color: #96363e;
}

.dark-layout .olympiac-profile-menu {
    --profile-menu-ink: #e6e8ee;
    --profile-menu-muted: #aeb4c1;
    --profile-menu-border: rgba(230, 232, 238, .12);
    --profile-menu-hover: #343b4d;
}

.dark-layout .olympiac-profile-menu__dropdown {
    border-color: var(--profile-menu-border);
    background: #283046;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
}

.dark-layout .olympiac-profile-menu__language-options {
    background: #222a3b;
}

.dark-layout .olympiac-profile-menu__language-choice:hover,
.dark-layout .olympiac-profile-menu__language-choice.is-active {
    background: #303c49;
}

.dark-layout .olympiac-profile-menu__dropdown .olympiac-profile-menu__logout:hover {
    background: rgba(169, 67, 75, .16);
}

@keyframes olympiac-profile-menu-enter {
    from { opacity: 0; transform: translateY(-4px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes olympiac-profile-menu-exit {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-3px) scale(.99); }
}

@keyframes olympiac-profile-menu-submenu-enter {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 575.98px) {
    .olympiac-profile-menu__trigger-copy .user-status,
    .dropdown-user .olympiac-profile-menu__caret {
        display: none;
    }

    .olympiac-profile-menu > .dropdown-user-link {
        gap: .25rem;
        padding-inline: .35rem;
    }

    .olympiac-profile-menu__trigger-copy .user-name {
        max-width: 7.25rem;
        font-size: .78rem;
    }

    .olympiac-profile-menu > .dropdown-user-link > .avatar {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .olympiac-profile-menu__dropdown {
        right: 0;
        max-height: min(72vh, 520px);
    }

    .olympiac-profile-menu__mobile-identity {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: .4rem;
        padding: 0 .55rem .35rem;
        color: var(--profile-menu-muted);
        font-size: .75rem;
    }

    .olympiac-profile-menu__mobile-identity-name {
        min-width: 0;
        overflow: hidden;
        color: var(--profile-menu-ink);
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .olympiac-profile-menu__mobile-identity-role {
        flex: 0 0 auto;
        padding-left: .4rem;
        border-left: 1px solid var(--profile-menu-border);
        white-space: nowrap;
    }
}

@media (max-width: 359.98px) {
    .olympiac-profile-menu__trigger-copy .user-name {
        max-width: 5rem;
    }
}

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