/* BTB Social Messages: iPhone viewport/scroll containment.
   Only the inbox's active content pane scrolls; the page and chrome stay fixed.
   Do not remove keyboard focus rings from actionable controls. */
@media (max-width:780px) {
 html:has(body.creator-inbox-screen) {
  height:100%;
  overflow:hidden!important;
  overscroll-behavior:none!important;
 }
 body.creator-inbox-screen {
  position:fixed!important;
  inset:0!important;
  box-sizing:border-box;
  width:100%!important;
  height:100dvh!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
 }
 body.creator-inbox-screen #view-inbox {
  position:fixed!important;
  z-index:12;
  top:62px;
  left:max(10px,env(safe-area-inset-left,0px));
  right:max(10px,env(safe-area-inset-right,0px));
  bottom:calc(76px + env(safe-area-inset-bottom,0px) + var(--btb-social-safari-bottom,0px));
  width:auto!important;
  min-width:0;
  max-width:none!important;
  min-height:0;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  padding:10px 0 2px;
  gap:0;
  overflow:hidden!important;
  overscroll-behavior:none;
  background:#0b1020;
  -webkit-tap-highlight-color:transparent;
 }
 /* iOS may focus the scroll section itself after dismissing the Notes modal.
    That should never paint a blue frame around the *entire* Messages screen. */
 body.creator-inbox-screen #view-inbox,
 body.creator-inbox-screen #view-inbox:focus,
 body.creator-inbox-screen #view-inbox:focus-visible,
 body.creator-inbox-screen #view-inbox:focus-within {
  outline:none!important;
  outline-offset:0!important;
  box-shadow:none!important;
  border:0!important;
 }
 /* Heading, note bubbles, tabs and their buttons are anchored in place. */
 body.creator-inbox-screen #view-inbox>.creator-messages-header,
 body.creator-inbox-screen #view-inbox>.creator-notes-rail,
 body.creator-inbox-screen #view-inbox>.creator-inbox-unread-summary,
 body.creator-inbox-screen #view-inbox>.creator-inbox-view-switch {
  flex:0 0 auto;
  min-width:0;
 }
 body.creator-inbox-screen #view-inbox>.creator-messages-header {
  margin:3px 3px 9px;
 }
 body.creator-inbox-screen #view-inbox>.creator-notes-rail {
  margin:2px 0 8px;
  padding-bottom:4px;
 }
 body.creator-inbox-screen #view-inbox .creator-notes-list {
  overflow-x:auto!important;
  overflow-y:hidden!important;
  overscroll-behavior-x:contain;
  touch-action:pan-x;
 }
 body.creator-inbox-screen #view-inbox>.creator-inbox-view-switch {
  margin:4px 0 9px;
 }
 body.creator-inbox-screen #view-inbox>.creator-message-compose-start {
  flex:0 1 auto;
  min-height:0;
  max-height:34%;
  overflow-y:auto;
  overscroll-behavior:contain;
 }
 /* The only independently scrolling panes on the inbox screen. */
 body.creator-inbox-screen #view-inbox>#inbox-conversations,
 body.creator-inbox-screen #view-inbox>#creator-message-requests,
 body.creator-inbox-screen #view-inbox>#creator-group-chat {
  flex:1 1 auto;
  min-height:0;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y;
  margin-bottom:0!important;
 }
 body.creator-inbox-screen #view-inbox #inbox-conversations .creator-inbox-heading {
  position:sticky;
  top:0;
  z-index:2;
  background:#0b1020;
 }
 /* In an open DM, keep the sheet stable and scroll ONLY message history. */
 body.creator-inbox-screen.creator-chat-open #view-inbox #inbox-thread-panel {
  left:0!important;
  right:0!important;
  width:100%!important;
  max-width:100vw!important;
  overscroll-behavior:contain;
 }
 body.creator-inbox-screen.creator-chat-open #view-inbox #inbox-thread-messages {
  overscroll-behavior-y:contain;
  touch-action:pan-y;
 }
}
