.oz-av {
    position: relative;
    display: inline-block;
    width: var(--av);
    height: var(--av);
    flex: 0 0 var(--av);
    border-radius: 50%;
    padding: max(1.5px, calc(var(--av) * 0.03));
    background: linear-gradient(135deg, #5ff0ff, #b57bff);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}
.oz-av-photo {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #0b3b44;
}
.oz-av-f {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform-origin: 50% 85%;
    animation: ozAvBreath 3.8s ease-in-out infinite;
}
/* Blink and talk frames sit on top, hidden until their moment. */
.oz-av-blink {
    opacity: 0;
    animation: ozAvBreath 3.8s ease-in-out infinite, ozAvBlink 4.3s ease-in-out infinite;
}
.oz-av-talk {
    opacity: 0;
}
.oz-av[data-state="speaking"] .oz-av-talk {
    animation: ozAvBreath 3.8s ease-in-out infinite, ozAvTalk 1.44s linear infinite;
}
.oz-av[data-state="speaking"] .oz-av-f {
    animation-name: ozAvNod;
    animation-duration: 1.6s;
}
.oz-av[data-state="speaking"] .oz-av-talk {
    animation-name: ozAvNod, ozAvTalk;
    animation-duration: 1.6s, 1.44s;
    animation-timing-function: ease-in-out, linear;
}
.oz-av[data-state="speaking"] .oz-av-blink {
    animation-name: ozAvNod, ozAvBlink;
    animation-duration: 1.6s, 4.3s;
}
.oz-av[data-state="speaking"] {
    animation: ozAvTalkRing 0.8s ease-in-out infinite;
}
.oz-av[data-state="listening"] {
    animation: ozAvRing 1.2s ease-in-out infinite;
}
.oz-av[data-state="thinking"] {
    animation: ozAvThinkRing 1.2s ease-in-out infinite;
}
.oz-av[data-state="thinking"] .oz-av-photo {
    transform: rotate(4deg);
    transition: transform 0.3s;
}
.oz-av-dots {
    position: absolute;
    top: 2%;
    inset-inline-end: -4%;
    display: flex;
    gap: 2px;
    pointer-events: none;
}
.oz-av-dots i {
    width: max(4px, calc(var(--av) * 0.07));
    height: max(4px, calc(var(--av) * 0.07));
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.oz-av[data-state="thinking"] .oz-av-dots i {
    animation: ozAvDot 1.2s infinite;
}
.oz-av[data-state="thinking"] .oz-av-dots i:nth-child(2) {
    animation-delay: 0.2s;
}
.oz-av[data-state="thinking"] .oz-av-dots i:nth-child(3) {
    animation-delay: 0.4s;
}
/* Eyes close and open in about a fifth of a second. Talking moves like syllables: short uneven beats, each change
   quick, so there's never a long half-open blur; the talk frame only changes her mouth. */
@keyframes ozAvBlink {
    0%,
    94.5% {
        opacity: 0;
    }
    96.5% {
        opacity: 1;
    }
    99%,
    100% {
        opacity: 0;
    }
}
@keyframes ozAvTalk {
    0.00% {
        opacity: 0.95;
    }
    3.75% {
        opacity: 0;
    }
    8.33% {
        opacity: 0;
    }
    12.08% {
        opacity: 0.98;
    }
    16.67% {
        opacity: 0.98;
    }
    20.42% {
        opacity: 0;
    }
    25.00% {
        opacity: 0;
    }
    28.75% {
        opacity: 0.87;
    }
    33.33% {
        opacity: 0.87;
    }
    37.08% {
        opacity: 0;
    }
    41.67% {
        opacity: 0;
    }
    45.42% {
        opacity: 0.84;
    }
    50.00% {
        opacity: 0.84;
    }
    53.75% {
        opacity: 0.89;
    }
    58.33% {
        opacity: 0.89;
    }
    62.08% {
        opacity: 0;
    }
    66.67% {
        opacity: 0;
    }
    70.42% {
        opacity: 0;
    }
    75.00% {
        opacity: 0;
    }
    78.75% {
        opacity: 0.86;
    }
    83.33% {
        opacity: 0.86;
    }
    87.08% {
        opacity: 0.99;
    }
    91.67% {
        opacity: 0.99;
    }
    95.42% {
        opacity: 0.95;
    }
    100.00% {
        opacity: 0.95;
    }
}
@keyframes ozAvBreath {
    50% {
        transform: scale(1.015);
    }
}
@keyframes ozAvNod {
    25% {
        transform: rotate(-1.8deg) scale(1.01);
    }
    75% {
        transform: rotate(1.8deg) scale(1.01);
    }
}
@keyframes ozAvTalkRing {
    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(39, 221, 134, 0.95);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(39, 221, 134, 0.15);
    }
}
@keyframes ozAvThinkRing {
    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(181, 123, 255, 0.9);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(181, 123, 255, 0.15);
    }
}
.oz-av-stage {
    display: none;
    align-items: center;
    gap: 14px;
    margin: 8px 12px 2px;
    padding: 10px 14px;
    border-radius: 20px;
    border: 1px solid rgba(8, 222, 244, 0.35);
    background: linear-gradient(90deg, rgba(8, 222, 244, 0.14), transparent);
    font-weight: 900;
    font-size: 16px;
    color: #f2f7fa;
}
.oz-av-stage[data-state="listening"],
.oz-av-stage[data-state="thinking"],
.oz-av-stage[data-state="speaking"] {
    display: flex;
}
.oz-av-stage[data-state="speaking"] {
    border-color: rgba(39, 221, 134, 0.4);
    background: linear-gradient(90deg, rgba(39, 221, 134, 0.14), transparent);
}
.oz-av-stage .s-listening,
.oz-av-stage .s-thinking,
.oz-av-stage .s-speaking {
    display: none;
}
.oz-av-stage[data-state="listening"] .s-listening,
.oz-av-stage[data-state="thinking"] .s-thinking,
.oz-av-stage[data-state="speaking"] .s-speaking {
    display: inline;
}
@keyframes ozAvRing {
    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(8, 222, 244, 0.9);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(8, 222, 244, 0.15);
    }
}
@keyframes ozAvDot {
    0%,
    100% {
        opacity: 0.15;
    }
    50% {
        opacity: 1;
    }
}
@media (prefers-reduced-motion: reduce) {
    .oz-av,
    .oz-av * {
        animation: none !important;
    }
}
/* Fulla the robot (the same drawing as in the app). */
.oz-av-robot .oz-av-photo {
    background: radial-gradient(circle at 50% 35%, #12344a, #050b10 75%);
}
.oz-av-robot .oz-bot {
    position: absolute;
    inset: 4% 6% 0;
    width: 88%;
    height: 96%;
    display: block;
}
.oz-av-robot .oz-av-dots {
    display: none;
}
/* Free-floating (no round frame): the flying Fulla. */
.oz-av-free {
    padding: 0;
    background: none;
    box-shadow: none;
    height: calc(var(--av) * 1.2);
    border-radius: 0;
}
.oz-av-free .oz-av-photo {
    background: none;
    border-radius: 0;
    overflow: visible;
}
.oz-av-free .oz-bot {
    inset: 0;
    width: 100%;
    height: 100%;
}
.oz-av-free[data-state] {
    animation: none;
}
