.bd-nexo-guide {
    display: grid;
    --bd-nexo-width: clamp(58px, 7vw, 86px);
    grid-template-columns: var(--bd-nexo-width) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    order: -3;
    margin: 0 max(14px, calc((100% - 1450px) / 2));
}
.bd-nexo-guide--right { grid-template-columns: minmax(0, 1fr) var(--bd-nexo-width); }
.bd-nexo-guide--right .bd-nexo { grid-area: 1 / 2; }
.bd-nexo-guide--right .bd-nexo-caption { grid-area: 1 / 1; }

.bd-guide .bd-nexo-caption {
    --bd-nexo-bubble: #f0f8f7;
    --bd-nexo-border: #c9e0dd;
    position: relative;
    order: 0;
    min-width: 0;
    width: auto;
    margin: 0;
    padding: 8px 14px 10px;
    background: var(--bd-nexo-bubble);
    border-color: var(--bd-nexo-border);
}

.bd-nexo-caption::before,
.bd-nexo-caption::after {
    content: "";
    position: absolute;
    top: 15px;
    right: 100%;
    width: 21px;
    height: 17px;
    clip-path: polygon(0 30%, 100% 0, 100% 100%);
    pointer-events: none;
}
.bd-nexo-guide--right .bd-nexo-caption::before,
.bd-nexo-guide--right .bd-nexo-caption::after {
    right: auto;
    left: 100%;
    transform: scaleX(-1);
}
.bd-nexo-guide--right .bd-nexo-caption::after { left: calc(100% - 1px); }
.bd-nexo-caption::before { background: var(--bd-nexo-border); }
.bd-nexo-caption::after {
    right: calc(100% - 1px);
    background: var(--bd-nexo-bubble);
    clip-path: polygon(12% 32%, 100% 7%, 100% 91%);
}

.bd-nexo-caption .bd-guide-header {
    flex-wrap: wrap;
    gap: 2px 9px;
    padding: 0;
    border: 0;
    background: transparent;
    align-items: baseline;
}
.bd-nexo-caption .bd-guide-header h2 { color: #0d4da4; font-size: 14px; }
.bd-nexo-caption .bd-guide-header #bd-guide-status {
    margin: 0;
    color: var(--bd-muted);
    font-size: 11px;
    font-weight: 400;
}
.bd-nexo-caption .bd-voice-kind { float: none; max-width: none; margin-left: auto; }

.bd-nexo {
    position: relative;
    z-index: 1;
    aspect-ratio: 282 / 328;
    margin-top: 1px;
    pointer-events: none;
    transform-origin: center bottom;
}
.bd-nexo-motion { position: absolute; inset: 0; transform-origin: 43% 48%; }
.bd-nexo-motion img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 150ms ease;
}
.bd-nexo-presenting,
.bd-nexo-greeting,
.bd-nexo-wave-hand,
.bd-nexo-inviting-hand,
.bd-nexo-explaining,
.bd-nexo-guide--right .bd-nexo-idle,
.bd-nexo.is-presenting .bd-nexo-idle,
.bd-nexo.is-greeting .bd-nexo-idle,
.bd-nexo.is-inviting .bd-nexo-idle { opacity: 0; }
.bd-nexo.is-presenting .bd-nexo-presenting,
.bd-nexo.is-greeting .bd-nexo-greeting,
.bd-nexo.is-greeting .bd-nexo-wave-hand,
.bd-nexo.is-inviting .bd-nexo-presenting,
.bd-nexo.is-inviting .bd-nexo-inviting-hand,
.bd-nexo-guide--right .bd-nexo-explaining { opacity: 1; }
.bd-nexo.is-speaking .bd-nexo-motion { animation: bd-nexo-nod 1.9s ease-in-out infinite; }
.bd-nexo.is-speaking:is(.is-greeting, .is-inviting) .bd-nexo-motion { animation: none; }

/* Separa la mano por la muñeca para saludar sin mover el cuerpo. */
.bd-nexo-greeting {
    clip-path: polygon(0 0, 76.5% 0, 76.5% 34%, 73.5% 34%, 73.5% 41.5%, 88% 47.1%, 100% 47.1%, 100% 100%, 0 100%);
}
.bd-nexo-wave-hand {
    clip-path: polygon(76.5% 0, 100% 0, 100% 49%, 88% 49%, 73.5% 43%, 73.5% 34%, 76.5% 34%);
    transform-origin: 82% 45%;
}
.bd-nexo.is-greeting .bd-nexo-wave-hand { animation: bd-nexo-wave 1s ease-in-out both; }

