/* DVStore Chatbot v4 — brand tokens: navy #0B1B4D, blue #0B51FF, gold #FFD60A */

#dvsc-root, #dvsc-root * {
  box-sizing: border-box;
}
#dvsc-root {
  font-family: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ===== Launcher ===== */
#dvsc-launcher {
  position: fixed !important;
  right: 18px;
  bottom: 92px;
  z-index: 999999;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #0B1B4D 0%, #0B51FF 100%) !important;
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(11, 81, 255, 0.35);
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  line-height: 1;
}
#dvsc-launcher .dvsc-launcher-icon { font-size: 20px; }
#dvsc-launcher .dvsc-launcher-text { font-size: 9px; font-weight: 800; color: #fff !important; text-align: center; }
#dvsc-launcher.dvsc-hidden { display: none !important; }
#dvsc-launcher.dvsc-pulse { animation: dvscPulse 1.4s infinite ease-in-out; }
@keyframes dvscPulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(11, 81, 255, 0.35); }
  50% { box-shadow: 0 10px 28px rgba(11, 81, 255, 0.6), 0 0 0 8px rgba(11, 81, 255, 0.12); }
}

/* ===== Panel ===== */
#dvsc-panel {
  position: fixed !important;
  right: 16px;
  bottom: 170px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: auto;
  max-height: calc(100vh - 130px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 55px rgba(11, 81, 255, 0.25);
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.92) translateY(14px);
  transform-origin: bottom right;
  pointer-events: none;
  z-index: 999999;
  transition: opacity .2s ease, transform .2s ease;
}
#dvsc-panel.dvsc-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* Head */
.dvsc-head {
  background: linear-gradient(135deg, #0B1B4D 0%, #0B51FF 100%);
  padding: 16px;
  display: flex !important;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.dvsc-head-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.dvsc-head-text { flex: 1 1 auto; min-width: 0; }
.dvsc-title {
  font-weight: 800;
  font-size: 15px;
  color: #fff !important;
  line-height: 1.2;
}
.dvsc-subtitle {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.78) !important;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.dvsc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  display: inline-block;
  flex-shrink: 0;
}
.dvsc-close {
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff !important;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== Body / messages ===== */
.dvsc-body {
  padding: 16px 14px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  background: #FAFBFF;
}

.dvsc-row {
  display: flex !important;
  width: 100%;
  margin: 10px 0;
  gap: 8px;
  animation: dvscPopIn .32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.dvsc-row-bot { justify-content: flex-start; }
.dvsc-row-you { justify-content: flex-end; }

@keyframes dvscPopIn {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .dvsc-row { animation: none; }
}

.dvsc-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0B51FF;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}

.dvsc-bubble {
  max-width: 76%;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 14px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.dvsc-bubble a { color: #0B51FF; font-weight: 700; text-decoration: underline; }
.dvsc-bubble-bot {
  background: #fff;
  color: #1E293B;
  border: 1px solid #eef2ff;
  border-top-left-radius: 4px;
}
.dvsc-bubble-you {
  background: #0B51FF;
  color: #fff;
  border-top-right-radius: 4px;
}

/* Typing indicator */
.dvsc-bubble.dvsc-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 13px 16px;
}
.dvsc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  animation: dvscTypingBounce 1.1s infinite ease-in-out;
}
.dvsc-typing span:nth-child(2) { animation-delay: .15s; }
.dvsc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dvscTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ===== Topic chips — single horizontally-scrolling row ===== */
.dvsc-chips {
  flex: 0 0 auto;
  display: flex !important;
  gap: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  border-top: 1px solid #eef2ff;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.dvsc-chips::-webkit-scrollbar { height: 4px; }
.dvsc-chips::-webkit-scrollbar-thumb { background: #eef2ff; border-radius: 4px; }

.dvsc-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid #eef2ff;
  border-radius: 50px;
  background: #F8FAFF;
  color: #0B1B4D;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 12px;
  font-family: Arial, Helvetica, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.dvsc-chip-icon { font-size: 13px; }
.dvsc-chip:hover, .dvsc-chip:active {
  background: #0B51FF;
  color: #fff !important;
  border-color: #0B51FF;
}

/* ===== Input footer ===== */
.dvsc-foot {
  flex: 0 0 auto;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid #eef2ff;
  background: #fff;
}
.dvsc-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1.5px solid #eef2ff;
  border-radius: 50px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-family: Arial, Helvetica, sans-serif;
  outline: none;
}
.dvsc-input:focus { border-color: #0B51FF; }
.dvsc-send {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #0B51FF !important;
  color: #fff !important;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dvsc-send:hover { background: #0B1B4D !important; }

/* ===== Mobile ===== */
@media (max-width: 420px) {
  #dvsc-launcher { right: 12px; bottom: 86px; width: 60px; height: 60px; }
  #dvsc-panel {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 156px;
    height: auto;
    max-height: calc(100vh - 230px);
  }
  .dvsc-bubble { max-width: 82%; font-size: 13px; }
  .dvsc-chip { font-size: 11.5px; padding: 7px 12px; }
}
