/* SLPT MOB_01 private QA v3: mobile touch keyboard viewport clearance only. */
@media screen and (max-width:900px) and (pointer:coarse){
  html[data-slpt-edit-focus="true"] .msg-shell.msg-thread-open .msg-layout{
    min-height:0!important;
    height:max(180px,calc(var(--slpt-visible-height,100svh) - 122px))!important;
    max-height:calc(var(--slpt-visible-height,100svh) - 8px)!important;
  }
  html[data-slpt-edit-focus="true"] .msg-shell.msg-thread-open .msg-conversation{
    min-height:0!important;max-height:100%!important;overflow:hidden!important;
  }
  html[data-slpt-edit-focus="true"] .msg-shell.msg-thread-open .msg-history{
    flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  html[data-slpt-edit-focus="true"] .msg-shell.msg-thread-open .msg-compose{
    flex:0 0 auto!important;min-height:0!important;position:relative;z-index:2;
    padding:7px 10px max(8px,env(safe-area-inset-bottom,0px))!important;
  }
  html[data-slpt-edit-focus="true"] .msg-shell.msg-thread-open .msg-compose textarea{
    min-height:38px!important;max-height:64px!important;resize:none!important;
  }
  html[data-slpt-edit-focus="true"] .msg-shell.msg-thread-open .msg-compose-foot{
    flex-wrap:wrap!important;align-items:center!important;
  }
  html[data-slpt-edit-focus="true"] .msg-shell.msg-thread-open .msg-primary{
    min-height:42px!important;flex:0 0 auto!important;
  }
  /* Client shell already maintains these viewport flags independently. */
  html[data-ui2-edit-focus="true"][data-ui-device="mobile"][data-route="messages"] .ui2-messages-workspace{
    min-height:0!important;
    height:max(180px,calc(var(--ui2-touch-viewport-height,100svh) - 118px))!important;
    max-height:calc(var(--ui2-touch-viewport-height,100svh) - 8px)!important;
  }
  html[data-ui2-edit-focus="true"][data-ui-device="mobile"][data-route="messages"] .ui2-messages-thread{
    min-height:0!important;max-height:100%!important;overflow:hidden!important;
  }
  html[data-ui2-edit-focus="true"][data-ui-device="mobile"][data-route="messages"] .ui2-messages-thread-body{
    min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;
  }
  html[data-ui2-edit-focus="true"][data-ui-device="mobile"][data-route="messages"] .ui2-messages-composer{
    position:sticky!important;bottom:0!important;z-index:3!important;
    padding-bottom:max(8px,env(safe-area-inset-bottom,0px))!important;
    background:rgba(9,15,20,.98)!important;
  }
  html[data-ui2-edit-focus="true"][data-ui-device="mobile"][data-route="messages"] .ui2-messages-composer button{
    min-height:44px!important;min-width:44px!important;
  }
  html[data-slpt-edit-focus="true"] .s23-dialog[open] .s23-dialog-card{
    min-height:0!important;max-height:100%!important;
  }
  html[data-slpt-edit-focus="true"] #slptCalendarDialogPortal .cal-edit-modal{
    max-height:100%!important;min-height:0!important;overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  html[data-slpt-edit-focus="true"] #slptCalendarDialogPortal .cal-edit-modal form footer{
    position:sticky!important;bottom:0!important;z-index:4!important;
  }
}
