.dwca-widget {
  --dwca-green: #25d366;
  --dwca-green-dark: #075e54;
  --dwca-ink: #111b21;
  --dwca-soft: #e5ddd5;
  --dwca-line: #d1d7db;
  --dwca-panel-bg: #efeae2;
  --dwca-header-bg: #075e54;
  --dwca-header-text: #ffffff;
  --dwca-input-bg: #ffffff;
  --dwca-input-text: #111b21;
  --dwca-user-bubble: #dcf8c6;
  --dwca-user-text: #111b21;
  --dwca-assistant-bubble: #ffffff;
  --dwca-assistant-text: #111b21;
  font-family: "Segoe UI", sans-serif;
}

.dwca-widget-floating {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
}

.dwca-widget-inline {
  position: relative;
  max-width: 380px;
}

.dwca-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2fe66d, var(--dwca-green-dark));
  color: #fff;
  width: 64px;
  height: 64px;
  padding: 0;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(18, 140, 126, 0.28);
  position: relative;
  z-index: 5;
}

.dwca-popup-heartbeat:not(.dwca-open) {
  animation: dwca-widget-nudge 3s ease-in-out infinite;
}

.dwca-popup-heartbeat .dwca-toggle {
  animation: dwca-heartbeat-pop 1.7s ease-in-out infinite;
}

.dwca-popup-heartbeat .dwca-toggle__icon {
  animation: dwca-icon-vibrate 1.7s linear infinite;
}

.dwca-popup-heartbeat .dwca-toggle::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 2px solid rgba(37, 211, 102, 0.45);
  pointer-events: none;
  animation: dwca-heartbeat-ring 1.7s ease-out infinite;
}

.dwca-popup-heartbeat.dwca-open {
  animation: none;
}

.dwca-popup-heartbeat.dwca-open .dwca-toggle::before {
  animation-play-state: paused;
  opacity: 0;
}

.dwca-popup-heartbeat.dwca-open .dwca-toggle,
.dwca-popup-heartbeat.dwca-open .dwca-toggle__icon {
  animation-play-state: paused;
}

.dwca-popup-heartbeat.dwca-open .dwca-panel {
  animation: dwca-panel-pulse 2.2s ease-in-out infinite;
}

@keyframes dwca-widget-nudge {
  0%,
  84%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  86% {
    transform: translate3d(-1.5px, 0, 0);
  }
  88% {
    transform: translate3d(1.5px, 0, 0);
  }
  90% {
    transform: translate3d(-1px, 0, 0);
  }
  92% {
    transform: translate3d(1px, 0, 0);
  }
}

@keyframes dwca-heartbeat-pop {
  0%,
  40%,
  100% {
    transform: scale(1);
  }
  8% {
    transform: scale(1.08);
  }
  16% {
    transform: scale(0.96);
  }
  24% {
    transform: scale(1.06);
  }
}

@keyframes dwca-icon-vibrate {
  0%,
  40%,
  100% {
    transform: rotate(0deg);
  }
  6% {
    transform: rotate(-4deg);
  }
  10% {
    transform: rotate(4deg);
  }
  14% {
    transform: rotate(-3deg);
  }
  18% {
    transform: rotate(3deg);
  }
}

@keyframes dwca-heartbeat-ring {
  0% {
    transform: scale(0.92);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.18);
    opacity: 0;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@keyframes dwca-panel-pulse {
  0%,
  100% {
    box-shadow: 0 24px 60px rgba(17, 27, 33, 0.24);
  }
  50% {
    box-shadow: 0 28px 68px rgba(37, 211, 102, 0.28);
  }
}

.dwca-toggle__icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: var(--dwca-green-dark);
  box-shadow: inset 0 0 0 1px rgba(18, 140, 126, 0.1);
}

.dwca-toggle__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.dwca-toggle__text {
  display: none;
}

