.nav-links {
    align-items: center;
}

.nav-links a,
.nav-dropdown__toggle {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    transition: all var(--transition-base);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-dropdown__toggle:hover {
    background: rgba(59, 130, 246, 0.12);
}

.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown__chevron {
    margin-left: 6px;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base);
}

.nav-dropdown__chevron img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.nav-dropdown__menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 200px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px;
    display: none;
    z-index: 60;
}

.nav-dropdown__menu a {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
}

.nav-dropdown__menu a:hover,
.nav-dropdown__menu a:focus {
    background: rgba(59, 130, 246, 0.12);
    outline: none;
}

.nav-dropdown.is-open .nav-dropdown__menu {
    display: grid;
    gap: 4px;
}

.nav-account {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-account--desktop {
    margin-left: 12px;
}

.nav-account__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--nav-border);
    background: var(--card-bg);
    color: var(--text-dark);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-base);
    min-height: 38px;
}

.nav-account__toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.nav-account__avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.15);
    font-size: 0.75rem;
    font-weight: 700;
}

.nav-account__chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base);
}

.nav-account__chevron img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.nav-account__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 10px;
    display: none;
    z-index: 70;
    color: var(--text-dark);
}

.nav-account__meta {
    display: grid;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 8px;
}

.nav-account__name {
    font-weight: 600;
}

.nav-account__label .user-name,
.nav-account__name .user-name,
.nav-profile__name .user-name {
    color: inherit;
}

.nav-account__item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}

.nav-account__item.hide {
    display: none;
}

.nav-account__item:hover,
.nav-account__item:focus {
    background: rgba(59, 130, 246, 0.12);
    outline: none;
}

.nav-account__item[data-auth-open]:not([data-auth-open-tab="signup"]) {
    background: #16a34a;
    color: #fff;
}

.nav-account__item[data-auth-open]:not([data-auth-open-tab="signup"]):hover,
.nav-account__item[data-auth-open]:not([data-auth-open-tab="signup"]):focus {
    background: #15803d;
    color: #fff;
}

.nav-account__item[data-auth-open][data-auth-open-tab="signup"] {
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: var(--color-primary);
}

.nav-account__item[data-auth-open][data-auth-open-tab="signup"]:hover,
.nav-account__item[data-auth-open][data-auth-open-tab="signup"]:focus {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-primary);
}

.nav-account__item[data-auth-logout] {
    color: #dc2626;
}

.nav-account__item[data-auth-logout]:hover,
.nav-account__item[data-auth-logout]:focus {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.nav-account.is-open .nav-account__menu {
    display: grid;
    gap: 4px;
}

.nav-dropdown.is-open .nav-dropdown__chevron,
.nav-account.is-open .nav-account__chevron {
    transform: rotate(180deg);
}

.nav-account--drawer {
    display: none;
    width: 100%;
    max-width: 260px;
}

.nav-account--drawer .nav-account__menu {
    position: static;
    box-shadow: none;
    border-radius: var(--radius-md);
}

@media (max-width: 1024px) {
    .nav-links a,
    .nav-dropdown__toggle {
        font-size: 0.9rem;
        padding: 7px 12px;
    }
}

@media (max-width: 768px) {
    .nav-account--desktop {
        display: none;
    }

    .nav-account--drawer {
        display: grid;
        gap: 10px;
        text-align: left;
    }

    .nav-dropdown {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-dropdown__toggle {
        width: 100%;
        justify-content: center;
        background: rgba(255, 255, 255, 0.12);
        min-height: 44px;
    }

    .nav-dropdown__menu {
        position: static;
        box-shadow: none;
        border-radius: var(--radius-md);
        margin-top: 8px;
    }

    .nav-dropdown.is-open .nav-dropdown__menu {
        display: grid;
    }
}
