/* ===== FUTUDATA — Asistente virtual ===== */

/* Launcher FAB */
.asst-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9000;
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(10,77,255,0.18), rgba(0,198,255,0.18));
  color: white;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    0 18px 50px -12px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 1px 0 rgba(255,255,255,0.12) inset;
  transition:
    padding .3s cubic-bezier(0.4, 0, 0.2, 1),
    gap .3s cubic-bezier(0.4, 0, 0.2, 1),
    border-radius .3s ease,
    transform .25s ease,
    box-shadow .3s ease,
    background .3s ease;
  isolation: isolate;
  overflow: hidden;
}
.asst-fab:hover {
  transform: translateY(-2px);
  gap: 14px;
  padding: 10px 10px 10px 22px;
  box-shadow:
    0 24px 60px -14px rgba(0,198,255,0.45),
    0 0 0 1px rgba(0,198,255,0.25) inset,
    0 1px 0 rgba(255,255,255,0.18) inset;
}
.asst-fab:hover .asst-fab-label {
  max-width: 200px;
  opacity: 1;
  transform: translateX(0);
}
.asst-fab.is-open .asst-fab-label {
  opacity: 0;
  transform: translateX(6px);
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.asst-fab.is-open {
  padding: 10px;
  gap: 0;
  background: linear-gradient(135deg, rgba(10,77,255,0.32), rgba(0,198,255,0.32));
  border-radius: 50%;
}
.asst-fab.is-open:hover { padding: 10px; gap: 0; }

.asst-fab-content {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 60%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: white;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 6px 18px -6px rgba(10,77,255,0.5);
  flex-shrink: 0;
}
.asst-fab-label {
  display: flex; flex-direction: column;
  text-align: right; line-height: 1.15;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transform: translateX(8px);
  transition:
    opacity .25s ease,
    transform .3s cubic-bezier(0.4, 0, 0.2, 1),
    max-width .35s cubic-bezier(0.4, 0, 0.2, 1);
}
.asst-fab-label .t { font-size: 14px; }
.asst-fab-label .d {
  font-family: var(--font-sans);
  font-weight: 400; font-size: 11px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.01em;
}

/* Pulse ring */
.asst-fab-pulse {
  position: absolute;
  right: 10px; top: 50%;
  width: 44px; height: 44px;
  margin-top: -22px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: 0;
  animation: fab-pulse 2.4s ease-out infinite;
  z-index: -1;
}
.asst-fab.is-open .asst-fab-pulse { display: none; }
.asst-fab-ring {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 30%, rgba(0,198,255,0.4), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.asst-fab:hover .asst-fab-ring { opacity: 1; }

@keyframes fab-pulse {
  0%   { opacity: 0.55; transform: scale(0.9); }
  70%  { opacity: 0;    transform: scale(1.8); }
  100% { opacity: 0;    transform: scale(1.8); }
}

.asst-fab-dot {
  position: absolute;
  top: 8px; left: 18px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #FF5C7C;
  border: 2px solid #0B0F1A;
  box-shadow: 0 0 0 3px rgba(255,92,124,0.25);
  animation: pulse-soft 1.6s ease infinite;
}

/* Veil (backdrop) — light, doesn't block scroll on desktop */
.asst-panel {
  position: fixed;
  inset: 0;
  z-index: 8999;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 24px 96px 0;
}
.asst-veil {
  position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 88% 90%, rgba(0,12,40,0.55), transparent 60%);
  opacity: 0;
  transition: opacity .35s ease;
}
.asst-panel.is-open { pointer-events: auto; }
.asst-panel.is-open .asst-veil { opacity: 1; }

/* Glass chat container */
.asst-glass {
  position: relative;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: min(620px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(0,198,255,0.10), transparent 60%),
    linear-gradient(180deg, rgba(13,18,32,0.78), rgba(8,12,22,0.82));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  overflow: hidden;
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  box-shadow:
    0 40px 120px -20px rgba(0,0,0,0.75),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 1px 0 rgba(255,255,255,0.14) inset;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity .3s ease, transform .35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.asst-panel.is-open .asst-glass {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Header */
.asst-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
  flex-shrink: 0;
}
.asst-avatar {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(10,77,255,0.25), rgba(0,198,255,0.25));
  border: 1px solid rgba(255,255,255,0.14);
  display: grid; place-items: center;
}
.asst-avatar .status {
  position: absolute;
  right: -3px; bottom: -3px;
  width: 12px; height: 12px;
  background: #5BE49B;
  border-radius: 50%;
  border: 2px solid #0B0F1A;
  box-shadow: 0 0 0 3px rgba(91,228,155,0.2);
}
.asst-id { flex: 1; min-width: 0; }
.asst-id .name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 15px;
  letter-spacing: 0.02em;
}
.asst-id .name .ai {
  font-weight: 400; color: var(--text-3); font-size: 12px; letter-spacing: 0;
}
.asst-id .meta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-2); margin-top: 2px;
  font-family: var(--font-mono);
}
.asst-id .meta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #5BE49B;
  box-shadow: 0 0 0 3px rgba(91,228,155,0.18);
  animation: pulse-soft 2s ease infinite;
}
.asst-close {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-1);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.asst-close:hover { background: rgba(255,255,255,0.1); color: white; }

