/* ═══════════════════════════════════════════════════════════════
   ZXIA — AI Assistant Sidebar
   Estilo: Comet-inspired · Glassmorphism · Apple spatial precision
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --zxia-accent:      #C6FF00;
  --zxia-cyan:        #00E5FF;
  --zxia-magenta:     #FF00FF;
  --zxia-bg:          #07080b;
  --zxia-bg-header:   #0c0d11;
  --zxia-border:      rgba(255,255,255,0.07);
  --zxia-border-acc:  rgba(198,255,0,0.12);
  --zxia-w:           390px;
  --zxia-tab-w:       38px;
  --zxia-ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --zxia-duration:    0.38s;
}

/* ── Main layout adjustment when sidebar opens ─────────────── */
.main {
  transition: margin-right var(--zxia-duration) var(--zxia-ease) !important;
}
body.zxia-sidebar-open .main {
  margin-right: var(--zxia-w) !important;
}

/* ── Tab Trigger — FAB circle floating on right edge ───────── */
/*
 * Visual: exact original FAB — 56x56px circle, #050607 fill,
 * iridescent conic-gradient ring via ::before, inner glow via ::after,
 * pulse box-shadow animation, robot SVG icon.
 * Position: fixed right:12px, centered vertically.
 * When sidebar opens (.sidebar-open) slides right to 402px.
 */

@keyframes zxia-tab-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(198,255,0,0.35),
                     0 4px 24px rgba(0,0,0,0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(198,255,0,0),
                     0 4px 24px rgba(0,0,0,0.55); }
  100% { box-shadow: 0 0 0 0   rgba(198,255,0,0),
                     0 4px 24px rgba(0,0,0,0.55); }
}

@keyframes zxia-tab-ring-spin {
  from { --zxia-orb-angle: 0deg;   }
  to   { --zxia-orb-angle: 360deg; }
}

#zxia-tab {
  /* Layout */
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  z-index: 1050;
  cursor: pointer;

  /* Shown state — JS toggles display */
  display: none;            /* shown after login via ZXIA_show */
  align-items: center;
  justify-content: center;

  /* Base fill: near-black, matches original FAB #050607 */
  background: #050607;
  border: none;
  outline: none;
  padding: 0;

  /* Pulse animation on box-shadow every 3.5s */
  animation: zxia-tab-pulse 3.5s ease-out infinite;

  /* Slide transition when sidebar opens */
  transition:
    right var(--zxia-duration) var(--zxia-ease),
    transform 0.18s ease;

  overflow: visible;
}

/* Sidebar-open state: slide left so tab clears the sidebar */
#zxia-tab.sidebar-open {
  right: calc(var(--zxia-w) + 12px); /* 390px + 12px margin = 402px */
}

/* Hover: lift + scale, ring speeds up */
#zxia-tab:hover {
  transform: translateY(-50%) scale(1.08) translateY(-2px);
  animation: zxia-tab-pulse 3.5s ease-out infinite; /* keep pulse */
}
#zxia-tab:hover::before {
  animation-duration: 4s; /* ring speeds up on hover */
}
#zxia-tab:active {
  transform: translateY(-50%) scale(0.94);
}

/* ── ::before — iridescent rotating ring ──────────────────── */
/*
 * Technique: conic-gradient as background, -webkit-mask with xor
 * to punch out the interior, leaving only the ring stroke visible.
 * Ring thickness ≈ 2px (inset -4px + padding 2px on each side).
 */
#zxia-tab::before {
  content: '';
  position: absolute;
  inset: -4px;           /* ring extends 4px beyond circle edge */
  border-radius: 50%;
  padding: 2px;          /* ring stroke thickness */
  background: conic-gradient(
    from var(--zxia-orb-angle, 0deg),
    #C6FF00  0deg,
    #00E5FF  100deg,
    #7C4DFF  200deg,
    #FF2E9A  280deg,
    #C6FF00  360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: zxia-tab-ring-spin 9s linear infinite;
  pointer-events: none;
}

