.lg-ai-chat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99998;
    font-family: "Poppins", Arial, Helvetica, sans-serif;
}

.lg-ai-chat *,
.lg-ai-chat *::before,
.lg-ai-chat *::after {
    box-sizing: border-box;
}

.lg-ai-chat__launcher {
    min-width: 58px;
    width: auto;
    height: 58px;
    padding: 0 12px;
    border: 0;
    border-radius: 50%;
    background: var(--lg-ai-chat-primary, #060d34);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 40px rgba(6, 13, 52, .28);
    cursor: pointer;
}

.lg-ai-chat__launcher span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    min-width: 34px;
    padding: 0 7px;
    background: var(--lg-ai-chat-accent, #2bc6eb);
    color: var(--lg-ai-chat-primary, #060d34);
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.lg-ai-chat__panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: min(376px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 124px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(6, 13, 52, .12);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(6, 13, 52, .24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.lg-ai-chat.is-open .lg-ai-chat__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lg-ai-chat__header {
    min-height: 72px;
    padding: 16px 18px;
    background: var(--lg-ai-chat-primary, #060d34);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lg-ai-chat__header strong,
.lg-ai-chat__header span {
    display: block;
    color: #fff;
}

.lg-ai-chat__header strong {
    font-size: 16px;
    line-height: 22px;
    font-weight: 600;
}

.lg-ai-chat__header span {
    position: relative;
    padding-left: 12px;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
    line-height: 18px;
}

.lg-ai-chat__header span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--lg-ai-chat-accent, #2bc6eb);
}

.lg-ai-chat__close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 24px;
    line-height: 30px;
    cursor: pointer;
}

.lg-ai-chat__messages {
    min-height: 0;
    padding: 18px;
    overflow-y: auto;
    background: #f6f9fc;
}

.lg-ai-chat__message {
    display: flex;
    margin-bottom: 12px;
}

.lg-ai-chat__message span {
    max-width: 86%;
    padding: 11px 13px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 21px;
    white-space: pre-wrap;
}

.lg-ai-chat__message--assistant span {
    background: #fff;
    color: #24344d;
    border: 1px solid #e2eaf4;
}

.lg-ai-chat__message--user {
    justify-content: flex-end;
}

.lg-ai-chat__message--user span {
    background: #060d34;
    color: #fff;
}

.lg-ai-chat__message--typing span {
    color: #657389;
}

.lg-ai-chat__form {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #e2eaf4;
    background: #fff;
}

.lg-ai-chat__lead {
    overflow: hidden;
    border: 1px solid #e2eaf4;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 24px rgba(6, 13, 52, .06);
}

.lg-ai-chat.has-saved-lead .lg-ai-chat__lead {
    display: none;
}

.lg-ai-chat__lead-head {
    width: 100%;
    color: #24344d;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    text-align: left;
}

.lg-ai-chat__lead-icon {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(43, 198, 235, .16);
    box-shadow: inset 0 0 0 1px rgba(43, 198, 235, .22);
}

.lg-ai-chat__lead-icon::before,
.lg-ai-chat__lead-icon::after {
    content: "";
    position: absolute;
    left: 9px;
    right: 9px;
    border-radius: 999px;
    background: var(--lg-ai-chat-primary, #060d34);
}

.lg-ai-chat__lead-icon::before {
    top: 10px;
    height: 6px;
}

.lg-ai-chat__lead-icon::after {
    top: 20px;
    height: 3px;
    opacity: .72;
}

.lg-ai-chat__lead-copy {
    min-width: 0;
}

.lg-ai-chat__lead-copy strong,
.lg-ai-chat__lead-copy small {
    display: block;
}

.lg-ai-chat__lead-copy strong {
    color: #060d34;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
}

.lg-ai-chat__lead-copy small {
    margin-top: 1px;
    color: #657389;
    font-size: 11px;
    line-height: 16px;
}

.lg-ai-chat__lead-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 12px 12px;
}

.lg-ai-chat__field {
    width: 100%;
    min-height: 38px;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    background: #fff;
    padding: 9px 10px;
    color: #060d34;
    font-size: 13px;
    line-height: 18px;
    outline: 0;
    box-shadow: 0 1px 0 rgba(6, 13, 52, .03);
}

.lg-ai-chat__field::placeholder {
    color: #8a98aa;
}

.lg-ai-chat__field:focus {
    border-color: var(--lg-ai-chat-accent, #2bc6eb);
    box-shadow: 0 0 0 3px rgba(43, 198, 235, .16);
}

.lg-ai-chat__field--wide {
    grid-column: 1 / -1;
}

.lg-ai-chat__composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 10px;
}

.lg-ai-chat__input {
    width: 100%;
    min-height: 42px;
    max-height: 112px;
    resize: none;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--lg-ai-chat-primary, #060d34);
    font-size: 14px;
    line-height: 20px;
    outline: 0;
}

.lg-ai-chat__input:focus {
    border-color: var(--lg-ai-chat-accent, #2bc6eb);
}

.lg-ai-chat__send {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--lg-ai-chat-accent, #2bc6eb);
    color: var(--lg-ai-chat-primary, #060d34);
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
}

.lg-ai-chat__send:disabled {
    opacity: .55;
    cursor: wait;
}

@media (max-width: 767px) {
    .lg-ai-chat {
        right: 16px;
        bottom: 16px;
    }

    .lg-ai-chat__panel {
        right: -4px;
        bottom: 72px;
        width: calc(100vw - 24px);
        height: min(520px, calc(100vh - 104px));
    }

    .lg-ai-chat__lead-head {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .lg-ai-chat__lead-fields {
        grid-template-columns: 1fr;
        padding: 0 10px 10px;
    }
}