@media (min-width: 601px) {
  .dwca-desktop-style-2 .dwca-toggle {
    border-radius: 16px;
  }

  .dwca-desktop-style-3 .dwca-toggle {
    width: 62px;
    height: 62px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }

  .dwca-desktop-style-3 .dwca-toggle__text {
    display: none;
  }

  .dwca-desktop-style-3x .dwca-toggle {
    width: 76px;
    height: 76px;
    padding: 0;
    border-radius: 24px;
    justify-content: center;
  }

  .dwca-desktop-style-3x .dwca-toggle__text {
    display: none;
  }

  .dwca-desktop-style-4 .dwca-toggle {
    border-radius: 999px;
    padding-inline: 24px;
  }

  .dwca-desktop-style-5 .dwca-toggle {
    background: #fff;
    color: var(--dwca-green-dark);
    border: 1px solid var(--dwca-line);
  }

  .dwca-desktop-style-6 .dwca-toggle {
    background: transparent;
    box-shadow: none;
    color: var(--dwca-green-dark);
    padding: 0;
  }

  .dwca-desktop-style-6 .dwca-toggle__icon {
    display: none;
  }

  .dwca-desktop-style-7 .dwca-toggle {
    padding: 18px;
    border-radius: 22px;
  }

  .dwca-desktop-style-7 .dwca-toggle__text {
    display: none;
  }

  .dwca-desktop-style-7x .dwca-toggle {
    padding: 18px 24px 18px 18px;
    border-radius: 22px;
  }

  .dwca-desktop-style-8 .dwca-toggle {
    background: linear-gradient(135deg, #1f2f3a, #25d366);
    border-radius: 14px;
  }

  .dwca-desktop-style-99 .dwca-toggle {
    width: 70px;
    height: 70px;
    padding: 0;
    border-radius: 20px;
    justify-content: center;
  }

  .dwca-desktop-style-99 .dwca-toggle__text {
    display: none;
  }

  .dwca-desktop-style-99 .dwca-toggle__icon {
    width: 46px;
    height: 46px;
  }
}

.dwca-panel {
  width: min(420px, calc(100vw - 24px));
  position: absolute;
  bottom: calc(100% + 12px);
  background: #fff;
  border: 1px solid var(--dwca-line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(17, 27, 33, 0.24);
  overflow: hidden;
  height: min(340px, calc(100vh - 96px));
  max-height: min(340px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.dwca-widget.dwca-open .dwca-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.dwca-align-right .dwca-panel {
  right: 0;
  left: auto;
}

.dwca-align-left .dwca-panel {
  left: 0;
  right: auto;
}

.dwca-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--dwca-header-bg);
  border-bottom: 1px solid var(--dwca-line);
}

.dwca-panel__intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dwca-assistant-image {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dwca-panel__intro strong {
  color: var(--dwca-header-text);
  font-size: 15px;
  font-weight: 600;
}

.dwca-panel__header p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.dwca-close {
  border: 0;
  background: transparent;
  color: var(--dwca-header-text);
  font-size: 28px;
  line-height: 1;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  flex: 0 0 38px;
  position: relative;
  z-index: 3;
}

.dwca-close:hover,
.dwca-close:focus,
.dwca-close:active,
.dwca-close:focus-visible {
  background: transparent;
  box-shadow: none;
  outline: none;
}

.dwca-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background-color: var(--dwca-panel-bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14)),
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.18) 0, rgba(255, 255, 255, 0.18) 2px, transparent 2px),
    radial-gradient(circle at 75% 45%, rgba(0, 0, 0, 0.03) 0, rgba(0, 0, 0, 0.03) 2px, transparent 2px);
  background-size: auto, 32px 32px, 28px 28px;
  background-attachment: local;
}

.dwca-message {
  max-width: 86%;
  margin-bottom: 10px;
  padding: 11px 13px;
  border-radius: 8px;
  line-height: 1.45;
  font-size: 14px;
  box-shadow: 0 1px 1px rgba(17, 27, 33, 0.08);
}

.dwca-message-assistant {
  background: var(--dwca-assistant-bubble);
  color: var(--dwca-assistant-text);
  border: 0;
}

.dwca-message-user {
  background: var(--dwca-user-bubble);
  color: var(--dwca-user-text);
  margin-left: auto;
}

.dwca-question-form {
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  padding: 10px 12px;
  background: #f0f2f5;
  border-top: 1px solid #d9dee3;
}

