.leadya-assistant {
    position: fixed !important;
    right: 24px !important;
    bottom: 24px !important;
    z-index: 2147483000 !important;
    display: block;
    visibility: visible;
    font-family: inherit;
}

.leadya-assistant--website {
    bottom: 96px !important;
}

/* Aura shares the application's portrait and light violet palette. */
.leadya-assistant--aura {
    --ld-brand: #6c4cf1; --ld-bg: #f5f5f7; --ld-surface: #fff;
    --ld-text: #14122b; --ld-text-muted: #5b6271; --ld-border: #ececf1;
}
.leadya-assistant--aura[hidden], .leadya-assistant--aura [hidden] { display: none !important; }
.leadya-assistant--aura .leadya-assistant__launcher {
    display: flex; align-items: center; gap: 10px; width: auto; height: 64px;
    max-width: calc(100vw - 32px); padding: 5px 16px 5px 5px; border-radius: 36px;
    border: 1px solid var(--ld-border); background: var(--ld-surface); color: var(--ld-text);
    font-size: 13px; font-weight: 600; box-shadow: 0 6px 24px #14122b24;
}
.leadya-assistant--aura .leadya-assistant__avatar {
    position: relative; display: block; flex: 0 0 auto; isolation: isolate;
    width: 52px; height: 52px; overflow: hidden; border-radius: 50%;
    border: 3px solid var(--ld-brand); background: #f3f1fa;
}
.leadya-assistant--aura .leadya-assistant__avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.leadya-assistant--aura .leadya-assistant__avatar::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: var(--ld-brand); mix-blend-mode: color; opacity: .28;
}
.leadya-assistant--aura .leadya-assistant__identity { display: flex; align-items: center; gap: 10px; }
.leadya-assistant--aura .leadya-assistant__header .leadya-assistant__avatar { width: 44px; height: 44px; }
.leadya-assistant--aura .leadya-assistant__header { background: var(--ld-surface); color: var(--ld-text); border-bottom: 1px solid var(--ld-border); }
.leadya-assistant--aura .leadya-assistant__header .leadya-assistant__subtitle { color: var(--ld-text-muted); }
.leadya-assistant--aura .leadya-assistant__panel { bottom: 0; border-radius: 16px; border-color: var(--ld-border); }
.leadya-assistant--aura.leadya-assistant--open .leadya-assistant__launcher { visibility: hidden; }
.leadya-assistant--aura .leadya-assistant__messages { min-height: 0; background: var(--ld-bg); }
.leadya-assistant--aura .leadya-assistant__close { background: var(--ld-bg); color: var(--ld-text); }
.leadya-assistant--aura .leadya-assistant__message--assistant .leadya-assistant__bubble { background: #f3f1fa; color: var(--ld-text); border-color: var(--ld-border); }
.leadya-assistant--aura .leadya-assistant__send,
.leadya-assistant--aura .leadya-assistant__message--user .leadya-assistant__bubble { background: var(--ld-brand); color: #fff; }
.leadya-assistant--aura .leadya-assistant__input { color: var(--ld-text); background: var(--ld-surface); font-size: 16px; }
.leadya-assistant--aura :is(button, textarea):focus-visible { outline: 2px solid var(--ld-brand); outline-offset: 3px; }

.leadya-assistant__launcher {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: #1b6a68;
    color: #fff;
    box-shadow: 0 12px 30px rgba(19, 37, 43, 0.28);
    font-size: 22px;
    cursor: pointer;
}

.leadya-assistant__panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(23, 43, 54, 0.14);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(19, 37, 43, 0.24);
}

/* Website variant sits 72px higher (bottom: 96px), so the panel needs its own
   height budget: 96px widget offset + 72px panel offset + 24px top margin. */
.leadya-assistant--website .leadya-assistant__panel {
    height: min(560px, calc(100vh - 192px));
    height: min(560px, calc(100dvh - 192px));
}

.leadya-assistant__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #12343f;
    color: #fff;
}

.leadya-assistant__header strong,
.leadya-assistant__header span {
    display: block;
    line-height: 1.25;
}

.leadya-assistant__header span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.leadya-assistant__close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
}

.leadya-assistant__messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f5f7f8;
}

.leadya-assistant__message {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.leadya-assistant__message--user {
    align-items: flex-end;
}

.leadya-assistant__message--assistant {
    align-items: flex-start;
}

.leadya-assistant__bubble-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 92%;
}

.leadya-assistant__bubble {
    max-width: 86%;
    padding: 10px 12px;
    border-radius: 8px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.leadya-assistant__message--user .leadya-assistant__bubble {
    background: #1b6a68;
    color: #fff;
}

.leadya-assistant__message--assistant .leadya-assistant__bubble {
    background: #fff;
    color: #182b34;
    border: 1px solid rgba(23, 43, 54, 0.1);
}

.leadya-assistant__loading-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4f6570;
    font-size: 13px;
}

.leadya-assistant__typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.leadya-assistant__typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #1b6a68;
    opacity: 0.35;
    animation: leadya-assistant-typing 1s infinite ease-in-out;
}

.leadya-assistant__typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.leadya-assistant__typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes leadya-assistant-typing {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    40% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

.leadya-assistant__source-help {
    position: relative;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 4px;
    border: 1px solid rgba(27, 106, 104, 0.28);
    border-radius: 50%;
    background: #eef6f6;
    color: #1b6a68;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    cursor: help;
}

.leadya-assistant__source-tooltip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 2;
    display: none;
    width: min(260px, calc(100vw - 64px));
    padding: 10px;
    border: 1px solid rgba(23, 43, 54, 0.14);
    border-radius: 8px;
    background: #fff;
    color: #263b44;
    box-shadow: 0 12px 26px rgba(19, 37, 43, 0.18);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
}

.leadya-assistant__source-tooltip span {
    display: block;
    overflow-wrap: anywhere;
}

.leadya-assistant__source-help:hover .leadya-assistant__source-tooltip,
.leadya-assistant__source-help:focus .leadya-assistant__source-tooltip,
.leadya-assistant__source-help:focus-within .leadya-assistant__source-tooltip {
    display: block;
}

.leadya-assistant__form {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(23, 43, 54, 0.12);
    background: #fff;
}

.leadya-assistant__input {
    min-height: 44px;
    max-height: 110px;
    resize: vertical;
    border: 1px solid rgba(23, 43, 54, 0.18);
    border-radius: 8px;
    padding: 9px 10px;
    line-height: 1.35;
}

.leadya-assistant__send {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: #a94438;
    color: #fff;
    cursor: pointer;
}

.leadya-assistant__send:disabled {
    cursor: progress;
    opacity: 0.6;
}

@media (max-width: 520px) {
    .leadya-assistant {
        right: 16px !important;
        bottom: 16px;
    }

    .leadya-assistant--website {
        bottom: 84px !important;
    }

    .leadya-assistant__panel {
        bottom: 68px;
        width: calc(100vw - 32px);
        height: min(520px, calc(100vh - 104px));
    }

    /* Keep both sides inside the viewport, including its scrollbar. */
    .leadya-assistant--website .leadya-assistant__panel {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 84px;
        width: auto;
        height: min(520px, calc(100vh - 172px));
        height: min(520px, calc(100dvh - 172px));
    }
}