/* ── ::after — inner radial glow ──────────────────────────── */
/*
 * Subtle white highlight at top + faint green tint overall.
 * Replicates the original FAB ::after inner glow.
 */
#zxia-tab::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 38% 32%,
      rgba(255,255,255,0.10) 0%,
      transparent 55%
    ),
    radial-gradient(
      circle at 60% 70%,
      rgba(198,255,0,0.06) 0%,
      transparent 60%
    );
  pointer-events: none;
}

/* Fallback: no @property support → static gradient, no spin */
@supports not (background: conic-gradient(from var(--a, 0deg), #000, #fff)) {
  #zxia-tab::before {
    background: linear-gradient(135deg, #C6FF00, #00E5FF, #7C4DFF, #FF2E9A);
    animation: none;
  }
}

/* ── Robot icon container ─────────────────────────────────── */
/*
 * Transparent container — icon is rendered as SVG directly inside
 * #zxia-tab. No background here; the circle bg comes from #zxia-tab.
 */
#zxia-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;           /* above ::after glow layer */
  pointer-events: none;
}

#zxia-tab-icon svg {
  width: 26px;
  height: 26px;
  stroke: #C6FF00;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 4px rgba(198,255,0,0.70))
    drop-shadow(0 0 10px rgba(198,255,0,0.35));
  transition: filter 0.2s ease;
}

#zxia-tab:hover #zxia-tab-icon svg {
  filter:
    drop-shadow(0 0 6px rgba(198,255,0,0.90))
    drop-shadow(0 0 16px rgba(198,255,0,0.50));
}

/* ── Notification badge — small dot top-right of circle ───── */
#zxia-tab-badge {
  position: absolute;
  top: 1px;            /* sits on top edge of the 56px circle */
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FF2E9A; /* magenta for contrast against green icon */
  border: 2px solid #050607;
  display: none;       /* shown via JS when there are unread messages */
  z-index: 2;
  animation: zxia-badge-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  pointer-events: none;
}

@keyframes zxia-badge-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Sidebar Container ─────────────────────────────────────── */
#zxia-sidebar {
  position: fixed;
  top: 0;
  right: calc(-1 * var(--zxia-w));
  bottom: 0;
  width: var(--zxia-w);
  z-index: 1049;
  display: none; /* shown via ZXIA_show as flex */
  flex-direction: column;
  background: var(--zxia-bg);
  border-left: 1px solid var(--zxia-border-acc);
  box-shadow:
    -24px 0 80px rgba(0,0,0,0.55),
    -1px 0 0 rgba(198,255,0,0.06);
  transition: right var(--zxia-duration) var(--zxia-ease);
  overflow: hidden;
}
#zxia-sidebar.zxia-open {
  right: 0;
}

/* Subtle grid bg */
#zxia-sidebar::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(198,255,0,0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198,255,0,0.016) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Top accent line */
#zxia-sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(198,255,0,0.5) 50%, transparent);
  z-index: 2;
}

/* ── Header ──────────────────────────────────────────────────── */
#zxia-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--zxia-border);
  flex-shrink: 0;
  background: var(--zxia-bg-header);
}

.zxia-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--zxia-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.82rem;
  color: #000;
  letter-spacing: -0.02em;
  box-shadow: 0 0 24px rgba(198,255,0,0.35);
  flex-shrink: 0;
}

