/* V35.14 — MOBILE COMPOSER STATE FIX (TARGETED ONLY)
 * No menu/message-list/PC layout changes.
 */
@media (max-width:767px){
  /* The input row is always the first/visible layer when an auxiliary surface is open. */
  .chat-input-zone.v3513-attachment-open,
  .chat-input-zone.v3513-emoji-open{
    display:flex !important;
    flex-direction:column !important;
    justify-content:flex-end !important;
    align-items:stretch !important;
    height:auto !important;
    max-height:none !important;
    min-height:0 !important;
    overflow:visible !important;
  }
  .chat-input-zone.v3513-attachment-open > .zalo-input-area,
  .chat-input-zone.v3513-emoji-open > .zalo-input-area,
  .zalo-input-area.mobile-wa-input-area{
    order:1 !important;
    flex:0 0 auto !important;
    position:relative !important;
    z-index:100 !important;
    visibility:visible !important;
    opacity:1 !important;
  }

  /* Payload state: text/image/attachment -> green send button, no camera/mic. */
  .zalo-input-area.mobile-wa-input-area .send-submit-btn{
    display:none !important;
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    min-height:42px !important;
    flex:0 0 42px !important;
    border-radius:50% !important;
    align-items:center !important;
    justify-content:center !important;
    padding:0 !important;
    margin:0 2px 0 0 !important;
    background:#25D366 !important;
    color:#fff !important;
    border:0 !important;
    box-shadow:none !important;
    z-index:101 !important;
  }
  .zalo-input-area.mobile-wa-input-area .send-submit-btn svg{
    width:22px !important;
    height:22px !important;
    fill:currentColor !important;
    stroke:none !important;
  }
  .zalo-input-area.mobile-wa-input-area.v3514-has-payload .send-submit-btn{
    display:flex !important;
  }
  .zalo-input-area.mobile-wa-input-area.v3514-has-payload .mobile-wa-right{
    display:none !important;
  }
  .zalo-input-area.mobile-wa-input-area.v3514-has-payload .zalo-input-box{
    flex:1 1 auto !important;
  }

  /* No payload -> original WhatsApp camera + microphone pair. */
  .zalo-input-area.mobile-wa-input-area:not(.v3514-has-payload) .mobile-wa-right{
    display:flex !important;
  }

  /* Emoji surface stays below the input row; never covers the composer controls. */
  .chat-input-zone.v3513-emoji-open > .emoji-panel.v6-emoji-open{
    order:2 !important;
    position:static !important;
    flex:0 0 min(46dvh,350px) !important;
    width:100% !important;
    max-width:100% !important;
    height:min(46dvh,350px) !important;
    max-height:min(46dvh,350px) !important;
    margin:0 !important;
    left:auto !important;
    right:auto !important;
    top:auto !important;
    bottom:auto !important;
    z-index:20 !important;
    visibility:visible !important;
    opacity:1 !important;
    overflow:hidden !important;
  }
  .chat-input-zone.v3513-emoji-open > .zalo-input-area{
    z-index:100 !important;
  }

  /* Attachment surface also remains below the input row. */
  .chat-input-zone.v3513-attachment-open > .mobile-wa-attachment-panel.show{
    order:2 !important;
    position:static !important;
    flex:0 0 auto !important;
    z-index:20 !important;
    visibility:visible !important;
    opacity:1 !important;
  }

  /* The keyboard icon must remain clickable while emoji is visible. */
  .chat-input-zone.v3513-emoji-open .mobile-wa-emoji{
    position:absolute !important;
    z-index:120 !important;
    pointer-events:auto !important;
    visibility:visible !important;
  }
}
