/* =========================================================
   PENÍNSULA — WIDGET GLOBAL DE ASISTENCIA
   /redesign/css/widget.css
========================================================= */

.pen-assistant {
    --assistant-navy: #011e41;
    --assistant-teal: #285766;
    --assistant-green: #009b67;
    --assistant-border: #161616;
    --assistant-muted: #626262;
    --assistant-panel-width: 350px;

    /*
     * FIX INTERACTIVO:
     * el wrapper ahora ocupa realmente todo el alto del viewport.
     * Antes tenía height:0; los elementos podían verse pero el
     * hit-testing podía ser inconsistente.
     */
    position:
        fixed;

    z-index:
        100050;

    top:
        0;

    right:
        0;

    width:
        calc(
            var(--assistant-panel-width)
            + 106px
        );

    height:
        100vh;

    height:
        100dvh;

    transform:
        none;

    /*
     * El wrapper completo NO bloquea el sitio.
     * Solo rail y panel reciben interacción.
     */
    pointer-events:
        none;

    font-family:
        var(
            --font-ui,
            "SF Pro Text",
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            Arial,
            sans-serif
        );
}


/* =========================================================
   RAIL INACTIVO
========================================================= */

.pen-assistant__rail {
    position:
        absolute;

    pointer-events:
        auto;

    top:
        50%;

    right:
        14px;

    width:
        68px;

    padding:
        15px
        9px;

    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    gap:
        14px;

    background:
        #ffffff;

    border:
        1.5px solid
        var(--assistant-border);

    border-radius:
        999px;

    box-shadow:
        0 7px 14px
        rgba(0,0,0,.18);

    transform:
        translateY(-50%);

    transition:
        padding .35s ease,
        gap .35s ease,
        transform .45s cubic-bezier(.16,1,.3,1),
        box-shadow .35s ease;

    isolation:
        isolate;
}


.pen-assistant__rail-button,
.pen-assistant__rail-link {
    appearance:
        none;

    width:
        42px;

    height:
        42px;

    flex:
        0 0 42px;

    padding:
        0;

    display:
        grid;

    place-items:
        center;

    color:
        #000000;

    background:
        transparent;

    border:
        0;

    border-radius:
        50%;

    text-decoration:
        none;

    cursor:
        pointer;

    transition:
        transform .26s cubic-bezier(.16,1,.3,1),
        background-color .24s ease,
        opacity .24s ease;
}


.pen-assistant__rail-button:hover,
.pen-assistant__rail-link:hover {
    transform:
        scale(1.10);
}


.pen-assistant__rail-button:focus-visible,
.pen-assistant__rail-link:focus-visible,
.pen-assistant__close:focus-visible,
.pen-assistant__primary:focus-visible,
.pen-assistant__mini:focus-visible,
.pen-assistant__help-option:focus-visible {
    outline:
        3px solid
        rgba(64,128,151,.28);

    outline-offset:
        3px;
}


.pen-assistant__rail-icon {
    width:
        39px;

    height:
        39px;

    display:
        grid;

    place-items:
        center;

    border-radius:
        50%;

    background:
        #ffffff;

    box-shadow:
        0 5px 8px
        rgba(0,0,0,.22);
}


.pen-assistant__rail-icon img {
    width:
        30px;

    height:
        30px;

    object-fit:
        contain;
}


.pen-assistant__rail-link img {
    display:
        block;

    width:
        26px;

    height:
        26px;

    object-fit:
        contain;
}


.pen-assistant__rail-link:last-child img {
    width:
        27px;

    height:
        27px;
}


.pen-assistant__rail-divider {
    width:
        42px;

    height:
        1px;

    margin:
        -2px 0 0;

    background:
        rgba(0,0,0,.08);

    transition:
        opacity .28s ease,
        height .28s ease,
        margin .28s ease;
}


/* Cuando el chat está activo, el rail conserva solo redes. */
/*
 * Chat abierto:
 * el botón Chat permanece visible.
 */
