.hs-chat-widget {
  position: fixed;
  right: 14px;
  bottom: 82px;
  z-index: 99998;
  font-family: inherit;
}

.hs-chat-trigger {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 18px 0 12px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #42a063 0%, #2f8553 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 26px rgba(31, 101, 60, 0.24);
  cursor: pointer;
}

.hs-chat-trigger__waves,
.hs-chat-trigger__waves::before,
.hs-chat-trigger__waves::after {
  position: absolute;
  inset: 0;
  border-radius: 999px;
}

.hs-chat-trigger__waves {
  z-index: -1;
  pointer-events: none;
}

.hs-chat-trigger__waves::before,
.hs-chat-trigger__waves::after {
  content: "";
  background: rgba(60, 160, 96, 0.5);
  box-shadow: 0 0 0 1px rgba(60, 160, 96, 0.18);
  animation: hs-chat-wave 1.9s ease-out infinite;
}

.hs-chat-trigger__waves::after {
  animation-delay: 1s;
}

.hs-chat-trigger__icon,
.hs-chat-widget__heading-icon,
.hs-chat-panel__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 auto;
}

.hs-chat-trigger__icon {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.14);
  animation: hs-chat-icon-shake 3s ease-in-out infinite;
}

.hs-chat-trigger__icon img,
.hs-chat-widget__heading-icon img,
.hs-chat-panel__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hs-chat-trigger__label {
  white-space: nowrap;
}

.hs-chat-widget__contacts,
.hs-chat-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: min(356px, calc(100vw - 18px));
  border-radius: 18px;
  background: #fff;
  border: 1px solid #dce8e4;
  box-shadow: 0 18px 38px rgba(16, 24, 40, 0.15);
  overflow: hidden;
}

.hs-chat-panel {
  display: flex;
  flex-direction: column;
  height: min(520px, calc(100vh - 92px));
  max-height: min(520px, calc(100vh - 92px));
}

.hs-chat-widget__header,
.hs-chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}

.hs-chat-widget__header {
  background: #dff7ef;
  color: #059787;
  border-bottom: 1px solid #d2ece4;
}

.hs-chat-widget__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hs-chat-widget__heading strong {
  font-size: 13px;
  line-height: 1.35;
}

.hs-chat-widget__heading-icon {
  width: 30px;
  height: 30px;
  background: rgba(5, 151, 135, 0.1);
}

.hs-chat-widget__minimize,
.hs-chat-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #ff6070;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.hs-chat-widget__contact-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.hs-chat-widget__contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid #dde5eb;
  border-radius: 14px;
  background: #fff;
  color: #182433;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hs-chat-widget__contact-item--button {
  width: 100%;
}

.hs-chat-widget__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  flex: 0 0 34px;
}

.hs-chat-widget__badge img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.hs-chat-widget__badge--phone,
.hs-chat-widget__badge--chat {
  background: #0c9f8f;
}

.hs-chat-widget__badge--zalo {
  background: #ebf3ff;
}

.hs-chat-widget__badge--messenger {
  background: #eef4ff;
}

.hs-chat-widget__badge--chat img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hs-chat-panel__header {
  background: #0c9f8f;
  color: #fff;
}

.hs-chat-panel__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.hs-chat-panel__brand > div {
  min-width: 0;
  flex: 1 1 auto;
}

.hs-chat-panel__logo {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.16);
}

.hs-chat-panel__brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
}

.hs-chat-panel__brand span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.15;
  opacity: 0.96;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hs-chat-panel__close {
  background: transparent;
  width: 24px;
  height: 24px;
  font-size: 24px;
}

.hs-chat-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.hs-chat-panel__intro,
.hs-chat-panel__conversation {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.hs-chat-panel__intro {
  overflow-y: auto;
}

.hs-chat-panel__intro h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  color: #182433;
}

.hs-chat-panel__intro p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #5f7086;
}

.hs-chat-panel__lead-form {
  display: grid;
  gap: 10px;
}

.hs-chat-panel__field input,
.hs-chat-panel__composer input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #d5e1e8;
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  color: #182433;
}

.hs-chat-panel__submit,
.hs-chat-panel__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0d8aa0 0%, #11b4bf 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.hs-chat-panel__error {
  margin: 0;
  color: #d92d20;
  font-size: 12px;
  line-height: 1.45;
}

.hs-chat-panel__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.hs-chat-message {
  display: flex;
  gap: 8px;
}

.hs-chat-message--user {
  justify-content: flex-end;
}

.hs-chat-message__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7fbf7;
  color: #0c9f8f;
  font-size: 10px;
  font-weight: 900;
  flex: 0 0 24px;
}

.hs-chat-message__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hs-chat-message--user .hs-chat-message__avatar {
  display: none;
}

.hs-chat-message__bubble {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f2f5f8;
  color: #182433;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.hs-chat-message--user .hs-chat-message__bubble {
  background: #0c9f8f;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.hs-chat-message__sources {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(24, 36, 51, 0.1);
  display: grid;
  gap: 4px;
}

.hs-chat-message__sources a {
  color: #0d78b4;
  text-decoration: none;
  font-size: 12px;
}

.hs-chat-panel__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.hs-chat-panel__suggestion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #d7dfe6;
  border-radius: 999px;
  background: #fff;
  color: #182433;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.hs-chat-panel__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid #edf2f7;
  background: #fff;
}

.hs-chat-panel__send {
  min-height: 40px;
}

@keyframes hs-chat-wave {
  0% {
    transform: scale(1);
    opacity: 0.72;
  }

  100% {
    transform: scale(1.58);
    opacity: 0;
  }
}

@keyframes hs-chat-icon-shake {
  0%,
  75%,
  100% {
    transform: rotate(0deg) translateX(0);
  }

  80% {
    transform: rotate(-7deg) translateX(-1px);
  }

  85% {
    transform: rotate(7deg) translateX(1px);
  }

  90% {
    transform: rotate(-5deg) translateX(-1px);
  }

  95% {
    transform: rotate(5deg) translateX(1px);
  }
}

@media (max-width: 767px) {
  .hs-chat-widget {
    right: 10px;
    bottom: 70px;
  }

  .hs-chat-trigger {
    min-height: 46px;
    padding: 0 15px 0 10px;
    gap: 8px;
    font-size: 12px;
  }

  .hs-chat-trigger__icon {
    width: 28px;
    height: 28px;
  }

  .hs-chat-widget__contacts,
  .hs-chat-panel {
    width: min(100vw - 14px, 320px);
    bottom: 58px;
    border-radius: 16px;
  }

  .hs-chat-panel {
    height: min(500px, calc(100vh - 78px));
    max-height: min(500px, calc(100vh - 78px));
  }

  .hs-chat-widget__header,
  .hs-chat-panel__header {
    padding: 10px 12px;
  }

  .hs-chat-widget__contact-list {
    gap: 8px;
    padding: 10px;
  }

  .hs-chat-widget__contact-item {
    min-height: 50px;
    padding: 0 12px;
    font-size: 12px;
  }

  .hs-chat-panel__intro,
  .hs-chat-panel__conversation {
    padding: 12px;
  }

  .hs-chat-panel__composer {
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 8px;
    padding: 10px 12px 12px;
  }
}
