/* FPC Wire v2.3.1e2 — Mobile Notifications & Message Composer Repair */
@media (max-width:799px){

  /* Notification page: restore the real four-part mobile row. */
  body.wire-notifications-layout-fix [data-notification-card],
  [data-notification-card]{
    display:grid!important;
    grid-template-columns:auto auto minmax(0,1fr) auto!important;
    align-items:center!important;
    column-gap:10px!important;
    row-gap:2px!important;
    min-height:72px!important;
    padding:12px 14px!important;
    margin:0!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
    background:#0a1521!important;
  }

  body.wire-notifications-layout-fix [data-notification-card] > *,
  [data-notification-card] > *{
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    align-self:center!important;
  }

  /* Reaction/event icon. */
  body.wire-notifications-layout-fix [data-notification-card] > :nth-child(1),
  [data-notification-card] > :nth-child(1){
    grid-column:1!important;
  }

  /* Actor avatar. */
  body.wire-notifications-layout-fix [data-notification-card] > :nth-child(2),
  [data-notification-card] > :nth-child(2){
    grid-column:2!important;
    flex:none!important;
  }

  /* Main notification copy. */
  body.wire-notifications-layout-fix [data-notification-card] > :nth-child(3),
  [data-notification-card] > :nth-child(3){
    grid-column:3!important;
    display:block!important;
    width:auto!important;
    min-width:0!important;
    overflow:visible!important;
    color:#eef4fb!important;
    opacity:1!important;
    visibility:visible!important;
    white-space:normal!important;
    line-height:1.35!important;
  }

  body.wire-notifications-layout-fix [data-notification-card] > :nth-child(3) *,
  [data-notification-card] > :nth-child(3) *{
    opacity:1!important;
    visibility:visible!important;
  }

  body.wire-notifications-layout-fix [data-notification-card] > :nth-child(3) a,
  body.wire-notifications-layout-fix [data-notification-card] > :nth-child(3) strong,
  [data-notification-card] > :nth-child(3) a,
  [data-notification-card] > :nth-child(3) strong{
    color:#fff!important;
  }

  body.wire-notifications-layout-fix [data-notification-card] > :nth-child(3) small,
  body.wire-notifications-layout-fix [data-notification-card] > :nth-child(3) time,
  [data-notification-card] > :nth-child(3) small,
  [data-notification-card] > :nth-child(3) time{
    display:block!important;
    margin-top:2px!important;
    color:#8fa0b4!important;
    font-size:11px!important;
  }

  /* Read/check control stays at the far right only when present. */
  body.wire-notifications-layout-fix [data-notification-card] .notification-read-form,
  [data-notification-card] .notification-read-form{
    grid-column:4!important;
    justify-self:end!important;
    margin:0!important;
  }

  /* Cards with only three children: let the copy span through the last column. */
  body.wire-notifications-layout-fix [data-notification-card] > :nth-child(3):last-child,
  [data-notification-card] > :nth-child(3):last-child{
    grid-column:3 / 5!important;
  }

  /* Keep filter bar usable without distorting the page. */
  body.wire-notifications-layout-fix [data-notification-filters],
  [data-notification-filters]{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:8px!important;
    overflow-x:auto!important;
    padding:10px 14px 12px!important;
    margin:0!important;
    scrollbar-width:none!important;
  }

  body.wire-notifications-layout-fix [data-notification-filters]::-webkit-scrollbar,
  [data-notification-filters]::-webkit-scrollbar{
    display:none!important;
  }

  body.wire-notifications-layout-fix [data-notification-filter],
  [data-notification-filter]{
    flex:0 0 auto!important;
    min-height:40px!important;
    padding:0 14px!important;
    white-space:nowrap!important;
  }

  /* Message composer: hard reset so Send never overlays the textarea. */
  .message-composer,
  .messages-composer,
  [data-message-composer-form]{
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr) auto!important;
    grid-auto-rows:auto!important;
    align-items:end!important;
    gap:8px!important;
    width:100%!important;
    max-width:none!important;
    padding:10px 10px calc(10px + env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
  }

  .message-composer > *,
  .messages-composer > *,
  [data-message-composer-form] > *{
    min-width:0!important;
    max-width:100%!important;
  }

  .message-composer textarea,
  .messages-composer textarea,
  [data-message-composer-form] textarea,
  [data-message-composer]{
    grid-column:2!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    margin:0!important;
    padding:11px 14px!important;
  }

  .message-composer button[type="submit"],
  .messages-composer button[type="submit"],
  [data-message-composer-form] button[type="submit"]{
    grid-column:3!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    float:none!important;
    width:auto!important;
    min-width:70px!important;
    max-width:none!important;
    margin:0!important;
    align-self:end!important;
    z-index:auto!important;
  }

  .message-composer label,
  .messages-composer label,
  [data-message-composer-form] label{
    grid-column:1!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
  }

  .wire-message-send-state,
  .wire-message-attachment-preview{
    grid-column:2 / 4!important;
  }
}