.dwca-question-form {
  grid-template-columns: 1fr auto;
}

.dwca-question-form input {
  width: 100%;
  border: 1px solid #ffffff;
  background: var(--dwca-input-bg);
  color: var(--dwca-input-text);
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
}

.dwca-question-form input::placeholder {
  color: #667781;
}

.dwca-question-form button,
.dwca-live-chat {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 600;
  text-decoration: none;
}

.dwca-question-form button {
  background: var(--dwca-header-bg);
  color: #fff;
  cursor: pointer;
}

.dwca-actions {
  flex: 0 0 auto;
  padding: 0 12px 12px;
  background: #f0f2f5;
}

.dwca-live-chat {
  display: block;
  text-align: center;
  background: #25d366;
  color: #fff;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dwca-qr {
  width: fit-content;
  max-width: 86%;
  margin: 0 0 12px;
  padding: 12px;
  text-align: center;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 1px rgba(17, 27, 33, 0.08);
}

.dwca-qr__name {
  display: block;
  margin: 0 0 8px;
  color: #111b21;
  font-size: 14px;
  font-weight: 600;
}

.dwca-qr p {
  margin: 0 0 10px;
  font-size: 13px;
  color: #4d6168;
}

.dwca-qr img {
  max-width: 140px;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--dwca-line);
}

@media (max-width: 600px) {
  .dwca-panel {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
    height: calc(100vh - 108px);
    max-height: calc(100vh - 108px);
    border-radius: 18px;
  }

  .dwca-question-form {
    grid-template-columns: 1fr;
  }

  .dwca-widget-floating {
    right: 12px;
    bottom: 12px;
  }

  .dwca-toggle__text {
    display: none;
  }

  .dwca-toggle {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    justify-content: center;
    padding: 0;
  }

  .dwca-toggle__icon {
    width: 38px;
    height: 38px;
  }

  .dwca-widget-floating {
    z-index: 99999;
  }

  .dwca-mobile-style-2 .dwca-toggle {
    border-radius: 16px;
  }

  .dwca-mobile-style-3 .dwca-toggle {
    width: 62px;
    height: 62px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }

  .dwca-mobile-style-3 .dwca-toggle__text {
    display: none;
  }

  .dwca-mobile-style-3x .dwca-toggle {
    width: 76px;
    height: 76px;
    padding: 0;
    border-radius: 24px;
    justify-content: center;
  }

  .dwca-mobile-style-3x .dwca-toggle__text {
    display: none;
  }

  .dwca-mobile-style-4 .dwca-toggle {
    border-radius: 999px;
    padding-inline: 24px;
  }

  .dwca-mobile-style-5 .dwca-toggle {
    background: #fff;
    color: var(--dwca-green-dark);
    border: 1px solid var(--dwca-line);
  }

  .dwca-mobile-style-6 .dwca-toggle {
    background: transparent;
    box-shadow: none;
    color: var(--dwca-green-dark);
    padding: 0;
    width: auto;
  }

  .dwca-mobile-style-6 .dwca-toggle__icon {
    display: none;
  }

  .dwca-mobile-style-7 .dwca-toggle {
    padding: 18px;
    border-radius: 22px;
  }

  .dwca-mobile-style-7 .dwca-toggle__text {
    display: none;
  }

  .dwca-mobile-style-7x .dwca-toggle {
    padding: 18px 24px 18px 18px;
    border-radius: 22px;
    width: auto;
  }

  .dwca-mobile-style-8 .dwca-toggle {
    background: linear-gradient(135deg, #1f2f3a, #25d366);
    border-radius: 14px;
    width: auto;
    padding: 14px 20px 14px 14px;
  }

  .dwca-mobile-style-99 .dwca-toggle {
    width: 70px;
    height: 70px;
    padding: 0;
    border-radius: 20px;
    justify-content: center;
  }

  .dwca-mobile-style-99 .dwca-toggle__text {
    display: none;
  }

  .dwca-mobile-style-99 .dwca-toggle__icon {
    width: 46px;
    height: 46px;
  }
}
