:root {
    --cobocito-green: #006c43;
    --cobocito-green-dark: #005337;
    --cobocito-green-soft: #edf7f2;
    --cobocito-white: #ffffff;
    --cobocito-text: #171917;
    --cobocito-muted: #6f7772;
    --cobocito-border: #dfe6e2;
    --cobocito-assistant: #f4f6f5;
    --cobocito-shadow:
        0 18px 54px rgba(0, 0, 0, 0.18);
}


.cobocito-root,
.cobocito-root * {
    box-sizing: border-box;
}


.cobocito-root {
    position: relative;
    z-index: 2147483000;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}


.cobocito-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}


.cobocito-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 78px;
    height: 78px;
    padding: 0;
    overflow: visible;
    border: 3px solid var(--cobocito-green);
    border-radius: 50%;
    background: var(--cobocito-white);
    box-shadow:
        0 8px 26px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    z-index: 2147483002;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}


.cobocito-launcher:hover {
    transform: translateY(-2px) scale(1.025);
    box-shadow:
        0 11px 30px rgba(0, 0, 0, 0.25);
}


.cobocito-launcher-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 50%;
    background: #fff;
}


.cobocito-launcher-avatar img {
    display: block;
    width: 94%;
    height: 94%;
    object-fit: contain;
}


.cobocito-launcher-status {
    position: absolute;
    right: 3px;
    bottom: 7px;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #31c96f;
}


.cobocito-panel {
    position: fixed;
    right: 24px;
    bottom: 116px;
    display: flex;
    flex-direction: column;
    width: min(400px, calc(100vw - 32px));
    height: min(620px, calc(100dvh - 150px));
    min-height: 450px;
    overflow: hidden;
    border: 1px solid rgba(0, 108, 67, 0.23);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--cobocito-shadow);
    z-index: 2147483001;
    transform-origin: right bottom;
    animation: cobocito-panel-in 180ms ease-out;
}


.cobocito-panel[hidden] {
    display: none !important;
}


@keyframes cobocito-panel-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


.cobocito-header {
    display: flex;
    align-items: center;
    min-height: 90px;
    padding: 14px 13px 14px 15px;
    background:
        linear-gradient(
            135deg,
            #007749 0%,
            #005f3d 100%
        );
    color: #fff;
}


.cobocito-header-avatar,
.cobocito-message-avatar {
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 50%;
    background: #fff;
}


.cobocito-header-avatar {
    width: 54px;
    height: 54px;
    border: 2px solid rgba(255, 255, 255, 0.9);
}


.cobocito-header-avatar img,
.cobocito-message-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}


.cobocito-header-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    margin-left: 12px;
}


.cobocito-title {
    font-size: 18px;
    font-weight: 760;
    line-height: 1.15;
    letter-spacing: 0.01em;
}


.cobocito-subtitle {
    margin-top: 3px;
    overflow: hidden;
    font-size: 12.5px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.95;
}


.cobocito-online {
    display: flex;
    align-items: center;
    margin-top: 5px;
    font-size: 12px;
    opacity: 0.95;
}


.cobocito-online-dot {
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: #39dd7e;
    box-shadow:
        0 0 0 3px rgba(57, 221, 126, 0.15);
}


.cobocito-close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    margin-left: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 31px;
    font-weight: 300;
    line-height: 34px;
    cursor: pointer;
}


.cobocito-close:hover {
    background: rgba(255, 255, 255, 0.14);
}


.cobocito-launcher:focus-visible,
.cobocito-close:focus-visible,
.cobocito-send:focus-visible,
.cobocito-suggestion:focus-visible,
.cobocito-input:focus-visible {
    outline: 3px solid rgba(0, 108, 67, 0.28);
    outline-offset: 2px;
}


.cobocito-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 16px 16px;
    background: #fff;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color:
        #bcc8c2
        transparent;
}


.cobocito-message {
    display: flex;
    align-items: flex-end;
    width: 100%;
    margin: 0 0 14px;
}


