.webai-aave-header {
    --webai-aave-bg: #faf9f9;
    --webai-aave-border: rgba(46, 15, 15, 0.08);
    --webai-aave-fg: #727274;
    --webai-aave-primary: #9896ff;
    position: relative;
    z-index: 1100;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 10px 14px 12px;
}

.webai-aave-header__brand {
    width: 190px;
    height: 68px;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    color: #fff;
    font-size: 22px;
    font-weight: 760;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.webai-aave-header__logo-image {
    width: 170px !important;
    max-width: none;
    height: auto !important;
    max-height: none !important;
    flex: 0 0 auto;
    object-fit: contain;
}

.webai-aave-header__nav-viewport {
    min-width: 0;
    display: flex;
    justify-content: center;
    overflow: visible;
}

.webai-aave-header__nav-viewport > nav {
    min-width: 0;
}

.webai-aave-header__nav {
    position: relative;
    isolation: isolate;
    width: max-content;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 2px;
    border: 1px solid var(--webai-aave-border);
    border-radius: 9999px;
    background: var(--webai-aave-bg);
    box-shadow:
        0 1px 2px rgba(46, 15, 15, 0.03),
        0 10px 28px rgba(31, 18, 18, 0.055);
}

.webai-aave-header__nav-item {
    position: relative;
    z-index: 10;
    min-width: 0;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 13px;
    border: 0;
    border-radius: 9999px;
    color: var(--webai-aave-fg);
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
        color 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
        scale 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.webai-aave-header__nav-item:hover {
    color: #5a5858;
}

.webai-aave-header__nav-item:active {
    scale: 0.97;
}

.webai-aave-header__nav-item:focus-visible,
.webai-aave-header__brand:focus-visible,
.webai-aave-header__profile:focus-visible,
.webai-aave-header__login:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--webai-aave-primary);
}

.webai-aave-header__nav-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.webai-aave-header__menu-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: inline-grid;
    place-items: center;
    color: #646266;
}

.webai-aave-header__menu-icon > svg,
.webai-aave-header__menu-icon > i,
.webai-aave-header__menu-icon > img {
    width: 100%;
    height: 100%;
    display: block;
    margin: 0 !important;
    object-fit: contain;
}

