/* Move the entire Bitrix launcher, including its channels, as one unit. */
@media (max-width: 992px) {
  :root[data-cb-bottom-stack] :is(.cb-prehead-menu, [data-cb-bottom-layer="navigation"]) {
    bottom: var(--cb-navigation-bottom, 0px) !important;
  }

  :root[data-cb-bottom-stack] :is(.ny-sticky-actions, [data-cb-bottom-layer="actions"]) {
    bottom: var(--cb-actions-bottom, 0px) !important;
  }

  :root[data-cb-bottom-stack] :is(.cookie-container, [data-cb-cookie], [data-cb-bottom-layer="cookie"]) {
    bottom: var(--cb-cookie-bottom, 0px) !important;
    margin-bottom: 0 !important;
  }

  .b24-widget-button-wrapper.b24-widget-button-position-bottom-right {
    top: auto !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    bottom: max(calc(12px + env(safe-area-inset-bottom, 0px)), var(--cb-chat-bottom, 12px)) !important;
    left: auto !important;
    display: block !important;
    width: 48px !important;
    height: 48px !important;
    transition: bottom 240ms ease !important;
  }

  .b24-widget-button-wrapper [data-b24-crm-button-block-button] {
    position: absolute !important;
    inset: 0 0 auto auto !important;
    width: 66px !important;
    height: 66px !important;
    margin: 0 !important;
    transform: scale(.7272727) !important;
    transform-origin: top right !important;
    touch-action: manipulation;
  }

  /* The greeting is a card above the launcher, inside the viewport gutters. */
  .b24-widget-button-wrapper .b24-widget-button-popup {
    box-sizing: border-box !important;
    inset: auto 0 60px auto !important;
    width: min(312px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))) !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: max(0px, calc(100dvh - var(--cb-chat-bottom, 12px) - 72px));
    margin: 0 !important;
    padding: 16px 36px 16px 14px !important;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .b24-widget-button-wrapper .b24-widget-button-popup-inner {
    min-width: 0;
  }

  .b24-widget-button-wrapper .b24-widget-button-popup-image {
    flex: 0 0 42px;
  }

  .b24-widget-button-wrapper .b24-widget-button-popup-content {
    flex: 1 1 0%;
    width: auto !important;
    min-width: 0 !important;
    overflow-wrap: anywhere;
  }

  .b24-widget-button-wrapper .b24-widget-button-popup-btn-hide {
    top: 0 !important;
    right: 0 !important;
    width: 44px !important;
    height: 44px !important;
    touch-action: manipulation;
  }

  .b24-widget-button-wrapper .b24-widget-button-popup-triangle {
    display: none !important;
  }

  .b24-widget-button-wrapper .b24-widget-button-social {
    position: absolute !important;
    inset: auto 0 60px auto !important;
    flex-direction: column-reverse !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    gap: 8px;
    width: 48px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .b24-widget-button-wrapper .b24-widget-button-social-item {
    box-sizing: border-box;
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    --ui-icon-size: 44px;
    touch-action: manipulation;
  }
}

@media (max-width: 992px) and (prefers-reduced-motion: reduce) {
  .b24-widget-button-wrapper.b24-widget-button-position-bottom-right {
    transition: none !important;
  }
}
