.chatbot-toggle {
    --chat-navy: #003366;
    --chat-slate: #4D4D4D;
    --chat-teal: #008080;
    --chat-bronze: #A67C52;
    position: fixed;
    right: 22px;
    bottom: 94px;
    z-index: 1200;
    border: 0;
    background: linear-gradient(145deg, #128c7e, #25d366);
    border-radius: 999px;
    width: 62px;
    height: 62px;
    padding: 0;
    font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid #ffffff;
    box-shadow: 0 12px 28px rgba(0, 51, 102, 0.34), 0 0 0 1px rgba(166,124,82,.3);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    animation: chatbotPulse 2.8s ease-in-out infinite;
}

.chatbot-toggle:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 18px 34px rgba(0, 30, 60, 0.36);
}

.chatbot-toggle img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes chatbotPulse {
    0%,
    100% {
        box-shadow: 0 14px 30px rgba(0, 30, 60, 0.32), 0 0 0 0 rgba(0, 128, 128, 0.26);
    }
    50% {
        box-shadow: 0 14px 30px rgba(0, 30, 60, 0.32), 0 0 0 10px rgba(0, 128, 128, 0.06);
    }
}

.chatbot-shell {
    --chat-navy: #003366;
    --chat-slate: #4D4D4D;
    --chat-teal: #008080;
    --chat-bronze: #A67C52;
    position: fixed;
    right: 18px;
    bottom: 72px;
    width: min(390px, calc(100vw - 24px));
    max-height: min(72vh, 640px);
    background: #ffffff;
    border: 1px solid rgba(0, 51, 102, 0.15);
    border-radius: 18px;
    z-index: 1200;
    display: none;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    box-shadow: 0 24px 58px rgba(0, 38, 77, 0.28), 0 4px 14px rgba(166,124,82,.12);
    font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
    color: #4D4D4D;
}

.chatbot-shell.open {
    display: grid;
}

