/* 2.9.62 · Small-screen interaction polish; no desktop layout overrides.
 * Keep the approved page rhythm, search geometry, logos and card sizes.
 */
@media(max-width:860px){
  body.branchentrainer-site .bt-mobile-nav>summary{
    display:flex!important;
    align-items:center;
    justify-content:center;
    min-width:44px!important;
    min-height:44px!important;
    padding:8px!important;
    line-height:1!important;
    box-sizing:border-box;
  }
  body.branchentrainer-site .bt-mobile-panel{
    top:calc(100% + 20px)!important;
    right:0!important;
    width:min(330px,calc(100vw - 56px))!important;
    max-height:calc(100vh - 120px - env(safe-area-inset-bottom));
    max-height:calc(100dvh - 120px - env(safe-area-inset-bottom));
    overflow-y:auto;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
  }

  /* Hide only our closed launcher over protected content; never third-party
     chat buttons, an open dialog, or the header's regular contact link. */
  #bt-first-conversation-assistant[data-state="closed"].bt-mobile-content-visible .bt-first-conversation-launcher,
  #bt-first-conversation-assistant[data-state="closed"].bt-mobile-menu-visible .bt-first-conversation-launcher{
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }

  /* Short phones and landscape: fixed header/footer, scrollable dialog body.
     The close control stays below the sticky site header. */
  .bt-first-conversation-dialog:not([hidden]){
    display:flex;
    flex-direction:column;
    position:fixed;
    right:12px;
    bottom:calc(12px + env(safe-area-inset-bottom));
    width:min(410px,calc(100vw - 24px));
    max-height:min(680px,calc(100vh - 112px - env(safe-area-inset-bottom)));
    max-height:min(680px,calc(100dvh - 112px - env(safe-area-inset-bottom)));
  }
  .bt-first-conversation-dialog .bt-first-conversation-header,
  .bt-first-conversation-dialog .bt-first-conversation-footer{flex:0 0 auto}
  .bt-first-conversation-dialog .bt-first-conversation-content{
    flex:1 1 auto;
    min-height:0;
    max-height:none;
    overflow-y:auto;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
  }
}
