/* DVS — AI Chatbot styles */
.dvs-bot {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 9100;
  width: 380px;
  max-width: calc(100vw - 28px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #FFFFFF;
  border: 1px solid var(--m-line, rgba(10,10,11,0.10));
  border-radius: 18px;
  box-shadow: 0 24px 60px -20px rgba(10,10,11,0.35);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--m-font-body, system-ui), sans-serif;
}
.dvs-bot.is-open { display: flex; }
/* send arrow: the svg points right; flip it for RTL (forward = left) */
.dvs-bot[dir="rtl"] .dvs-bot-send svg { transform: scaleX(-1); }
/* While the chat is open, get the floating buttons out of its way -
   they otherwise sit on top of the input row. */
body.dvs-bot-open .dvs-fab,
body.dvs-bot-open .dvs-a11y-btn,
body.dvs-bot-open .dvs-a11y-panel { display: none !important; }
@media (max-width: 480px) {
  .dvs-bot {
    right: 8px; left: 8px; bottom: 12px;
    width: auto;
    height: calc(100vh - 90px);
    height: calc(100dvh - 90px);
  }
}

/* Header */
.dvs-bot-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--m-ink, #0A0A0B);
  color: var(--m-bone, #FBFAF6);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dvs-bot-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--m-gold, #B08948);
  color: var(--m-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--m-font-display, serif);
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
}
.dvs-bot-avatar::after {
  content: '';
  position: absolute;
  bottom: -2px; right: -2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #25D366;
  border: 2px solid var(--m-ink);
}
.dvs-bot-title { font-family: var(--m-font-display, serif); font-size: 16px; font-weight: 500; line-height: 1.1; }
[lang="he"] .dvs-bot-title { font-family: var(--m-font-display-he, serif); }
.dvs-bot-sub { font-size: 11px; opacity: 0.7; font-family: var(--m-font-mono, monospace); letter-spacing: 0.04em; }
.dvs-bot-close {
  margin-inline-start: auto;
  background: transparent; border: 0;
  color: var(--m-bone, #FBFAF6);
  cursor: pointer; font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
}
.dvs-bot-close:hover { background: rgba(255,255,255,0.08); }

/* Body / scroll area */
.dvs-bot-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--m-bone, #FBFAF6);
}
.dvs-bot-msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}
.dvs-bot-msg.is-bot {
  background: #FFFFFF;
  border: 1px solid var(--m-line, rgba(10,10,11,0.08));
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
[dir="rtl"] .dvs-bot-msg.is-bot { border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.dvs-bot-msg.is-user {
  background: var(--m-ink, #0A0A0B);
  color: var(--m-bone, #FBFAF6);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
[dir="rtl"] .dvs-bot-msg.is-user { border-bottom-right-radius: 16px; border-bottom-left-radius: 4px; }
.dvs-bot-msg.is-system {
  align-self: center;
  font-family: var(--m-font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--m-ink);
  opacity: 0.5;
  background: transparent;
  padding: 4px 10px;
  border: 1px solid var(--m-line);
}

/* Typing indicator */
.dvs-bot-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}
.dvs-bot-typing span {
  width: 6px; height: 6px;
  background: var(--m-ink);
  border-radius: 50%;
  opacity: 0.4;
  animation: dvs-typing 1.2s infinite ease-in-out;
}
.dvs-bot-typing span:nth-child(2) { animation-delay: 0.15s; }
.dvs-bot-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dvs-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 0.9; }
}

/* Quick replies */
.dvs-bot-quick {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 16px 10px;
  background: var(--m-bone, #FBFAF6);
}
.dvs-bot-quick-btn {
  background: #FFFFFF;
  border: 1px solid var(--m-line, rgba(10,10,11,0.10));
  color: var(--m-ink, #0A0A0B);
  border-radius: 999px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 180ms;
}
.dvs-bot-quick-btn:hover {
  background: var(--m-ink, #0A0A0B);
  color: var(--m-bone, #FBFAF6);
  border-color: var(--m-ink);
}

/* Input */
.dvs-bot-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--m-line, rgba(10,10,11,0.10));
  background: #FFFFFF;
}
.dvs-bot-input {
  flex: 1;
  border: 1px solid var(--m-line, rgba(10,10,11,0.10));
  background: var(--m-bone, #FBFAF6);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--m-ink);
  outline: none;
  transition: border-color 180ms, background 180ms;
}
.dvs-bot-input:focus {
  border-color: var(--m-gold, #B08948);
  background: #FFFFFF;
}
.dvs-bot-input:disabled { opacity: 0.6; }
.dvs-bot-send {
  background: var(--m-ink, #0A0A0B);
  color: var(--m-bone, #FBFAF6);
  border: 0;
  border-radius: 50%;
  width: 40px; height: 40px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 200ms, transform 200ms;
}
.dvs-bot-send:hover { background: var(--m-gold, #B08948); transform: translateY(-1px); }
.dvs-bot-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.dvs-bot-send svg { width: 18px; height: 18px; }
[dir="rtl"] .dvs-bot-send svg { transform: scaleX(-1); }

/* Lead summary block (when bot proposes sending) */
.dvs-bot-summary {
  align-self: stretch;
  background: #FFFFFF;
  border: 1px solid var(--m-gold, #B08948);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.dvs-bot-summary h4 {
  margin: 0 0 8px;
  font-family: var(--m-font-display, serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--m-ink);
}
[lang="he"] .dvs-bot-summary h4 { font-family: var(--m-font-display-he, serif); }
.dvs-bot-summary ul { margin: 0 0 12px; padding-inline-start: 20px; }
.dvs-bot-summary li { margin-bottom: 4px; }
.dvs-bot-summary-actions { display: flex; gap: 8px; }
.dvs-bot-summary-actions button,
.dvs-bot-summary-actions a {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  text-decoration: none;
  text-align: center;
  transition: all 180ms;
}
.dvs-bot-summary-send {
  background: var(--m-ink);
  color: var(--m-bone);
}
.dvs-bot-summary-send:hover { background: var(--m-gold); color: var(--m-ink); }
.dvs-bot-summary-edit {
  background: transparent;
  border: 1px solid var(--m-line) !important;
  color: var(--m-ink);
}
.dvs-bot-summary-edit:hover { border-color: var(--m-ink) !important; }
