.hw-header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hw-profile-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.hw-user-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    margin: 0;
    border: 1px solid var(--hw-app-line);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,247,250,0.98));
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hw-user-avatar:hover,
.hw-profile-menu:focus-within .hw-user-avatar {
    transform: translateY(-1px);
    border-color: rgba(41, 124, 56, 0.24);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.hw-user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--hw-app-line);
    box-shadow: var(--hw-app-shadow);
}

.hw-avatar-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    min-height: 18px;
    background: #ffffff;
    border-radius: 50%;
    border: 1px solid var(--hw-app-line);
    padding: 2px;
    color: var(--hw-color-primary);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.hw-avatar-icon svg {
    display: block;
}

.hw-profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    border-radius: 22px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
    border: 1px solid var(--hw-app-line);
    padding: 10px;
    list-style: none;
    margin: 0;
    z-index: 9999;
    animation: hwDropdownFade 0.18s ease-out;
}

.hw-profile-menu.open .hw-profile-dropdown,
.hw-profile-menu:hover .hw-profile-dropdown,
.hw-profile-menu:focus-within .hw-profile-dropdown {
    display: block;
}

@keyframes hwDropdownFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hw-profile-block {
    margin: 0 0 10px;
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(41, 124, 56, 0.10);
    background:
        radial-gradient(circle at top right, rgba(41, 124, 56, 0.10), transparent 38%),
        linear-gradient(180deg, rgba(249, 251, 252, 0.98), rgba(243, 247, 245, 0.98));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.hw-profile-card-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
}

.hw-profile-block:hover .hw-profile-card-link {
    background: rgba(255, 255, 255, 0.38);
}

.hw-profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(41, 124, 56, 0.18);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}

.hw-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hw-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
    flex: 1 1 auto;
}

.hw-user-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--hw-color-text-strong);
    margin: 0;
}

.hw-user-handle,
.hw-user-email {
    font-size: 12px;
    color: var(--hw-color-muted);
    margin: 4px 0 0;
}

.hw-user-email {
    word-break: break-all;
    font-size: 11px;
}

.hw-profile-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(41, 124, 56, 0.10);
    color: var(--hw-color-primary);
    flex-shrink: 0;
}

.hw-profile-actions-label {
    margin: 0 0 6px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--hw-color-muted);
}

.hw-profile-dropdown li:not(.hw-profile-block) {
    margin-top: 0;
}

.hw-profile-dropdown li {
    list-style: none;
}

.hw-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 14px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    width: auto;
    color: var(--hw-color-text-strong);
}

.hw-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(41, 124, 56, 0.08);
    color: var(--hw-color-primary);
    flex-shrink: 0;
}

.hw-menu-link:hover {
    background: rgba(41, 124, 56, 0.08);
    transform: translateX(2px);
}

.hw-menu-name {
    font-size: 13px;
    font-weight: 700;
    color: inherit;
}

.hw-menu-link[href*="logout"]:hover {
    background: rgba(220, 38, 38, 0.08);
}

.hw-menu-link[href*="logout"] .hw-menu-icon {
    background: rgba(220, 38, 38, 0.10);
    color: #dc2626;
}

.hw-menu-link[href*="logout"] .hw-menu-name {
    color: #dc2626;
}

@media (max-width: 640px) {
    .hw-profile-dropdown {
        width: min(92vw, 320px);
        right: 1vw;
    }
}
