.dac-chatbot {
  --dac-primary: #1fa2d6;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  z-index: 9999;
}

.dac-floating {
  position: fixed;
}

.dac-floating.dac-pos-bottom_right { right: var(--dac-offset-h, 22px); bottom: var(--dac-offset-v, 22px); }
.dac-floating.dac-pos-bottom_left { left: var(--dac-offset-h, 22px); bottom: var(--dac-offset-v, 22px); }
.dac-floating.dac-pos-top_right { right: var(--dac-offset-h, 22px); top: var(--dac-offset-v, 22px); }
.dac-floating.dac-pos-top_left { left: var(--dac-offset-h, 22px); top: var(--dac-offset-v, 22px); }

.dac-launcher {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--dac-primary);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
  cursor: pointer;
  font-weight: 800;
}

.dac-avatar-face,
.dac-avatar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dac-panel {
  display: none;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,.24);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.08);
}

.dac-chatbot[data-state="open"] .dac-panel { display: flex; flex-direction: column; }
.dac-chatbot[data-state="open"] .dac-launcher { display: none; }
.dac-embedded .dac-launcher { display: none; }
.dac-embedded .dac-panel { display: flex; position: relative; width: 100%; max-width: 760px; height: 560px; }

.dac-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, var(--dac-primary), #64c7ee);
  color: #fff;
}

.dac-header small { display: block; opacity: .9; }
.dac-close { margin-left: auto; border: none; background: transparent; color: #fff; font-size: 28px; cursor: pointer; }
.dac-embedded .dac-close { display: none; }

.dac-avatar {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  background: #fff;
  color: var(--dac-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
}

.dac-avatar-thinking { animation: dacPulse 1s infinite; }
.dac-avatar-happy { transform: rotate(-3deg) scale(1.05); }
@keyframes dacPulse { 0%,100%{ transform: scale(1);} 50%{ transform: scale(1.08);} }

.dac-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f6f8fb;
}

.dac-msg {
  max-width: 84%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 16px;
  line-height: 1.35;
  font-size: 14px;
}

.dac-bot, .dac-typing { background: #fff; color: #263238; border: 1px solid rgba(0,0,0,.06); }
.dac-user { background: var(--dac-primary); color: #fff; margin-left: auto; }
.dac-typing { opacity: .75; font-style: italic; }

.dac-guided-links {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
}

.dac-guided-links button {
  border: 1px solid var(--dac-primary);
  color: var(--dac-primary);
  background: #fff;
  border-radius: 999px;
  padding: 8px 10px;
  white-space: nowrap;
  cursor: pointer;
  font-size: 13px;
}


.dac-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dac-action-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 11px;
  background: var(--dac-primary);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.dac-action-links a:hover {
  color: #fff;
  filter: brightness(.95);
}

.dac-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
}

.dac-form input {
  flex: 1;
  border: 1px solid #dce3ea;
  border-radius: 999px;
  padding: 11px 14px;
  outline: none;
}

.dac-form button {
  border: none;
  border-radius: 999px;
  background: var(--dac-primary);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 480px) {
  .dac-floating.dac-pos-bottom_right { right: 12px; bottom: 12px; }
  .dac-floating.dac-pos-bottom_left { left: 12px; bottom: 12px; }
  .dac-floating.dac-pos-top_right { right: 12px; top: 12px; }
  .dac-floating.dac-pos-top_left { left: 12px; top: 12px; }
  .dac-panel { width: calc(100vw - 24px); height: calc(100vh - 90px); }
}

/* Avatar animado Fase 1: logo Daismar Web */
.dac-launcher {
  background: #ffffff;
  border: 2px solid rgba(31,162,214,.35);
  overflow: hidden;
  animation: dacFloat 3.6s ease-in-out infinite;
}

.dac-launcher::after,
.dac-avatar::after {
  content: "";
  position: absolute;
  inset: -35%;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.65) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: dacShine 3.8s ease-in-out infinite;
  pointer-events: none;
}

.dac-avatar-face img,
.dac-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.dac-avatar-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 8px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(31,162,214,.08), 0 0 28px rgba(31,162,214,.35);
}

.dac-avatar {
  position: relative;
  overflow: hidden;
  background: #fff;
  padding: 5px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.45), 0 0 18px rgba(255,255,255,.55);
}

.dac-avatar span {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
}

