/* EllGab Modern 1.0.28: Mobile reply composer layout. SMF 2.0.
   Presentation only: do not remove toolbar buttons, smileys, input fields,
   JavaScript handlers, or modify Classic theme. */
@media screen and (max-width: 700px) {
  /* Full-width labels instead of the Curve 15%/83% two-column form. */
  form#postmodify .roundframe {
    box-sizing: border-box;
    padding: 12px !important;
    max-width: 100%;
    min-width: 0;
  }
  form#postmodify #post_header {
    box-sizing: border-box;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 3px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 5px 0 10px !important;
    margin: 0 !important;
    overflow: visible !important;
  }
  form#postmodify #post_header dt,
  form#postmodify #post_header dd {
    box-sizing: border-box;
    float: none !important;
    clear: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-wrap: normal;
    word-break: normal;
  }
  form#postmodify #post_header dt {
    padding-top: 8px !important;
    font-size: .9rem !important;
    line-height: 1.35 !important;
  }
  form#postmodify #post_header dd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-bottom: 4px !important;
  }
  form#postmodify #post_header dd input.input_text,
  form#postmodify #post_header dd input[name="subject"] {
    box-sizing: border-box;
    flex: 1 1 100%;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    font-size: 16px !important;
  }
  form#postmodify #post_header dd select {
    box-sizing: border-box;
    max-width: min(100%, 320px) !important;
    font-size: 16px !important;
  }
  form#postmodify #post_header dd img {
    max-width: 34px;
    max-height: 34px;
    margin: 0 4px !important;
  }
  /* Toolbar groups remain available; each becomes a tidy, swipeable strip.
     Keep row height compact instead of 3-5 uneven rows of large icons. */
  #bbcBox_message,
  #smileyBox_message {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 8px 0 !important;
    padding: 7px 5px !important;
    background: #17212c;
    border: 1px solid #33475a;
    border-radius: 8px;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #52687e transparent;
  }
  #bbcBox_message > div,
  #smileyBox_message > div {
    box-sizing: border-box;
    width: max-content;
    min-width: 100%;
    max-width: none !important;
    margin: 2px 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
  }
  #bbcBox_message img,
  #smileyBox_message img {
    width: auto !important;
    height: auto !important;
    max-width: 26px !important;
    max-height: 26px !important;
    margin: 2px 3px 2px 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
  }
  #bbcBox_message select {
    box-sizing: border-box;
    max-width: 150px !important;
    min-width: 0 !important;
    margin: 2px 4px !important;
    font-size: 14px !important;
    vertical-align: middle;
  }
  #smileyBox_message { padding: 5px !important; }
  #smileyBox_message img {
    max-width: 25px !important;
    max-height: 25px !important;
    margin-right: 5px !important;
  }
  /* Keep the actual composer full width and usable on iOS Safari. */
  form#postmodify textarea.editor,
  form#postmodify textarea[name="message"] {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    font-size: 16px !important;
  }
}