.zxia-header-info { flex: 1; min-width: 0; }
.zxia-header-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zxia-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}
.zxia-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--zxia-accent);
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(198,255,0,0.4);
}
.zxia-status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--zxia-accent);
  opacity: 0;
  animation: zxia-status-pulse 2.2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  transform: translateZ(0);
}
@keyframes zxia-status-pulse {
  0%   { transform: scale(1); opacity: 0.6; }
  60%, 100% { transform: scale(2.4); opacity: 0; }
}
.zxia-status-text {
  font-size: 0.68rem;
  color: rgba(198,255,0,0.65);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.zxia-provider-badge {
  font-size: 0.58rem;
  color: rgba(0,229,255,0.65);
  letter-spacing: 0.09em;
  margin-left: 5px;
  text-transform: uppercase;
  font-weight: 600;
}
.zxia-header-actions { display: flex; gap: 4px; flex-shrink: 0; }
.zxia-header-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.zxia-header-btn:hover { background: rgba(255,255,255,0.07); color: #fff; }

/* ── Voice overlay ───────────────────────────────────────────── */
#zxia-voice-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(7,8,11,0.93);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#zxia-voice-overlay.active { opacity: 1; pointer-events: all; }
.zxia-voice-ring {
  position: relative;
  width: 72px;
  height: 72px;
}
.zxia-voice-ring::before,
.zxia-voice-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(198,255,0,0.3);
  animation: zxia-ring-expand 1.5s ease-out infinite;
}
.zxia-voice-ring::after { animation-delay: 0.5s; }
.zxia-voice-mic-btn {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--zxia-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(198,255,0,0.5);
}
@keyframes zxia-ring-expand {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}
.zxia-voice-transcript {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  text-align: center;
  max-width: 80%;
  min-height: 40px;
  padding: 0 16px;
  font-style: italic;
}
.zxia-voice-hint {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Messages area ───────────────────────────────────────────── */
#zxia-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 2;
  scroll-behavior: smooth;
}
#zxia-messages::-webkit-scrollbar { width: 3px; }
#zxia-messages::-webkit-scrollbar-track { background: transparent; }
#zxia-messages::-webkit-scrollbar-thumb {
  background: rgba(198,255,0,0.18);
  border-radius: 9999px;
}

/* Empty / welcome state */
.zxia-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  gap: 14px;
}
.zxia-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(198,255,0,0.07);
  border: 1px solid rgba(198,255,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(198,255,0,0.06);
}
.zxia-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.01em;
}
.zxia-empty-sub {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.38);
  margin: 0;
  line-height: 1.6;
}
.zxia-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 6px;
}
.zxia-chip {
  padding: 7px 14px;
  border-radius: 22px;
  border: 1px solid rgba(198,255,0,0.18);
  background: rgba(198,255,0,0.04);
  color: rgba(198,255,0,0.75);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.zxia-chip:hover {
  background: rgba(198,255,0,0.09);
  border-color: rgba(198,255,0,0.45);
  color: var(--zxia-accent);
  transform: translateY(-1px);
}

/* Message bubbles */
.zxia-msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
  animation: zxia-msg-in 0.22s cubic-bezier(0.25,1,0.5,1);
}
@keyframes zxia-msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.zxia-msg.zxia-user { flex-direction: row-reverse; }

.zxia-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.zxia-msg.zxia-ai .zxia-msg-avatar {
  background: rgba(198,255,0,0.09);
  border: 1px solid rgba(198,255,0,0.18);
  color: var(--zxia-accent);
}
.zxia-msg.zxia-user .zxia-msg-avatar {
  background: rgba(0,229,255,0.09);
  border: 1px solid rgba(0,229,255,0.18);
  color: var(--zxia-cyan);
}

.zxia-msg-body { flex: 1; min-width: 0; }
.zxia-msg-bubble {
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 0.845rem;
  line-height: 1.58;
  word-break: break-word;
  white-space: pre-wrap;
}
.zxia-msg.zxia-ai .zxia-msg-bubble {
  background: rgba(255,255,255,0.042);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.9);
  border-bottom-left-radius: 4px;
}
.zxia-msg.zxia-user .zxia-msg-bubble {
  background: rgba(198,255,0,0.09);
  border: 1px solid rgba(198,255,0,0.18);
  color: rgba(255,255,255,0.93);
  border-bottom-right-radius: 4px;
  margin-left: auto;
  max-width: 88%;
}
.zxia-msg-time {
  font-size: 0.64rem;
  color: rgba(255,255,255,0.22);
  margin-top: 5px;
  padding: 0 2px;
}
.zxia-msg.zxia-user .zxia-msg-time { text-align: right; }

