.ai-assistant-mount {
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 17;
    width: min(360px, 100vw);
    height: min(360px, 100vh);
    pointer-events: none;
    contain: layout paint style;
}

.ai-assistant-mount[data-assistant-enabled="false"] {
    display: none;
}

.ai-assistant-viewport {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ai-assistant-webgl-root {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ghost-assistant {
    --ghost-x: 0px;
    --ghost-y: 0px;
    --mira-scale: 0.85;
    --mira-width: clamp(150px, 14vw, 190px);
    --mira-height: clamp(320px, 36vw, 430px);
    --mira-idle-opacity: 0.96;
    position: fixed;
    right: clamp(16px, 3vw, 34px);
    bottom: clamp(16px, 4vw, 34px);
    z-index: 18;
    display: block;
    width: var(--mira-width);
    height: var(--mira-height);
    opacity: var(--mira-idle-opacity);
    pointer-events: none;
    transform: translate3d(var(--ghost-x), calc(12px + var(--ghost-y)), 0) scale(var(--mira-scale));
    transform-origin: top left;
    transition: opacity 220ms ease, transform 320ms ease;
    will-change: transform, opacity;
}

.ghost-assistant.is-positioned {
    top: 0;
    right: auto;
    bottom: auto;
    left: 0;
}

.ghost-assistant.is-visible {
    opacity: var(--mira-idle-opacity);
    transform: translate3d(var(--ghost-x), var(--ghost-y), 0) scale(var(--mira-scale));
}

.ghost-assistant.is-visible.has-message {
    opacity: 0.96;
}

.ghost-assistant.is-minimized {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(var(--ghost-x), calc(22px + var(--ghost-y)), 0) scale(calc(var(--mira-scale) * 0.94));
}

.ghost-assistant.is-calm {
    opacity: 0.72;
    transform: translate3d(var(--ghost-x), var(--ghost-y), 0) scale(calc(var(--mira-scale) * 0.92));
}

.ghost-assistant.is-dragging {
    opacity: 0.98;
    transition: opacity 120ms ease;
    user-select: none;
}

.ghost-assistant.is-resizing {
    opacity: 1;
    transition: opacity 120ms ease;
    user-select: none;
}

.ghost-assistant.is-listening,
.ghost-assistant.is-processing,
.ghost-assistant.is-speaking {
    opacity: 1;
}

.ghost-speech {
    position: absolute;
    right: calc(100% - 16px);
    bottom: 96px;
    width: max-content;
    max-width: min(208px, calc(100vw - 176px));
    border: 0;
    border-radius: 0;
    padding: 0;
    color: rgba(18, 61, 79, 0.82);
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 780;
    line-height: 1.32;
    text-align: left;
    cursor: default;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 320ms ease, transform 320ms ease;
    touch-action: none;
    user-select: none;
}

.ghost-assistant.is-on-left .ghost-speech {
    right: auto;
    left: calc(100% - 16px);
}

.ghost-assistant.has-message:not(.speech-suppressed) .ghost-speech {
    opacity: 1;
    pointer-events: none;
    transform: translateY(0);
}

.ghost-assistant.has-message.speech-forced .ghost-speech {
    opacity: 1;
    pointer-events: none;
    transform: translateY(0);
}

.ghost-body {
    display: grid;
    justify-items: center;
    width: 100%;
    height: 100%;
    color: #123d4f;
    text-decoration: none;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.ghost-close:hover,
.ghost-close:focus-visible,
.ghost-speech:hover,
.ghost-speech:focus-visible,
.ghost-body:hover,
.ghost-body:focus-visible {
    outline: 3px solid rgba(185, 133, 46, 0.22);
    outline-offset: 2px;
}

.ghost-assistant.is-dragging .ghost-body,
.ghost-assistant.is-dragging .ghost-speech {
    cursor: grabbing;
}

.mira-presence {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border-radius: 0;
    filter: none;
    transform-style: preserve-3d;
    animation: mira-idle-float 3.8s ease-in-out infinite;
    will-change: transform, filter;
}

.ghost-assistant.is-listening .mira-presence,
.ghost-assistant.is-processing .mira-presence {
    animation-duration: 2.4s;
}

.ghost-assistant.is-processing .mira-presence {
    transform: scale(1.02);
}

.mira-cutout {
    position: relative;
    z-index: 2;
    display: block;
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center bottom;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.mira-three-root {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: block;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: normal;
    filter: none;
    transition: opacity 220ms ease;
}

.mira-three-root canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.ghost-assistant.mira-glb-loaded .mira-three-root {
    opacity: 1;
}

.ghost-voice-button,
.ghost-help-button,
.ghost-close,
.ghost-help-panel,
.ghost-result-panel,
.ghost-voice-confirm {
    display: none !important;
}

@keyframes mira-idle-float {
    0%,
    100% {
        filter: none;
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        filter: none;
        transform: translate3d(0, -8px, 0) scale(1.035);
    }
}

@media (max-width: 760px) {
    .ai-assistant-mount {
        width: 180px;
        height: 180px;
    }

    .ghost-assistant,
    .ghost-assistant.is-visible,
    .ghost-assistant.is-minimized {
        --mira-scale: 0.72;
        --mira-width: 112px;
        --mira-height: 236px;
    }

    .ghost-speech {
        right: 72px;
        bottom: 70px;
        max-width: min(180px, calc(100vw - 144px));
        font-size: 0.72rem;
    }

    .ghost-assistant.is-on-left .ghost-speech {
        right: auto;
        left: 72px;
    }
}
