/* Cristal — estilos del asistente flotante */
#cristal-mount { position: fixed; z-index: 60; }

/* Launcher abajo-izquierda */
.cr-launcher {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(34, 211, 238, 0.35);
  transition: transform 0.2s ease;
}
.cr-launcher:hover { transform: scale(1.06); }
.cr-launcher.hidden { display: none; }
.cr-launcher.pulse { animation: crPulse 1.6s ease-out 2; }
@keyframes crPulse {
  0% { box-shadow: 0 0 0 0 rgba(34,211,238,0.5); }
  100% { box-shadow: 0 0 0 18px rgba(34,211,238,0); }
}
.cr-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #fff; color: #0891b2; font-weight: 800; font-size: 15px;
  display: grid; place-items: center;
}
.cr-avatar.sm { width: 34px; height: 34px; font-size: 16px; }
.cr-launcher-dot {
  position: absolute; top: 6px; right: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #f43f5e; border: 2px solid #fff;
}

/* Panel */
.cr-panel {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 48px);
  background: #0b1220;
  border: 1px solid #1e2a4a;
  border-radius: 18px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #e2e8f0;
}
.cr-panel.open { display: flex; }

.cr-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(135deg, #0e7490, #155e75);
  border-bottom: 1px solid #1e2a4a;
}
.cr-header-info { display: flex; align-items: center; gap: 10px; }
.cr-name { font-weight: 700; font-size: 14px; color: #fff; }
.cr-role { font-size: 11px; color: #cffafe; opacity: 0.85; }
.cr-close {
  background: transparent; border: none; color: #fff; font-size: 22px;
  line-height: 1; cursor: pointer; opacity: 0.8;
}
.cr-close:hover { opacity: 1; }

.cr-log {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: #0b1220;
}
.cr-msg { display: flex; }
.cr-bot { justify-content: flex-start; }
.cr-user { justify-content: flex-end; }
.cr-bubble {
  max-width: 85%; padding: 9px 12px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.5;
}
.cr-bot .cr-bubble {
  background: #111a2e; border: 1px solid #1e2a4a; color: #e2e8f0;
  border-bottom-left-radius: 4px;
}
.cr-user .cr-bubble {
  background: #0891b2; color: #fff; border-bottom-right-radius: 4px;
}
.cr-bubble strong { color: #67e8f9; }
.cr-bot .cr-bubble strong { color: #67e8f9; }

.cr-typing { display: flex; gap: 4px; padding: 12px 14px; background: #111a2e; border-radius: 14px; border-bottom-left-radius: 4px; }
.cr-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #67e8f9;
  animation: crBlink 1.2s infinite ease-in-out;
}
.cr-typing span:nth-child(2) { animation-delay: 0.2s; }
.cr-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes crBlink { 0%,80%,100% { opacity: 0.3; } 40% { opacity: 1; } }

.cr-quick {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px;
  border-top: 1px solid #1e2a4a; background: #0b1220;
}
.cr-quick button {
  background: #111a2e; border: 1px solid #1e4a5a; color: #a5f3fc;
  font-size: 12px; padding: 6px 10px; border-radius: 20px; cursor: pointer;
  transition: all 0.15s ease;
}
.cr-quick button:hover { background: #0e7490; color: #fff; border-color: #0e7490; }

.cr-inputbar {
  display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid #1e2a4a; background: #0b1220;
}
.cr-text {
  flex: 1; background: #111a2e; border: 1px solid #1e2a4a; color: #e2e8f0;
  border-radius: 10px; padding: 9px 11px; font-size: 13px; outline: none;
}
.cr-text:focus { border-color: #0891b2; }
.cr-sendbtn {
  background: #0891b2; border: none; color: #fff; width: 40px; border-radius: 10px;
  cursor: pointer; font-size: 14px;
}
.cr-sendbtn:hover { background: #06b6d4; }

.cr-foot {
  padding: 6px 12px 10px; font-size: 10.5px; text-align: center; background: #0b1220;
}
.cr-foot a { color: #64748b; text-decoration: none; }
.cr-foot a:hover { color: #67e8f9; text-decoration: underline; }

.cr-form { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; }
.cr-input {
  background: #111a2e; border: 1px solid #1e2a4a; color: #e2e8f0;
  border-radius: 10px; padding: 9px 11px; font-size: 13px; outline: none; width: 100%;
}
.cr-input:focus { border-color: #0891b2; }
.cr-send {
  background: #0891b2; color: #fff; border: none; border-radius: 10px;
  padding: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cr-send:hover { background: #06b6d4; }
.cr-legal {
  font-size: 10.5px; color: #64748b; text-align: center; text-decoration: none;
}
.cr-legal:hover { color: #67e8f9; text-decoration: underline; }

@media (max-width: 480px) {
  .cr-launcher { bottom: 16px; left: 16px; width: 54px; height: 54px; }
  .cr-panel { bottom: 16px; left: 16px; right: 16px; width: auto; height: 70vh; }
}