/* Typing indicator */
.zxia-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.zxia-typing-dots {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.042);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}
.zxia-typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--zxia-accent);
  opacity: 0.4;
  animation: zxia-dot-wave 1.4s ease-in-out infinite;
  transform: translateZ(0); /* Hardware acceleration */
}
.zxia-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.zxia-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes zxia-dot-wave {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-4px); opacity: 1; }
}
.zxia-typing-label {
  font-size: 0.68rem;
  color: rgba(198,255,0,0.55);
  letter-spacing: 0.04em;
  font-weight: 500;
  white-space: nowrap;
  min-width: 125px; /* Prevent jitter when text changes */
  display: inline-block;
}

/* Action chips */
.zxia-action-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.zxia-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid rgba(0,229,255,0.28);
  background: rgba(0,229,255,0.055);
  color: rgba(0,229,255,0.88);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.025em;
}
.zxia-action-chip:hover {
  background: rgba(0,229,255,0.13);
  border-color: rgba(0,229,255,0.55);
  color: var(--zxia-cyan);
  transform: translateY(-1px);
}

/* ── Input area ─────────────────────────────────────────────── */
#zxia-input-area {
  position: relative;
  z-index: 2;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--zxia-border);
  background: var(--zxia-bg-header);
  flex-shrink: 0;
}
.zxia-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  padding: 9px 9px 9px 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.zxia-input-row:focus-within {
  border-color: rgba(198,255,0,0.32);
  box-shadow: 0 0 0 3px rgba(198,255,0,0.065);
}
#zxia-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255,255,255,0.9);
  font-size: 0.855rem;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  line-height: 1.5;
  resize: none;
  min-height: 22px;
  max-height: 130px;
  overflow-y: auto;
  padding: 2px 0;
}
#zxia-textarea::placeholder { color: rgba(255,255,255,0.2); }
#zxia-textarea::-webkit-scrollbar { width: 2px; }
#zxia-textarea::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }

.zxia-input-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-bottom: 1px;
}
.zxia-input-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.zxia-input-btn:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7); }
.zxia-input-btn:active { transform: scale(0.88); }
.zxia-input-btn.recording {
  color: var(--zxia-accent);
  background: rgba(198,255,0,0.09);
  animation: zxia-mic-pulse 1s ease-in-out infinite;
}
@keyframes zxia-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198,255,0,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(198,255,0,0); }
}
#zxia-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: var(--zxia-accent);
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  flex-shrink: 0;
  opacity: 0.4;
}
#zxia-send-btn.ready { opacity: 1; }
#zxia-send-btn:hover { box-shadow: 0 0 18px rgba(198,255,0,0.5); transform: scale(1.06); }
#zxia-send-btn:active { transform: scale(0.9); }

.zxia-voice-shortcut {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  padding: 0 2px;
}
.zxia-kbd {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.09);
  font-size: 0.63rem;
  color: rgba(255,255,255,0.35);
  font-family: monospace;
  letter-spacing: 0.03em;
}
.zxia-voice-hint-text {
  font-size: 0.67rem;
  color: rgba(255,255,255,0.22);
}

