/* V35.21 — MOBILE KEYBOARD COMPOSER RECOVERY — TARGETED ONLY
 * Base: FIXED25. Only repairs the mobile composer/keyboard handoff.
 * Menu, navigation, message markup/rendering, Firebase and send logic untouched.
 */
@media (max-width:767px){
  /* The visual viewport is already reduced by the existing responsive shell.
     Position the composer by its TOP edge at the visible viewport bottom instead
     of stacking another bottom offset. This prevents the composer from jumping
     behind/above the native keyboard. */
  #chatMainContainer.mobile-active .chat-input-zone.v3521-keyboard-recovery,
  body.mobile-chat-focus .chat-input-zone.v3521-keyboard-recovery{
    position:fixed !important;
    left:0 !important;
    right:0 !important;
    top:var(--v3521-composer-top,auto) !important;
    bottom:auto !important;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    margin:0 !important;
    padding:0 !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    justify-content:flex-end !important;
    overflow:visible !important;
    visibility:visible !important;
    opacity:1 !important;
    z-index:2155 !important;
    box-sizing:border-box !important;
    background:var(--bg-main,#111b21) !important;
  }

  #chatMainContainer.mobile-active .chat-input-zone.v3521-keyboard-recovery > .zalo-input-area,
  body.mobile-chat-focus .chat-input-zone.v3521-keyboard-recovery > .zalo-input-area{
    display:flex !important;
    visibility:visible !important;
    opacity:1 !important;
    position:relative !important;
    order:1 !important;
    flex:0 0 auto !important;
    width:100% !important;
    min-height:54px !important;
    height:auto !important;
    z-index:2156 !important;
    box-sizing:border-box !important;
  }

  #chatMainContainer.mobile-active .chat-input-zone.v3521-keyboard-recovery #messageInput,
  body.mobile-chat-focus .chat-input-zone.v3521-keyboard-recovery #messageInput{
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
    display:block !important;
  }

  /* Keyboard mode owns only the composer. Do not allow older V35.15/V35.18
     bottom-offset rules to move it a second time. */
  .chat-input-zone.v3521-keyboard-recovery{
    bottom:auto !important;
    --v3515-keyboard-offset:0px !important;
    --v3518-keyboard-offset:0px !important;
  }
}
