.lead-chat {
    position: fixed;
    z-index: 1200;
    right: 24px;
    bottom: 24px;
    font-family: Inter, Arial, sans-serif;
}

.lead-chat__launcher {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 999px;
    padding: 14px 18px;
    color: #061a33;
    background: linear-gradient(135deg, #67e8f9, #22c55e);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .35);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.lead-chat__launcher-icon { font-size: 18px; }

.lead-chat__panel {
    display: none;
    width: min(390px, calc(100vw - 32px));
    max-height: min(660px, calc(100vh - 110px));
    margin-bottom: 12px;
    overflow: auto;
    color: #e5edf8;
    background: #0f1e35;
    border: 1px solid rgba(103, 232, 249, .35);
    border-radius: 20px;
    box-shadow: 0 25px 70px rgba(2, 6, 23, .55);
}

.lead-chat.is-open .lead-chat__panel { display: block; }
.lead-chat.is-open .lead-chat__launcher { display: none; }

.lead-chat__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 20px;
    color: #052a3c;
    background: linear-gradient(135deg, #67e8f9, #86efac);
}

.lead-chat__eyebrow {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.lead-chat__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    color: inherit;
    background: rgba(255, 255, 255, .4);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.lead-chat__body { padding: 18px; }

.lead-chat__message {
    margin-bottom: 15px;
    padding: 12px 14px;
    border-radius: 4px 15px 15px;
    color: #d8f4ff;
    background: #183356;
    font-size: 14px;
    line-height: 1.5;
}

.lead-chat__prompt { margin: 0 0 10px; color: #cbd5e1; font-size: 14px; }

.lead-chat__choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 17px; }

.lead-chat__choices button {
    min-height: 46px;
    padding: 8px;
    border: 1px solid #315276;
    border-radius: 10px;
    color: #dbeafe;
    background: #122944;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.lead-chat__choices button:hover,
.lead-chat__choices button.is-selected { border-color: #67e8f9; background: #164164; }

.lead-chat__form { display: none; gap: 10px; }
.lead-chat__form.is-visible { display: grid; }

.lead-chat__form label { display: grid; gap: 5px; color: #dbeafe; font-size: 12px; font-weight: 700; }
.lead-chat__form input:not([type="checkbox"]),
.lead-chat__form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #315276;
    border-radius: 9px;
    color: #f8fafc;
    background: #091a2e;
    font: inherit;
}

.lead-chat__form textarea { resize: vertical; }
.lead-chat__turnstile { min-height: 65px; overflow: hidden; }

.lead-chat__consent { grid-template-columns: 16px 1fr; align-items: start; font-weight: 400 !important; line-height: 1.4; }
.lead-chat__consent input { margin-top: 2px; }

.lead-chat__status { min-height: 18px; margin: 0; color: #fcd34d; font-size: 12px; line-height: 1.4; }
.lead-chat__status.is-success { color: #86efac; }
.lead-chat__status.is-error { color: #fca5a5; }

.lead-chat__submit {
    border: 0;
    border-radius: 9px;
    padding: 12px;
    color: #042f2e;
    background: #86efac;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.lead-chat__submit:disabled { cursor: wait; opacity: .7; }

/* Keep the lead assistant readable whenever the public site uses light mode. */
html[data-theme="light"] .lead-chat__launcher {
    color: #073047;
    background: linear-gradient(135deg, #67e8f9, #4ade80);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .22);
}

html[data-theme="light"] .lead-chat__panel {
    color: #0f172a;
    background: #ffffff;
    border-color: #94a3b8;
    box-shadow: 0 25px 70px rgba(15, 23, 42, .28);
}

html[data-theme="light"] .lead-chat__header {
    color: #083344;
    background: linear-gradient(135deg, #a5f3fc, #bbf7d0);
}

html[data-theme="light"] .lead-chat__close {
    background: rgba(255, 255, 255, .72);
}

html[data-theme="light"] .lead-chat__message {
    color: #0f172a;
    background: #e0f2fe;
}

html[data-theme="light"] .lead-chat__prompt,
html[data-theme="light"] .lead-chat__form label {
    color: #334155;
}

html[data-theme="light"] .lead-chat__choices button {
    color: #0f172a;
    background: #f0fdfa;
    border-color: #94a3b8;
}

html[data-theme="light"] .lead-chat__choices button:hover,
html[data-theme="light"] .lead-chat__choices button.is-selected {
    border-color: #0891b2;
    background: #cffafe;
}

html[data-theme="light"] .lead-chat__form input:not([type="checkbox"]),
html[data-theme="light"] .lead-chat__form textarea {
    color: #0f172a;
    background: #ffffff;
    border-color: #94a3b8;
}

html[data-theme="light"] .lead-chat__status.is-success { color: #15803d; }
html[data-theme="light"] .lead-chat__status.is-error { color: #b91c1c; }

@media (max-width: 600px) {
    .lead-chat { right: 16px; bottom: 16px; }
    .lead-chat__panel { max-height: calc(100vh - 32px); margin-bottom: 0; }
}
