/**
 * Vanessa — mobile premium (dopo vanessa-widget-composer.css)
 * Pattern allineato a Elements concierge: fullscreen, sticky chrome, safe-area,
 * touch scroll. visualViewport: vanessa-widget.js (prompt 3+).
 * Step 5: tipografia mobile, nero #0a0a0a, touch 44px. Agente 19px + padding-right.
 */

@media (max-width: 768px) {
    .bt-vanessa__fab {
        bottom: 16px;
        right: 16px;
    }

    body.bt-vanessa-open .bt-vanessa__fab {
        display: none;
    }

    .bt-vanessa__panel {
        inset: 0;
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        max-height: none;
        min-height: 0;
        display: flex;
        flex-direction: column;
        border-radius: 0;
        border: none;
        z-index: 9999;
        will-change: height, top;
        transition: none;
        background: #0a0a0a;
    }

    .bt-vanessa__header {
        position: sticky;
        top: 0;
        z-index: 10;
        flex-shrink: 0;
        height: 48px;
        padding: 0 12px 0 16px;
        background: #0a0a0a;
        border-bottom: 1px solid #1a1a1a;
    }

    .bt-vanessa__close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .bt-vanessa__main {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .bt-vanessa__messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        padding-left: 16px;
        padding-right: 16px;
        background: #0a0a0a;
    }

    .bt-vanessa__messages::after {
        background: linear-gradient(to bottom, transparent, #0a0a0a);
    }

    .bt-vanessa__msg--user {
        font-size: 17px;
        line-height: 1.6;
        max-width: 82%;
        margin-right: 0;
        border-radius: 20px;
        padding: 14px 18px;
        background: #222;
    }

    .bt-vanessa__msg--assistant {
        font-size: 19px;
        line-height: 1.7;
        background: transparent;
        padding: 4px 12px 4px 0;
    }

    .bt-vanessa__textarea {
        font-size: 17px;
    }

    .bt-vanessa__composer {
        position: sticky;
        bottom: 0;
        z-index: 11;
        flex-shrink: 0;
        background: #0a0a0a;
        border-top: 1px solid #1a1a1a;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 12px));
        border-radius: 0;
    }

    .bt-vanessa__input-row {
        padding-right: 4px;
    }

    .bt-vanessa__send-btn.bt-vanessa__send {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .bt-vanessa__scroll-down {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }
}

body.bt-vanessa-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}
