
.dnchatbot {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.dnchatbot-toggle {
  width: 4rem;
  height: 4rem;
  border: none;
  padding: 0.25rem;
  border-radius: 999px;
  background: #111827;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dnchatbot-toggle:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.dnchatbot-toggle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.dnchatbot-toggle-icon {
  font-size: 1.5rem;
  color: #fff;
}

.dnchatbot-window {
  position: fixed;
  bottom: 6rem;
  right: 1rem;
  width: min(40rem, calc(100% - 2rem));
  max-width: 100%;
  height: 20rem;
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.dnchatbot.is-open .dnchatbot-window {
  display: flex;
}

.dnchatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
}

.dnchatbot-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #374151;
}

.dnchatbot-body {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  position: relative;
  padding: 0.75rem 1rem 1rem;
  gap: 0.75rem;
  min-height: 0;
}

.dnchatbot-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.dnchatbot .msg {
  white-space: pre-wrap;
  padding: 8px 10px;
  border-radius: 10px;
}

.dnchatbot .msg.user {
  background: #eef2ff;
  align-self: flex-end;
}

.dnchatbot .msg.assistant {
  background: #f9fafb;
  display: block;
  white-space: normal;
}

.dnchatbot .msg.placeholder {
  opacity: 0.75;
  font-style: italic;
}

.dnchatbot-form {
  display: flex;
  gap: 8px;
}

.dnchatbot-form input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.dnchatbot-form button {
  padding: 10px 14px;
  border-radius: 8px;
  border: 0;
  background: #111827;
  color: #fff;
  cursor: pointer;
}

.dnchatbot-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
}

.dnchatbot-loader::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #111827;
  border-radius: 50%;
  animation: dnchatbot-spin 0.9s linear infinite;
}

.dnchatbot.is-loading .dnchatbot-loader {
  display: flex;
}

@keyframes dnchatbot-spin {
  to { transform: rotate(360deg); }
}