.cobocito-message-user {
    justify-content: flex-end;
}


.cobocito-message-assistant {
    justify-content: flex-start;
}


.cobocito-message-avatar {
    width: 34px;
    height: 34px;
    margin: 0 8px 2px 0;
    border: 1px solid var(--cobocito-border);
}


.cobocito-bubble {
    max-width: 82%;
    padding: 11px 13px;
    border-radius: 17px;
    font-size: 14px;
    line-height: 1.46;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}


.cobocito-bubble-assistant {
    border: 1px solid #edf0ee;
    border-bottom-left-radius: 6px;
    background: var(--cobocito-assistant);
    color: var(--cobocito-text);
}


.cobocito-bubble-user {
    border-bottom-right-radius: 6px;
    background: var(--cobocito-green);
    color: #fff;
}


.cobocito-bubble a {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}


.cobocito-bubble-assistant a {
    color: var(--cobocito-green);
}


.cobocito-bubble-user a {
    color: #fff;
}


.cobocito-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 3px 0 19px 42px;
}


.cobocito-suggestion {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(0, 108, 67, 0.48);
    border-radius: 999px;
    background: #fff;
    color: var(--cobocito-green-dark);
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1.25;
    cursor: pointer;
}


.cobocito-suggestion:hover {
    border-color: var(--cobocito-green);
    background: var(--cobocito-green-soft);
}


.cobocito-thinking {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}


.cobocito-thinking-text {
    margin-right: 3px;
    color: #4f5753;
}


.cobocito-thinking-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cobocito-green);
    animation:
        cobocito-thinking-bounce
        1.15s
        infinite
        ease-in-out;
}


.cobocito-thinking-dot:nth-child(3) {
    animation-delay: 0.14s;
}


.cobocito-thinking-dot:nth-child(4) {
    animation-delay: 0.28s;
}


@keyframes cobocito-thinking-bounce {
    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}


.cobocito-composer-wrap {
    flex: 0 0 auto;
    padding: 12px 14px 10px;
    border-top: 1px solid var(--cobocito-border);
    background: #fff;
}


.cobocito-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-height: 48px;
    padding: 6px 6px 6px 14px;
    border: 1px solid #d4ddd8;
    border-radius: 25px;
    background: #fff;
}


.cobocito-form:focus-within {
    border-color: rgba(0, 108, 67, 0.72);
    box-shadow:
        0 0 0 3px rgba(0, 108, 67, 0.09);
}


.cobocito-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-height: 104px;
    padding: 7px 0;
    overflow-y: auto;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--cobocito-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.42;
    resize: none;
}


.cobocito-input::placeholder {
    color: #909691;
}


.cobocito-send {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--cobocito-green);
    color: #fff;
    cursor: pointer;
}


.cobocito-send:hover {
    background: var(--cobocito-green-dark);
}


.cobocito-send:active {
    transform: scale(0.96);
}


.cobocito-send:disabled,
.cobocito-suggestion:disabled {
    cursor: default;
    opacity: 0.52;
}


.cobocito-disclaimer {
    padding: 8px 7px 0;
    color: #7a817d;
    font-size: 10.5px;
    line-height: 1.35;
    text-align: center;
}


@media (max-width: 767px) {

    .cobocito-launcher {
        right: 17px;
        bottom: 18px;
        width: 68px;
        height: 68px;
    }


    .cobocito-launcher-status {
        right: 2px;
        bottom: 5px;
        width: 13px;
        height: 13px;
    }


    .cobocito-panel {
        right: 12px;
        bottom: 96px;
        width: calc(100vw - 24px);
        height: min(72dvh, 620px);
        min-height: 430px;
        border-radius: 19px;
    }


    .cobocito-header {
        min-height: 82px;
        padding: 12px 11px 12px 13px;
    }


    .cobocito-header-avatar {
        width: 48px;
        height: 48px;
    }


    .cobocito-title {
        font-size: 17px;
    }


    .cobocito-subtitle {
        max-width: 220px;
        font-size: 11.5px;
    }


    .cobocito-messages {
        padding: 15px 12px 12px;
    }


    .cobocito-bubble {
        max-width: 84%;
        font-size: 13.5px;
    }


    .cobocito-suggestions {
        gap: 7px;
        margin-left: 40px;
    }


    .cobocito-suggestion {
        font-size: 12px;
    }


    .cobocito-composer-wrap {
        padding:
            10px
            11px
            max(8px, env(safe-area-inset-bottom));
    }
}


