/* Sticky site assistant (homepage): FAB + chat panel — above footer, under modals */

.dm-site-assistant {
  --dm-assistant-z: 1050;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: var(--dm-assistant-z);
  font-size: 0.9375rem;
}

@media (min-width: 768px) {
  .dm-site-assistant {
    right: 1.25rem;
    bottom: 1.25rem;
  }
}

.dm-site-assistant__fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, #2f57ef 0%, #4f64f0 50%, #b966e7 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(47, 87, 239, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dm-site-assistant__fab:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 32px rgba(47, 87, 239, 0.5);
  color: #fff;
}

.dm-site-assistant__fab:focus-visible {
  outline: 2px solid #2f57ef;
  outline-offset: 3px;
}


.dm-site-assistant__fab .bi {
  line-height: 1;
  display: block;
}

/* Panel */
.dm-site-assistant__panel {
  display: flex;
  flex-direction: column;
  width: min(100vw - 2rem, 24rem);
  max-height: min(70vh, 32rem);
  background: #fff;
  border-radius: 0.9rem;
  box-shadow: 0 12px 48px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.1);
  overflow: hidden;
  transform-origin: bottom right;
  animation: dm-assistant-in 0.2s ease;
}

@keyframes dm-assistant-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dm-site-assistant__panel[hidden] {
  display: none !important;
}

.dm-site-assistant__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: #f8fafc;
}

.dm-site-assistant__head-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.25;
  font-family: var(--font-display, "Plus Jakarta Sans", system-ui, sans-serif);
}

.dm-site-assistant__head-sub {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.85;
  display: block;
  margin-top: 0.1rem;
}

.dm-site-assistant__close {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
  line-height: 1;
  cursor: pointer;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.dm-site-assistant__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dm-site-assistant__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem 0.25rem;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.dm-site-assistant__chip {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.dm-site-assistant__chip:hover {
  border-color: #2f57ef;
  color: #2f57ef;
}

.dm-site-assistant__messages {
  flex: 1 1 auto;
  min-height: 8rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.75rem;
  background: #fafbfc;
  scroll-behavior: smooth;
}

.dm-site-assistant__msg {
  margin-bottom: 0.6rem;
  max-width: 100%;
  word-wrap: break-word;
}

.dm-site-assistant__msg--user {
  margin-left: 2rem;
  padding: 0.45rem 0.6rem;
  background: #e0e7ff;
  border-radius: 0.6rem 0.6rem 0.15rem 0.6rem;
  font-size: 0.875rem;
  color: #0f172a;
}

.dm-site-assistant__msg--asst {
  margin-right: 1.5rem;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem 0.6rem 0.6rem 0.2rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #1e293b;
}

.dm-site-assistant__msg--asst a {
  font-weight: 600;
  color: #2f57ef;
  word-break: break-word;
}

.dm-site-assistant__msg--err {
  color: #b91c1c;
  font-size: 0.8rem;
}

.dm-site-assistant__typing {
  display: flex;
  gap: 0.2rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
}

.dm-site-assistant__form {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem 0.75rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

.dm-site-assistant__input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.45rem 0.6rem;
}

.dm-site-assistant__input:focus {
  border-color: #2f57ef;
  box-shadow: 0 0 0 2px rgba(47, 87, 239, 0.2);
  outline: none;
}

.dm-site-assistant__send {
  flex-shrink: 0;
  border: none;
  border-radius: 0.5rem;
  padding: 0 0.9rem;
  font-weight: 600;
  font-size: 0.85rem;
  background: #2f57ef;
  color: #fff;
  cursor: pointer;
}

.dm-site-assistant__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body.dm-assistant-open {
  /* optional: no scroll lock on mobile to keep UX simple */
}