.pen-assistant.is-open
.pen-assistant__rail-divider,
.pen-assistant.is-closing
.pen-assistant__rail-divider {
    height:
        0;

    margin:
        0;

    opacity:
        0;

    overflow:
        hidden;
}


.pen-assistant.is-open
.pen-assistant__rail,
.pen-assistant.is-closing
.pen-assistant__rail {
    gap:
        13px;

    padding-top:
        15px;

    padding-bottom:
        15px;
}


/* =========================================================
   PANEL
========================================================= */

.pen-assistant__panel {
    position:
        absolute;

    right:
        92px;

    top:
        50%;

    width:
        var(--assistant-panel-width);

    height:
        min(
            560px,
            calc(100vh - 28px)
        );

    height:
        min(
            560px,
            calc(100dvh - 28px)
        );

    overflow:
        hidden;

    color:
        #111111;

    background:
        #ffffff;

    border:
        1.5px solid
        var(--assistant-border);

    border-radius:
        7px;

    box-shadow:
        0 14px 34px
        rgba(0,0,0,.14);

    /*
     * Cerrado = fuera del árbol visual/interactivo.
     * Esto evita que el panel invisible interfiera con scroll,
     * hit-testing o gestos del viewport.
     */
    display:
        none;

    pointer-events:
        none;

    transform:
        translate3d(
            0,
            -50%,
            0
        )
        scale(1);

    transform-origin:
        right center;
}


.pen-assistant.is-open
.pen-assistant__panel {
    display:
        block;

    pointer-events:
        auto;

    /*
     * Fade in real al mostrar el panel.
     */
    animation:
        penAssistantPanelFadeIn
        .36s
        cubic-bezier(.22,1,.36,1)
        both;
}


/*
 * Durante el cierre el panel sigue en display:block
 * únicamente mientras termina el fade out.
 * JS elimina .is-closing al final y vuelve automáticamente
 * al display:none del estado base.
 */
.pen-assistant.is-closing
.pen-assistant__panel {
    display:
        block;

    pointer-events:
        none;

    animation:
        penAssistantPanelFadeOut
        .30s
        cubic-bezier(.4,0,.2,1)
        both;
}


@keyframes penAssistantPanelFadeIn {

    from {
        opacity:
            0;

        transform:
            translate3d(
                16px,
                -50%,
                0
            )
            scale(.985);
    }

    to {
        opacity:
            1;

        transform:
            translate3d(
                0,
                -50%,
                0
            )
            scale(1);
    }

}


@keyframes penAssistantPanelFadeOut {

    from {
        opacity:
            1;

        transform:
            translate3d(
                0,
                -50%,
                0
            )
            scale(1);
    }

    to {
        opacity:
            0;

        transform:
            translate3d(
                14px,
                -50%,
                0
            )
            scale(.99);
    }

}


/* =========================================================
   CLOSE
========================================================= */

.pen-assistant__close {
    position:
        absolute;

    z-index:
        10;

    top:
        16px;

    right:
        16px;

    width:
        25px;

    height:
        25px;

    padding:
        0;

    display:
        grid;

    place-items:
        center;

    color:
        var(--assistant-navy);

    background:
        transparent;

    border:
        0;

    cursor:
        pointer;

    transition:
        transform .25s ease,
        opacity .25s ease;
}


.pen-assistant__close:hover {
    transform:
        rotate(7deg)
        scale(1.08);

    opacity:
        .78;
}


.pen-assistant__close svg {
    width:
        24px;

    height:
        24px;

    fill:
        none;

    stroke:
        currentColor;

    stroke-width:
        1.8;

    stroke-linecap:
        round;

    stroke-linejoin:
        round;
}


/* =========================================================
   VIEWS / TRANSICIONES
========================================================= */