/* Body / messages */
.asst-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px 12px;
  display: flex; flex-direction: column; gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.asst-body::-webkit-scrollbar { width: 6px; }
.asst-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12); border-radius: 99px;
}

.msg { display: flex; gap: 10px; max-width: 100%; }
.msg-user { justify-content: flex-end; }
.msg .bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 82%;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: msg-in .35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.msg-user .bubble {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 24px -10px rgba(10,77,255,0.5);
  font-weight: 500;
}
.msg-ai .bubble {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.94);
  border-bottom-left-radius: 6px;
  backdrop-filter: blur(8px);
}
.msg-ai .ai-avatar {
  width: 28px; height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(10,77,255,0.3), rgba(0,198,255,0.3));
  border: 1px solid rgba(255,255,255,0.12);
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Typing dots */
.bubble-typing { padding: 14px 18px !important; display: inline-flex; gap: 4px; align-items: center; }
.bubble-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  animation: typing 1.2s infinite ease-in-out;
}
.bubble-typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Suggestions */
.asst-suggest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  margin-left: 38px;
}
.asst-suggest .chip {
  text-align: left;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(0,198,255,0.06);
  border: 1px solid rgba(0,198,255,0.22);
  color: var(--text-0);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
  line-height: 1.4;
}
.asst-suggest .chip:hover {
  background: rgba(0,198,255,0.14);
  border-color: rgba(0,198,255,0.45);
  transform: translateX(2px);
}

/* Input */
.asst-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 14px 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.18));
  flex-shrink: 0;
}
.asst-input textarea {
  flex: 1;
  resize: none;
  max-height: 140px;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.4;
  outline: none;
  transition: border-color .2s ease, background .2s ease;
}
.asst-input textarea::placeholder { color: rgba(255,255,255,0.4); }
.asst-input textarea:focus {
  border-color: rgba(0,198,255,0.5);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 4px rgba(0,198,255,0.08);
}
.asst-input button[type="submit"] {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  color: white;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
  box-shadow: 0 8px 22px -6px rgba(10,77,255,0.5);
  flex-shrink: 0;
}
.asst-input button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -6px rgba(0,198,255,0.5);
}
.asst-input button[type="submit"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.asst-input button[type="submit"] svg { transform: rotate(0deg); }

.asst-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 18px 14px;
  font-size: 11px;
  color: var(--text-3);
  border-top: 1px solid rgba(255,255,255,0.04);
}
.asst-foot a {
  color: var(--accent-2);
  font-weight: 500;
  transition: opacity .2s ease;
}
.asst-foot a:hover { opacity: 0.8; }

