/* RUYA_V2.4.24.3_HF7_ANDROID_MESSAGE_SAFEAREA_DATA_PUSH_SAFE
 * Frontend-only additive hotfix.
 * Scope: Android parent Messages conversation viewport + reply composer safe area.
 * No DB, API, server, push worker, VAPID, service-worker, PDF, Documents,
 * Bulletin deep-link, iPhone Messages or Announcement behavior changes.
 */
@media (max-width:900px){
  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout{
    display:block!important;
    width:100%!important;
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }

  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .conversationList{
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:128px!important;
    margin:0 0 10px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
    touch-action:pan-y!important;
  }

  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .conversationThread{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }

  /* Important: keep the history in its own bounded scroller. HF6 made this
     unbounded, which pushed the composer underneath the fixed bottom nav. */
  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .messageThread{
    display:block!important;
    flex:0 0 auto!important;
    width:100%!important;
    height:clamp(220px,38dvh,340px)!important;
    min-height:220px!important;
    max-height:340px!important;
    margin:0!important;
    padding:12px 12px 18px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    box-sizing:border-box!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
    touch-action:pan-y!important;
    scroll-behavior:auto!important;
  }

  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .replyComposer{
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    right:auto!important;
    top:auto!important;
    bottom:auto!important;
    transform:none!important;
    z-index:4!important;
    flex:0 0 auto!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 88px!important;
    align-items:end!important;
    gap:8px!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0 0 calc(122px + env(safe-area-inset-bottom))!important;
    padding:10px!important;
    box-sizing:border-box!important;
    border:1px solid #dfe5ee!important;
    border-top:1px solid #dfe5ee!important;
    border-radius:0 0 16px 16px!important;
    background:#fff!important;
    box-shadow:0 8px 22px rgba(25,46,78,.08)!important;
    scroll-margin-bottom:calc(112px + env(safe-area-inset-bottom))!important;
  }

  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .replyComposer textarea{
    width:100%!important;
    min-width:0!important;
    min-height:50px!important;
    max-height:104px!important;
    margin:0!important;
    padding:11px 12px!important;
    box-sizing:border-box!important;
    resize:none!important;
    font-size:16px!important;
    line-height:1.35!important;
    touch-action:manipulation!important;
  }

  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .replyComposer button{
    width:88px!important;
    min-width:88px!important;
    height:50px!important;
    min-height:50px!important;
    margin:0!important;
    padding:0 8px!important;
    border-radius:14px!important;
    font-size:12px!important;
    white-space:nowrap!important;
  }

  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .conversationPlaceholder{
    min-height:88px!important;
    height:auto!important;
    padding:22px 16px!important;
    box-sizing:border-box!important;
  }

  /* Keyboard/editor mode: existing mobile runtime adds this class. Remove the
     fixed nav and the artificial nav reserve while typing. */
  html.ruyaHf7AndroidMessages body.ruyaMobileComposerFocus #root nav.ruya-r793-bottom-nav[aria-label="Mobil navigasyon"]{
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  html.ruyaHf7AndroidMessages body.ruyaMobileComposerFocus #root .role-parent .messagingLayout .replyComposer{
    margin-bottom:14px!important;
    scroll-margin-bottom:18px!important;
  }
}

@media (max-width:420px){
  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .messageThread{
    height:clamp(200px,34dvh,292px)!important;
    min-height:200px!important;
    max-height:292px!important;
  }
  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .replyComposer{
    grid-template-columns:minmax(0,1fr) 82px!important;
  }
  html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .replyComposer button{
    width:82px!important;
    min-width:82px!important;
  }
}

@media(max-width:900px){html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout:not(:has(.replyComposer)) .messageThread{margin-bottom:calc(122px + env(safe-area-inset-bottom))!important;}}

@media(max-width:900px){html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .conversationThread{margin-bottom:calc(122px + env(safe-area-inset-bottom))!important;}html.ruyaHf7AndroidMessages #root .role-parent .messagingLayout .replyComposer{margin-bottom:0!important;}}