@media (max-width: 380px) {

    .cobocito-panel {
        right: 8px;
        bottom: 91px;
        width: calc(100vw - 16px);
        height: min(74dvh, 610px);
    }


    .cobocito-subtitle {
        max-width: 185px;
    }


    .cobocito-suggestions {
        margin-left: 0;
    }
}


@media (prefers-reduced-motion: reduce) {

    .cobocito-launcher,
    .cobocito-panel,
    .cobocito-thinking-dot {
        animation: none !important;
        transition: none !important;
    }
}


/* ==========================================================
   COBOCITO UI 1.0.1
   Blindaje del launcher frente a estilos globales del tema.
   ========================================================== */

html body #cobocito-root #cobocito-launcher.cobocito-launcher {
    position: fixed !important;
    right: 24px !important;
    bottom: 24px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;

    height: 78px !important;
    min-height: 78px !important;
    max-height: 78px !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: visible !important;

    border:
        3px solid
        var(--cobocito-green)
        !important;

    border-radius: 50% !important;

    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;

    color: inherit !important;

    line-height: 1 !important;

    box-shadow:
        0 8px 26px
        rgba(0, 0, 0, 0.22)
        !important;

    appearance: none !important;
    -webkit-appearance: none !important;

    cursor: pointer !important;

    z-index: 2147483002 !important;
}


html body #cobocito-root #cobocito-launcher.cobocito-launcher::before,
html body #cobocito-root #cobocito-launcher.cobocito-launcher::after {
    content: none !important;
    display: none !important;
}


html body #cobocito-root
#cobocito-launcher
.cobocito-launcher-avatar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;

    border-radius: 50% !important;

    background: #ffffff !important;
    background-color: #ffffff !important;
}


html body #cobocito-root
#cobocito-launcher
.cobocito-launcher-avatar img {
    display: block !important;

    width: 94% !important;
    min-width: 0 !important;
    max-width: 94% !important;

    height: 94% !important;
    min-height: 0 !important;
    max-height: 94% !important;

    margin: auto !important;
    padding: 0 !important;

    object-fit: contain !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;

    box-shadow: none !important;
}


html body #cobocito-root
#cobocito-launcher
.cobocito-launcher-status {
    position: absolute !important;

    right: 3px !important;
    bottom: 7px !important;

    display: block !important;

    width: 14px !important;
    min-width: 14px !important;

    height: 14px !important;
    min-height: 14px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 2px solid #ffffff !important;
    border-radius: 50% !important;

    background: #31c96f !important;

    z-index: 2 !important;
}


@media (max-width: 767px) {

    html body #cobocito-root #cobocito-launcher.cobocito-launcher {
        right: 17px !important;
        bottom: 18px !important;

        width: 68px !important;
        min-width: 68px !important;
        max-width: 68px !important;

        height: 68px !important;
        min-height: 68px !important;
        max-height: 68px !important;
    }


    html body #cobocito-root
    #cobocito-launcher
    .cobocito-launcher-status {
        right: 2px !important;
        bottom: 5px !important;

        width: 13px !important;
        min-width: 13px !important;

        height: 13px !important;
        min-height: 13px !important;
    }

}


/* ==========================================================
   COBOCITO UI 1.0.2
   Inicio compacto, saludo alineado y accesos rápidos.
   ========================================================== */


