#dgai-root {
  position: fixed;
  bottom: 20px;
  z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#dgai-root.dgai-right { right: 20px; }
#dgai-root.dgai-left { left: 20px; }

.dgai-boton {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-top: 12px;
  margin-left: auto;
}
#dgai-root.dgai-left .dgai-boton { margin-left: 0; margin-right: auto; }
.dgai-boton:hover { transform: scale(1.06); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); }
.dgai-boton:active { transform: scale(0.96); }

.dgai-panel {
  width: 370px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dgai-in 0.22s ease;
}
@keyframes dgai-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.dgai-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
}
.dgai-header .dgai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.9;
}
.dgai-header .dgai-nombre { font-weight: 700; }
.dgai-header .dgai-estado { margin-left: auto; font-size: 11px; font-weight: 500; opacity: 0.85; }
.dgai-header .dgai-badge-trial {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}

.dgai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f7f7f5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dgai-msg { display: flex; }
.dgai-msg.dgai-user { justify-content: flex-end; }
.dgai-msg.dgai-bot { justify-content: flex-start; }

.dgai-burbuja {
  max-width: 80%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.dgai-msg.dgai-bot .dgai-burbuja {
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid #e6e6e2;
  border-bottom-left-radius: 4px;
}
.dgai-msg.dgai-user .dgai-burbuja {
  border-bottom-right-radius: 4px;
}

.dgai-typing .dgai-burbuja { display: flex; gap: 4px; align-items: center; }
.dgai-typing .dgai-burbuja span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b8b8b2;
  animation: dgai-bounce 1.2s infinite;
}
.dgai-typing .dgai-burbuja span:nth-child(2) { animation-delay: 0.15s; }
.dgai-typing .dgai-burbuja span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dgai-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.dgai-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #ececec;
  background: #ffffff;
}
.dgai-input {
  flex: 1;
  border: 1px solid #dcdcd8;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  color: #1a1a1a;
  background: #fff;
}
.dgai-input:focus { border-color: #bdbdb8; }
.dgai-enviar {
  border: none;
  border-radius: 12px;
  width: 42px;
  min-width: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.dgai-enviar:hover { filter: brightness(1.08); }
.dgai-enviar:active { transform: scale(0.94); }

.dgai-marca {
  text-align: center;
  font-size: 10px;
  color: #9a9a95;
  padding: 0 0 8px;
  background: #ffffff;
}
.dgai-marca a { color: #7a7a75; text-decoration: none; }
.dgai-marca a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .dgai-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
  }
  #dgai-root { bottom: 12px; }
  #dgai-root.dgai-right { right: 12px; }
  #dgai-root.dgai-left { left: 12px; }
}