.chatbot-head {
    padding: 16px;
    background: linear-gradient(120deg, #003366 0%, #003f70 52%, #008080 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-head strong {
    font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 14px;
}

.chatbot-head button {
    border: 0;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.chatbot-head button:hover {
    background: rgba(255,255,255,.32);
    transform: rotate(90deg);
}

.chatbot-messages {
    padding: 12px;
    overflow: auto;
    display: grid;
    gap: 8px;
    background: #f4f7f8;
}

.chatbot-msg {
    max-width: 92%;
    padding: 9px 11px;
    border-radius: 14px;
    font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.42;
    white-space: pre-line;
}

.chatbot-msg.bot {
    background: #ffffff;
    border: 1px solid rgba(0, 51, 102, 0.14);
    border-left: 3px solid #008080;
    color: #4D4D4D;
}

.chatbot-msg.user {
    margin-left: auto;
    background: #003366;
    color: #ffffff;
    border-bottom-right-radius: 5px;
}

.chatbot-actions {
    padding: 10px;
    border-top: 1px solid rgba(0, 51, 102, 0.12);
    background: #ffffff;
    display: grid;
    gap: 8px;
}

.chatbot-option {
    border: 1px solid rgba(0, 128, 128, 0.4);
    background: #f2f8f7;
    color: #003366;
    border-radius: 10px;
    padding: 9px 10px;
    font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.chatbot-option:hover {
    background: #e2f0ef;
    border-color: #008080;
}

.chatbot-form {
    display: grid;
    gap: 8px;
}

.chatbot-form label {
    font-size: 12px;
    color: #003366;
    font-weight: 700;
}

.chatbot-form input,
.chatbot-form textarea {
    width: 100%;
    border: 1px solid rgba(0, 51, 102, 0.2);
    border-radius: 8px;
    padding: 8px 9px;
    font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 14px;
}

.chatbot-form input:focus,
.chatbot-form textarea:focus {
    outline: 2px solid rgba(0,128,128,.2);
    border-color: #008080;
}

.chatbot-form textarea {
    resize: vertical;
    min-height: 78px;
}

.chatbot-submit,
.chatbot-upload {
    border: 0;
    background: #A67C52;
    color: #ffffff;
    border-radius: 10px;
    padding: 10px 11px;
    font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.chatbot-submit:hover,
.chatbot-upload:hover {
    background: #8a6541;
    transform: translateY(-1px);
}

.chatbot-note {
    font-size: 12px;
    color: #4D4D4D;
}

@media (max-width: 640px) {
    .chatbot-shell {
        right: 10px;
        bottom: 66px;
        width: calc(100vw - 20px);
    }

    .chatbot-toggle {
    right: 12px;
    bottom: 92px;
    }
}

/* Presentación moderna y aislada del chatbot, estilo mensajería social. */
.chatbot-toggle {
    width: 68px;
    height: 68px;
    right: 24px;
    bottom: 96px;
    border: 3px solid #ffffff;
    box-shadow: 0 10px 24px rgba(18, 140, 126, .3), 0 0 0 5px rgba(37, 211, 102, .14);
}

.chatbot-toggle::after {
    content: "";
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 14px;
    height: 14px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #36c978;
}

.chatbot-shell {
    right: 24px;
    bottom: 92px;
    width: min(408px, calc(100vw - 28px));
    max-height: min(82vh, 720px);
    border: 0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 26px 70px rgba(0, 34, 68, .32), 0 8px 22px rgba(0, 51, 102, .12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .24s ease, transform .24s ease, visibility .24s ease;
}

.chatbot-shell.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chatbot-head {
    min-height: 76px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #075e54 0%, #128c7e 54%, #25d366 100%);
    position: relative;
    overflow: hidden;
}

.chatbot-head::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -54px;
    top: -86px;
    border: 1px solid rgba(126, 216, 216, .26);
    border-radius: 50%;
    box-shadow: 0 0 0 18px rgba(126, 216, 216, .06), 0 0 0 36px rgba(126, 216, 216, .04);
}

.chatbot-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.chatbot-head-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .16);
}

.chatbot-head-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.chatbot-brand-copy {
    display: grid;
    gap: 3px;
}

.chatbot-head strong {
    font-size: 15px;
    letter-spacing: .01em;
}

.chatbot-brand-copy small {
    color: rgba(255, 255, 255, .8);
    font-size: 11px;
    font-weight: 400;
}

.chatbot-brand-copy small i {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-radius: 50%;
    background: #25d366;
    box-shadow: 0 0 0 3px rgba(97, 230, 160, .16);
}

.chatbot-head button {
    position: relative;
    z-index: 2;
    width: 31px;
    height: 31px;
    font-size: 20px;
    line-height: 1;
}

.chatbot-messages {
    min-height: 190px;
    padding: 18px 14px;
    gap: 10px;
    background-color: #f5f8fa;
    background-image: linear-gradient(rgba(0, 51, 102, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 51, 102, .025) 1px, transparent 1px);
    background-size: 24px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 128, 128, .45) transparent;
}

.chatbot-msg {
    max-width: 86%;
    padding: 11px 13px;
    border-radius: 17px;
    font-size: 13px;
    line-height: 1.48;
    box-shadow: 0 2px 7px rgba(0, 51, 102, .06);
}

.chatbot-msg.bot {
    border: 1px solid rgba(0, 128, 128, .13);
    border-left: 3px solid #25d366;
    border-bottom-left-radius: 5px;
    color: #334b60;
}

.chatbot-msg.user {
    border-bottom-right-radius: 5px;
    background: linear-gradient(135deg, #128c7e, #25d366);
    box-shadow: 0 4px 10px rgba(18, 140, 126, .2);
}

.chatbot-actions {
    min-height: 0;
    max-height: min(48vh, 430px);
    padding: 12px 14px 14px;
    gap: 7px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 51, 102, .08);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 128, 128, .45) transparent;
}

.chatbot-option {
    position: relative;
    border: 1px solid rgba(18, 140, 126, .3);
    background: #ffffff;
    color: #003366;
    border-radius: 12px;
    padding: 11px 34px 11px 13px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 51, 102, .04);
    transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.chatbot-option::after {
    content: "›";
    position: absolute;
    right: 13px;
    top: 50%;
    color: #128c7e;
    font-size: 20px;
    line-height: 1;
    transform: translateY(-53%);
}

.chatbot-option:hover {
    background: #effbf5;
    border-color: #25d366;
    box-shadow: 0 5px 12px rgba(37, 211, 102, .14);
    transform: translateY(-1px);
}

.chatbot-form input,
.chatbot-form textarea {
    border: 1px solid rgba(0, 51, 102, .2);
    border-radius: 10px;
    background: #fbfcfd;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.chatbot-form input:focus,
.chatbot-form textarea:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 128, 128, .12);
}

.chatbot-submit,
.chatbot-upload {
    border-radius: 12px;
    padding: 11px 13px;
    background: linear-gradient(135deg, #a67c52, #bd9364);
    box-shadow: 0 5px 12px rgba(166, 124, 82, .22);
}

.chatbot-note {
    color: #718294;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .chatbot-shell {
        right: 10px;
        bottom: 78px;
        width: calc(100vw - 20px);
        max-height: min(78vh, 680px);
        border-radius: 20px;
    }

    .chatbot-actions {
        max-height: 48vh;
    }

    .chatbot-toggle {
        right: 12px;
        bottom: 92px;
    }
}