.dac-avatar-thinking {
  animation: dacPulse 1s infinite, dacGlow 1.4s ease-in-out infinite;
}

.dac-avatar-happy {
  animation: dacHappy .8s ease-in-out;
}

@keyframes dacFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes dacShine {
  0%, 45% { transform: translateX(-120%); }
  70%, 100% { transform: translateX(120%); }
}

@keyframes dacGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,.45), 0 0 14px rgba(255,255,255,.5); }
  50% { box-shadow: 0 0 0 4px rgba(255,255,255,.7), 0 0 30px rgba(255,255,255,.95); }
}

@keyframes dacHappy {
  0% { transform: rotate(0) scale(1); }
  35% { transform: rotate(-4deg) scale(1.08); }
  70% { transform: rotate(3deg) scale(1.04); }
  100% { transform: rotate(0) scale(1); }
}

/* Fase 3: voz y movimiento facial simulado sobre el logo */
.dac-face-rig {
  position: relative;
}

.dac-led-eye {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 9px rgba(31,162,214,.95), 0 0 16px rgba(255,255,255,.8);
  opacity: .92;
  pointer-events: none;
}

.dac-avatar-face .dac-led-eye-left { left: 35%; top: 33%; }
.dac-avatar-face .dac-led-eye-right { right: 31%; top: 33%; }
.dac-avatar .dac-led-eye-left { left: 36%; top: 34%; }
.dac-avatar .dac-led-eye-right { right: 30%; top: 34%; }

.dac-led-mouth {
  position: absolute;
  left: 38%;
  bottom: 24%;
  width: 22%;
  height: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
  opacity: .95;
}

.dac-led-mouth i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 8px rgba(31,162,214,.9), 0 0 14px rgba(255,255,255,.8);
}

.dac-avatar-speaking .dac-led-mouth i:nth-child(1),
.dac-avatar-face.dac-avatar-speaking .dac-led-mouth i:nth-child(1) { animation: dacMouth 360ms infinite ease-in-out; }
.dac-avatar-speaking .dac-led-mouth i:nth-child(2),
.dac-avatar-face.dac-avatar-speaking .dac-led-mouth i:nth-child(2) { animation: dacMouth 300ms infinite ease-in-out .08s; }
.dac-avatar-speaking .dac-led-mouth i:nth-child(3),
.dac-avatar-face.dac-avatar-speaking .dac-led-mouth i:nth-child(3) { animation: dacMouth 420ms infinite ease-in-out .14s; }

.dac-avatar-speaking,
.dac-avatar-face.dac-avatar-speaking {
  animation: dacSpeakGlow .9s ease-in-out infinite;
}

.dac-avatar-listening,
.dac-avatar-face.dac-avatar-listening {
  animation: dacListenGlow 1.1s ease-in-out infinite;
}

.dac-avatar-listening .dac-led-eye,
.dac-avatar-face.dac-avatar-listening .dac-led-eye {
  animation: dacBlink 1.2s infinite;
}

@keyframes dacMouth {
  0%,100% { height: 3px; opacity: .75; }
  45% { height: 10px; opacity: 1; }
  70% { height: 6px; opacity: .95; }
}

@keyframes dacSpeakGlow {
  0%,100% { filter: drop-shadow(0 0 4px rgba(31,162,214,.4)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 14px rgba(31,162,214,.9)); transform: scale(1.04); }
}

@keyframes dacListenGlow {
  0%,100% { filter: drop-shadow(0 0 4px rgba(255,255,255,.6)); }
  50% { filter: drop-shadow(0 0 16px rgba(255,255,255,1)); }
}

@keyframes dacBlink {
  0%, 88%, 100% { transform: scaleY(1); }
  92% { transform: scaleY(.2); }
}

.dac-voice-btn {
  min-width: 38px;
  padding: 0 10px !important;
  background: #eef8fc !important;
  color: var(--dac-primary) !important;
  border: 1px solid rgba(31,162,214,.25) !important;
}

.dac-voice-btn:hover {
  filter: brightness(.97);
}

.dac-voice-disabled .dac-speak-last,
.dac-mic-disabled .dac-mic-btn,
.dac-face-disabled .dac-led-eye,
.dac-face-disabled .dac-led-mouth {
  display: none !important;
}

/* v0.2.2: Avatar más llamativo - modo neón vivo */
.dac-visual-neon_vivo {
  --dac-primary: #00BFFF;
  --dac-secondary: #00E5FF;
  --dac-accent: #7C3CFF;
  --dac-lime: #39FFB6;
}

