.hcb-widget,
.hcb-widget * {
  box-sizing: border-box;
  font-family: 'Poppins', Arial, sans-serif;
}

.hcb-widget {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 999999;
  color: #302638;
  font-size: 14px;
  line-height: 1.45;
}

.hcb-widget .hcb-toggle,
.hcb-widget .hcb-close,
.hcb-widget .hcb-new-conversation,
.hcb-widget .hcb-expand,
.hcb-widget .hcb-info,
.hcb-widget .hcb-info-done,
.hcb-widget .hcb-send {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  text-transform: none;
}

.hcb-widget .hcb-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid #735989;
  border-radius: 999px;
  background: #735989;
  box-shadow: 0 9px 25px rgb(41 26 54 / 25%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

.hcb-widget .hcb-toggle[hidden] {
  display: none;
}

.hcb-widget .hcb-toggle::before {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23735989' d='M12 1.25c1.55 6.95 3.8 9.2 10.75 10.75-6.95 1.55-9.2 3.8-10.75 10.75C10.45 15.8 8.2 13.55 1.25 12 8.2 10.45 10.45 8.2 12 1.25Z'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  content: '';
}

.hcb-widget .hcb-toggle:hover,
.hcb-widget .hcb-toggle:focus-visible {
  border-color: #604a74;
  background: #604a74;
  color: #fff;
}

.hcb-widget :is(button, textarea, a):focus-visible {
  outline: 3px solid #d5bdea;
  outline-offset: 3px;
}

.hcb-widget .hcb-panel[hidden] {
  display: none;
}

.hcb-widget .hcb-panel {
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 40px));
  height: min(590px, calc(100vh - 110px));
  height: min(590px, calc(100dvh - 110px));
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid #ded6e3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 46px rgb(41 26 54 / 22%);
}

.hcb-widget .hcb-modal-backdrop[hidden] {
  display: none;
}

.hcb-widget .hcb-modal-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  background: rgb(115 89 137 / 62%);
  animation: hcb-modal-fade-in 180ms ease-out both;
  cursor: default;
}

.hcb-widget--modal {
  inset: 0;
  right: auto;
  bottom: auto;
  display: grid;
  width: 100%;
  height: 100%;
  padding: 24px;
  place-items: center;
}

.hcb-widget--modal .hcb-panel {
  position: fixed;
  z-index: 1;
  right: auto;
  bottom: auto;
  width: min(760px, calc(100vw - 48px));
  height: min(820px, calc(100vh - 48px));
  height: min(820px, calc(100dvh - 48px));
  margin: 0;
  animation: hcb-modal-panel-in 200ms ease-out both;
}

html.hcb-modal-open {
  overflow: hidden;
}

@keyframes hcb-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hcb-modal-panel-in {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hcb-widget .hcb-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #735989;
  color: #fff;
}

.hcb-widget .hcb-heading {
  min-width: 0;
}

.hcb-widget .hcb-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.hcb-widget .hcb-new-conversation {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  place-items: center;
}

.hcb-widget .hcb-expand {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  place-items: center;
}

.hcb-widget .hcb-new-conversation svg,
.hcb-widget .hcb-expand svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hcb-widget .hcb-new-conversation:hover,
.hcb-widget .hcb-new-conversation:focus-visible,
.hcb-widget .hcb-expand:hover,
.hcb-widget .hcb-expand:focus-visible {
  background: rgb(255 255 255 / 17%);
  color: #fff;
}

.hcb-widget .hcb-new-conversation:disabled {
  cursor: wait;
  opacity: 0.65;
}

