.dv-chat {
  --dv-chat-bg: #0f1c24;
  --dv-chat-panel: #f7f4ef;
  --dv-chat-ink: #1a242c;
  --dv-chat-muted: #5c6b75;
  --dv-chat-accent: #0e7a5a;
  --dv-chat-accent-2: #c45c26;
  --dv-chat-user: #143d4f;
  position: fixed;
  right: 18px;
  bottom: 96px;
  z-index: 1100;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dv-chat__fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px 12px 14px;
  background: linear-gradient(135deg, #143d4f, #0e7a5a);
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 40, 48, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dv-chat__fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(15, 40, 48, 0.4);
}

.dv-chat__fab-label {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.dv-chat__panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 140px));
  background: var(--dv-chat-panel);
  color: var(--dv-chat-ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(10, 24, 32, 0.28);
  border: 1px solid rgba(20, 40, 50, 0.08);
}

.dv-chat.is-open .dv-chat__panel {
  display: flex;
  animation: dvChatIn 0.22s ease;
}

.dv-chat.is-open .dv-chat__fab {
  display: none;
}

@keyframes dvChatIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.dv-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, #143d4f, #1b5c4a);
  color: #fff;
}

.dv-chat__head .dv-chat__close + .dv-chat__close {
  margin-left: 4px;
}

.dv-chat__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.dv-chat__brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 4px;
}

.dv-chat__brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.dv-chat__brand span {
  display: block;
  font-size: 12px;
  opacity: 0.85;
}

.dv-chat__close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.dv-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 10% 0%, rgba(14, 122, 90, 0.08), transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(196, 92, 38, 0.07), transparent 35%),
    var(--dv-chat-panel);
}

.dv-chat__bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.dv-chat__bubble--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(20, 40, 50, 0.08);
  color: var(--dv-chat-ink);
  border-bottom-left-radius: 4px;
}

.dv-chat__bubble--user {
  align-self: flex-end;
  background: var(--dv-chat-user);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.dv-chat__link {
  color: #0b6b4f;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.dv-chat__bubble--user .dv-chat__link {
  color: #d7fff0;
}

.dv-chat__bubble--typing {
  color: var(--dv-chat-muted);
  font-style: italic;
}

.dv-chat__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 8px;
}

.dv-chat__quick button {
  border: 1px solid rgba(20, 61, 79, 0.18);
  background: #fff;
  color: #143d4f;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.dv-chat__quick button:hover {
  border-color: var(--dv-chat-accent);
  color: var(--dv-chat-accent);
}

.dv-chat__form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(20, 40, 50, 0.08);
  background: #fff;
}

.dv-chat__form input {
  flex: 1;
  border: 1px solid rgba(20, 40, 50, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.dv-chat__form input:focus {
  border-color: var(--dv-chat-accent);
}

.dv-chat__form button {
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  background: var(--dv-chat-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.dv-chat__form button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.dv-chat__foot {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 8px 12px 12px;
  background: #fff;
  font-size: 12px;
}

.dv-chat__foot a {
  color: var(--dv-chat-accent-2);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 640px) {
  .dv-chat {
    right: 12px;
    bottom: 88px;
  }

  .dv-chat__panel {
    width: calc(100vw - 24px);
    height: min(70vh, 560px);
  }

  .dv-chat__fab-label {
    display: none;
  }

  .dv-chat__fab {
    width: 54px;
    height: 54px;
    padding: 0;
    justify-content: center;
  }
}