.bd-nexo.is-inviting .bd-nexo-presenting {
    clip-path: polygon(0 0, 100% 0, 100% 37%, 75.6% 37%, 75.6% 45%, 78% 55.5%, 100% 55.5%, 100% 100%, 0 100%);
}
.bd-nexo-inviting-hand {
    clip-path: polygon(74.2% 37%, 100% 37%, 100% 56.5%, 77% 56.5%, 74.2% 45%);
    transform-origin: 76.5% 49.5%;
}
.bd-nexo.is-inviting .bd-nexo-inviting-hand { animation: bd-nexo-invite 1.15s ease-in-out both; }

.bd-nexo-blink { position: absolute; inset: 0; animation: bd-nexo-blink 7s linear infinite; }
.bd-nexo-blink::before,
.bd-nexo-blink::after {
    content: "";
    position: absolute;
    top: 22%;
    width: 9.5%;
    height: 10.4%;
    border-radius: 45%;
    background: linear-gradient(#fff, #fff) center / 55% 9% no-repeat, #0c3f7c;
}
.bd-nexo-blink::before { left: 26.7%; }
.bd-nexo-blink::after { left: 49.5%; }
.bd-nexo-guide--right .bd-nexo-blink::before,
.bd-nexo-guide--right .bd-nexo-blink::after { top: 24%; width: 7.7%; height: 8.4%; }
.bd-nexo-guide--right .bd-nexo-blink::before { left: 38.3%; }
.bd-nexo-guide--right .bd-nexo-blink::after { left: 58.4%; }

.bd-nexo-mouth {
    display: none;
    position: absolute;
    left: 38%;
    top: 31.3%;
    width: 10.5%;
    height: 3.75%;
    border-radius: 45%;
    background: linear-gradient(#0c3f7c, #083a75);
}
.bd-nexo.is-speaking .bd-nexo-mouth { display: block; }
.bd-nexo-guide--right .bd-nexo-mouth { left: 48.5%; top: 31.9%; width: 7.9%; }
.bd-nexo-mouth::after {
    content: "";
    position: absolute;
    inset: 18% 14%;
    border-radius: 34% 34% 50% 50%;
    background: #fff;
    animation: bd-nexo-talk .43s ease-in-out infinite alternate;
}

.bd-nexo-guide--right .bd-nexo-motion { transform-origin: 51% 54%; }
.bd-nexo-guide--right:has(.bd-narration-phrase.is-speaking) .bd-nexo-motion {
    animation: bd-nexo-explain 2.5s ease-in-out infinite;
}

@keyframes bd-nexo-talk {
    from { transform: scaleY(.28); }
    to { transform: scaleY(1); }
}
@keyframes bd-nexo-nod {
    0%, 100% { transform: rotate(0); }
    45% { transform: rotate(-2deg); }
}
@keyframes bd-nexo-explain {
    0%, 100% { transform: rotate(0); }
    30% { transform: rotate(-3deg); }
    66% { transform: rotate(2deg); }
}
@keyframes bd-nexo-wave {
    0%, 100% { transform: rotate(0); }
    22%, 65% { transform: rotate(14deg); }
    44%, 83% { transform: rotate(-7deg); }
}
@keyframes bd-nexo-invite {
    0%, 100% { transform: rotate(0); }
    24% { transform: rotate(-13deg); }
    48% { transform: rotate(4deg); }
    72% { transform: rotate(-7deg); }
}
@keyframes bd-nexo-blink {
    0%, 92%, 96%, 100% { opacity: 0; }
    94% { opacity: 1; }
}

@media (max-width: 600px) {
    .bd-nexo-guide { --bd-nexo-width: 53px; gap: 7px; }
    .bd-guide .bd-nexo-caption { padding: 7px 9px 9px; }
    .bd-nexo-caption::before,
    .bd-nexo-caption::after { top: 11px; width: 14px; height: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .bd-nexo-motion img { transition: none; }
    .bd-nexo.is-speaking .bd-nexo-motion,
    .bd-nexo-guide--right:has(.bd-narration-phrase.is-speaking) .bd-nexo-motion { animation: none; }
    .bd-nexo-greeting, .bd-nexo.is-inviting .bd-nexo-presenting { clip-path: none; }
    .bd-nexo-wave-hand, .bd-nexo-inviting-hand { display: none; }
    .bd-nexo-blink, .bd-nexo.is-speaking .bd-nexo-mouth { display: none; }
}
