/* Decisionmaker public-website chatbot widget — Alex */
.dm-chat-root {
  position: fixed; bottom: 18px; right: 18px; z-index: 9990;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1f2937;
}
.dm-chat-root *, .dm-chat-root *::before, .dm-chat-root *::after { box-sizing: border-box; }

.dm-chat-launcher {
  width: 60px; height: 60px; border-radius: 50%;
  background: #fff; border: none; cursor: pointer; padding: 0;
  box-shadow: 0 10px 25px rgba(8,115,154,.25), 0 4px 10px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.dm-chat-launcher:hover { transform: scale(1.06); }
.dm-chat-launcher img { width: 52px; height: 52px; border-radius: 50%; display: block; }

.dm-chat-root.is-proactive {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
}
.dm-chat-proactive {
  position: relative;
  max-width: 270px; padding: 12px 28px 12px 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  border: 1px solid #e5e7eb;
  font-size: 15px; line-height: 1.4;
}
.dm-chat-proactive .dm-chat-proactive-body {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.dm-chat-proactive .dm-chat-dismiss {
  position: absolute; top: 6px; right: 6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  color: #9ca3af; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.dm-chat-proactive .dm-chat-dismiss:hover { background: #f3f4f6; color: #374151; }

.dm-chat-window {
  width: 360px; max-width: calc(100vw - 36px);
  height: 540px; max-height: 80vh;
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  border: 1px solid #e5e7eb;
}
.dm-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px;
  background: linear-gradient(135deg, #08739A 0%, #0a8bb6 100%);
  color: #fff;
}
.dm-chat-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dm-chat-header img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff; }
.dm-chat-header-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.dm-chat-header-sub  { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.dm-chat-header-actions { display: flex; gap: 4px; }
.dm-chat-icon-btn {
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: transparent; color: #fff; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.dm-chat-icon-btn:hover { background: rgba(255,255,255,.12); }

.dm-chat-messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 12px; background: #f9fafb;
  display: flex; flex-direction: column; gap: 10px;
}
.dm-chat-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.dm-chat-msg.user { justify-content: flex-end; }
.dm-chat-msg img { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.dm-chat-bubble {
  max-width: 78%;
  padding: 8px 12px; border-radius: 16px;
  font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.dm-chat-bubble.assistant {
  background: #fff; color: #1f2937; border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}
.dm-chat-bubble.user {
  background: #08739A; color: #fff; border-bottom-right-radius: 4px;
}

/* Prior-conversation recap rendering. Greyed-out so it's clearly
   "history" and not part of today's exchange. */
.dm-chat-msg.history { opacity: .7; }
.dm-chat-msg.history .dm-chat-bubble.assistant { background: #f5f7fa; }
.dm-chat-msg.history .dm-chat-bubble.user { background: #4a8aa6; }
.dm-chat-divider {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0; font-size: 11px; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .05em;
}
.dm-chat-divider::before,
.dm-chat-divider::after {
  content: ''; flex: 1; height: 1px; background: #e2e8f0;
}
.dm-chat-divider span { padding: 0 4px; }

.dm-chat-quick-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0 0 36px;
}
.dm-chat-quick-row button {
  background: #fff;
  border: 1px solid rgba(8,115,154,.4);
  color: #08739A;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
}
.dm-chat-quick-row button:hover {
  background: #08739A;
  color: #fff;
}
.dm-chat-typing {
  display: inline-flex; gap: 4px;
  padding: 10px 14px; background: #fff; border: 1px solid #e5e7eb;
  border-radius: 16px; border-bottom-left-radius: 4px;
}
.dm-chat-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #9ca3af;
  animation: dm-chat-bounce 1.2s infinite;
}
.dm-chat-typing span:nth-child(2) { animation-delay: .15s; }
.dm-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dm-chat-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.dm-chat-form {
  display: grid; gap: 6px; padding: 10px;
  background: #fff; border-top: 1px solid #e5e7eb;
}
.dm-chat-form input[type="text"],
.dm-chat-form input[type="email"] {
  width: 100%; padding: 8px 10px;
  border: 1px solid #e5e7eb; border-radius: 8px;
  font-size: 13px; outline: none;
}
.dm-chat-form input:focus { border-color: #08739A; box-shadow: 0 0 0 3px rgba(8,115,154,.15); }
.dm-chat-form .dm-chat-consent {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 11px; color: #6b7280; line-height: 1.4;
}
.dm-chat-form .dm-chat-consent input { margin-top: 2px; accent-color: #08739A; }
.dm-chat-form .dm-chat-submit {
  width: 100%; padding: 8px 12px;
  background: #08739A; color: #fff; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.dm-chat-form .dm-chat-submit:disabled { opacity: .5; cursor: not-allowed; }

.dm-chat-input-wrap { position: relative; }
.dm-chat-input-row {
  display: flex; align-items: flex-end; gap: 4px;
  padding: 8px; background: #fff; border-top: 1px solid #e5e7eb;
}
.dm-chat-input-row textarea {
  flex: 1; min-height: 36px; max-height: 120px;
  padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 10px;
  font-size: 13px; font-family: inherit; resize: none; outline: none;
}
.dm-chat-input-row textarea:focus { border-color: #08739A; box-shadow: 0 0 0 3px rgba(8,115,154,.15); }
.dm-chat-icon-action {
  height: 36px; width: 36px; padding: 0;
  background: transparent; color: #6b7280; border: none; border-radius: 10px;
  cursor: pointer; font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.dm-chat-icon-action:hover { background: #f3f4f6; color: #374151; }
.dm-chat-input-row .dm-chat-send {
  height: 36px; width: 36px; padding: 0;
  background: #08739A; color: #fff; border: none; border-radius: 10px;
  cursor: pointer; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.dm-chat-input-row .dm-chat-send:disabled { opacity: .5; cursor: not-allowed; }
.dm-chat-emoji-panel {
  position: absolute;
  bottom: calc(100% + 4px); left: 8px;
  z-index: 10;
  width: 260px;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
  padding: 8px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.dm-chat-emoji-panel button {
  background: transparent; border: none; cursor: pointer;
  padding: 4px; border-radius: 6px;
  font-size: 18px; line-height: 1;
}
.dm-chat-emoji-panel button:hover { background: #f3f4f6; }

.dm-chat-privacy {
  padding: 6px 10px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  font-size: 10px; line-height: 1.4; color: #6b7280;
  text-align: center;
}
