/* FPC Wire v2.5.1d — Mobile Messages Inbox First */
@media(max-width:799px){
  .messages-page-header{
    position:sticky;
    top:0;
    z-index:20;
    background:#07111d;
  }

  .messages-shell{
    display:block!important;
    min-height:calc(100dvh - 130px - env(safe-area-inset-bottom))!important;
  }

  /* /messages: show the inbox and never an empty thread panel. */
  .messages-shell:not(.has-active-thread) .conversation-sidebar{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    border-right:0!important;
  }
  .messages-shell:not(.has-active-thread) .message-thread-panel{
    display:none!important;
  }

  /* /messages/{id}: show only the selected conversation. */
  .messages-shell.has-active-thread .conversation-sidebar{
    display:none!important;
  }
  .messages-shell.has-active-thread .message-thread-panel{
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    width:100%!important;
    min-width:0!important;
    min-height:calc(100dvh - 76px - env(safe-area-inset-bottom))!important;
  }

  .conversation-list{
    display:grid!important;
    width:100%!important;
  }

  .conversation-row{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr) auto!important;
    gap:12px!important;
    align-items:center!important;
    min-height:76px!important;
    padding:12px 14px!important;
  }

  .conversation-copy{
    min-width:0!important;
  }
  .conversation-copy > span{
    display:block!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  .message-thread-header{
    position:sticky!important;
    top:0!important;
    z-index:25!important;
    background:#07111d!important;
  }

  .message-back-link{
    display:grid!important;
    place-items:center!important;
    width:42px!important;
    height:42px!important;
    flex:0 0 42px!important;
    border-radius:999px!important;
    font-size:34px!important;
    text-decoration:none!important;
  }

  .message-thread{
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
  }

  .message-composer{
    position:sticky!important;
    bottom:calc(68px + env(safe-area-inset-bottom))!important;
    z-index:30!important;
    background:#07111d!important;
  }

  body.wire-message-keyboard-open .message-composer{
    bottom:0!important;
  }
}