/* ── Markdown inside messages ─────────────────────────────── */
.zxia-msg-bubble strong { color: var(--zxia-accent); font-weight: 700; }
.zxia-msg-bubble em     { color: rgba(0,229,255,0.85); font-style: italic; }
.zxia-msg-bubble code {
  background: rgba(198,255,0,0.07);
  border: 1px solid rgba(198,255,0,0.14);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.82em;
  color: var(--zxia-accent);
}
.zxia-msg-bubble a { color: var(--zxia-cyan); text-decoration: underline; text-underline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════════
   HERO LISTENING EXPERIENCE — Siri-inspired aurora ring
   ═══════════════════════════════════════════════════════════════ */

@property --zxia-ring-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@property --zxia-orb-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* Aurora ring */
#zxia-aurora-ring {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms cubic-bezier(0.22,1,0.36,1);
  will-change: opacity;
}
#zxia-aurora-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 3px;
  background: conic-gradient(
    from var(--zxia-ring-angle, 0deg),
    #C6FF00 0deg, #00E5FF 90deg, #7C4DFF 200deg, #FF2E9A 285deg, #C6FF00 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: zxia-ring-rotate 6s linear infinite;
  filter: blur(0.3px);
}
#zxia-aurora-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 0 80px 0 rgba(198,255,0,0.10),
    inset 0 0 180px 0 rgba(0,229,255,0.05),
    inset 0 0 280px 0 rgba(124,77,255,0.04);
  pointer-events: none;
}
#zxia-aurora-ring.active { opacity: 1; }
@keyframes zxia-ring-rotate {
  from { --zxia-ring-angle: 0deg; }
  to   { --zxia-ring-angle: 360deg; }
}
@supports not (background: conic-gradient(from var(--a, 0deg), #000, #fff)) {
  #zxia-aurora-ring::before {
    background: linear-gradient(135deg, #C6FF00, #00E5FF 40%, #7C4DFF 70%, #FF2E9A);
    animation: zxia-ring-breath 3s ease-in-out infinite;
  }
}
@keyframes zxia-ring-breath {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1; }
}

body.zxia-listening::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.28) 100%);
  animation: zxia-vignette-in 300ms ease forwards;
}
@keyframes zxia-vignette-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Listening pill */
#zxia-listening-pill {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translate(-50%, -20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px 10px 14px;
  min-width: 320px;
  max-width: calc(100vw - 32px);
  height: 56px;
  border-radius: 999px;
  background: rgba(10,11,14,0.78);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    0 0 0 1px rgba(198,255,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease, transform 380ms cubic-bezier(0.34,1.45,0.64,1);
  will-change: transform, opacity;
}
#zxia-listening-pill.active {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.zxia-pill-mic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C6FF00, #8FCC00);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(198,255,0,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: background 280ms ease, box-shadow 280ms ease;
}
.zxia-pill-mic svg { width: 15px; height: 15px; }
.zxia-pill-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 32px;
  flex: 1;
  min-width: 140px;
  max-width: 200px;
}
.zxia-pill-wave-bar {
  width: 3px;
  height: 4px;
  min-height: 4px;
  max-height: 28px;
  background: linear-gradient(180deg, #C6FF00 0%, #00E5FF 60%, #7C4DFF 100%);
  border-radius: 2px;
  transition: height 70ms cubic-bezier(0.4,0,0.2,1);
  transform-origin: center;
}
.zxia-pill-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.zxia-pill-dots { display: inline-block; width: 1.1em; text-align: left; }
.zxia-pill-dots::after {
  content: "";
  animation: zxia-dots 1.4s steps(4, end) infinite;
}
@keyframes zxia-dots {
  0%, 20%  { content: ""; }
  40%      { content: "."; }
  60%      { content: ".."; }
  80%, 100%{ content: "..."; }
}
#zxia-listening-pill[data-state="processing"] .zxia-pill-mic {
  background: linear-gradient(135deg, #00E5FF, #7C4DFF);
  box-shadow: 0 0 20px rgba(0,229,255,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
  animation: zxia-shimmer 1.2s ease-in-out infinite;
}
#zxia-listening-pill[data-state="processing"] .zxia-pill-wave-bar {
  animation: zxia-wave-rest 1.6s ease-in-out infinite;
}
#zxia-listening-pill[data-state="processing"] .zxia-pill-wave-bar:nth-child(2n) { animation-delay: 0.1s; }
#zxia-listening-pill[data-state="processing"] .zxia-pill-wave-bar:nth-child(3n) { animation-delay: 0.2s; }
#zxia-listening-pill[data-state="processing"] .zxia-pill-wave-bar:nth-child(5n) { animation-delay: 0.3s; }
@keyframes zxia-wave-rest {
  0%, 100% { height: 4px; opacity: 0.5; }
  50%      { height: 12px; opacity: 1; }
}
#zxia-listening-pill[data-state="done"] .zxia-pill-mic {
  background: linear-gradient(135deg, #C6FF00, #8FCC00);
  box-shadow: 0 0 24px rgba(198,255,0,0.5);
}
#zxia-listening-pill[data-state="cancel"] .zxia-pill-mic {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
}
@keyframes zxia-shimmer {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.35); }
}