/*
 * El mensaje de bienvenida debe comportarse exactamente
 * como cualquier respuesta normal de COBOCITO.
 */
html body #cobocito-root
.cobocito-message.cobocito-message-assistant {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;

    width: 100% !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    text-align: left !important;
}


html body #cobocito-root
.cobocito-message-assistant
.cobocito-message-avatar {
    flex:
        0
        0
        34px
        !important;

    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;

    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;

    margin:
        2px
        8px
        0
        0
        !important;

    padding: 0 !important;

    align-self: flex-start !important;
}


html body #cobocito-root
.cobocito-message-assistant
.cobocito-bubble-assistant {
    display: block !important;

    flex:
        0
        1
        auto
        !important;

    width: auto !important;

    max-width:
        calc(
            100%
            - 44px
        )
        !important;

    margin: 0 !important;

    padding:
        10px
        12px
        !important;

    text-align: left !important;

    line-height: 1.42 !important;

    white-space: pre-wrap !important;
}


/*
 * Tres accesos rápidos solamente.
 * En ancho normal se muestran en una única fila.
 */
html body #cobocito-root
#cobocito-suggestions.cobocito-suggestions {
    display: grid !important;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        )
        !important;

    gap: 7px !important;

    width:
        calc(
            100%
            - 42px
        )
        !important;

    margin:
        4px
        0
        12px
        42px
        !important;

    padding: 0 !important;

    align-items: stretch !important;
}


html body #cobocito-root
#cobocito-suggestions[hidden] {
    display: none !important;
}


html body #cobocito-root
#cobocito-suggestions
button.cobocito-suggestion {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;

    min-width: 0 !important;
    max-width: none !important;

    min-height: 42px !important;
    height: auto !important;

    margin: 0 !important;

    padding:
        7px
        7px
        !important;

    border:
        1px solid
        rgba(0, 108, 67, 0.58)
        !important;

    border-radius: 12px !important;

    background:
        #ffffff
        !important;

    background-color:
        #ffffff
        !important;

    background-image:
        none
        !important;

    color:
        #005337
        !important;

    font-family:
        inherit
        !important;

    font-size:
        11.5px
        !important;

    font-weight:
        600
        !important;

    line-height:
        1.22
        !important;

    text-align:
        center
        !important;

    text-transform:
        none
        !important;

    letter-spacing:
        normal
        !important;

    box-shadow:
        none
        !important;

    appearance:
        none
        !important;

    -webkit-appearance:
        none
        !important;

    white-space:
        normal
        !important;

    cursor:
        pointer
        !important;
}


html body #cobocito-root
#cobocito-suggestions
button.cobocito-suggestion::before,
html body #cobocito-root
#cobocito-suggestions
button.cobocito-suggestion::after {
    content: none !important;
    display: none !important;
}


html body #cobocito-root
#cobocito-suggestions
button.cobocito-suggestion:hover {
    border-color:
        #006c43
        !important;

    background:
        #edf7f2
        !important;

    color:
        #005337
        !important;
}


/*
 * Pantallas particularmente estrechas:
 * dos columnas y el tercer acceso ocupa toda la segunda fila.
 */
@media (max-width: 360px) {

    html body #cobocito-root
    #cobocito-suggestions.cobocito-suggestions {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            )
            !important;
    }


    html body #cobocito-root
    #cobocito-suggestions
    button.cobocito-suggestion:last-child {
        grid-column:
            1 / -1
            !important;
    }

}


/* ==========================================================
   COBOCITO UI 1.0.3
   Corrección definitiva del saludo inicial.
   No preservar espacios/saltos de indentación del HTML.
   ========================================================== */

html body #cobocito-root
#cobocito-messages
.cobocito-message.cobocito-message-assistant {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: left !important;
}


/*
 * La burbuja es el último hijo del mensaje:
 * el primero corresponde al avatar.
 *
 * white-space: normal elimina los espacios y saltos
 * introducidos únicamente por la indentación del PHP/HTML.
 */
