/* El widget se monta dentro de un Shadow DOM (ver frontend.js), por lo que el CSS
   externo del tema u otros plugins no puede afectarlo. Esta base solo fija
   tipografía e herencia limpias dentro del propio widget. */
.chatbot-wrapper,
.chatbot-wrapper *,
.chatbot-wrapper *::before,
.chatbot-wrapper *::after {
    box-sizing: border-box;
}

.chatbot-wrapper {
    position: fixed;
    bottom: var(--chatbot-bottom-offset, 22px);
    z-index: 9999;
    margin: 0;
    padding: 0;
    font-family: var(--chatbot-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
    color: var(--chatbot-text, #1f2937);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

.chatbot-embed-page {
    margin: 0;
    background: transparent;
    overflow: hidden;
}

.chatbot-embed-page .chatbot-wrapper,
.chatbot-wrapper-embed {
    position: fixed;
    bottom: var(--chatbot-bottom-offset, 22px);
    width: auto;
    height: auto;
    z-index: 1;
}

.chatbot-embed-page .chatbot-position-bottom-right,
.chatbot-wrapper-embed.chatbot-position-bottom-right,
.chatbot-position-bottom-right {
    right: var(--chatbot-offset, 22px);
    left: auto;
}

.chatbot-embed-page .chatbot-position-bottom-left,
.chatbot-wrapper-embed.chatbot-position-bottom-left,
.chatbot-position-bottom-left {
    right: auto;
    left: var(--chatbot-offset, 22px);
}

.chatbot-wrapper *,
.chatbot-wrapper *::before,
.chatbot-wrapper *::after {
    box-sizing: border-box;
}

@keyframes chatbot-slide-up {
    from { opacity: 0; transform: translateY(18px) scale(.96); filter: blur(2px); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes chatbot-slide-down {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(1px); }
}

@keyframes chatbot-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes chatbot-message-user-in {
    from { opacity: 0; transform: translateX(14px) translateY(4px) scale(.98); }
    to { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}

@keyframes chatbot-message-bot-in {
    from { opacity: 0; transform: translateX(-14px) translateY(4px) scale(.98); }
    to { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}

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

@keyframes chatbot-send-ready {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.chatbot-minimized {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--chatbot-launcher-size, 62px);
    height: var(--chatbot-launcher-size, 62px);
    padding: 8px;
    cursor: pointer;
    background: var(--chatbot-bg, #fff);
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 999px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.chatbot-minimized:hover {
    transform: translateY(-2px);
    border-color: var(--chatbot-primary, #b0bf38);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
}

.chatbot-minimized-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-minimized-avatar {
    width: var(--chatbot-launcher-icon-width, 34px);
    height: var(--chatbot-launcher-icon-height, 34px);
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: var(--chatbot-avatar-fit, cover);
    object-position: var(--chatbot-avatar-position, center center);
    background: #fff;
    border: 0;
}

.chatbot-avatar {
    width: var(--chatbot-avatar-width, 42px);
    height: var(--chatbot-avatar-height, 42px);
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: var(--chatbot-avatar-fit, cover);
    object-position: var(--chatbot-avatar-position, center center);
    background: #fff;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .08);
}

.chatbot-minimized-name {
    color: var(--chatbot-text, #1f2937);
    font-size: 14px;
    font-weight: 700;
}

.chatbot-container {
    display: none;
    width: var(--chatbot-window-width, 440px);
    max-width: calc(100vw - 28px);
    height: var(--chatbot-window-height, 640px);
    max-height: min(85vh, 860px);
    overflow: hidden;
    flex-direction: column;
    color: var(--chatbot-text, #1f2937);
    background: var(--chatbot-bg, #fff);
    border: 1px solid rgba(15, 23, 42, .09);
    border-radius: var(--chatbot-radius, 14px);
    box-shadow: var(--chatbot-shadow, 0 18px 50px rgba(15, 23, 42, .18));
    font-family: var(--chatbot-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.chatbot-container.active {
    display: flex;
    animation: chatbot-slide-up .28s cubic-bezier(.2, .8, .2, 1);
}

.chatbot-wrapper-embed .chatbot-container {
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 110px);
}

.chatbot-container.is-closing {
    display: flex;
    animation: chatbot-slide-down .2s ease-in forwards;
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(180deg, var(--chatbot-header-bg, #f8fafc), #fff);
    border-bottom: 1px solid rgba(15, 23, 42, .07);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.chatbot-header-info > div {
    min-width: 0;
}

.chatbot-header h3 {
    margin: 0;
    color: var(--chatbot-text, #1f2937);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-header p {
    margin: 2px 0 0;
    color: rgba(31, 41, 55, .68);
    font-size: 12px;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.chatbot-minimize-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    padding: 0;
    cursor: pointer;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 50%;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}

.chatbot-minimize-btn:hover {
    color: #172033;
    background: #eef2f7;
    transform: rotate(3deg);
}

.chatbot-close-svg {
    display: block;
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.chatbot-minimize-btn:focus-visible,
.chatbot-send:focus-visible,
.chatbot-minimized:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(176, 191, 56, .24);
}

.chatbot-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-word;
    background:
        radial-gradient(circle at top left, rgba(176, 191, 56, .12), transparent 28%),
        #fff;
}

.chatbot-welcome-message {
    padding: 13px 14px;
    margin: 0 0 4px;
    color: #374151;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, .06);
    border-left: 4px solid var(--chatbot-primary, #b0bf38);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
}

.chatbot-welcome-message p {
    margin: 0 0 8px;
}

.chatbot-welcome-message p:last-child {
    margin-bottom: 0;
}

.chatbot-message {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    animation: chatbot-fade-in .22s ease-out;
}

.chatbot-message-user {
    align-self: flex-end;
    color: #fff;
    background: var(--chatbot-primary, #b0bf38);
    border-bottom-right-radius: 5px;
    box-shadow: 0 8px 18px rgba(176, 191, 56, .2);
    animation-name: chatbot-message-user-in;
}

.chatbot-message-bot {
    align-self: flex-start;
    color: var(--chatbot-text, #1f2937);
    background: var(--chatbot-bot-msg, #f1f5f9);
    border: 1px solid rgba(15, 23, 42, .05);
    border-bottom-left-radius: 5px;
    animation-name: chatbot-message-bot-in;
}

.chatbot-typing-indicator {
    padding: 8px 16px 0;
    color: #64748b;
    font-size: 13px;
    animation: chatbot-fade-in .18s ease-out;
}

.chatbot-typing-indicator em {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-style: normal;
}

.chatbot-typing-indicator em::after {
    content: "";
    width: 22px;
    height: 6px;
    display: inline-block;
    background:
        radial-gradient(circle, currentColor 42%, transparent 46%) 0 50% / 6px 6px no-repeat,
        radial-gradient(circle, currentColor 42%, transparent 46%) 8px 50% / 6px 6px no-repeat,
        radial-gradient(circle, currentColor 42%, transparent 46%) 16px 50% / 6px 6px no-repeat;
    animation: chatbot-dot-pulse 1s infinite ease-in-out;
}

.chatbot-input-area {
    padding: 10px;
    background: var(--chatbot-header-bg, #f8fafc);
    border-top: 1px solid rgba(15, 23, 42, .07);
    flex-shrink: 0;
}

.chatbot-input {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    padding: 6px 8px 6px 14px;
    background: var(--chatbot-input-bg, #fff);
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 22px;
    max-height: 180px;
    transition: border-color .2s ease, box-shadow .2s ease, border-radius .2s ease;
}

.chatbot-input:focus-within,
.chatbot-input.is-writing {
    border-radius: 18px;
    border-color: var(--chatbot-primary, #b0bf38);
}

.chatbot-input:focus-within {
    box-shadow: 0 0 0 3px rgba(176, 191, 56, .18);
}

.chatbot-input.is-writing {
    border-color: color-mix(in srgb, var(--chatbot-primary, #b0bf38), #fff 18%);
    box-shadow: none;
}

.chatbot-input textarea {
    flex: 1;
    width: 100%;
    max-height: 150px;
    min-height: 36px;
    padding: 6px 0;
    border: 0;
    outline: 0;
    resize: none;
    color: var(--chatbot-text, #1f2937);
    background: transparent;
    font: inherit;
    font-size: 15px;
    line-height: 1.45;
    overflow-y: auto;
    align-self: center;
}

.chatbot-input textarea::placeholder {
    color: #94a3b8;
}

.chatbot-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    padding: 0;
    cursor: pointer;
    color: #fff;
    background: var(--chatbot-primary, #b0bf38);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 6px 14px rgba(176, 191, 56, .25);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.chatbot-mic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    padding: 0;
    cursor: pointer;
    color: #64748b;
    background: transparent;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 50%;
    transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.chatbot-mic:hover {
    color: var(--chatbot-primary, #b0bf38);
    border-color: var(--chatbot-primary, #b0bf38);
    background: rgba(176, 191, 56, .08);
}

.chatbot-mic.is-listening {
    color: #fff;
    background: #ef4444;
    border-color: #ef4444;
    animation: chatbot-mic-pulse 1.2s ease-in-out infinite;
}

.chatbot-mic-svg {
    width: 18px;
    height: 18px;
    display: block;
}

@keyframes chatbot-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .45); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.chatbot-send:hover {
    background: var(--chatbot-primary-hover, #98a62e);
    transform: translateY(-1px);
}

.chatbot-input.is-writing .chatbot-send:not(:disabled) {
    animation: chatbot-send-ready .9s ease-in-out infinite;
}

.chatbot-send-svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chatbot-send:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
    box-shadow: none;
}

.chatbot-footer {
    margin-top: 6px;
    text-align: center;
    padding: 6px 10px 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    color: #94a3b8;
    line-height: 1.5;
}

.chatbot-footer-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 2px 10px;
    margin-bottom: 4px;
}

.chatbot-footer-top a,
.chatbot-footer-top span {
    color: #94a3b8;
    font-weight: 700;
}

.chatbot-footer-top a:hover {
    color: var(--chatbot-primary, #b0bf38);
    text-decoration: underline;
}

.chatbot-clear-history-inline {
    padding: 0;
    color: #94a3b8;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}

.chatbot-clear-history-inline:hover,
.chatbot-clear-history-inline:focus {
    color: var(--chatbot-primary-hover, #748014);
    outline: 0;
}

/* Aviso de protección de datos: compacto, sin borde */
.chatbot-privacy-note {
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 2px 6px;
}

.chatbot-privacy-note small {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.45;
    color: #94a3b8;
}

.chatbot-privacy-note a {
    color: var(--chatbot-primary, #b0bf38);
    font-weight: 600;
}

.chatbot-links {
    margin-top: 10px;
    font-size: 12px;
}

.chatbot-links a {
    display: block;
    color: var(--chatbot-primary-hover, #748014);
    text-decoration: underline;
    word-break: break-word;
}

@media (max-width: 782px) {
    .chatbot-container {
        width: min(var(--chatbot-window-width-tablet, 420px), calc(100vw - 24px));
        height: min(var(--chatbot-window-height-tablet, 600px), calc(100vh - 92px));
        border-radius: min(var(--chatbot-radius, 14px), 18px);
    }

    .chatbot-minimized {
        width: var(--chatbot-launcher-size-tablet, 58px);
        height: var(--chatbot-launcher-size-tablet, 58px);
    }

    .chatbot-minimized-avatar {
        width: var(--chatbot-launcher-icon-width-tablet, 32px);
        height: var(--chatbot-launcher-icon-height-tablet, 32px);
    }

    .chatbot-avatar {
        width: var(--chatbot-avatar-width-tablet, 40px);
        height: var(--chatbot-avatar-height-tablet, 40px);
    }

    .chatbot-header {
        padding: 14px;
    }

    .chatbot-conversation {
        padding: 14px;
        gap: 10px;
    }

    .chatbot-message {
        max-width: 88%;
        font-size: 13.5px;
        padding: 9px 12px;
    }

    .chatbot-input textarea {
        font-size: 14px;
        min-height: 32px;
    }

    .chatbot-footer {
        padding: 4px 8px 10px;
    }
}

@media (max-width: 480px) {
    .chatbot-wrapper {
        bottom: min(var(--chatbot-bottom-offset, 8px), calc(100dvh - var(--chatbot-launcher-size-mobile, 56px) - 8px));
    }

    .chatbot-position-bottom-right {
        right: min(var(--chatbot-offset, 8px), calc(100vw - var(--chatbot-launcher-size-mobile, 56px) - 8px));
        left: auto;
    }

    .chatbot-position-bottom-left {
        left: min(var(--chatbot-offset, 8px), calc(100vw - var(--chatbot-launcher-size-mobile, 56px) - 8px));
        right: auto;
    }

    .chatbot-container {
        width: min(var(--chatbot-window-width-mobile, 360px), calc(100vw - 16px));
        height: min(80vh, var(--chatbot-window-height-mobile, 560px));
        max-height: calc(100dvh - 80px);
        border-radius: min(var(--chatbot-radius, 14px), 16px);
    }

    .chatbot-minimized {
        width: var(--chatbot-launcher-size-mobile, 56px);
        height: var(--chatbot-launcher-size-mobile, 56px);
    }

    .chatbot-minimized-avatar {
        width: var(--chatbot-launcher-icon-width-mobile, 30px);
        height: var(--chatbot-launcher-icon-height-mobile, 30px);
    }

    .chatbot-avatar {
        width: var(--chatbot-avatar-width-mobile, 38px);
        height: var(--chatbot-avatar-height-mobile, 38px);
    }

    .chatbot-header {
        padding: 12px;
    }

    .chatbot-header h3 {
        font-size: 14px;
    }

    .chatbot-header p {
        font-size: 11px;
    }

    .chatbot-conversation {
        padding: 10px;
        gap: 8px;
    }

    .chatbot-message {
        max-width: 92%;
        font-size: 13px;
        padding: 8px 11px;
        border-radius: 14px;
    }

    .chatbot-welcome-message {
        padding: 10px 12px;
        font-size: 12px;
    }

    .chatbot-input-area {
        padding: 8px;
    }

    .chatbot-input {
        padding: 4px 6px 4px 10px;
        gap: 6px;
        border-radius: 18px;
        max-height: 140px;
    }

    .chatbot-input textarea {
        font-size: 14px;
        min-height: 30px;
        max-height: 120px;
    }

    .chatbot-send,
    .chatbot-mic {
        width: 34px;
        height: 34px;
    }

    .chatbot-footer {
        padding: 3px 6px 8px;
        font-size: 9px;
    }

    .chatbot-footer-top {
        gap: 1px 6px;
    }

    .chatbot-privacy-note small {
        font-size: 9px;
    }

    .chatbot-suggested-chip {
        font-size: 11px;
        padding: 6px 10px;
    }
}

@media (max-width: 360px) {
    .chatbot-container {
        width: calc(100vw - 10px);
        border-radius: 12px;
    }

    .chatbot-position-bottom-right {
        right: min(var(--chatbot-offset, 5px), calc(100vw - var(--chatbot-launcher-size-mobile, 56px) - 5px));
    }

    .chatbot-position-bottom-left {
        left: min(var(--chatbot-offset, 5px), calc(100vw - var(--chatbot-launcher-size-mobile, 56px) - 5px));
    }

    .chatbot-wrapper {
        bottom: min(var(--chatbot-bottom-offset, 6px), calc(100dvh - var(--chatbot-launcher-size-mobile, 56px) - 6px));
    }

    .chatbot-message {
        max-width: 95%;
        font-size: 12.5px;
        padding: 7px 10px;
    }

    .chatbot-conversation {
        padding: 8px;
        gap: 6px;
    }

    .chatbot-header {
        padding: 10px;
    }

    .chatbot-input {
        padding: 3px 5px 3px 8px;
        border-radius: 16px;
        max-height: 120px;
    }

    .chatbot-input textarea {
        font-size: 13px;
        max-height: 100px;
    }

    .chatbot-footer {
        font-size: 8.5px;
    }
}

/* Banner de reanudar conversación */
.chatbot-resume-banner {
    margin-bottom: 14px;
    padding: 16px;
    background: var(--chatbot-bot-msg, #f1f5f9);
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: var(--chatbot-radius, 14px);
}

.chatbot-resume-title {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 14px;
    color: var(--chatbot-text, #1f2937);
}

.chatbot-resume-text {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(15, 23, 42, 0.65);
}

.chatbot-resume-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chatbot-resume-actions button {
    flex: 1 1 auto;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: filter 0.15s ease, background 0.15s ease;
}

.chatbot-resume-continue {
    color: #fff;
    background: var(--chatbot-primary, #b0bf38);
}

.chatbot-resume-continue:hover {
    background: var(--chatbot-primary-hover, #9aa830);
}

.chatbot-resume-new {
    color: var(--chatbot-text, #1f2937);
    background: transparent;
    border-color: rgba(15, 23, 42, 0.18);
}

.chatbot-resume-new:hover {
    background: rgba(15, 23, 42, 0.05);
}

/* Tipografía del contenido markdown de los mensajes (tras el reset all: revert) */
.chatbot-message p {
    margin: 0 0 8px;
}

.chatbot-message p:last-child {
    margin-bottom: 0;
}

.chatbot-message ul,
.chatbot-message ol {
    margin: 0 0 8px;
    padding-left: 20px;
}

.chatbot-message li {
    margin: 0 0 4px;
}

.chatbot-message a {
    color: var(--chatbot-primary, #b0bf38);
    text-decoration: underline;
    word-break: break-word;
}

.chatbot-message strong {
    font-weight: 700;
}

.chatbot-message code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92em;
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.06);
}

.chatbot-message pre {
    margin: 0 0 8px;
    padding: 10px 12px;
    overflow-x: auto;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
}

.chatbot-message pre code {
    padding: 0;
    background: none;
}

/* Preguntas sugeridas (chips) */
.chatbot-suggested {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.chatbot-suggested-chip {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    color: var(--chatbot-primary, #b0bf38);
    background: transparent;
    border: 1px solid var(--chatbot-primary, #b0bf38);
    border-radius: 999px;
    transition: background .18s ease, color .18s ease;
}

.chatbot-suggested-chip:hover {
    color: #fff;
    background: var(--chatbot-primary, #b0bf38);
}

/* Captación de leads */
.chatbot-lead-cta {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.chatbot-lead-trigger {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: var(--chatbot-primary, #b0bf38);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .14);
    transition: filter .18s ease, transform .18s ease;
}

.chatbot-lead-trigger:hover {
    transform: translateY(-1px);
    background: var(--chatbot-primary-hover, #9aa830);
}

.chatbot-lead-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 8px;
    padding: 16px;
    background: var(--chatbot-bot-msg, #f1f5f9);
    border: 1px solid rgba(15, 23, 42, .09);
    border-radius: var(--chatbot-radius, 14px);
}

/* El atributo hidden debe ganar al display:flex (autor vence a UA con misma especificidad). */
.chatbot-lead-form[hidden] {
    display: none;
}

.chatbot-lead-intro {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--chatbot-text, #1f2937);
}

.chatbot-lead-form input,
.chatbot-lead-form textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--chatbot-text, #1f2937);
    background: var(--chatbot-input-bg, #fff);
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 10px;
    outline: 0;
    resize: none;
}

.chatbot-lead-form input:focus,
.chatbot-lead-form textarea:focus {
    border-color: var(--chatbot-primary, #b0bf38);
    box-shadow: 0 0 0 3px rgba(176, 191, 56, .18);
}

.chatbot-lead-actions {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.chatbot-lead-send {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: var(--chatbot-primary, #b0bf38);
    border: 0;
    border-radius: 999px;
}

.chatbot-lead-send:hover {
    background: var(--chatbot-primary-hover, #9aa830);
}

.chatbot-lead-cancel {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--chatbot-text, #1f2937);
    background: transparent;
    border: 1px solid rgba(15, 23, 42, .18);
    border-radius: 999px;
}

.chatbot-lead-cancel:hover {
    background: rgba(15, 23, 42, .05);
}

.chatbot-lead-status {
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
}

.chatbot-lead-status.is-error {
    color: #b32d2e;
}

.chatbot-lead-success {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--chatbot-text, #1f2937);
    text-align: center;
}
