:root {
    --chatbot-primary:#0E7A3D;
    --chatbot-secondary:#F4A300;
    --chatbot-button:#25D366;
    --chatbot-assistant-bubble:#ffffff;
    --chatbot-user-bubble:#0E7A3D;
    --chatbot-surface:#f7fffb;
    --chatbot-popup-width:390px;
    --chatbot-ink:#17322d;
    --chatbot-muted:#6a7b75;
    --chatbot-shadow:0 30px 80px rgba(14,53,44,.22);
}

.chatbot-widget {
    position:fixed;
    right:20px;
    bottom:20px;
    z-index:9999;
    font-family:"Segoe UI",Arial,sans-serif;
}

.chatbot-widget[data-position="left"] {
    right:auto;
    left:20px;
}

.chatbot-launcher {
    position:relative;
    width:68px;
    height:68px;
    border:0;
    border-radius:999px;
    background:linear-gradient(135deg,var(--chatbot-button),var(--chatbot-primary));
    color:#fff;
    box-shadow:0 18px 44px rgba(37,211,102,.35);
    cursor:pointer;
    transition:transform .22s ease, box-shadow .22s ease;
}

.chatbot-launcher:hover { transform:translateY(-2px) scale(1.02); }
.chatbot-launcher.is-pulse { animation:chatbotPulse 2.8s infinite; }

.chatbot-launcher__tooltip {
    position:absolute;
    right:82px;
    top:50%;
    transform:translateY(-50%);
    white-space:nowrap;
    background:rgba(18,46,39,.96);
    color:#fff;
    padding:10px 14px;
    border-radius:14px;
    font-size:13px;
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease;
}

.chatbot-widget[data-position="left"] .chatbot-launcher__tooltip {
    right:auto;
    left:82px;
}

.chatbot-launcher:hover .chatbot-launcher__tooltip { opacity:1; }

.chatbot-launcher__icon,
.chatbot-launcher__icon svg {
    width:32px;
    height:32px;
}

.chatbot-panel {
    position:absolute;
    right:0;
    bottom:86px;
    width:min(var(--chatbot-popup-width), calc(100vw - 20px));
    border-radius:28px;
    overflow:hidden;
    background:linear-gradient(180deg,var(--chatbot-surface),#ffffff);
    border:1px solid rgba(14,122,61,.12);
    box-shadow:var(--chatbot-shadow);
    opacity:0;
    pointer-events:none;
    transform:translateY(18px) scale(.98);
    transition:opacity .24s ease, transform .24s ease;
}

.chatbot-widget[data-position="left"] .chatbot-panel {
    right:auto;
    left:0;
}

.chatbot-panel.is-open {
    opacity:1;
    pointer-events:auto;
    transform:translateY(0) scale(1);
}

.chatbot-panel__header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:18px;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--chatbot-secondary) 28%, transparent), transparent 45%),
        linear-gradient(135deg, color-mix(in srgb, var(--chatbot-primary) 12%, white), color-mix(in srgb, var(--chatbot-secondary) 12%, white));
    border-bottom:1px solid rgba(14,122,61,.1);
}

.chatbot-panel__brand {
    display:flex;
    align-items:center;
    gap:12px;
}

.chatbot-panel__logo {
    width:48px;
    height:48px;
    border-radius:14px;
    object-fit:cover;
    background:#fff;
    padding:6px;
}

.chatbot-panel__eyebrow {
    margin:0 0 4px;
    font-size:11px;
    color:var(--chatbot-primary);
    text-transform:uppercase;
    letter-spacing:.12em;
    font-weight:700;
}

.chatbot-panel__header h3 {
    margin:0;
    font-size:18px;
    color:var(--chatbot-ink);
}

.chatbot-panel__header small { color:var(--chatbot-muted); }

.chatbot-icon-button {
    width:34px;
    height:34px;
    border-radius:999px;
    border:0;
    background:#fff;
    color:var(--chatbot-ink);
    font-size:22px;
    cursor:pointer;
}

.chatbot-messages {
    min-height:320px;
    max-height:380px;
    overflow-y:auto;
    padding:18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.95), rgba(245,251,248,.98)),
        repeating-linear-gradient(135deg, rgba(14,122,61,.02) 0 18px, rgba(14,122,61,.04) 18px 36px);
}

.chatbot-bubble {
    max-width:88%;
    margin-bottom:14px;
    padding:14px 16px;
    border-radius:20px;
    box-shadow:0 12px 30px rgba(17,46,39,.08);
}

.chatbot-bubble--assistant {
    background:var(--chatbot-assistant-bubble);
    color:var(--chatbot-ink);
    border-bottom-left-radius:8px;
}

.chatbot-bubble--user {
    margin-left:auto;
    background:linear-gradient(135deg,var(--chatbot-user-bubble),var(--chatbot-primary));
    color:#fff;
    border-bottom-right-radius:8px;
}

.chatbot-bubble__label {
    margin-bottom:6px;
    font-size:11px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.08em;
    opacity:.8;
}

.chatbot-bubble__text {
    white-space:pre-wrap;
    line-height:1.55;
    font-size:14px;
}

.chatbot-lead-form,
.chatbot-input {
    background:#fff;
}

.chatbot-lead-form { padding:0 14px 12px; }

.chatbot-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

.chatbot-input {
    display:grid;
    grid-template-columns:1fr auto;
    gap:10px;
    padding:14px;
    border-top:1px solid rgba(14,122,61,.1);
}

.chatbot-input input,
.chatbot-lead-form input {
    width:100%;
    border:1px solid #d3e4dc;
    border-radius:14px;
    padding:12px 14px;
    font:inherit;
    color:var(--chatbot-ink);
    outline:none;
}

.chatbot-input input:focus,
.chatbot-lead-form input:focus {
    border-color:var(--chatbot-primary);
    box-shadow:0 0 0 4px rgba(14,122,61,.12);
}

.chatbot-input button,
.chatbot-submit-lead {
    border:0;
    border-radius:14px;
    background:linear-gradient(135deg,var(--chatbot-primary),var(--chatbot-secondary));
    color:#fff;
    font-weight:700;
    padding:12px 18px;
    cursor:pointer;
}

.chatbot-loader {
    display:flex;
    gap:8px;
    padding:0 18px 12px;
}

.chatbot-loader span {
    width:10px;
    height:10px;
    border-radius:50%;
    background:var(--chatbot-primary);
    animation:chatbotDots 1.2s infinite ease-in-out;
}

.chatbot-loader span:nth-child(2) { animation-delay:.15s; }
.chatbot-loader span:nth-child(3) { animation-delay:.3s; }

.is-hidden { display:none !important; }

@keyframes chatbotPulse {
    0%,100% { transform:scale(1); }
    50% { transform:scale(1.05); }
}

@keyframes chatbotDots {
    0%,80%,100% { opacity:.35; transform:translateY(0); }
    40% { opacity:1; transform:translateY(-3px); }
}

@media (max-width:640px) {
    .chatbot-widget,
    .chatbot-widget[data-position="left"] {
        right:12px;
        left:auto;
        bottom:12px;
    }
    .chatbot-panel {
        width:min(calc(100vw - 12px), calc(100vw - 12px));
        right:-2px;
        left:auto;
        bottom:78px;
        border-radius:24px;
    }
    .chatbot-grid { grid-template-columns:1fr; }
    .chatbot-messages { min-height:280px; max-height:48vh; }
}
