.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    color: var(--color-text-primary);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: color 180ms ease, background-color 180ms ease;
}

.nav-toggle__line {
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 220ms ease, opacity 160ms ease;
}

.navbar :focus-visible {
    outline: 2px solid var(--color-success);
    outline-offset: 3px;
}

.nav-toggle[aria-expanded="true"] {
    color: var(--color-success);
    background: var(--color-success-surface);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.navigation-panel,
.navigation-panel__content {
    display: contents;
}

@media (max-width: 1100px) {
    .navbar {
        height: auto;
        min-height: 64px;
        padding: 9px 16px;
        flex-wrap: wrap;
        gap: 0 8px;
    }

    .navbar .brand {
        gap: 8px;
        font-size: var(--font-section);
        flex: 0 0 auto;
    }

    .navbar .brand__mark {
        width: 24px;
        height: 24px;
    }

    .navbar .nav-actions {
        order: 1;
        margin-left: auto;
        gap: 8px;
    }

    .navbar .profile {
        min-height: 44px;
        padding: 0;
        width: 44px;
        height: 44px;
        justify-content: center;
    }

    .navbar .icon-button {
        width: 44px;
        height: 44px;
        justify-content: center;
    }

    .navbar .profile > span:not(.profile__avatar),
    .navbar .profile__chevron {
        display: none;
    }

    .navbar[data-navigation-ready] .nav-toggle {
        display: flex;
        order: 2;
    }

    .navbar .navigation-panel {
        order: 3;
        display: grid;
        grid-template-rows: 1fr;
        width: 100%;
        margin-top: 8px;
    }

    .navbar .navigation-panel__content {
        display: block;
        min-height: 0;
        overflow: hidden;
    }

    html[data-navigation-enhanced] .navbar .navigation-panel,
    .navbar[data-navigation-ready] .navigation-panel {
        grid-template-rows: 0fr;
        margin-top: 0;
        opacity: 0;
        visibility: hidden;
    }

    .navbar[data-navigation-animated="true"] .navigation-panel {
        transition: grid-template-rows 220ms ease, margin-top 220ms ease,
                    opacity 160ms ease, visibility 0s 220ms;
    }

    .navbar[data-navigation-ready][data-navigation-open="true"] .navigation-panel {
        grid-template-rows: 1fr;
        margin-top: 8px;
        opacity: 1;
        visibility: visible;
        transition-delay: 0s;
    }

    .navbar .nav-links {
        --nav-hover-background: #f4fdf9;
        width: 100%;
        height: auto;
        min-width: 0;
        padding-top: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        overflow: visible;
        border-top: 1px solid var(--color-border);
    }

    .navbar .nav-link {
        min-height: 44px;
        height: auto;
        padding: 12px 16px;
        font-size: var(--font-body);
        white-space: normal;
        border: 0;
        border-radius: 8px;
    }

    .navbar .nav-link--active {
        color: var(--color-success);
        background: var(--color-success-surface);
    }

    .navbar .nav-link:focus-visible {
        outline-offset: -3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .navbar .nav-link,
    .navbar .icon-button,
    .navbar .profile,
    .nav-toggle,
    .nav-toggle__line,
    .navbar[data-navigation-ready] .navigation-panel {
        transition: none;
    }
}
