/* ── Profile menu ───────────────────────────────────────────── */
.profile-menu {
    margin-left: auto;
    position: relative;
}

.profile-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: 0;
    transition: color .15s;
}

.profile-menu-btn:hover { color: var(--text); }

.profile-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 160px;
    max-height: calc(100dvh - 5rem);
    overflow-y: auto;
    padding: .35rem;
    z-index: 100;
}

.profile-menu-dropdown:has(.profile-menu__group) {
    min-width: min(240px, calc(100vw - 2rem));
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .45rem .65rem;
    font-size: .875rem;
    font-weight: 400;
    color: var(--text);
    background: none;
    border: none;
    border-radius: 7px;
    text-align: left;
    cursor: pointer;
    transition: background .15s;
}

.profile-menu-item:hover { background: var(--surface-2); }

.profile-menu-item--signout:hover {
    color: var(--red);
    background: rgba(224,85,85,.08);
}

.profile-menu-item--danger:hover {
    color: var(--red);
    background: rgba(224,85,85,.1);
}

.profile-menu__label {
    display: block;
    padding: .45rem .65rem .2rem;
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-menu__count {
    margin-left: auto;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

@keyframes dot-fade {
    0%, 100% { opacity: 0; }
    50%       { opacity: 1; }
}

@media (max-width: 600px) {
    .profile-menu {
        margin-left: auto;
    }

    /* The mobile navigation's More holds these pages. */
    .profile-menu-group--more {
        display: none;
    }

    /* Without them, a divider can end up first in the menu. */
    .profile-menu-group--more:first-child + .profile-menu-divider {
        display: none;
    }
}
