/* GG Master Compound V35 — deterministic inbox entry + stable DM-list exit layout.
   Additive on V34. No other GG surface is redesigned here. */
@media (max-width:900px){
  /* Inbox is always a normal document section after leaving a thread. */
  html.gg-mobile-v17 .messages-layout.mobile-inbox{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    overflow:visible!important;
  }
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    overflow:visible!important;
  }
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-thread{display:none!important}

  /* One stable Instagram-like row. Flex removes the stale grid coordinates that
     could survive presence/avatar wrapping after backing out of a conversation. */
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button{
    position:relative!important;
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:12px!important;
    width:100%!important;
    min-width:0!important;
    min-height:72px!important;
    margin:0!important;
    padding:8px 16px!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    text-align:start!important;
    overflow:visible!important;
    transform:none!important;
  }
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button+button{
    border-top:1px solid rgba(0,0,0,.035)!important;
  }
  html[data-theme="dark"].gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button+button{
    border-color:rgba(255,255,255,.06)!important;
  }
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button.active{
    background:transparent!important;
  }
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button:active{
    background:#f7f7f7!important;
  }
  html[data-theme="dark"].gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button:active{
    background:#171917!important;
  }

  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button>.gg-avatar,
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button>.avatar-fallback,
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button>.gg-v29-avatar-wrap,
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button>.gg-v32-presence-wrap,
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button>.gg-v33-presence-wrap{
    order:0!important;
    flex:0 0 56px!important;
    width:56px!important;
    height:56px!important;
    min-width:56px!important;
    min-height:56px!important;
    margin:0!important;
    inset:auto!important;
    transform:none!important;
    overflow:visible!important;
  }
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button .gg-avatar,
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button .avatar-fallback{
    width:56px!important;
    height:56px!important;
    min-width:56px!important;
    min-height:56px!important;
    margin:0!important;
    border-radius:50%!important;
    object-fit:cover!important;
    transform:none!important;
  }
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button>span:not(.gg-v29-avatar-wrap):not(.gg-v32-presence-wrap):not(.gg-v33-presence-wrap){
    order:1!important;
    flex:1 1 auto!important;
    display:block!important;
    width:auto!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
  }
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button>span>strong,
  html.gg-mobile-v17 .messages-layout.mobile-inbox>.conversation-inbox>button>span>small{
    width:100%!important;
    max-width:100%!important;
    margin-inline:0!important;
    transform:none!important;
  }
  html.gg-mobile-v17 .messages-layout.mobile-inbox .message-unread-count{
    order:2!important;
    flex:0 0 auto!important;
    position:static!important;
    margin:0!important;
    transform:none!important;
  }

  /* The green dot remains on the inbox avatar after exiting a thread. */
  html.gg-mobile-v17 .messages-layout.mobile-inbox .gg-v33-online-dot{
    display:block!important;
    width:15px!important;
    height:15px!important;
    bottom:1px!important;
    inset-inline-end:1px!important;
  }
}