.hcb-widget .hcb-title {
  clear: none;
  margin: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.hcb-widget .hcb-close {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}

.hcb-widget .hcb-close:hover,
.hcb-widget .hcb-close:focus-visible {
  background: rgb(255 255 255 / 17%);
  color: #fff;
}

.hcb-widget .hcb-info {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}

.hcb-widget .hcb-info:hover,
.hcb-widget .hcb-info:focus-visible {
  background: rgb(255 255 255 / 17%);
  color: #fff;
}

.hcb-widget .hcb-info--welcome {
  display: inline-grid;
  width: 22px;
  height: 22px;
  margin-left: 5px;
  vertical-align: middle;
  border-color: #735989;
  color: #735989;
  font-size: 15px;
}

.hcb-widget .hcb-info--welcome:hover,
.hcb-widget .hcb-info--welcome:focus-visible {
  background: #f3edf6;
  color: #604a74;
}

.hcb-widget .hcb-info-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  max-height: min(80vh, calc(100dvh - 32px));
  padding: 0;
  overflow: auto;
  border: 1px solid #ded6e3;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 46px rgb(41 26 54 / 30%);
  color: #302638;
}

.hcb-widget .hcb-info-dialog::backdrop {
  background: rgb(32 24 38 / 55%);
}

.hcb-widget .hcb-info-dialog--fallback {
  position: fixed;
  z-index: 1000000;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.hcb-widget .hcb-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: #735989;
  color: #fff;
}

.hcb-widget .hcb-info-title {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.hcb-widget .hcb-info-body {
  padding: 16px;
}

.hcb-widget .hcb-info-heading {
  margin: 16px 0 8px;
  color: #33263b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.hcb-widget .hcb-info-copy {
  margin: 0;
  color: #5a4a65;
  font-size: 13px;
  line-height: 1.55;
}

.hcb-widget .hcb-info-note {
  margin-top: 16px;
}

.hcb-widget .hcb-info-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px 16px;
}

.hcb-widget .hcb-info-done {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #735989;
  border-radius: 8px;
  background: #735989;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.hcb-widget .hcb-info-done:hover,
.hcb-widget .hcb-info-done:focus-visible {
  border-color: #604a74;
  background: #604a74;
  color: #fff;
}

.hcb-widget .hcb-messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #faf8fb;
}

.hcb-widget .hcb-waiting {
  margin: 0 0 14px;
  color: #5a4a65;
  font-size: 13px;
  line-height: 1.5;
}

.hcb-widget .hcb-privacy-link,
.hcb-widget .hcb-privacy-link:visited {
  color: #49315a;
  text-decoration: underline;
}

.hcb-widget .hcb-waiting {
  font-style: italic;
}

.hcb-widget .hcb-message {
  max-width: 93%;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid #e4dce8;
  border-radius: 12px;
  background: #fff;
  overflow-wrap: anywhere;
}

.hcb-widget .hcb-message--user {
  margin-left: auto;
  border-color: #735989;
  background: #735989;
  color: #fff;
}

.hcb-widget .hcb-message-label,
.hcb-widget .hcb-sources-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
}