.pen-assistant__view {
    position:
        absolute;

    inset:
        0;

    padding:
        28px
        20px
        16px;

    display:
        flex;

    flex-direction:
        column;

    overflow-y:
        auto;

    overscroll-behavior:
        contain;

    scrollbar-width:
        thin;

    opacity:
        0;

    visibility:
        hidden;

    pointer-events:
        none;

    transform:
        translateX(16px);

    transition:
        opacity .24s ease,
        visibility 0s linear .28s,
        transform .34s cubic-bezier(.16,1,.3,1);
}


.pen-assistant__view.is-active {
    opacity:
        1;

    visibility:
        visible;

    pointer-events:
        auto;

    transform:
        translateX(0);

    transition-delay:
        0s;
}


.pen-assistant__view.is-leaving-left {
    opacity:
        0;

    transform:
        translateX(-16px);
}


.pen-assistant__view.is-entering-back {
    transform:
        translateX(-16px);
}


/* =========================================================
   BRAND
========================================================= */

.pen-assistant__brand {
    flex:
        0 0 auto;
}


.pen-assistant__brand img {
    display:
        block;

    width:
        42px;

    height:
        42px;

    object-fit:
        contain;
}


.pen-assistant__brand--center {
    margin:
        2px auto
        7px;
}


.pen-assistant__brand--help {
    margin-top:
        86px;
}


.pen-assistant__brand--success {
    margin:
        -12px
        0
        0
        -4px;
}


/* =========================================================
   TITLES
========================================================= */

.pen-assistant__title {
    margin:
        0 0
        10px;

    color:
        var(--assistant-navy);

    font-size:
        18px;

    font-weight:
        600;

    line-height:
        1.15;

    text-align:
        center;

    letter-spacing:
        -.02em;
}


/* =========================================================
   PROFILE FORM
========================================================= */

.pen-assistant__profile {
    display:
        flex;

    flex-direction:
        column;

    flex:
        1;
}


.pen-assistant__field {
    margin-bottom:
        11px;
}


.pen-assistant__field label {
    display:
        block;

    margin:
        0 0
        6px;

    color:
        #111111;

    font-size:
        13px;

    font-weight:
        400;

    line-height:
        1.15;
}


.pen-assistant__field input {
    width:
        100%;

    height:
        49px;

    padding:
        0
        17px;

    color:
        #111111;

    background:
        #ffffff;

    border:
        1px solid
        #696969;

    border-radius:
        999px;

    outline:
        none;

    font:
        inherit;

    font-size:
        15px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background-color .2s ease;
}


.pen-assistant__field input:focus {
    border-color:
        var(--assistant-teal);

    box-shadow:
        0 0 0 3px
        rgba(40,87,102,.12);
}


.pen-assistant__field.is-error
input {
    border-color:
        #a43232;

    background:
        #fffafa;
}


.pen-assistant__error,
.pen-assistant__help-error {
    display:
        block;

    min-height:
        0;

    margin-top:
        4px;

    color:
        #a43232;

    font-size:
        10px;

    line-height:
        1.15;
}


.pen-assistant__field.is-error
input {
    animation:
        penAssistantFieldShake
        .28s ease;
}


@keyframes penAssistantFieldShake {

    0%,
    100% {
        transform:
            translateX(0);
    }

    35% {
        transform:
            translateX(-3px);
    }

    70% {
        transform:
            translateX(3px);
    }

}


/* =========================================================
   PRIMARY ACTION
========================================================= */

.pen-assistant__actions {
    display:
        flex;

    justify-content:
        center;

    margin-top:
        4px;
}


.pen-assistant__primary {
    appearance:
        none;

    min-width:
        138px;

    min-height:
        45px;

    padding:
        9px
        20px;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    gap:
        12px;

    color:
        #ffffff;

    background:
        var(--assistant-teal);

    border:
        1px solid
        var(--assistant-teal);

    border-radius:
        4px;

    font:
        inherit;

    font-size:
        15px;

    font-weight:
        400;

    cursor:
        pointer;

    transition:
        transform .24s ease,
        box-shadow .24s ease,
        background-color .24s ease;
}


