@media (max-width: 767px) {
  html.gsfc-customer-service-page .gsfc-mobile-chat-empty {
    display: none !important;
  }
  html:not(.gsfc-ios-keyboard).gsfc-customer-service-page:not(.gsfc-keyboard-active):not(.gsfc-keyboard-closing) .mobile-customer-service > .safe-bottom.gsfc-customer-service-composer-ready {
    box-sizing: border-box !important;
    min-height: 72px !important;
    height: 72px !important;
    padding: 14px 12px !important;
    align-items: flex-start !important;
  }
  /* iPhone Safari gets its own keyboard/viewport owner.  The generic history
     rule above used to overwrite the approved 64px composer with 72px/14px,
     making the idle input bar sit lower than Android. */
  html.gsfc-ios-browser.gsfc-customer-service-page:not(.gsfc-keyboard-active):not(.gsfc-keyboard-closing) .mobile-customer-service > .safe-bottom.gsfc-customer-service-composer-ready {
    box-sizing: border-box !important;
    min-height: 64px !important;
    height: auto !important;
    padding: 10px 12px max(20px, calc(10px + env(safe-area-inset-bottom, 0px))) !important;
    align-items: center !important;
  }
  /* The iOS home-screen version has no Safari toolbar.  Keep its controls
     identical to Safari and reserve only the real home-indicator inset. */
  html.gsfc-ios-standalone.gsfc-customer-service-page:not(.gsfc-keyboard-active):not(.gsfc-keyboard-closing) .mobile-customer-service > .safe-bottom.gsfc-customer-service-composer-ready {
    box-sizing: border-box !important;
    min-height: 64px !important;
    height: auto !important;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom, 0px)) !important;
    align-items: center !important;
  }
  html.gsfc-customer-service-page:not(.gsfc-keyboard-active):not(.gsfc-keyboard-closing) .mobile-customer-service > .safe-bottom.gsfc-customer-service-composer-ready > .ant-upload-wrapper,
  html.gsfc-customer-service-page:not(.gsfc-keyboard-active):not(.gsfc-keyboard-closing) .mobile-customer-service > .safe-bottom.gsfc-customer-service-composer-ready > .gsfc-customer-service-input-hit,
  html.gsfc-customer-service-page:not(.gsfc-keyboard-active):not(.gsfc-keyboard-closing) .mobile-customer-service > .safe-bottom.gsfc-customer-service-composer-ready > button {
    height: 44px !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 767px) and (display-mode: standalone),
       (max-width: 767px) and (display-mode: fullscreen) {
  html.gsfc-customer-service-page:not(.gsfc-keyboard-active):not(.gsfc-keyboard-closing) .mobile-customer-service > .safe-bottom.gsfc-customer-service-composer-ready {
    box-sizing: border-box !important;
    min-height: 64px !important;
    height: auto !important;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom, 0px)) !important;
    align-items: center !important;
  }
}

@media (max-width: 767px) {
  /* Focus arrives before WebKit reports the keyboard viewport. Keep the
     pre-keyboard composer geometry during that short transition. */
  html.gsfc-customer-service-page.gsfc-chat-keyboard-pending {
    --gsfc-chat-safe: env(safe-area-inset-bottom, 0px) !important;
  }
  html.gsfc-customer-service-page.gsfc-ios-browser.gsfc-chat-keyboard-pending .mobile-customer-service > .safe-bottom.gsfc-customer-service-composer-ready {
    box-sizing: border-box !important;
    min-height: 64px !important;
    height: auto !important;
    padding: 10px 12px max(20px, calc(10px + env(safe-area-inset-bottom, 0px))) !important;
    align-items: center !important;
    transition: none !important;
  }
  /* The shared keyboard session can add its active class before the
     composer-ready marker exists. Lock the parent geometry as well so the
     first focus event cannot move the whole input bar downward. */
  html.gsfc-customer-service-page.gsfc-ios-browser.gsfc-chat-keyboard-pending .mobile-customer-service > .safe-bottom {
    box-sizing: border-box !important;
    min-height: 64px !important;
    height: auto !important;
    padding: 10px 12px max(20px, calc(10px + env(safe-area-inset-bottom, 0px))) !important;
    align-items: center !important;
    transition: none !important;
  }
  html.gsfc-customer-service-page.gsfc-ios-standalone.gsfc-chat-keyboard-pending .mobile-customer-service > .safe-bottom.gsfc-customer-service-composer-ready {
    box-sizing: border-box !important;
    min-height: 64px !important;
    height: auto !important;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom, 0px)) !important;
    align-items: center !important;
    transition: none !important;
  }
  html.gsfc-customer-service-page.gsfc-ios-standalone.gsfc-chat-keyboard-pending .mobile-customer-service > .safe-bottom {
    box-sizing: border-box !important;
    min-height: 64px !important;
    height: auto !important;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom, 0px)) !important;
    align-items: center !important;
    transition: none !important;
  }
}
