/* Keep the native Bitrix24 dialog within narrow and short viewports. */
.bx-livechat-wrapper {
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 24px) !important;
  max-height: calc(100dvh - 24px) !important;
}
.bx-livechat-wrapper .bx-livechat-box { min-width: 0; }
.bx-livechat-wrapper button:focus-visible {
  outline: 2px solid #1b5e20;
  outline-offset: -3px;
}
@media (max-width: 600px), (max-height: 680px) {
  .bx-livechat-wrapper.bx-livechat-show {
    inset: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0;
    transform: none !important;
    animation: none !important;
    box-sizing: border-box;
  }
  .bx-livechat-wrapper.bx-livechat-show .bx-livechat-box { border-radius: 0; }
  .bx-livechat-wrapper.bx-livechat-show .bx-livechat-head {
    padding-top: env(safe-area-inset-top, 0px);
    height: auto;
    min-height: 48px;
    flex-basis: auto;
  }
  .bx-livechat-wrapper.bx-livechat-show .bx-livechat-textarea-container {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}