/* Mobile: full-screen panel */
@media (max-width: 640px) {
  /* When chat is open on mobile (full-screen panel), hide the FAB —
     the header X button is the close affordance. Prevents FAB overlapping
     the send button. */
  .asst-fab.is-open {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
  }

  .asst-fab {
    right: 16px;
    bottom: 16px;
    padding: 8px;
    gap: 0;
    border-radius: 50%;
  }
  /* No hover expansion on touch — keeps button compact & out of the way */
  .asst-fab:hover {
    padding: 8px;
    gap: 0;
  }
  .asst-fab:hover .asst-fab-label {
    max-width: 0;
    opacity: 0;
  }
  .asst-fab-label { display: none; }
  .asst-fab-content { width: 40px; height: 40px; }

  .asst-panel { padding: 0; align-items: stretch; justify-content: stretch; }
  .asst-glass {
    width: 100%;
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
    transform-origin: bottom center;
  }
  .asst-veil { display: none; }
  .asst-head { padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
  .asst-input { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* ===== Futu robot avatar overrides ===== */
.asst-avatar:has(.futu-avatar-img),
.msg-ai .ai-avatar:has(.futu-avatar-img) {
  background: transparent;
  border: 0;
}
.asst-fab-content:has(.futu-avatar-img) {
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.22), transparent 60%),
    linear-gradient(135deg, rgba(10,77,255,0.65), rgba(0,198,255,0.55));
}
.futu-avatar-img {
  filter: drop-shadow(0 2px 6px rgba(0,198,255,0.35));
}


/* ============================================================
   FUTU - Escalado progresivo de atencion (v3 MEGA)
   Niveles:
     0 idle (0s)
     1 pulso suave (10s)
     2 doble pulso + 3 particulas (20s)
     3 crecido + 5 particulas + glow pulsante (30s)
     4 MEGA: aun mas grande + 8 particulas en doble orbita (90s)
   Overlay 'waving': saludo del robot + tooltip cada 60s
   ============================================================ */

/* Anillos de energia */
.asst-fab .energy-ring {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2.5px solid rgba(0, 220, 255, 0.85);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
@keyframes energy-ring-expand {
  0%   { transform: scale(0.85); opacity: 1; border-width: 3.5px; }
  60%  { opacity: 0.3; border-width: 1.5px; }
  100% { transform: scale(2.8); opacity: 0; border-width: 0.5px; }
}
.asst-fab.level-1 .energy-ring.r1,
.asst-fab.level-2 .energy-ring.r1,
.asst-fab.level-3 .energy-ring.r1,
.asst-fab.level-4 .energy-ring.r1 {
  animation: energy-ring-expand 2.4s ease-out infinite;
}
.asst-fab.level-2 .energy-ring.r2,
.asst-fab.level-3 .energy-ring.r2,
.asst-fab.level-4 .energy-ring.r2 {
  animation: energy-ring-expand 2.4s ease-out infinite;
  animation-delay: 0.8s;
}
.asst-fab.level-3 .energy-ring.r3,
.asst-fab.level-4 .energy-ring.r3 {
  animation: energy-ring-expand 2.4s ease-out infinite;
  animation-delay: 1.6s;
}
/* Nivel 4: anillos mas anchos y mas brillantes */
.asst-fab.level-4 .energy-ring {
  border-color: rgba(0, 240, 255, 1);
  border-width: 3px;
}

/* Respiracion del robot */
.asst-fab .asst-fab-content { animation: futu-breathing 3.6s ease-in-out infinite; }
@keyframes futu-breathing {
  0%, 100% { transform: scale(1.0); }
  50%      { transform: scale(1.04); }
}
.asst-fab.level-2 .asst-fab-content,
.asst-fab.level-3 .asst-fab-content,
.asst-fab.level-4 .asst-fab-content {
  animation: futu-breathing 2.6s ease-in-out infinite;
}

/* NIVEL 3: circulo 56px + glow pulsante */
.asst-fab.level-3 .asst-fab-content {
  width: 56px;
  height: 56px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 0 5px rgba(0, 198, 255, 0.22),
    0 0 0 12px rgba(0, 198, 255, 0.10),
    0 12px 38px -6px rgba(0, 198, 255, 0.85);
  animation: futu-breathing 2.6s ease-in-out infinite, futu-glow-pulse 2.2s ease-in-out infinite;
  transition: width 1.2s ease, height 1.2s ease;
}
@keyframes futu-glow-pulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.4),
      0 0 0 5px rgba(0, 198, 255, 0.22),
      0 0 0 12px rgba(0, 198, 255, 0.10),
      0 12px 38px -6px rgba(0, 198, 255, 0.85);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.5),
      0 0 0 7px rgba(0, 220, 255, 0.32),
      0 0 0 16px rgba(0, 220, 255, 0.16),
      0 14px 46px -4px rgba(0, 220, 255, 1);
  }
}