.hcb-widget .hcb-message-text {
  margin: 0;
  color: inherit;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.hcb-widget .hcb-sources-label {
  margin: 11px 0 4px;
  color: #5b476a;
}

.hcb-widget .hcb-sources {
  margin: 0;
  padding-left: 17px;
  list-style: decimal;
}

.hcb-widget .hcb-sources li {
  margin: 3px 0;
  padding: 0;
}

.hcb-widget .hcb-source-link,
.hcb-widget .hcb-source-link:visited {
  color: #604a74;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hcb-widget .hcb-source-link:hover {
  color: #3f2e50;
}

.hcb-widget .hcb-sources li.hcb-source-item--product {
  margin: 8px 0;
}

.hcb-widget .hcb-source-card,
.hcb-widget .hcb-source-card:visited {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid #ded6e3;
  border-radius: 9px;
  background: #fff;
  color: #44354e;
  text-decoration: none;
}

.hcb-widget .hcb-source-card:hover {
  border-color: #8d73a1;
  background: #f8f4fa;
}

.hcb-widget .hcb-source-image {
  display: block;
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  border-radius: 6px;
  background: #eee8f2;
  object-fit: cover;
}

.hcb-widget .hcb-source-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hcb-widget .hcb-source-title {
  color: #604a74;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hcb-widget .hcb-source-detail {
  color: #5a4a65;
  font-size: 11px;
  line-height: 1.35;
}

.hcb-widget .hcb-source-meta {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 3px;
  margin-top: 2px;
}

.hcb-widget .hcb-source-pricing,
.hcb-widget .hcb-source-price-current,
.hcb-widget .hcb-source-price-regular {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
}

.hcb-widget .hcb-source-pricing {
  gap: 2px 10px;
}

.hcb-widget .hcb-source-price-label {
  color: #81758a;
  font-size: 10px;
  font-weight: 500;
}

.hcb-widget .hcb-source-price {
  color: #604a74;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.hcb-widget .hcb-source-price-regular {
  color: #81758a;
  font-size: 11px;
}

.hcb-widget .hcb-source-price-regular del {
  text-decoration-thickness: 1px;
}

.hcb-widget .hcb-source-availability {
  color: #5a4a65;
  font-size: 10px;
}

.hcb-widget .hcb-form {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 14px 10px;
  border-top: 1px solid #e4dce8;
  background: #fff;
}

.hcb-widget .hcb-input-wrap {
  position: relative;
}

.hcb-widget .hcb-input {
  display: block;
  width: 100%;
  min-height: 58px;
  max-height: 130px;
  margin: 0;
  padding: 9px 48px 20px 11px;
  resize: vertical;
  border: 1px solid #cfc4d5;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #302638;
  font-size: 13px;
  line-height: 1.4;
}

.hcb-widget .hcb-input::placeholder {
  color: #766d7c;
  opacity: 1;
}

.hcb-widget .hcb-captcha--checkbox {
  margin-top: 10px;
}

.hcb-widget .hcb-captcha-label {
  display: block;
  margin-bottom: 6px;
  color: #51405e;
  font-size: 11px;
  font-weight: 600;
}

.hcb-widget .hcb-captcha-mount {
  max-width: 100%;
}

.hcb-widget .hcb-form-bottom {
  display: block;
  margin-top: 8px;
}

.hcb-widget .hcb-count {
  color: #665b6c;
  font-size: 10px;
  line-height: 1.3;
}

.hcb-widget .hcb-count {
  position: absolute;
  right: 20px;
  bottom: 5px;
  padding: 0 3px;
  background: #fff;
  pointer-events: none;
}

.hcb-widget .hcb-send {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #735989;
  border-radius: 8px;
  background: #735989;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.hcb-widget .hcb-send:hover,
.hcb-widget .hcb-send:focus-visible {
  border-color: #604a74;
  background: #604a74;
  color: #fff;
}

.hcb-widget .hcb-send:disabled {
  border-color: #d5ceda;
  background: #d5ceda;
  color: #53495a;
  cursor: not-allowed;
}

.hcb-widget .hcb-status {
  min-height: 0;
  margin: 0;
  color: #5b476a;
  font-size: 11px;
  line-height: 1.4;
}

.hcb-widget .hcb-status:not(:empty) {
  margin-top: 8px;
}

.hcb-widget .hcb-status--error {
  color: #9b2732;
}

@media (max-width: 600px) {
  .hcb-widget {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .hcb-widget .hcb-panel {
    width: calc(100vw - 24px);
    height: min(580px, calc(100vh - 92px));
    height: min(580px, calc(100dvh - 92px));
  }

  .hcb-widget--modal {
    padding: 12px;
  }

  .hcb-widget--modal .hcb-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
  }

  .hcb-widget .hcb-toggle {
    width: 52px;
    min-width: 52px;
    min-height: 52px;
    gap: 0;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    line-height: 0;
  }

  .hcb-widget .hcb-header {
    gap: 8px;
    padding: 14px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .hcb-widget .hcb-modal-backdrop,
  .hcb-widget--modal .hcb-panel {
    animation-duration: 1ms;
  }
}

@media (max-width: 360px) {
  .hcb-widget .hcb-source-card {
    gap: 7px;
    padding: 7px;
  }

  .hcb-widget .hcb-source-image {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
  }
}

@media print {
  .hcb-widget {
    display: none;
  }
}