/* Caption under pill */
#zxia-listening-caption {
  position: fixed;
  top: 92px;
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 9999;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.68);
  letter-spacing: 0.005em;
  max-width: min(680px, calc(100vw - 48px));
  text-align: center;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 320ms cubic-bezier(0.34,1.45,0.64,1);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
#zxia-listening-caption.active {
  opacity: 1;
  transform: translate(-50%, 0);
}
#zxia-listening-caption::before { content: "\201C"; opacity: 0.4; margin-right: 4px; }
#zxia-listening-caption::after  { content: "\201D"; opacity: 0.4; margin-left: 2px; }
#zxia-listening-caption.empty::before,
#zxia-listening-caption.empty::after { display: none; }

/* Orb wave bars inside tab (when recording) */
#zxia-tab-wave {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 20px;
}
#zxia-tab.zxia-listening #zxia-tab-wave { display: flex; }
#zxia-tab.zxia-listening #zxia-tab-icon { display: none; }
/* chevron removed from tab — no rule needed */
.zxia-tab-wave-bar {
  width: 2px;
  height: 6px;
  min-height: 3px;
  max-height: 20px;
  background: linear-gradient(180deg, #C6FF00, #00E5FF);
  border-radius: 2px;
  transition: height 70ms cubic-bezier(0.4,0,0.2,1);
}

/* Hide legacy in-panel voice overlay */
#zxia-voice-overlay.active { opacity: 0 !important; pointer-events: none !important; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --zxia-w: 340px; }
}
@media (max-width: 640px) {
  :root { --zxia-w: 100vw; }
  #zxia-tab { display: none !important; }
  #zxia-sidebar {
    right: -100vw;
    border-left: none;
    border-top: 1px solid var(--zxia-border-acc);
  }
  body.zxia-sidebar-open .main { margin-right: 0 !important; }
}

@media (max-width: 560px) {
  #zxia-listening-pill { top: 18px; min-width: 0; width: calc(100vw - 24px); padding: 10px 18px 10px 12px; }
  .zxia-pill-wave { max-width: 120px; min-width: 80px; }
  .zxia-pill-label { font-size: 12px; }
  #zxia-listening-caption { top: 82px; font-size: 13px; max-width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  #zxia-aurora-ring::before { animation: none; }
  body.zxia-listening::after { animation: none; }
  .zxia-pill-wave-bar, .zxia-tab-wave-bar { transition: none; }
  #zxia-listening-pill { transition: opacity 180ms ease; }
  #zxia-tab-icon::before { animation: none; }
}

/* Highlight pulse cuando el asistente apunta a un elemento del dashboard */
.zxia-highlight {
  position: relative;
  animation: zxia-highlight-pulse 1.6s ease-out;
  outline: 2px solid rgba(99, 102, 241, .6);
  outline-offset: 4px;
  border-radius: 8px;
}
@keyframes zxia-highlight-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(99, 102, 241, .55); }
  60%  { box-shadow: 0 0 0 14px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
