/*
 * Floating launcher positioning
 * Desktop: button bottom-left, panel sits directly above it.
 * Phone/tablet: reserve the site's fixed 55px bottom navigation.
 * The launcher sits above it; when open, the panel also stops above it.
 */

.mwa-float-button{
    position:fixed!important;
    left:max(20px,env(safe-area-inset-left))!important;
    bottom:max(20px,env(safe-area-inset-bottom))!important;
    z-index:2147483000!important;
    width:58px!important;
    height:58px!important;
    min-width:0!important;
    min-height:0!important;
    padding:0!important;
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    border:0!important;
    border-radius:50%!important;
    background:#111827!important;
    color:#fff!important;
    box-shadow:0 10px 30px rgba(0,0,0,.28)!important;
    cursor:pointer!important;
    appearance:none!important;
    -webkit-appearance:none!important
}
.mwa-float-button svg{
    width:50%!important;
    height:50%!important;
    fill:currentColor!important;
    display:block!important
}

.mwa-float-panel{
    position:fixed!important;
    left:max(20px,env(safe-area-inset-left))!important;
    bottom:92px!important; /* 20px launcher offset + 58px button + 14px gap */
    z-index:2147483001!important;
    width:min(560px,calc(100vw - 40px))!important;
    height:min(80dvh,780px)!important;
    min-height:min(520px,calc(100dvh - 112px))!important;
    max-height:calc(100dvh - 112px)!important;
    display:none!important;
    flex-direction:column!important;
    background:#fff!important;
    border:1px solid #e5e7eb!important;
    border-radius:18px!important;
    overflow:hidden!important;
    box-shadow:0 24px 70px rgba(0,0,0,.28)!important
}
.mwa-float-panel.is-open{display:flex!important}

.mwa-float-topbar{
    height:clamp(46px,6vh,52px)!important;
    flex:0 0 clamp(46px,6vh,52px)!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    padding:0 clamp(10px,1.5vw,16px)!important;
    background:#111827!important;
    color:#fff!important;
    box-sizing:border-box!important
}
.mwa-float-topbar strong{color:#fff!important;font-size:15px!important}
.mwa-float-close{
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    min-height:34px!important;
    max-width:34px!important;
    max-height:34px!important;
    flex:0 0 34px!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    border-radius:50%!important;
    aspect-ratio:1/1!important;
    background:rgba(255,255,255,.12)!important;
    color:#fff!important;
    font-size:24px!important;
    line-height:1!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    box-sizing:border-box!important;
    cursor:pointer!important
}

.mwa-float-content{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow:hidden!important
}
.mwa-float-content .mwa-app.mwa-popup{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important
}
.mwa-float-content .mwa-app.mwa-popup .mwa-messages{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important
}
.mwa-float-content .mwa-app.mwa-popup .mwa-controls{
    flex:0 0 auto!important
}

/*
 * Phone + tablet layout
 * Site sticky bottom navigation is 55px high.
 * Reserve that zone for both the closed launcher and the open panel.
 * Safe-area is added on devices such as iPhone.
 */
@media(max-width:1024px){
    .mwa-float-button{
        left:max(12px,env(safe-area-inset-left))!important;
        bottom:calc(67px + env(safe-area-inset-bottom))!important; /* 55px footer + 12px gap */
        width:54px!important;
        height:54px!important;
        transition:opacity .16s ease,transform .16s ease!important
    }

    .mwa-float-button[aria-expanded="true"]{
        opacity:0!important;
        visibility:hidden!important;
        pointer-events:none!important;
        transform:scale(.92)!important
    }

    .mwa-float-panel{
        top:calc(8px + env(safe-area-inset-top))!important;
        right:calc(8px + env(safe-area-inset-right))!important;
        bottom:calc(63px + env(safe-area-inset-bottom))!important; /* 55px footer + 8px gap */
        left:calc(8px + env(safe-area-inset-left))!important;
        width:auto!important;
        height:auto!important;
        min-height:0!important;
        max-height:none!important;
        border-radius:16px!important
    }
}