/* NIVEL 4 MEGA: circulo 72px + glow mas grande */
.asst-fab.level-4 .asst-fab-content {
  width: 72px;
  height: 72px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 0 7px rgba(0, 220, 255, 0.30),
    0 0 0 16px rgba(0, 220, 255, 0.16),
    0 0 0 26px rgba(0, 220, 255, 0.07),
    0 16px 54px -4px rgba(0, 220, 255, 1);
  animation: futu-breathing 2.4s ease-in-out infinite, futu-mega-glow 2s ease-in-out infinite;
  transition: width 1.5s ease, height 1.5s ease, box-shadow 1.5s ease;
}
@keyframes futu-mega-glow {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.5),
      0 0 0 7px rgba(0, 220, 255, 0.30),
      0 0 0 16px rgba(0, 220, 255, 0.16),
      0 0 0 26px rgba(0, 220, 255, 0.07),
      0 16px 54px -4px rgba(0, 220, 255, 1);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.6),
      0 0 0 10px rgba(0, 240, 255, 0.42),
      0 0 0 22px rgba(0, 240, 255, 0.22),
      0 0 0 34px rgba(0, 240, 255, 0.10),
      0 20px 64px -2px rgba(0, 240, 255, 1);
  }
}

/* Robot: nivel 3 = 1.22, nivel 4 = 1.40 */
.asst-fab.level-3 .futu-avatar-img {
  transform: scale(1.22);
  filter:
    drop-shadow(0 3px 14px rgba(0, 220, 255, 0.85))
    brightness(1.14)
    saturate(1.1);
  transition: transform 1.2s ease, filter 1.2s ease;
}
.asst-fab.level-4 .futu-avatar-img {
  transform: scale(1.40);
  filter:
    drop-shadow(0 4px 20px rgba(0, 240, 255, 1))
    brightness(1.18)
    saturate(1.18);
  transition: transform 1.5s ease, filter 1.5s ease;
}

/* OVERLAY 'waving': saludo del robot — funciona sobre cualquier nivel >= 3 */
.asst-fab.waving.level-3 .futu-avatar-img {
  animation: futu-wave-l3 1.6s ease-in-out 1;
}
.asst-fab.waving.level-4 .futu-avatar-img {
  animation: futu-wave-l4 1.6s ease-in-out 1;
}
@keyframes futu-wave-l3 {
  0%   { transform: scale(1.22) rotate(0deg); }
  12%  { transform: scale(1.26) rotate(-15deg); }
  30%  { transform: scale(1.26) rotate(12deg); }
  50%  { transform: scale(1.26) rotate(-9deg); }
  72%  { transform: scale(1.26) rotate(6deg); }
  100% { transform: scale(1.22) rotate(0deg); }
}
@keyframes futu-wave-l4 {
  0%   { transform: scale(1.40) rotate(0deg); }
  12%  { transform: scale(1.46) rotate(-18deg); }
  30%  { transform: scale(1.46) rotate(14deg); }
  50%  { transform: scale(1.46) rotate(-10deg); }
  72%  { transform: scale(1.46) rotate(7deg); }
  100% { transform: scale(1.40) rotate(0deg); }
}

/* ============================================================
   PARTICULAS — base
   ============================================================ */
.asst-fab .energy-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 1);
  box-shadow:
    0 0 10px rgba(0, 230, 255, 1),
    0 0 22px rgba(0, 198, 255, 0.85),
    0 0 36px rgba(0, 170, 255, 0.5);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

