.agente-lead-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 12, 22, 0.58);
    backdrop-filter: blur(18px);
    overflow: hidden;
    overscroll-behavior: none;
    height: 100%;
    height: 100dvh;
    box-sizing: border-box;
}

.agente-lead-overlay.is-open {
    display: flex;
}

.agente-lead-panel {
    width: min(520px, 100%);
    height: min(720px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: linear-gradient(180deg, #232838 0%, #1a1e2c 100%);
    border: 1px solid rgba(139, 92, 246, 0.32);
    border-radius: 24px;
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.2),
        0 0 36px rgba(59, 130, 246, 0.22),
        0 0 72px rgba(139, 92, 246, 0.16),
        0 24px 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.agente-lead-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.18);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.1));
}

.agente-lead-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1e2c;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.45);
}

.agente-lead-avatar img {
    width: 86%;
    height: 86%;
    object-fit: contain;
}

.agente-lead-title {
    flex: 1;
    min-width: 0;
}

.agente-lead-title h2,
.neury-name {
    margin: 0;
    font-family: 'Syne', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #f5c518;
    text-shadow: 0 0 14px rgba(245, 197, 24, 0.5);
}

.neury-name {
    font-size: inherit;
    font-family: inherit;
    font-weight: 700;
}

.agente-lead-title p {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.62);
}

.agente-lead-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
}

.agente-lead-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agente-lead-bubble {
    max-width: 86%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.agente-lead-bubble.is-bot {
    align-self: flex-start;
    background: transparent;
    color: rgba(255, 255, 255, 0.96);
    padding: 2px 4px;
    border-radius: 0;
}

.agente-lead-bubble.is-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #3b82f6, #7c3aed);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.agente-lead-bubble.is-error {
    align-self: flex-start;
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    padding: 12px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.agente-lead-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 8px;
    flex-shrink: 0;
    max-height: 30%;
    overflow-y: auto;
}

.agente-lead-chip {
    border: 0;
    background: linear-gradient(135deg, #3b82f6, #7c3aed);
    color: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.82rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.22);
}

.agente-lead-chip:hover,
.agente-lead-chip.is-selected {
    filter: brightness(1.12);
}

.agente-lead-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(59, 130, 246, 0.16);
    background: rgba(12, 14, 24, 0.35);
}

.agente-lead-form {
    display: flex;
    gap: 8px;
}

.agente-lead-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(139, 92, 246, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 999px;
    padding: 12px 16px;
    outline: none;
    font-size: 16px;
}

.agente-lead-form input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.agente-lead-form button {
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    background: linear-gradient(135deg, #3b82f6, #7c3aed);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    min-height: 44px;
}

.agente-lead-form button:disabled {
    opacity: 0.45;
    cursor: default;
}

.agente-lead-typing {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    min-height: 18px;
}

.agente-lead-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    animation: agente-lead-bounce 1s infinite ease-in-out;
}

.agente-lead-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.agente-lead-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes agente-lead-bounce {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.agente-lead-summary {
    white-space: pre-wrap;
    font-size: 0.86rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

body.agente-lead-open {
    overflow: hidden;
}

body.agente-lead-open .chatbot-toggle,
body.agente-lead-open .chatbot-container {
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 576px) {
    .agente-lead-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .agente-lead-panel {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
        border: 0;
    }

    .agente-lead-overlay.is-keyboard .agente-lead-header {
        padding: 8px 16px;
    }

    .agente-lead-overlay.is-keyboard .agente-lead-avatar {
        width: 32px;
        height: 32px;
    }

    .agente-lead-overlay.is-keyboard .agente-lead-messages {
        padding: 12px 16px;
    }

    .agente-lead-overlay.is-keyboard .agente-lead-chips {
        max-height: 22%;
        padding: 0 16px 6px;
    }

    .agente-lead-overlay.is-keyboard .agente-lead-footer {
        padding: 8px 12px 10px;
    }
}