.pen-assistant__primary:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 8px 16px
        rgba(40,87,102,.19);
}


.pen-assistant__primary svg {
    width:
        16px;

    height:
        16px;

    fill:
        none;

    stroke:
        currentColor;

    stroke-width:
        2;

    stroke-linecap:
        round;

    stroke-linejoin:
        round;
}


/* =========================================================
   MINI ASSISTANT CHIP
========================================================= */

.pen-assistant__mini {
    appearance:
        none;

    min-width:
        150px;

    height:
        51px;

    margin:
        auto
        0
        0
        auto;

    padding:
        5px
        12px
        5px
        7px;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        flex-start;

    gap:
        8px;

    color:
        #111111;

    background:
        #ffffff;

    border:
        1px solid
        #111111;

    border-radius:
        8px;

    font:
        inherit;

    font-size:
        12px;

    font-weight:
        500;

    cursor:
        pointer;

    transition:
        transform .22s ease,
        box-shadow .22s ease;
}


.pen-assistant__mini:hover {
    transform:
        translateY(-1px);

    box-shadow:
        0 5px 12px
        rgba(0,0,0,.10);
}


.pen-assistant__mini-icon {
    width:
        41px;

    height:
        41px;

    display:
        grid;

    place-items:
        center;

    flex:
        0 0 41px;

    border-radius:
        50%;

    background:
        #ffffff;

    box-shadow:
        0 5px 8px
        rgba(0,0,0,.22);
}


.pen-assistant__mini-icon img {
    width:
        29px;

    height:
        29px;

    object-fit:
        contain;
}


/* =========================================================
   STEP 2 — HELP TYPES
========================================================= */

.pen-assistant__help-types {
    display:
        grid;

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

    gap:
        8px;

    margin-top:
        56px;
}


.pen-assistant__help-option {
    appearance:
        none;

    min-width:
        0;

    min-height:
        34px;

    padding:
        5px
        9px;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    gap:
        6px;

    color:
        #171717;

    background:
        #ffffff;

    border:
        1px solid
        #666666;

    border-radius:
        999px;

    font:
        inherit;

    font-size:
        13px;

    line-height:
        1;

    white-space:
        nowrap;

    cursor:
        pointer;

    transition:
        color .22s ease,
        background-color .22s ease,
        border-color .22s ease,
        transform .22s ease;
}


.pen-assistant__help-option:hover {
    transform:
        translateY(-1px);
}


.pen-assistant__help-option[aria-pressed="true"] {
    color:
        #ffffff;

    background:
        var(--assistant-teal);

    border-color:
        var(--assistant-teal);
}


.pen-assistant__help-option svg {
    width:
        17px;

    height:
        17px;

    flex:
        0 0 auto;

    fill:
        none;

    stroke:
        currentColor;

    stroke-width:
        1.7;

    stroke-linecap:
        round;

    stroke-linejoin:
        round;
}


.pen-assistant__help-option--wide {
    grid-column:
        1 / -1;

    width:
        100%;
}


.pen-assistant__help-error {
    min-height:
        12px;

    margin:
        5px 0
        6px;

    text-align:
        center;
}


/* =========================================================
   MESSAGE
========================================================= */

.pen-assistant__message-wrap {
    position:
        relative;

    margin-top:
        17px;
}


.pen-assistant__message {
    width:
        100%;

    height:
        49px;

    min-height:
        49px;

    max-height:
        92px;

    padding:
        14px
        54px
        12px
        18px;

    color:
        #111111;

    background:
        #ffffff;

    border:
        1px solid
        #676767;

    border-radius:
        999px;

    outline:
        none;

    resize:
        none;

    overflow:
        hidden;

    font:
        inherit;

    font-size:
        14px;

    line-height:
        1.3;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}


.pen-assistant__message::placeholder {
    color:
        #c6c6c6;

    opacity:
        1;
}