/* Orbitas */
@keyframes futu-orbit-small {
  from { transform: rotate(0deg)   translateX(32px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(32px) rotate(-360deg); }
}
@keyframes futu-orbit-mid {
  from { transform: rotate(0deg)   translateX(46px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(46px) rotate(-360deg); }
}
@keyframes futu-orbit-inner {
  from { transform: rotate(0deg)   translateX(50px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(50px) rotate(-360deg); }
}
@keyframes futu-orbit-outer-rev {
  /* sentido inverso para la orbita externa (efecto atomo) */
  from { transform: rotate(360deg) translateX(70px) rotate(-360deg); }
  to   { transform: rotate(0deg)   translateX(70px) rotate(0deg); }
}

/* NIVEL 2: 3 particulas, orbita pequena */
.asst-fab.level-2 .energy-orbit.o1,
.asst-fab.level-2 .energy-orbit.o2,
.asst-fab.level-2 .energy-orbit.o3 { opacity: 1; }
.asst-fab.level-2 .energy-orbit.o1 { animation: futu-orbit-small 3.2s linear infinite; }
.asst-fab.level-2 .energy-orbit.o2 {
  animation: futu-orbit-small 3.2s linear infinite;
  animation-delay: -1.06s;
  background: rgba(120, 180, 255, 1);
  box-shadow: 0 0 10px rgba(120, 180, 255, 1), 0 0 22px rgba(70, 140, 255, 0.85);
}
.asst-fab.level-2 .energy-orbit.o3 {
  animation: futu-orbit-small 3.2s linear infinite;
  animation-delay: -2.13s;
  background: rgba(180, 220, 255, 1);
  box-shadow: 0 0 10px rgba(180, 220, 255, 1), 0 0 22px rgba(120, 180, 255, 0.8);
}

/* NIVEL 3: 5 particulas, orbita media */
.asst-fab.level-3 .energy-orbit.o1,
.asst-fab.level-3 .energy-orbit.o2,
.asst-fab.level-3 .energy-orbit.o3,
.asst-fab.level-3 .energy-orbit.o4,
.asst-fab.level-3 .energy-orbit.o5 { opacity: 1; }
.asst-fab.level-3 .energy-orbit.o1 { animation: futu-orbit-mid 2.8s linear infinite; }
.asst-fab.level-3 .energy-orbit.o2 {
  animation: futu-orbit-mid 2.8s linear infinite;
  animation-delay: -0.56s;
  background: rgba(120, 180, 255, 1);
  box-shadow: 0 0 10px rgba(120, 180, 255, 1), 0 0 22px rgba(70, 140, 255, 0.85);
}
.asst-fab.level-3 .energy-orbit.o3 {
  animation: futu-orbit-mid 2.8s linear infinite;
  animation-delay: -1.12s;
  background: rgba(180, 220, 255, 1);
  box-shadow: 0 0 10px rgba(180, 220, 255, 1), 0 0 22px rgba(120, 180, 255, 0.8);
}
.asst-fab.level-3 .energy-orbit.o4 {
  animation: futu-orbit-mid 2.8s linear infinite;
  animation-delay: -1.68s;
  background: rgba(0, 240, 255, 1);
}
.asst-fab.level-3 .energy-orbit.o5 {
  animation: futu-orbit-mid 2.8s linear infinite;
  animation-delay: -2.24s;
  background: rgba(220, 240, 255, 1);
  box-shadow: 0 0 10px rgba(220, 240, 255, 1), 0 0 22px rgba(180, 220, 255, 0.7);
}

/* NIVEL 4 MEGA: 8 particulas en DOBLE ORBITA (4 internas + 4 externas) */
.asst-fab.level-4 .energy-orbit { opacity: 1; }
.asst-fab.level-4 .energy-orbit { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }

/* Orbita interna (4 particulas, sentido horario, mas rapidas) */
.asst-fab.level-4 .energy-orbit.o1 {
  animation: futu-orbit-inner 2.6s linear infinite;
  animation-delay: 0s;
  background: rgba(0, 240, 255, 1);
  box-shadow:
    0 0 12px rgba(0, 240, 255, 1),
    0 0 26px rgba(0, 220, 255, 0.9),
    0 0 42px rgba(0, 198, 255, 0.55);
}
.asst-fab.level-4 .energy-orbit.o2 {
  animation: futu-orbit-inner 2.6s linear infinite;
  animation-delay: -0.65s;
  background: rgba(120, 180, 255, 1);
  box-shadow: 0 0 12px rgba(120, 180, 255, 1), 0 0 26px rgba(70, 140, 255, 0.9);
}
.asst-fab.level-4 .energy-orbit.o3 {
  animation: futu-orbit-inner 2.6s linear infinite;
  animation-delay: -1.3s;
  background: rgba(180, 220, 255, 1);
  box-shadow: 0 0 12px rgba(180, 220, 255, 1), 0 0 26px rgba(120, 180, 255, 0.85);
}
.asst-fab.level-4 .energy-orbit.o4 {
  animation: futu-orbit-inner 2.6s linear infinite;
  animation-delay: -1.95s;
  background: rgba(220, 240, 255, 1);
  box-shadow: 0 0 12px rgba(220, 240, 255, 1), 0 0 26px rgba(180, 220, 255, 0.75);
}

/* Orbita externa (4 particulas, sentido antihorario, mas lentas) */
.asst-fab.level-4 .energy-orbit.o5 {
  animation: futu-orbit-outer-rev 3.6s linear infinite;
  animation-delay: 0s;
  background: rgba(70, 170, 255, 1);
  box-shadow: 0 0 12px rgba(70, 170, 255, 1), 0 0 26px rgba(40, 130, 255, 0.85);
}
.asst-fab.level-4 .energy-orbit.o6 {
  animation: futu-orbit-outer-rev 3.6s linear infinite;
  animation-delay: -0.9s;
  background: rgba(0, 220, 255, 1);
  box-shadow: 0 0 12px rgba(0, 220, 255, 1), 0 0 26px rgba(0, 180, 255, 0.85);
}
.asst-fab.level-4 .energy-orbit.o7 {
  animation: futu-orbit-outer-rev 3.6s linear infinite;
  animation-delay: -1.8s;
  background: rgba(150, 200, 255, 1);
  box-shadow: 0 0 12px rgba(150, 200, 255, 1), 0 0 26px rgba(100, 160, 255, 0.85);
}
.asst-fab.level-4 .energy-orbit.o8 {
  animation: futu-orbit-outer-rev 3.6s linear infinite;
  animation-delay: -2.7s;
  background: rgba(200, 230, 255, 1);
  box-shadow: 0 0 12px rgba(200, 230, 255, 1), 0 0 26px rgba(150, 200, 255, 0.85);
}

/* Particulas o4-o8 ocultas en niveles 0-2 */
.asst-fab.level-0 .energy-orbit,
.asst-fab.level-1 .energy-orbit { opacity: 0 !important; }
.asst-fab.level-2 .energy-orbit.o4,
.asst-fab.level-2 .energy-orbit.o5,
.asst-fab.level-2 .energy-orbit.o6,
.asst-fab.level-2 .energy-orbit.o7,
.asst-fab.level-2 .energy-orbit.o8,
.asst-fab.level-3 .energy-orbit.o6,
.asst-fab.level-3 .energy-orbit.o7,
.asst-fab.level-3 .energy-orbit.o8 { opacity: 0 !important; }

/* ============================================================
   TOOLTIP "¿Conversemos? ✨"
   ============================================================ */
.asst-fab .energy-tooltip {
  position: absolute;
  right: calc(100% + 18px);
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, rgba(10, 77, 255, 0.96), rgba(0, 198, 255, 0.96));
  color: #fff;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow:
    0 10px 32px -6px rgba(0, 198, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: tooltip-pop 6s ease-out 1 forwards;
  opacity: 0;
}
.asst-fab .energy-tooltip::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  margin-top: -6px;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, rgba(10, 77, 255, 0.96), rgba(0, 198, 255, 0.96));
  transform: rotate(45deg);
  border-radius: 2px;
  z-index: -1;
}
@keyframes tooltip-pop {
  0%   { opacity: 0; transform: translateY(-50%) translateX(20px) scale(0.8); }
  10%  { opacity: 1; transform: translateY(-50%) translateX(0) scale(1.05); }
  18%  { transform: translateY(-50%) translateX(0) scale(1); }
  82%  { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
  100% { opacity: 0; transform: translateY(-50%) translateX(14px) scale(0.94); }
}

/* ============================================================
   AL ABRIR CHAT - matar todas las animaciones
   ============================================================ */
.asst-fab.is-open .energy-ring,
.asst-fab.is-open .energy-orbit,
.asst-fab.is-open .energy-tooltip {
  animation: none !important;
  opacity: 0 !important;
}
.asst-fab.is-open .asst-fab-content {
  animation: none;
  width: 44px;
  height: 44px;
}
.asst-fab.is-open .futu-avatar-img {
  animation: none;
  transform: none;
  filter: none;
}

/* Motion reducido */
@media (prefers-reduced-motion: reduce) {
  .asst-fab .energy-ring,
  .asst-fab .energy-orbit,
  .asst-fab .energy-tooltip,
  .asst-fab .asst-fab-content,
  .asst-fab .futu-avatar-img {
    animation: none !important;
  }
}
