/* Dave (A.I. guide) chat widget — scoped under #threehle-dave-root to avoid leaking styles */

#threehle-dave-root, #threehle-dave-root * { box-sizing: border-box; }

#threehle-dave-root .dv-bubble {
  position: fixed; right: 22px; bottom: 22px; z-index: 9998;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #0dd4e2, #20d5db);
  color: #0b1220; border: none; cursor: pointer;
  box-shadow: 0 10px 30px rgba(13,212,226,0.4), 0 4px 10px rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#threehle-dave-root .dv-bubble:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(13,212,226,0.55); }
#threehle-dave-root .dv-bubble svg { width: 28px; height: 28px; }

#threehle-dave-root .dv-panel {
  position: fixed; right: 22px; bottom: 96px; z-index: 9999;
  width: 380px; max-width: calc(100vw - 44px);
  height: 560px; max-height: calc(100vh - 140px);
  background: #0f172a; color: #e6eaf2;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 10px 30px rgba(0,0,0,0.3);
  transform: translateY(12px); opacity: 0; pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
#threehle-dave-root.dv-open .dv-panel { transform: translateY(0); opacity: 1; pointer-events: auto; }
#threehle-dave-root.dv-open .dv-bubble { opacity: 0.0; pointer-events: none; }

#threehle-dave-root .dv-head {
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(13,212,226,0.15), rgba(32,213,219,0.05));
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
#threehle-dave-root .dv-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #0dd4e2, #20d5db);
  color: #0b1220; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#threehle-dave-root .dv-head-text { flex: 1; line-height: 1.2; }
#threehle-dave-root .dv-head-text strong { display: block; font-size: 15px; }
#threehle-dave-root .dv-head-text span { font-size: 12px; opacity: 0.7; }
#threehle-dave-root .dv-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 1px solid rgba(255,255,255,0.15);
  color: #e6eaf2; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#threehle-dave-root .dv-close:hover { background: rgba(255,255,255,0.08); }

#threehle-dave-root .dv-body {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
#threehle-dave-root .dv-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; font-size: 14px;
  word-wrap: break-word;
}
#threehle-dave-root .dv-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0dd4e2, #20d5db); color: #0b1220;
  border-bottom-right-radius: 4px;
}
#threehle-dave-root .dv-msg.bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.06); color: #e6eaf2;
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 4px;
}
#threehle-dave-root .dv-msg.bot.typing {
  color: rgba(230,234,242,0.55); font-style: italic;
}
#threehle-dave-root .dv-msg.bot strong { color: #0dd4e2; }

#threehle-dave-root .dv-escalate {
  align-self: stretch; padding: 14px; border-radius: 12px;
  background: rgba(13,212,226,0.08); border: 1px solid rgba(13,212,226,0.25);
  display: flex; flex-direction: column; gap: 8px;
}
#threehle-dave-root .dv-escalate input, #threehle-dave-root .dv-escalate textarea {
  width: 100%; padding: 9px 12px; font-size: 14px;
  background: rgba(255,255,255,0.04); color: #e6eaf2;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; outline: none;
  font-family: inherit;
}
#threehle-dave-root .dv-escalate textarea { min-height: 64px; resize: vertical; }
#threehle-dave-root .dv-escalate input:focus, #threehle-dave-root .dv-escalate textarea:focus {
  border-color: #0dd4e2;
}
#threehle-dave-root .dv-escalate button {
  padding: 9px 14px; border-radius: 8px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #0dd4e2, #20d5db); color: #0b1220; font-weight: 700;
}

#threehle-dave-root .dv-foot {
  padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; gap: 8px; align-items: flex-end;
}
#threehle-dave-root .dv-input {
  flex: 1; min-height: 36px; max-height: 120px; padding: 8px 12px; font-size: 14px;
  background: rgba(255,255,255,0.04); color: #e6eaf2;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; outline: none;
  resize: none; font-family: inherit;
}
#threehle-dave-root .dv-input:focus { border-color: #0dd4e2; }
#threehle-dave-root .dv-send {
  width: 40px; height: 40px; border-radius: 10px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #0dd4e2, #20d5db); color: #0b1220;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#threehle-dave-root .dv-send:disabled { opacity: 0.4; cursor: not-allowed; }
#threehle-dave-root .dv-send svg { width: 18px; height: 18px; }
#threehle-dave-root .dv-privacy {
  padding: 6px 14px 10px; font-size: 11px; opacity: 0.55; text-align: center;
}

@media (max-width: 480px) {
  #threehle-dave-root .dv-panel {
    right: 10px; left: 10px; bottom: 84px; width: auto;
    height: calc(100vh - 100px); max-height: none;
  }
  #threehle-dave-root .dv-bubble { right: 14px; bottom: 14px; width: 54px; height: 54px; }
}
