/* Shared floating chat behaviour, separate from the vendor widget and WEB themes. */
#chat-support.nh-chat-draggable {
  --nh-chat-bubble-surface: rgba(255, 255, 255, 0.94);
  z-index: 1040;
}

#chat-support.nh-chat-draggable > .czm-button {
  cursor: grab;
  touch-action: none;
  transform: none !important;
  transition-property: opacity, background-color, box-shadow;
  -webkit-user-select: none;
  user-select: none;
}

#chat-support.nh-chat-draggable > .czm-button:focus-visible {
  outline: 3px solid #136b49;
  outline-offset: 5px;
}

#chat-support.nh-chat-positioned > .czm-button {
  animation: none !important;
}

#chat-support.nh-chat-dragging > .czm-button {
  cursor: grabbing;
}

#chat-support.nh-chat-draggable > .czm-popup,
#chat-support.nh-chat-draggable > .czm-speech-bubble {
  transition-property: opacity, visibility, transform;
}

#chat-support.nh-chat-draggable > .czm-popup {
  width: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#chat-support.nh-chat-draggable > .czm-speech-bubble {
  transform: none !important;
  transition-property: opacity, visibility;
  width: max-content;
}

#chat-support.nh-chat-draggable .czm-speech-bubble-text {
  background: var(--nh-chat-bubble-surface);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  color: #183044;
  max-width: 100%;
  overflow-wrap: anywhere;
}

#chat-support.nh-chat-draggable .czm-speech-bubble-text::before,
#chat-support.nh-chat-draggable .czm-speech-bubble-text::after {
  left: var(--nh-chat-tail-x, 12px);
  right: auto;
}

#chat-support.nh-chat-draggable .czm-speech-bubble-text::before {
  border-top-color: transparent;
}

#chat-support.nh-chat-draggable .czm-speech-bubble-text::after {
  border-top-color: var(--nh-chat-bubble-surface);
  margin-left: 1px;
  margin-right: 0;
}

#chat-support.nh-chat-bubble-below .czm-speech-bubble-text::before,
#chat-support.nh-chat-bubble-below .czm-speech-bubble-text::after {
  bottom: 100%;
  top: auto;
  border-top-color: transparent;
}

#chat-support.nh-chat-bubble-below .czm-speech-bubble-text::before {
  border-bottom-color: transparent;
}

#chat-support.nh-chat-bubble-below .czm-speech-bubble-text::after {
  border-bottom-color: var(--nh-chat-bubble-surface);
}

#chat-support.nh-chat-draggable .czm-speech-bubble-close {
  background-color: #e2e8f0;
  background-image: none;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
  height: 20px;
  left: auto;
  right: 0;
  top: -10px;
  width: 20px;
  z-index: 1;
}

#chat-support.nh-chat-draggable .czm-speech-bubble-close:hover {
  background-color: #cbd5e1;
}

#chat-support.nh-chat-draggable .czm-speech-bubble-close::before {
  color: #334155;
  content: "\00d7";
  display: block;
  font: 16px/20px Arial, sans-serif;
  text-align: center;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #chat-support.nh-chat-draggable {
    --nh-chat-bubble-surface: rgba(255, 255, 255, 0.68);
  }

  #chat-support.nh-chat-draggable .czm-speech-bubble-text {
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    backdrop-filter: blur(14px) saturate(150%);
  }
}

@media (max-width: 991.98px) {
  #chat-support.nh-chat-draggable.czm-chat-support-1 > .czm-button,
  #chat-support.nh-chat-draggable.czm-chat-support-1 .czm-button-person-avatar {
    height: var(--nh-chat-mobile-size, 48px);
    width: var(--nh-chat-mobile-size, 48px);
  }

  #chat-support.nh-chat-draggable.czm-chat-support-1 .czm-button-person-avatar i {
    font-size: var(--nh-chat-mobile-font-size, 27px);
  }

  #chat-support.nh-chat-draggable .czm-pulse {
    height: calc(var(--nh-chat-mobile-size, 48px) + 18px);
    left: -9px;
    top: -9px;
    width: calc(var(--nh-chat-mobile-size, 48px) + 18px);
  }

  #chat-support.nh-chat-draggable .czm-notify-circle {
    font-size: var(--nh-chat-mobile-badge-font, 10px);
    height: var(--nh-chat-mobile-badge-size, 16px);
    width: var(--nh-chat-mobile-badge-size, 16px);
  }
}
