/* Zakupki v1.9.33 — mobile chat composer content budgeting above the soft keyboard.
   When the real Android keyboard is open, the input/send row is always visible.
   Emoji, voice-draft and file-preview areas use only the remaining visual viewport
   and scroll internally instead of pushing the composer below the keyboard. */

@media (max-width:760px), (orientation:landscape) and (max-height:600px) and (max-width:1280px){
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating{
    display:flex!important;
    flex-direction:column!important;
    gap:0!important;
    max-height:var(--v1933-compose-max-height,calc(100dvh - 12px))!important;
    overflow:hidden!important;
    padding:7px!important;
    overscroll-behavior:contain!important;
  }

  /* Keep the actual input row as the last, non-shrinking part of the composer. */
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating .v1916-compose-main{
    order:100!important;
    flex:0 0 auto!important;
    min-height:44px!important;
    margin-top:5px!important;
    position:relative!important;
    z-index:3!important;
  }
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating .v1916-compose-main textarea{
    min-height:40px!important;
    max-height:min(76px,18dvh)!important;
  }

  /* Small reply preview can shrink, but never consume the whole visible area. */
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating #chatReplyPreview{
    order:10!important;
    flex:0 1 auto!important;
    max-height:var(--v1933-reply-max,64px)!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    margin-bottom:5px!important;
  }

  /* Attachments, voice drafts and emoji panel are independent scroll areas. */
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating #chatFilePreview{
    order:20!important;
    flex:0 1 auto!important;
    max-height:var(--v1933-files-max,120px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    align-content:flex-start!important;
    margin-bottom:5px!important;
    padding-right:2px!important;
  }
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating #voicePreview{
    order:30!important;
    flex:0 1 auto!important;
    max-height:var(--v1933-voice-max,170px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    margin-bottom:5px!important;
    padding-right:2px!important;
    scroll-padding-bottom:6px!important;
  }
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating .v1916-compose-extras{
    order:40!important;
    flex:0 1 auto!important;
    min-height:0!important;
    max-height:var(--v1933-extras-max,190px)!important;
    overflow:hidden!important;
    margin:0!important;
  }
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating #chatEmojiPicker{
    width:100%!important;
    min-height:0!important;
    max-height:var(--v1933-emoji-max,180px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scroll-padding-bottom:10px!important;
    padding:6px 6px 10px!important;
  }

  /* Three or more recordings stay readable and scroll instead of hiding input. */
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating #voicePreview .voice-draft{
    flex:0 0 auto!important;
    margin:0!important;
  }
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating #voicePreview .voice-draft + .voice-draft{
    margin-top:6px!important;
  }

  /* The last emoji/file/voice item must be reachable above the keyboard. */
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating #voicePreview::after,
  html.v1932-real-keyboard-open #chatForm.v1930-keyboard-floating #chatFilePreview::after{
    content:"";
    display:block;
    flex:0 0 3px;
    height:3px;
  }
}