.webai-aave-header__nav-item > span[data-webai-mobile-label] {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.webai-aave-header__nav-item:not(.webai-aave-header__nav-item--highlight)
    .webai-aave-header__icon-primary {
    color: #646266;
}

.webai-aave-header__nav-item:not(.webai-aave-header__nav-item--highlight)
    .webai-aave-header__icon-secondary {
    color: #969397;
}

.webai-aave-header__glass-root {
    position: absolute;
    z-index: 15;
    top: -81px;
    left: -41px;
    width: calc(100% + 80px);
    height: calc(100% + 160px);
    overflow: visible;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}

.webai-aave-header__nav.is-aave-ready .webai-aave-header__glass-root {
    opacity: 1;
}

.webai-aave-header__glass-content {
    position: absolute;
    z-index: 1;
    inset: 0;
    filter: url("#webai-aave-lore-glass");
    pointer-events: none;
    will-change: filter;
}

.webai-aave-header__highlight-track {
    position: absolute;
    top: 80px;
    left: 40px;
    width: max-content;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 2px;
    border: 1px solid transparent;
    border-radius: 9999px;
}

.webai-aave-header__nav-item--highlight {
    z-index: auto;
    padding: 10px 13px;
    color: #000;
    pointer-events: none;
}

.webai-aave-header__nav-item--highlight .webai-aave-header__icon-primary {
    color: var(--webai-aave-accent-deep);
}

.webai-aave-header__nav-item--highlight .webai-aave-header__icon-secondary {
    color: var(--webai-aave-accent);
}

.webai-aave-header__nav-item--highlight .webai-aave-header__menu-icon {
    color: var(--webai-aave-accent-deep);
}

/* The filter deliberately displaces the highlighted copy. Once its map is
   decoded and the spring settles, hide the unrefracted selected glyphs below
   it so the refraction reads as one label instead of a doubled label. */
.webai-aave-header__nav:not(.is-aave-moving)
    > .webai-aave-header__glass-root.is-lore-map-ready
    ~ .webai-aave-header__nav-item.is-selected {
    color: transparent;
}

.webai-aave-header__nav:not(.is-aave-moving)
    > .webai-aave-header__glass-root.is-lore-map-ready
    ~ .webai-aave-header__nav-item.is-selected
    .webai-aave-header__icon-primary,
.webai-aave-header__nav:not(.is-aave-moving)
    > .webai-aave-header__glass-root.is-lore-map-ready
    ~ .webai-aave-header__nav-item.is-selected
    .webai-aave-header__icon-secondary {
    color: transparent;
}

.webai-aave-header__nav:not(.is-aave-moving)
    > .webai-aave-header__glass-root.is-lore-map-ready
    ~ .webai-aave-header__nav-item.is-selected
    .webai-aave-header__menu-icon {
    opacity: 0;
}

.webai-aave-header__lens-layer {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
}

.webai-aave-header__lens {
    position: absolute;
    overflow: hidden;
    border: 0.7px solid rgba(255, 255, 255, 0.72);
    background: rgba(0, 0, 0, 0.04);
    box-shadow:
        0 2px 5px rgba(28, 13, 13, 0.16),
        0 9px 18px rgba(28, 13, 13, 0.09),
        inset 0 1px 1px rgba(255, 255, 255, 0.92),
        inset 0 -1px 1px rgba(46, 15, 15, 0.1);
    will-change: top, left, width, height, border-radius;
}

.webai-aave-header__lens::before {
    position: absolute;
    inset: 0;
    content: "";
    border-radius: inherit;
    background:
        radial-gradient(
            80% 58% at 46% -8%,
            rgba(255, 255, 255, 0.68),
            transparent 74%
        ),
        linear-gradient(
            115deg,
            rgba(255, 72, 72, 0.08),
            transparent 36%,
            rgba(72, 155, 255, 0.08)
        );
    mix-blend-mode: screen;
}

.webai-aave-header__filter-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.webai-aave-header__actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.webai-aave-header__balance,
.webai-aave-header__profile,
.webai-aave-header__login {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px;
    border: 1px solid var(--webai-aave-border);
    border-radius: 9999px;
    color: #5a5858;
    background: var(--webai-aave-bg);
    box-shadow: 0 8px 24px rgba(31, 18, 18, 0.055);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.webai-aave-header__profile,
.webai-aave-header__login {
    cursor: pointer;
    transition:
        color 180ms ease,
        background 180ms ease;
}

.webai-aave-header__profile:hover,
.webai-aave-header__login:hover {
    color: #000;
    background: #fff;
}

.webai-aave-header__balance i {
    color: var(--webai-aave-primary);
    font-style: normal;
}

.webai-aave-header__coin-image {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    object-fit: contain;
}

.webai-aave-header__avatar {
    width: 32px;
    height: 32px;
    display: inline-grid;
    flex: 0 0 32px;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    color: #fff;
    background: #242222;
    font-size: 12px;
    font-weight: 700;
}

.webai-aave-header__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webai-aave-header__profile > svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[data-webai-page-root][aria-busy="true"] {
    opacity: 0.72;
    transition: opacity 120ms ease;
}

@media (max-width: 1180px) {
    .webai-aave-header {
        grid-template-columns: minmax(155px, 190px) minmax(0, 1fr) auto;
        gap: 10px;
    }

    .webai-aave-header__brand {
        width: 158px;
        height: 60px;
    }

    .webai-aave-header__logo-image {
        width: 148px !important;
    }

    .webai-aave-header__nav-item,
    .webai-aave-header__nav-item--highlight {
        padding-right: 10px;
        padding-left: 10px;
    }

    .webai-aave-header__profile-name,
    .webai-aave-header__balance > span {
        display: none;
    }
}

@media (max-width: 980px) {
    .webai-shell {
        padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
    }

    .webai-aave-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 14px;
        padding: 4px 10px 7px;
    }

    .webai-aave-header__brand {
        width: 145px;
        height: 54px;
        grid-column: 1;
        grid-row: 1;
    }

    .webai-aave-header__logo-image {
        width: 136px !important;
    }

    .webai-aave-header__actions {
        grid-column: 2;
        grid-row: 1;
    }

    .webai-aave-header__nav-viewport {
        position: fixed;
        z-index: 30;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        justify-content: center;
        overflow: visible;
        padding: 8px max(10px, env(safe-area-inset-right))
            calc(8px + env(safe-area-inset-bottom))
            max(10px, env(safe-area-inset-left));
        pointer-events: none;
    }

    .webai-aave-header__nav-viewport > nav {
        width: min(720px, 100%);
        min-width: 0;
        pointer-events: auto;
    }

    .webai-aave-header__nav {
        width: 100%;
        max-width: 720px;
        display: grid;
        grid-template-columns: repeat(var(--webai-aave-nav-count, 1), minmax(0, 1fr));
        padding: 3px;
        border-radius: 24px;
        box-shadow:
            0 16px 44px rgba(3, 12, 28, 0.24),
            0 2px 8px rgba(3, 12, 28, 0.12);
    }

    .webai-aave-header__highlight-track {
        top: 81px;
        left: 41px;
        width: calc(100% - 80px);
        display: grid;
        grid-template-columns: repeat(var(--webai-aave-nav-count, 1), minmax(0, 1fr));
    }

    .webai-aave-header__nav-item,
    .webai-aave-header__nav-item--highlight {
        width: 100%;
        min-width: 0;
        min-height: 58px;
        flex: none;
        flex-direction: column;
        gap: 3px;
        padding: 7px 4px;
        font-size: 11px;
        line-height: 13px;
        text-align: center;
    }

    .webai-aave-header__nav-icon {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
    }

    .webai-aave-header__menu-icon {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
    }
}

@media (max-width: 560px) {
    .webai-shell {
        padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    }

    .webai-aave-header {
        gap: 6px 10px;
        padding-right: 8px;
        padding-left: 8px;
    }

    .webai-aave-header__brand {
        width: 122px;
        height: 50px;
    }

    .webai-aave-header__logo-image {
        width: 118px !important;
    }

    .webai-aave-header__balance {
        display: none;
    }

    .webai-aave-header__profile {
        min-height: 38px;
        padding: 2px;
    }

    .webai-aave-header__profile > svg {
        display: none;
    }

    .webai-aave-header__nav-item,
    .webai-aave-header__nav-item--highlight {
        min-height: 54px;
        gap: 2px;
        padding: 6px 2px;
        font-size: 10px;
        line-height: 12px;
    }

    .webai-aave-header__nav-item > span[data-webai-mobile-label] {
        font-size: 0;
    }

    .webai-aave-header__nav-item > span[data-webai-mobile-label]::after {
        content: attr(data-webai-mobile-label);
        font-size: 10px;
    }

    .webai-aave-header__nav-icon {
        width: 21px;
        height: 21px;
        flex-basis: 21px;
    }

    .webai-aave-header__menu-icon {
        width: 21px;
        height: 21px;
        flex-basis: 21px;
    }

    .webai-aave-header__nav {
        border-radius: 21px;
    }
}

@media (max-width: 380px) {
    .webai-aave-header__brand {
        width: 108px;
        height: 46px;
    }

    .webai-aave-header__logo-image {
        width: 106px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .webai-aave-header__glass-root,
    .webai-aave-header__nav-item,
    .webai-aave-header__profile,
    .webai-aave-header__login,
    [data-webai-page-root] {
        transition: none;
    }
}