.pen-assistant__message:focus {
    border-color:
        var(--assistant-teal);

    box-shadow:
        0 0 0 3px
        rgba(40,87,102,.10);
}


.pen-assistant__send-icon {
    position:
        absolute;

    top:
        50%;

    right:
        15px;

    width:
        24px;

    height:
        24px;

    display:
        grid;

    place-items:
        center;

    color:
        #ffffff;

    background:
        #83c7eb;

    border-radius:
        50%;

    transform:
        translateY(-50%);

    pointer-events:
        none;
}


.pen-assistant__send-icon svg {
    width:
        15px;

    height:
        15px;

    fill:
        none;

    stroke:
        currentColor;

    stroke-width:
        1.7;

    stroke-linecap:
        round;

    stroke-linejoin:
        round;
}


/* Step 2 spacing */
.pen-assistant__view[data-assistant-view="2"]
.pen-assistant__actions {
    margin-top:
        18px;
}


/* =========================================================
   SUCCESS
========================================================= */

.pen-assistant__view--success {
    padding-top:
        24px;
}


.pen-assistant__success-content {
    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    flex:
        1;

    min-height:
        0;
}


.pen-assistant__success-check {
    width:
        62px;

    height:
        62px;

    margin-top:
        66px;

    color:
        var(--assistant-green);
}


.pen-assistant__success-check svg {
    width:
        100%;

    height:
        100%;

    fill:
        none;

    stroke:
        currentColor;

    stroke-width:
        4.4;

    stroke-linecap:
        round;

    stroke-linejoin:
        round;
}


.pen-assistant__success-title {
    margin:
        10px 0
        18px;

    color:
        var(--assistant-navy);

    font-size:
        18px;

    font-weight:
        600;

    line-height:
        1.25;

    text-align:
        center;

    letter-spacing:
        -.02em;
}


.pen-assistant__buildings {
    width:
        calc(100% + 40px);

    max-width:
        none;

    height:
        auto;

    margin-top:
        auto;

    margin-left:
        -20px;

    margin-right:
        -20px;

    opacity:
        .70;

    object-fit:
        contain;

    object-position:
        center bottom;
}


/* =========================================================
   DESKTOP COMPACT
========================================================= */

