.dwc-chat {
  --dwc-chat-blue: #315dff;
  --dwc-chat-navy: #071225;
  --dwc-chat-ink: #10182b;
  --dwc-chat-muted: #61708a;
  --dwc-chat-line: #d8e4ff;
  --dwc-chat-soft: #f4f7ff;
  font-family: Inter, Manrope, Arial, "Helvetica Neue", sans-serif;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147482500;
}

.dwc-chat * {
  box-sizing: border-box;
}

.dwc-chat__launcher {
  position: relative;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  padding: 5px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.95), rgba(220, 231, 255, 0.48) 28%, transparent 48%),
    linear-gradient(145deg, #ffffff, #dce7ff 42%, #315dff);
  box-shadow: 0 22px 50px rgba(7, 18, 37, 0.32), 0 0 0 8px rgba(49, 93, 255, 0.12);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.dwc-chat__launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 28px 64px rgba(7, 18, 37, 0.38), 0 0 0 10px rgba(49, 93, 255, 0.16);
}

.dwc-chat__launcher img,
.dwc-chat__header-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.dwc-chat__avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--dwc-chat-blue);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.dwc-chat__launcher-badge {
  position: absolute;
  right: -3px;
  bottom: 4px;
  min-width: 30px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--dwc-chat-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dwc-chat__panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: 96px;
  width: min(410px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 126px));
  overflow: hidden;
  border: 1px solid rgba(216, 228, 255, 0.95);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 32px 86px rgba(7, 18, 37, 0.34);
}

.dwc-chat-is-open .dwc-chat__panel {
  display: flex;
  flex-direction: column;
}

.dwc-chat-is-open .dwc-chat__launcher {
  display: none;
}

.dwc-chat__header {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(135deg, #071225, #0d2a62 58%, #315dff);
  color: #fff;
}

.dwc-chat__header-avatar {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26);
}

.dwc-chat__header strong,
.dwc-chat__header span {
  display: block;
}

.dwc-chat__header strong {
  font-size: 16px;
  line-height: 1.15;
}

.dwc-chat__header span {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.78;
}

.dwc-chat__header button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dwc-chat__messages {
  flex: 1;
  min-height: 292px;
  overflow-y: auto;
  padding: 16px;
  background:
    linear-gradient(rgba(244, 247, 255, 0.94), rgba(244, 247, 255, 0.94)),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(49, 93, 255, 0.08) 29px 30px);
}

.dwc-chat__message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.dwc-chat__message--bot {
  border-bottom-left-radius: 6px;
  background: #fff;
  color: var(--dwc-chat-ink);
  border: 1px solid rgba(216, 228, 255, 0.92);
  box-shadow: 0 8px 22px rgba(7, 18, 37, 0.07);
}

.dwc-chat__message--user {
  margin-left: auto;
  border-bottom-right-radius: 6px;
  background: linear-gradient(135deg, #315dff, #173a96);
  color: #fff;
  box-shadow: 0 10px 22px rgba(49, 93, 255, 0.22);
}

.dwc-chat__quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--dwc-chat-line);
  background: #fff;
}

.dwc-chat__quick button {
  min-height: 38px;
  border: 1px solid #c9d8ff;
  border-radius: 999px;
  background: #f3f6ff;
  color: #13214a;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.dwc-chat__quick button:hover {
  border-color: var(--dwc-chat-blue);
  color: var(--dwc-chat-blue);
}

.dwc-chat__composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--dwc-chat-line);
  background: #fff;
}

.dwc-chat__composer input,
.dwc-chat__lead-form input,
.dwc-chat__lead-form select,
.dwc-chat__lead-form textarea {
  width: 100%;
  border: 1px solid #c9d8ea;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  color: var(--dwc-chat-ink);
  font: inherit;
}

.dwc-chat__composer input:focus,
.dwc-chat__lead-form input:focus,
.dwc-chat__lead-form select:focus,
.dwc-chat__lead-form textarea:focus {
  outline: 2px solid rgba(49, 93, 255, 0.24);
  border-color: var(--dwc-chat-blue);
}

.dwc-chat__composer button,
.dwc-chat__lead-form button {
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  background: var(--dwc-chat-blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.dwc-chat__composer button:hover,
.dwc-chat__lead-form button:hover {
  background: #173a96;
}

.dwc-chat__composer button:disabled,
.dwc-chat__composer input:disabled {
  opacity: 0.65;
  cursor: wait;
}

.dwc-chat__lead-form {
  display: grid;
  gap: 9px;
  margin: 12px 0;
  padding: 13px;
  border: 1px solid var(--dwc-chat-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(7, 18, 37, 0.08);
}

.dwc-chat__form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dwc-chat__privacy {
  margin: 0;
  padding: 0 14px 12px;
  background: #fff;
  color: var(--dwc-chat-muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 540px) {
  .dwc-chat {
    right: 14px;
    bottom: 14px;
  }

  .dwc-chat__launcher {
    width: 70px;
    height: 70px;
  }

  .dwc-chat__panel {
    right: -2px;
    bottom: 84px;
    width: calc(100vw - 24px);
  }

  .dwc-chat__quick,
  .dwc-chat__form-grid {
    grid-template-columns: 1fr;
  }
}
