/* === UNIFIED LANGUAGE SWITCH === */
.lang-switch {
    position: fixed !important;
    top: clamp(0.9rem, 1.8vh, 1.6rem) !important;
    right: clamp(1rem, 2vw, 2rem) !important;
    left: auto !important;
    display: flex;
    gap: clamp(0.18rem, 0.35vw, 0.35rem) !important;
    padding: clamp(0.28rem, 0.45vw, 0.42rem) !important;
    border: 1px solid rgba(26, 26, 26, 0.1);
    border-radius: 100px;
    background: rgba(240, 235, 227, 0.9);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #1a1a1a !important;
    z-index: 100;
}

.lang-opt {
    padding: clamp(0.35rem, 0.55vw, 0.52rem) clamp(0.65rem, 1vw, 1rem);
    border: 1px solid transparent;
    border-radius: 100px;
    color: rgba(26, 26, 26, 0.56) !important;
    font-family: var(--font, var(--font-main));
    font-size: clamp(0.68rem, 0.92vw, 0.86rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    text-decoration: none;
    opacity: 1 !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-opt:not(.active):hover {
    border-color: rgba(var(--accent-rgb), 0.4);
    color: var(--accent, var(--accent-primary)) !important;
}

.lang-opt.active {
    border-color: var(--accent, var(--accent-primary));
    background: var(--accent, var(--accent-primary));
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.28);
    color: #111 !important;
    cursor: default;
}

.lang-switch.on-dark {
    border-color: rgba(250, 249, 247, 0.12);
    background: rgba(26, 26, 26, 0.88);
}

.lang-switch.on-dark .lang-opt:not(.active) {
    color: rgba(250, 249, 247, 0.54) !important;
}

.slide-counter {
    top: auto !important;
    right: clamp(1rem, 2vw, 2rem) !important;
    bottom: clamp(1rem, 2vh, 2rem) !important;
}

/* === ASK THE AVATAR === */
.tavus-launcher {
    position: fixed;
    top: clamp(0.9rem, 1.8vh, 1.6rem);
    left: clamp(1rem, 2vw, 2rem);
    z-index: 220;
    display: inline-flex;
    align-items: center;
    gap: clamp(0.35rem, 0.7vw, 0.65rem);
    padding: clamp(0.48rem, 0.75vw, 0.68rem) clamp(0.75rem, 1.25vw, 1.1rem);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 100px;
    background: rgba(15, 20, 25, 0.92);
    color: #fff;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-family: var(--font, var(--font-main));
    font-size: clamp(0.72rem, 0.9vw, 0.88rem);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.tavus-launcher:hover { transform: translateY(-2px); background: #17212b; }
.tavus-launcher:focus-visible,
.tavus-close:focus-visible { outline: 3px solid var(--accent-light, var(--accent-primary-light)); outline-offset: 3px; }
.tavus-launcher svg { width: clamp(1rem, 1.35vw, 1.25rem); height: clamp(1rem, 1.35vw, 1.25rem); }

/* On module 1, slide 2, the avatar becomes part of the custom-chatbot card. */
body.deck-01.avatar-custom-chatbot > .tavus-launcher {
    opacity: 0;
    pointer-events: none;
}

.ai-levels article.custom-chatbot-level {
    position: relative;
}

.tavus-inline-launcher {
    position: absolute;
    z-index: 8;
    top: calc(-1 * clamp(3.85rem, 7.3vh, 4.35rem));
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: clamp(0.4rem, 0.72vw, 0.65rem);
    padding: clamp(0.58rem, 0.9vw, 0.78rem) clamp(0.95rem, 1.5vw, 1.3rem);
    transform: translateX(-50%);
    border-color: rgba(255, 255, 255, 0.42);
    border-style: solid;
    border-width: 1px;
    border-radius: 100px;
    background: #2476a8;
    color: #fff;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.34), 0 0 0 clamp(0.16rem, 0.24vw, 0.22rem) rgba(111, 190, 239, 0.16);
    font-family: var(--font, var(--font-main));
    font-size: clamp(0.82rem, 1vw, 0.98rem);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.tavus-inline-launcher::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(-1 * clamp(0.48rem, 0.62vw, 0.58rem));
    transform: translateX(-50%);
    border-left: clamp(0.42rem, 0.52vw, 0.5rem) solid transparent;
    border-right: clamp(0.42rem, 0.52vw, 0.5rem) solid transparent;
    border-top: clamp(0.5rem, 0.65vw, 0.6rem) solid #2476a8;
}

.tavus-inline-launcher:hover {
    transform: translateX(-50%) translateY(-2px);
    background: #2b83ba;
}

.tavus-inline-launcher:focus-visible {
    outline: 3px solid var(--accent-light, var(--accent-primary-light));
    outline-offset: 3px;
}

.tavus-inline-launcher svg {
    width: clamp(1rem, 1.35vw, 1.25rem);
    height: clamp(1rem, 1.35vw, 1.25rem);
}
.tavus-live-dot {
    width: clamp(0.42rem, 0.55vw, 0.52rem);
    height: clamp(0.42rem, 0.55vw, 0.52rem);
    border-radius: 50%;
    background: #62d7a7;
    box-shadow: 0 0 0 clamp(0.15rem, 0.25vw, 0.22rem) rgba(98, 215, 167, 0.16);
}

.tavus-overlay[hidden] { display: none; }
.tavus-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: clamp(0.7rem, 2vw, 1.6rem);
    overflow: hidden;
    background: rgba(7, 10, 13, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.tavus-dialog {
    width: min(94vw, 1180px);
    height: min(92dvh, 760px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: clamp(0.55rem, 1.1vh, 0.9rem);
    padding: clamp(0.8rem, 1.5vw, 1.25rem);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: clamp(18px, 2vw, 28px);
    background: #0f1419;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.tavus-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: clamp(0.7rem, 1.5vw, 1.2rem); }
.tavus-dialog-copy { display: grid; gap: clamp(0.12rem, 0.25vh, 0.22rem); }
.tavus-dialog-copy span { color: #62d7a7; font-size: clamp(0.62rem, 0.78vw, 0.74rem); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.tavus-dialog-copy strong { color: #fff; font-size: clamp(1rem, 1.7vw, 1.45rem); line-height: 1.2; }
.tavus-close {
    flex: 0 0 auto;
    width: clamp(2.35rem, 3vw, 2.8rem);
    height: clamp(2.35rem, 3vw, 2.8rem);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
    line-height: 1;
    cursor: pointer;
}

.tavus-stage { min-height: 0; overflow: hidden; border-radius: clamp(14px, 1.5vw, 22px); background: #050709; }
.tavus-stage tavus-embed { display: block; width: 100%; height: 100%; max-height: 100%; overflow: hidden; }
.tavus-loading { height: 100%; display: grid; place-items: center; padding: clamp(1rem, 3vw, 2rem); color: rgba(255, 255, 255, 0.72); font-size: clamp(0.9rem, 1.25vw, 1.1rem); text-align: center; }
.tavus-note { color: rgba(255, 255, 255, 0.62); font-size: clamp(0.62rem, 0.78vw, 0.74rem); line-height: 1.35; text-align: center; }
body.tavus-open { overflow: hidden; }
body.tavus-open .section-nav,
body.tavus-open .slide-counter,
body.tavus-open .lang-switch,
body.tavus-open .nav-dots,
body.tavus-open .tavus-launcher { opacity: 0; pointer-events: none; }

@media (max-height: 500px) { .lang-switch { display: none !important; } }
@media (max-width: 620px), (max-height: 560px) {
    .tavus-launcher-label { display: none; }
    .tavus-dialog { width: 96vw; height: 94dvh; }
}