@media (max-height: 650px)
and
(min-width: 601px) {

    .pen-assistant__panel {
        height:
            calc(100dvh - 20px);
    }


    .pen-assistant__view {
        padding-top:
            18px;

        padding-bottom:
            12px;
    }


    .pen-assistant__field input {
        height:
            43px;
    }


    .pen-assistant__field {
        margin-bottom:
            7px;
    }


    .pen-assistant__help-types {
        margin-top:
            26px;
    }


    .pen-assistant__brand--help {
        margin-top:
            50px;
    }


    .pen-assistant__success-check {
        margin-top:
            38px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .pen-assistant {
        right:
            6px;

        width:
            64px;
    }


    .pen-assistant__rail {
        width:
            64px;

        padding-left:
            8px;

        padding-right:
            8px;
    }


    /*
     * En estado activo la tarjeta ocupa prácticamente
     * el ancho del viewport, como las referencias.
     */
    .pen-assistant__panel {
        position:
            fixed;

        top:
            6px;

        left:
            6px;

        right:
            6px;

        width:
            auto;

        height:
            min(
                560px,
                calc(100dvh - 148px)
            );

        transform:
            translate3d(
                0,
                -12px,
                0
            )
            scale(.99);

        transform-origin:
            center top;
    }


    .pen-assistant.is-open
    .pen-assistant__panel {
        transform:
            translate3d(
                0,
                0,
                0
            )
            scale(1);
    }


    /*
     * El rail social queda bajo la tarjeta activa,
     * alineado a la derecha como en las capturas.
     */
    .pen-assistant.is-open {
        top:
            auto;

        bottom:
            8px;

        transform:
            none;
    }


    .pen-assistant.is-open
    .pen-assistant__rail {
        top:
            auto;

        bottom:
            0;

        transform:
            none;
    }


    .pen-assistant__view {
        padding:
            27px
            20px
            16px;
    }


    .pen-assistant__brand--help {
        margin-top:
            84px;
    }


    .pen-assistant__success-check {
        margin-top:
            64px;
    }

}


/* =========================================================
   SMALL MOBILE / SHORT VIEWPORT
========================================================= */

@media (max-width: 380px) {

    .pen-assistant__panel {
        left:
            5px;

        right:
            5px;
    }


    .pen-assistant__view {
        padding-left:
            16px;

        padding-right:
            16px;
    }


    .pen-assistant__help-option {
        padding-left:
            6px;

        padding-right:
            6px;

        font-size:
            12px;
    }

}


@media (max-height: 650px)
and
(max-width: 600px) {

    .pen-assistant__panel {
        height:
            calc(100dvh - 92px);
    }


    .pen-assistant.is-open
    .pen-assistant__rail {
        display:
            none;
    }


    .pen-assistant__brand--help {
        margin-top:
            32px;
    }


    .pen-assistant__success-check {
        margin-top:
            30px;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

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

    .pen-assistant *,
    .pen-assistant *::before,
    .pen-assistant *::after {
        animation:
            none !important;

        transition:
            none !important;

        scroll-behavior:
            auto !important;
    }

}


/* =========================================================
   WIDGET — FIX DE INTERACCIÓN / HIT AREA
   2026-08-25
========================================================= */

.pen-assistant__rail,
.pen-assistant.is-open .pen-assistant__panel {
    pointer-events:
        auto;
}


/*
 * Asegura que el botón del chat siempre quede por encima de
 * cualquier contenido interno del rail y reciba el clic.
 */
.pen-assistant__rail-chat {
    position:
        relative;

    z-index:
        5;

    pointer-events:
        auto;

    touch-action:
        manipulation;
}


/*
 * Evita que la propia imagen SVG capture eventos por separado.
 * El clic siempre termina en el <button>.
 */
.pen-assistant__rail-chat img,
.pen-assistant__rail-chat span,
.pen-assistant__rail-link img {
    pointer-events:
        none;
}


@media (max-width: 600px) {

    .pen-assistant {
        top:
            0;

        right:
            0;

        bottom:
            auto;

        width:
            100vw;

        height:
            100vh;

        height:
            100dvh;

        transform:
            none;

        pointer-events:
            none;
    }


    .pen-assistant__rail {
        right:
            6px;

        top:
            50%;

        bottom:
            auto;

        transform:
            translateY(-50%);

        pointer-events:
            auto;
    }


    .pen-assistant.is-open {
        top:
            0;

        right:
            0;

        bottom:
            auto;

        transform:
            none;
    }


    .pen-assistant.is-open
    .pen-assistant__rail {
        top:
            auto;

        right:
            6px;

        bottom:
            8px;

        transform:
            none;
    }

}

/* =========================================================
   CHAT ACTIVE — FINAL
========================================================= */

.pen-assistant.is-open
.pen-assistant__rail-chat,
.pen-assistant.is-closing
.pen-assistant__rail-chat {
    color:
        #ffffff;

    background:
        #111111;

    box-shadow:
        0 5px 12px
        rgba(0,0,0,.18);

    transform:
        scale(1.04);
}


.pen-assistant.is-open
.pen-assistant__rail-chat
.pen-assistant__rail-icon,
.pen-assistant.is-closing
.pen-assistant__rail-chat
.pen-assistant__rail-icon {
    background:
        transparent;

    box-shadow:
        none;
}


.pen-assistant.is-open
.pen-assistant__rail-chat img,
.pen-assistant.is-closing
.pen-assistant__rail-chat img {
    filter:
        brightness(0)
        invert(1);
}


.pen-assistant__rail-chat {
    transition:
        color .28s ease,
        background-color .28s ease,
        box-shadow .28s ease,
        transform .28s cubic-bezier(.16,1,.3,1);
}


.pen-assistant__rail-chat
.pen-assistant__rail-icon,
.pen-assistant__rail-chat img {
    transition:
        background-color .28s ease,
        box-shadow .28s ease,
        filter .28s ease;
}


/* Fallback por caché de markup anterior */
.pen-assistant__mini {
    display:
        none !important;
}


/* =========================================================
   MOBILE — DISPLAY NONE/BLOCK ANIMATION
========================================================= */

@media (max-width: 600px) {

    .pen-assistant.is-open
    .pen-assistant__panel {
        animation:
            penAssistantPanelFadeInMobile
            .34s
            cubic-bezier(.22,1,.36,1)
            both;
    }


    .pen-assistant.is-closing
    .pen-assistant__panel {
        animation:
            penAssistantPanelFadeOutMobile
            .28s
            cubic-bezier(.4,0,.2,1)
            both;
    }

}


@keyframes penAssistantPanelFadeInMobile {

    from {
        opacity:
            0;

        transform:
            translate3d(
                0,
                -12px,
                0
            )
            scale(.99);
    }

    to {
        opacity:
            1;

        transform:
            translate3d(
                0,
                0,
                0
            )
            scale(1);
    }

}


@keyframes penAssistantPanelFadeOutMobile {

    from {
        opacity:
            1;

        transform:
            translate3d(
                0,
                0,
                0
            )
            scale(1);
    }

    to {
        opacity:
            0;

        transform:
            translate3d(
                0,
                -10px,
                0
            )
            scale(.99);
    }

}



/* Burbuja única, fija abajo a la derecha en escritorio y móvil. */
.pen-assistant,
.pen-assistant.is-open,
.pen-assistant.is-closing {
    --assistant-bubble-size: 64px;
    --assistant-edge: 20px;
    --assistant-right: max(var(--assistant-edge), env(safe-area-inset-right));
    --assistant-bottom: max(var(--assistant-edge), env(safe-area-inset-bottom));
    top: auto;
    right: var(--assistant-right);
    bottom: calc(var(--assistant-bottom) + var(--assistant-keyboard-inset, 0px));
    width: var(--assistant-bubble-size);
    height: var(--assistant-bubble-size);
    transform: none;
}

.pen-assistant .pen-assistant__rail,
.pen-assistant.is-open .pen-assistant__rail,
.pen-assistant.is-closing .pen-assistant__rail {
    top: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: 100%;
    padding: 0;
    gap: 0;
    display: flex;
    justify-content: center;
    transform: none;
}

.pen-assistant .pen-assistant__rail-chat {
    width: 100%;
    height: 100%;
    flex: 1;
}

.pen-assistant .pen-assistant__panel {
    position: absolute;
    top: auto;
    left: auto;
    right: 0;
    bottom: calc(var(--assistant-bubble-size) + 12px);
    width: min(var(--assistant-panel-width), calc(100vw - var(--assistant-right) - max(var(--assistant-edge), env(safe-area-inset-left))));
    height: min(560px, calc(var(--assistant-visible-height, 100dvh) - var(--assistant-bottom) - var(--assistant-bubble-size) - 28px));
    transform: none;
    transform-origin: bottom right;
}

.pen-assistant.is-open .pen-assistant__panel {
    animation-name: penAssistantBubbleIn;
}
.pen-assistant.is-closing .pen-assistant__panel {
    animation-name: penAssistantBubbleOut;
}

@keyframes penAssistantBubbleIn {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes penAssistantBubbleOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(10px) scale(.99); }
}

@media (max-width: 900px) {
    .pen-assistant,
    .pen-assistant.is-open,
    .pen-assistant.is-closing { --assistant-edge: 16px; }
    /* Evita el zoom automático al escribir en Safari móvil. */
    .pen-assistant__field input,
    .pen-assistant__message { font-size: 16px; }
}