.dac-visual-neon_vivo .dac-launcher {
  width: 78px;
  height: 78px;
  background: radial-gradient(circle at 35% 28%, #ffffff 0%, #e8fbff 34%, #00d8ff 70%, #0878ff 100%);
  border: 3px solid rgba(255,255,255,.92);
  box-shadow:
    0 0 0 5px rgba(0,191,255,.18),
    0 0 24px rgba(0,191,255,.92),
    0 0 48px rgba(124,60,255,.62),
    0 18px 38px rgba(0,32,70,.33);
  animation: dacFloat 3.2s ease-in-out infinite, dacNeonBreath 1.9s ease-in-out infinite;
}

.dac-visual-neon_vivo .dac-launcher::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 999px;
  border: 2px solid rgba(0,229,255,.44);
  box-shadow: 0 0 24px rgba(0,229,255,.75), inset 0 0 16px rgba(57,255,182,.18);
  animation: dacOrbitRing 2.8s linear infinite;
  pointer-events: none;
}

.dac-visual-neon_vivo .dac-avatar-face {
  padding: 9px;
  background: radial-gradient(circle at 40% 28%, #ffffff 0%, #f0fdff 46%, rgba(0,191,255,.24) 100%);
  box-shadow:
    inset 0 0 14px rgba(255,255,255,.98),
    0 0 0 4px rgba(0,229,255,.18),
    0 0 28px rgba(0,229,255,.95),
    0 0 48px rgba(124,60,255,.45);
}

.dac-visual-neon_vivo .dac-header {
  background: linear-gradient(135deg, #0077ff 0%, #00cfff 46%, #7c3cff 100%);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.28);
}

.dac-visual-neon_vivo .dac-avatar {
  background: radial-gradient(circle at 40% 30%, #ffffff 0%, #e8fbff 48%, rgba(0,191,255,.32) 100%);
  box-shadow:
    0 0 0 3px rgba(255,255,255,.55),
    0 0 18px rgba(0,229,255,.95),
    0 0 34px rgba(124,60,255,.42);
}

.dac-visual-neon_vivo .dac-guided-links button,
.dac-visual-neon_vivo .dac-form button,
.dac-visual-neon_vivo .dac-action-links a {
  background: linear-gradient(135deg, #0077ff, #00cfff 62%, #39ffb6);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 18px rgba(0,191,255,.25);
}

.dac-visual-neon_vivo .dac-guided-links button:hover,
.dac-visual-neon_vivo .dac-form button:hover,
.dac-visual-neon_vivo .dac-action-links a:hover {
  filter: brightness(1.08) saturate(1.2);
  transform: translateY(-1px);
}

.dac-visual-neon_vivo .dac-user {
  background: linear-gradient(135deg, #0077ff, #00cfff);
}

.dac-visual-neon_vivo .dac-led-eye,
.dac-visual-neon_vivo .dac-led-mouth i {
  background: #39ffb6;
  box-shadow: 0 0 8px rgba(57,255,182,1), 0 0 18px rgba(0,229,255,.95), 0 0 28px rgba(255,255,255,.9);
}

.dac-visual-corporativo .dac-launcher {
  width: 64px;
  height: 64px;
}

@keyframes dacNeonBreath {
  0%, 100% {
    filter: saturate(1.25) brightness(1.03);
    box-shadow: 0 0 0 5px rgba(0,191,255,.18), 0 0 24px rgba(0,191,255,.82), 0 0 44px rgba(124,60,255,.52), 0 18px 38px rgba(0,32,70,.33);
  }
  50% {
    filter: saturate(1.55) brightness(1.12);
    box-shadow: 0 0 0 8px rgba(0,229,255,.22), 0 0 34px rgba(0,229,255,1), 0 0 66px rgba(124,60,255,.78), 0 22px 46px rgba(0,32,70,.38);
  }
}

@keyframes dacOrbitRing {
  0% { transform: rotate(0deg) scale(1); opacity: .76; }
  50% { transform: rotate(180deg) scale(1.06); opacity: 1; }
  100% { transform: rotate(360deg) scale(1); opacity: .76; }
}

@media (max-width: 480px) {
  .dac-visual-neon_vivo .dac-launcher {
    width: 70px;
    height: 70px;
  }
}
