/* Shared desktop account control for campus topbars. Load after page shell styles. */
.market-topbar-user,
.class-topbar-user {
    position: relative;
}

.market-topbar-user::after,
.class-topbar-user::after {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 140;
    display: none;
    width: 180px;
    height: 16px;
    content: "";
}

.market-topbar-user:hover::after,
.market-topbar-user:focus-within::after,
.class-topbar-user:hover::after,
.class-topbar-user:focus-within::after {
    display: block;
}

.market-topbar-user-trigger,
.class-topbar-user-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: 168px;
    min-height: 36px;
    padding: 5px 10px 5px 5px;
    border: 1px solid rgba(110, 84, 42, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: #3f382b;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: background 0.18s ease;
}

.market-topbar-user-trigger:hover,
.market-topbar-user:focus-within .market-topbar-user-trigger,
.class-topbar-user-trigger:hover,
.class-topbar-user:focus-within .class-topbar-user-trigger {
    background: rgba(255, 255, 255, 0.82);
}

.market-topbar-user-trigger > i,
.class-topbar-user-trigger > i {
    color: #8a7452;
    font-size: 10px;
    transition: transform 0.18s ease;
}

.market-topbar-user:hover .market-topbar-user-trigger > i,
.market-topbar-user:focus-within .market-topbar-user-trigger > i,
.class-topbar-user:hover .class-topbar-user-trigger > i,
.class-topbar-user:focus-within .class-topbar-user-trigger > i {
    transform: rotate(180deg);
}

.market-topbar-avatar,
.class-topbar-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    overflow: hidden;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f1dfbd;
    color: #3f382b;
    font-size: 13px;
    font-weight: 900;
}

.market-topbar-avatar img,
.class-topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-topbar-user-name,
.class-topbar-user-name {
    overflow: hidden;
    color: #3f382b;
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-topbar-user-menu,
.class-topbar-user-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 141;
    display: grid;
    min-width: 132px;
    padding: 6px;
    border: 1px solid rgba(110, 84, 42, 0.14);
    border-radius: 12px;
    background: #fffdf7;
    box-shadow: 0 18px 34px rgba(70, 52, 24, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity 0.16s ease 0.08s, transform 0.16s ease 0.08s, visibility 0s linear 0.24s;
}

.market-topbar-user-menu::before,
.class-topbar-user-menu::before {
    position: absolute;
    top: -6px;
    right: 16px;
    width: 12px;
    height: 12px;
    border-top: 1px solid rgba(110, 84, 42, 0.14);
    border-left: 1px solid rgba(110, 84, 42, 0.14);
    background: #fffdf7;
    content: "";
    transform: rotate(45deg);
}

.market-topbar-user:hover .market-topbar-user-menu,
.market-topbar-user:focus-within .market-topbar-user-menu,
.class-topbar-user:hover .class-topbar-user-menu,
.class-topbar-user:focus-within .class-topbar-user-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear;
}

.market-topbar-user-menu a,
.class-topbar-user-menu a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    color: #665b48;
    font-size: 12px;
    font-weight: 850;
}

.market-topbar-user-menu a:hover,
.class-topbar-user-menu a:hover {
    background: #fff4d5;
    color: #173d34;
}

.market-topbar-user-menu a:last-child:hover,
.class-topbar-user-menu a:last-child:hover {
    background: #fff8ec;
    color: #d94b40;
}

.market-topbar-user-menu i,
.class-topbar-user-menu i {
    width: 15px;
    text-align: center;
}

@media (max-width: 680px) {
    .market-topbar-user-name,
    .market-topbar-user-trigger > i,
    .class-topbar-user-name,
    .class-topbar-user-trigger > i {
        display: none;
    }

    .market-topbar-user-trigger,
    .class-topbar-user-trigger {
        width: 44px;
        min-height: 44px;
        padding: 5px;
    }
}