html body #cobocito-root
#cobocito-messages
.cobocito-message.cobocito-message-assistant
> :last-child {
    align-self: flex-start !important;

    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;

    text-align: left !important;

    white-space: normal !important;

    word-spacing: normal !important;
    letter-spacing: normal !important;

    line-height: 1.45 !important;
}


/*
 * Ningún elemento textual interno puede volver a centrar
 * el saludo por reglas globales del tema.
 */
html body #cobocito-root
#cobocito-messages
.cobocito-message.cobocito-message-assistant
> :last-child
p,

html body #cobocito-root
#cobocito-messages
.cobocito-message.cobocito-message-assistant
> :last-child
span,

html body #cobocito-root
#cobocito-messages
.cobocito-message.cobocito-message-assistant
> :last-child
div {
    margin-left: 0 !important;
    margin-right: 0 !important;

    text-align: left !important;

    white-space: normal !important;

    word-spacing: normal !important;
    letter-spacing: normal !important;
}


/*
 * Mantener avatar y burbuja arrancando desde arriba.
 */
html body #cobocito-root
#cobocito-messages
.cobocito-message.cobocito-message-assistant
> :first-child {
    align-self: flex-start !important;
    margin-top: 2px !important;
}


/* ==========================================================
   COBOCITO UI 1.0.4
   Botón cerrar: centrado geométrico y estados protegidos.
   ========================================================== */


/*
 * El tema no debe aportar fondo, borde, sombra,
 * tamaño ni desplazamiento al botón cerrar.
 */
html body #cobocito-root
button#cobocito-close {
    position: relative !important;

    display: flex !important;
    flex: 0 0 44px !important;

    align-items: center !important;
    justify-content: center !important;

    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;

    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 12px !important;

    outline: none !important;

    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    box-shadow: none !important;

    color: transparent !important;

    font-size: 0 !important;
    line-height: 0 !important;

    text-align: center !important;
    text-indent: 0 !important;

    transform: none !important;

    appearance: none !important;
    -webkit-appearance: none !important;

    overflow: hidden !important;

    cursor: pointer !important;
}


/*
 * La X se dibuja geométricamente, evitando la
 * desalineación vertical del carácter tipográfico ×.
 */
html body #cobocito-root
button#cobocito-close::before,

html body #cobocito-root
button#cobocito-close::after {
    content: "" !important;

    position: absolute !important;

    top: 50% !important;
    left: 50% !important;

    display: block !important;

    width: 16px !important;
    height: 2px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 2px !important;

    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;

    box-shadow: none !important;

    pointer-events: none !important;

    transform-origin: center center !important;
}


html body #cobocito-root
button#cobocito-close::before {
    transform:
        translate(-50%, -50%)
        rotate(45deg)
        !important;
}


html body #cobocito-root
button#cobocito-close::after {
    transform:
        translate(-50%, -50%)
        rotate(-45deg)
        !important;
}


/*
 * Hover, teclado y pulsación:
 * nunca debe aparecer el fondo negro heredado del tema.
 */
html body #cobocito-root
button#cobocito-close:hover,

html body #cobocito-root
button#cobocito-close:focus,

html body #cobocito-root
button#cobocito-close:focus-visible,

html body #cobocito-root
button#cobocito-close:active {
    border: 0 !important;

    background:
        rgba(255, 255, 255, 0.12)
        !important;

    background-color:
        rgba(255, 255, 255, 0.12)
        !important;

    background-image: none !important;

    color: transparent !important;

    box-shadow: none !important;

    outline: none !important;

    transform: none !important;
}


/*
 * Focus visible accesible, discreto y coherente
 * con el encabezado verde.
 */
html body #cobocito-root
button#cobocito-close:focus-visible {
    box-shadow:
        inset 0 0 0 2px
        rgba(255, 255, 255, 0.55)
        !important;
}
