/* BM3 Android WebView: contain all Better Messages vertical scroll surfaces. */
html.hb-bm-wv-guard,
html.hb-bm-wv-guard body {
    overscroll-behavior-y: none !important;
}
html.hb-bm-wv-guard body {
    /* Native SwipeRefreshLayout often checks whether the WebView itself can
       scroll upward. Two harmless document pixels let JS park it at 1px. */
    min-height: calc(100vh + 2px) !important;
}
html.hb-bm-wv-guard .bm-wrap,
html.hb-bm-wv-guard .bm-wrap-main,
html.hb-bm-wv-guard .bm-single-thread-wrap,
html.hb-bm-wv-guard .bm-thread-col,
html.hb-bm-wv-guard .bm-msg-list-wrap,
html.hb-bm-wv-guard .bm-threads-list-widget,
html.hb-bm-wv-guard .bm-list-wrap,
html.hb-bm-wv-guard .bm-list-wrap .bm-list,
html.hb-bm-wv-guard .bm-msg-list,
html.hb-bm-wv-guard [data-overlayscrollbars-viewport] {
    overscroll-behavior-y: contain !important;
}
html.hb-bm-wv-guard .bm-list-wrap .bm-list,
html.hb-bm-wv-guard .bm-msg-list,
html.hb-bm-wv-guard [data-overlayscrollbars-viewport] {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
}

/* BM3 desktop + BuddyX/BuddyPress width containment.
 * Scoped to the BuddyPress Messages screen only so Activity, Groups, Members
 * and other BuddyPress layouts are not changed. Mobile keeps its native layout.
 */
@media (min-width: 769px) {
    body.bp-messages #buddypress .bp-wrap,
    body.bp-messages #buddypress #item-body,
    body.bp-messages #buddypress .bm-wrap-main {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
}
