.profile-menu { position: relative; }
.profile-menu > summary {
    display: flex;
    align-items: center;
    gap: .375rem;
    min-height: 44px;
    padding: 3px 8px 3px 4px;
    border: 1px solid #dedbd2;
    border-radius: 12px;
    background: #fffdfa;
    color: #242424;
    cursor: pointer;
    list-style: none;
}
.profile-menu .profile-trigger-name { max-width: clamp(4rem, 18vw, 9rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; font-weight: 700; }
.profile-menu .profile-chevron { flex-shrink: 0; }
.profile-menu > summary::-webkit-details-marker { display: none; }
.profile-menu[open] .profile-chevron { transform: rotate(180deg); }
.profile-menu :is(summary, a, button):focus-visible,
.student-header-login:focus-visible { outline: 2px solid #70581d; outline-offset: 2px; }
.profile-menu .avatar {
    display: grid;
    flex: 0 0 36px;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3e8c9;
    color: #242424;
    font-size: 1rem;
    font-weight: 700;
}
.profile-menu .avatar-image { object-fit: cover; }
.profile-menu .user-actions {
    position: absolute;
    z-index: 100;
    inset-block-start: calc(100% + 8px);
    inset-inline-end: 0;
    width: min(21rem, calc(100vw - 70px));
    max-height: min(32rem, calc(100dvh - 110px));
    overflow: auto;
    overscroll-behavior: contain;
    background: #fffdfa;
    color: #242424;
    border: 1px solid #dedbd2;
    border-radius: 16px;
    box-shadow: 0 12px 28px #1917111f;
    font-size: 1rem;
}
.profile-menu .student-profile-identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 14px;
    background: #f5f2e9;
    border-bottom: 1px solid #e5e0d5;
}
.profile-menu .student-profile-person { flex: 1 1 130px; min-width: 0; }
.profile-menu .student-profile-name,
.profile-menu .student-profile-email { display: block; overflow-wrap: anywhere; line-height: 1.4; }
.profile-menu .student-profile-name { font-weight: 750; }
.profile-menu .student-profile-email { color: #57544c; font-size: .875rem; }
.profile-menu .student-profile-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 7px;
    background: #efe4c5;
    color: #624c18;
    font-size: .875rem;
    font-weight: 700;
}
.profile-menu .student-profile-links { padding: 6px; }
.profile-menu .user-actions :is(a, button) {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.profile-menu .student-profile-links svg { flex: 0 0 18px; width: 18px; height: 18px; }
.profile-menu .user-actions :is(a, button):hover { background: #eeeae0; }
.profile-menu .student-profile-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    border-top: 1px solid #e5e0d5;
    background: #f5f2e9;
}
.profile-menu .student-profile-footer form { margin-inline-start: auto; }
.profile-menu .user-actions button.profile-logout { color: #a7251a; font-weight: 650; cursor: pointer; }
.site-header .student-header-login {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #171714;
    color: #fffdfa;
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.site-header .student-header-login svg { display: block; width: 16px; height: 16px; }

.site-header-actions--mobile-slot .profile-menu { position: static; }
.site-header-actions--mobile-slot .user-actions {
    inset-inline-end: 16px;
    width: min(21rem, calc(100% - 32px));
}
