.bg-chat-widget, .bg-chat-widget * {
  box-sizing: border-box;
}

.bg-chat-widget {
  z-index: 999999;
  color: #242424;
  text-align: left;
  width: 56px;
  height: 56px;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  position: fixed;
  bottom: 24px;
  right: 24px;
}

.bg-chat-widget [hidden] {
  display: none !important;
}

body.auth-modal-open .bg-chat-widget {
  display: none;
}

.bg-chat-widget button, .bg-chat-widget textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.bg-chat-widget button {
  cursor: pointer;
  min-width: 0;
  min-height: 0;
  box-shadow: none;
  justify-content: center;
  align-items: center;
  margin: 0;
  display: inline-flex;
}

.bg-chat-widget button:focus-visible {
  outline-offset: 2px;
  outline: 2px solid #2563eb;
}

.bg-chat-widget textarea:focus-visible {
  outline-offset: 2px;
  outline: 2px solid #2563eb;
}

.bg-chat-launcher {
  width: 56px;
  height: 56px;
  color: #fff !important;
  background: #2563eb !important;
  border: 0 !important;
  border-radius: 50% !important;
  padding: 16px !important;
  box-shadow: 0 4px 16px #11182729 !important;
}

.bg-chat-launcher svg {
  fill: currentColor;
  width: 24px;
  height: 24px;
  display: block;
}

.bg-chat-widget.is-open {
  width: 60px;
  height: 60px;
  bottom: 20px;
  right: 20px;
}

.bg-chat-widget.is-open .bg-chat-launcher {
  width: 60px;
  height: 60px;
  padding: 16px !important;
}

.bg-chat-widget.is-open .bg-chat-launcher svg {
  fill: none;
  stroke: #111827;
  stroke-width: 1.5px;
  width: 28px;
  height: 28px;
}

.bg-chat-panel {
  background: #fff;
  border: 1px solid #e8e7ee;
  border-radius: 12px;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 100px);
  display: flex;
  position: absolute;
  bottom: 70px;
  right: 0;
  overflow: hidden;
  box-shadow: 0 24px 48px -12px #24242424, 0 8px 16px -4px #2424240f;
}

.bg-chat-header {
  background: #fff;
  border-bottom: 1px solid #e8e7ee;
  flex: 0 0 48px;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 6px 8px 6px 12px;
  display: flex;
}

.bg-chat-heading {
  flex: 1;
  align-items: center;
  min-width: 0;
  display: flex;
}

.bg-chat-brand {
  object-fit: contain;
  background: #f4f4f8;
  border: 1px solid #e8e7ee;
  border-radius: 50%;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.bg-chat-heading h3 {
  white-space: nowrap;
  color: #242424 !important;
  margin: 0 0 0 8px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 21px !important;
}

.bg-chat-badge {
  color: #6e7391;
  overflow-wrap: break-word;
  background: #f4f4f8;
  border-radius: 4px;
  max-width: 94px;
  margin-left: 8px;
  padding: 2px 5px;
  font-size: 9px;
  line-height: 12px;
}

.bg-chat-widget .bg-chat-close {
  color: #6e7391;
  background: none;
  border: 0;
  border-radius: 8px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 6px;
}

.bg-chat-close svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5px;
  width: 20px;
  height: 20px;
}

