/* V35.15 — MOBILE COMPOSER VIEWPORT / KEYBOARD FIX — TARGETED ONLY
 * Only affects the mobile composer surface. Menu, message list and PC are untouched.
 */
@media (max-width:767px){
  /* The composer becomes the lower viewport surface while an auxiliary panel is open.
     The input row stays visibly ABOVE the attachment/emoji surface. */
  .chat-input-zone.v3515-fixed-surface{
    position:fixed !important;
    left:0 !important;
    right:0 !important;
    bottom:var(--v3515-keyboard-offset,0px) !important;
    width:100% !important;
    max-width:100% !important;
    z-index:2140 !important;
    margin:0 !important;
    padding:0 0 env(safe-area-inset-bottom,0px) !important;
    box-sizing:border-box !important;
  }

  .chat-input-zone.v3515-fixed-surface > .zalo-input-area{
    position:relative !important;
    z-index:20 !important;
    flex:0 0 auto !important;
    order:1 !important;
    min-height:54px !important;
    visibility:visible !important;
    opacity:1 !important;
  }

  /* Keyboard state: only the input row remains. Never allow it to be hidden behind
     the visual viewport/OS keyboard. */
  .chat-input-zone.v3515-keyboard-open{
    position:fixed !important;
    left:0 !important;
    right:0 !important;
    bottom:var(--v3515-keyboard-offset,0px) !important;
    z-index:2140 !important;
  }

  .chat-input-zone.v3515-keyboard-open > .zalo-input-area,
  .chat-input-zone.v3515-fixed-surface > .zalo-input-area{
    display:flex !important;
    visibility:visible !important;
    opacity:1 !important;
  }

  /* WhatsApp-sized send control. */
  .zalo-input-area.mobile-wa-input-area .send-submit-btn,
  .zalo-input-area.mobile-wa-input-area .send-submit-btn.v3515-send-visible{
    width:32px !important;
    height:32px !important;
    min-width:32px !important;
    min-height:32px !important;
    flex:0 0 32px !important;
    padding:0 !important;
    margin:0 2px 0 0 !important;
    border-radius:50% !important;
    background:#25D366 !important;
    color:#fff !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    border:0 !important;
    box-shadow:none !important;
  }
  .zalo-input-area.mobile-wa-input-area .send-submit-btn svg{
    width:18px !important;
    height:18px !important;
    fill:currentColor !important;
    stroke:none !important;
    transform:translate(-1px,0) !important;
  }
  .zalo-input-area.mobile-wa-input-area:not(.v3514-has-payload) .send-submit-btn{display:none !important;}
  .zalo-input-area.mobile-wa-input-area.v3514-has-payload .mobile-wa-right{display:none !important;}

  /* Auxiliary panels occupy the lower portion, while the input row remains above them. */
  .chat-input-zone.v3515-fixed-surface.v3513-attachment-open > .mobile-wa-attachment-panel,
  .chat-input-zone.v3515-fixed-surface.v3513-emoji-open > .emoji-panel.v6-emoji-open{
    order:2 !important;
    position:relative !important;
    left:auto !important;
    right:auto !important;
    top:auto !important;
    bottom:auto !important;
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    box-sizing:border-box !important;
  }

  .chat-input-zone.v3515-fixed-surface.v3513-emoji-open > .emoji-panel.v6-emoji-open{
    height:min(46dvh,350px) !important;
    max-height:min(46dvh,350px) !important;
    flex:0 0 min(46dvh,350px) !important;
    overflow:hidden !important;
  }

  .chat-input-zone.v3515-fixed-surface.v3513-attachment-open > .mobile-wa-attachment-panel.show{
    flex:0 0 auto !important;
  }

  /* Never let legacy toolbar reappear and steal the composer height on mobile. */
  .chat-input-zone.v3515-fixed-surface .zalo-toolbar{display:none !important;}
}