.bg-chat-messages {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: auto;
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

.bg-chat-message {
  align-items: flex-start;
  min-width: 0;
  max-width: 88%;
  display: flex;
}

.bg-chat-message + .bg-chat-message {
  margin-top: 12px;
}

.bg-chat-avatar {
  object-fit: cover;
  background: #eeeff4;
  border-radius: 50%;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  overflow: hidden;
}

.bg-chat-bubble {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-wrap: break-word;
  background: #fff;
  border: 1px solid #e8e7ee;
  border-radius: 10px;
  min-width: 0;
  max-width: calc(100% - 36px);
  margin-left: 8px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 21px;
}

.bg-chat-author {
  color: #6e7391;
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 600;
  line-height: 16.5px;
}

.bg-chat-bubble p {
  font: inherit;
  color: inherit;
  white-space: pre-wrap;
  margin: 0;
}

.bg-chat-bubble p + p, .bg-chat-bubble ol + p {
  margin-top: 12px;
}

.bg-chat-bubble strong {
  font-weight: 600;
}

.bg-chat-bubble ol {
  margin: 8px 0 0;
  padding-left: 20px;
  list-style: decimal;
}

.bg-chat-bubble li {
  white-space: normal;
  margin: 0;
  list-style: decimal;
}

.bg-chat-bubble li + li {
  margin-top: 8px;
}

.bg-chat-message.is-user {
  justify-content: flex-end;
  margin-left: auto;
}

.bg-chat-message.is-user .bg-chat-bubble {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  max-width: 100%;
  margin-left: 0;
}

.bg-chat-suggestions {
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 0 12px 2px;
  display: flex;
}

.bg-chat-suggestions button {
  color: #242424;
  white-space: normal;
  text-align: left;
  background: #fff;
  border: 1px solid #e8e7ee;
  border-radius: 999px;
  margin: 0 6px 6px 0;
  padding: 5px 10px;
  font: 12px / 18px Arial, sans-serif;
}

.bg-chat-suggestions button:hover {
  background: #f4f4f8;
}

.bg-chat-widget .bg-chat-compose {
  background: #fff;
  border: 1px solid #e8e7ee;
  border-radius: 14px;
  flex-shrink: 0;
  align-items: flex-end;
  margin: 6px 12px 12px;
  padding: 6px;
  display: flex;
}

.bg-chat-widget .bg-chat-input {
  resize: none;
  width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  max-height: 90px;
  box-shadow: none;
  color: #242424;
  -webkit-appearance: none;
  background: none;
  border: 0;
  border-radius: 0;
  outline: none;
  flex: auto;
  padding: 6px;
  font-size: 14px;
  line-height: 20px;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
}

.bg-chat-input::placeholder {
  color: #6e7391;
  opacity: 1;
}

.bg-chat-widget .bg-chat-attach, .bg-chat-widget .bg-chat-send {
  color: #6e7391;
  background: none;
  border: 0;
  border-radius: 8px;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 7px;
}

.bg-chat-widget .bg-chat-send {
  color: #fff;
  background: #2563eb;
  border-radius: 50%;
  margin-left: 4px;
}

.bg-chat-widget .bg-chat-send:disabled {
  opacity: .45;
  cursor: default;
}

.bg-chat-attach svg, .bg-chat-send svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 18px;
  height: 18px;
  display: block;
}

.bg-chat-attachments {
  flex-shrink: 0;
  max-height: 70px;
  margin: 0 12px;
  overflow: auto;
}

.bg-chat-file-chip {
  background: #f4f4f8;
  border-radius: 6px;
  align-items: center;
  margin-top: 4px;
  padding: 4px 7px;
  font-size: 11px;
  display: flex;
}

.bg-chat-file-chip span {
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.bg-chat-file-chip button {
  color: #6e7391;
  background: none;
  border: 0;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0;
}

.bg-chat-typing span {
  background: #6e7391;
  border-radius: 50%;
  width: 5px;
  height: 5px;
  margin: 0 2px;
  animation: 1s infinite bg-chat-pulse;
  display: inline-block;
}

.bg-chat-typing span:nth-child(2) {
  animation-delay: .15s;
}

.bg-chat-typing span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes bg-chat-pulse {
  0%, 80%, 100% {
    opacity: .35;
  }

  40% {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .bg-chat-input {
    font-size: 16px !important;
  }

  .bg-chat-badge {
    max-width: 88px;
  }
}

@media (max-height: 400px) {
  .bg-chat-header {
    flex-basis: 40px;
    min-height: 40px;
  }

  .bg-chat-suggestions {
    max-height: 60px;
    overflow: auto;
  }

  .bg-chat-panel {
    bottom: 66px;
  }

  .bg-chat-widget.is-open {
    bottom: 10px;
  }

  .bg-chat-compose {
    margin-bottom: 8px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-chat-typing span {
    opacity: .6;
    animation: none;
  }
}
