/* ============================================================
   TRUE AI — Front-End Voice Interface Styles
   Author: Rev. Futurist Erskine Matthews
   Site:   https://newbeings1619.us
   ============================================================ */

/* ── CSS Variables (defaults, overridden by admin settings) ── */
:root {
  --tai-bg:             #0d0d1a;
  --tai-header-bg:      #1a1a2e;
  --tai-text:           #e2e8f0;
  --tai-accent:         #7c3aed;
  --tai-btn:            #7c3aed;
  --tai-btn-hover:      #6d28d9;
  --tai-mute:           #374151;
  --tai-transcript-bg:  rgba(255,255,255,0.08);
  --tai-orb-primary:    #7c3aed;
  --tai-orb-secondary:  #a855f7;
  --tai-orb-glow:       #c084fc;
  --tai-ring:           #6d28d9;
  --tai-width:          420px;
  --tai-radius:         20px;
  --tai-widget-icon-color: #7c3aed;
}

/* ── Light Theme Override ── */
.tai-light {
  --tai-bg:             #f0f0ff;
  --tai-header-bg:      #e8e0ff;
  --tai-text:           #1a1a2e;
  --tai-mute:           #d1d5db;
  --tai-transcript-bg:  rgba(0,0,0,0.06);
}

/* ── Reset for our elements ── */
.tai-voice-ui *,
.tai-voice-ui *::before,
.tai-voice-ui *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================================
   MAIN WRAPPER — replaces .mwai-realtime
   ============================================================ */
.tai-voice-ui {
  position: relative;
  width: 100%;
  max-width: var(--tai-width);
  margin: 0 auto;
  background: var(--tai-bg);
  border-radius: var(--tai-radius);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--tai-text);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
  transition: background 0.3s, color 0.3s;
}

/* ── Header ── */
.tai-header {
  background: var(--tai-header-bg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.tai-header-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--tai-text);
}

.tai-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tai-session-timer {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  padding: 3px 8px;
  border-radius: 20px;
  min-width: 48px;
  text-align: center;
}
.tai-light .tai-session-timer { color: rgba(0,0,0,0.4); background: rgba(0,0,0,0.07); }

.tai-theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}
.tai-theme-toggle-btn:hover { color: var(--tai-text); background: rgba(255,255,255,0.1); }
.tai-light .tai-theme-toggle-btn { color: rgba(0,0,0,0.4); }
.tai-light .tai-theme-toggle-btn:hover { background: rgba(0,0,0,0.08); }

/* ── Visualizer Stage ── */
.tai-visualizer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 20px;
  min-height: 280px;
}

/* ============================================================
   ORB VISUALIZER
   ============================================================ */
.tai-orb-container {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ripple rings */
.tai-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--tai-ring);
  opacity: 0;
  animation: tai-ring-expand 3s ease-out infinite;
  pointer-events: none;
}

.tai-ring:nth-child(1) { width: 120px; height: 120px; animation-delay: 0s; }
.tai-ring:nth-child(2) { width: 150px; height: 150px; animation-delay: 0.6s; }
.tai-ring:nth-child(3) { width: 180px; height: 180px; animation-delay: 1.2s; }
.tai-ring:nth-child(4) { width: 210px; height: 210px; animation-delay: 1.8s; }
.tai-ring:nth-child(5) { width: 240px; height: 240px; animation-delay: 2.4s; }

@keyframes tai-ring-expand {
  0%   { opacity: 0.7; transform: scale(0.6); }
  100% { opacity: 0;   transform: scale(1.4); }
}

/* Active state — faster rings */
.tai-voice-ui.tai-active .tai-ring { animation-duration: 1.5s; }
.tai-voice-ui.tai-speaking .tai-ring { animation-duration: 1.0s; border-color: var(--tai-orb-glow); }
.tai-voice-ui.tai-listening .tai-ring { animation-duration: 0.8s; border-color: var(--tai-orb-secondary); }

/* Orb itself */
.tai-orb {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--tai-orb-glow) 0%, var(--tai-orb-secondary) 35%, var(--tai-orb-primary) 70%, #2d1b69 100%);
  box-shadow:
    0 0 30px rgba(168,85,247,0.5),
    0 0 60px rgba(124,58,237,0.3),
    inset 0 0 20px rgba(255,255,255,0.1);
  animation: tai-orb-idle 4s ease-in-out infinite;
  transition: transform 0.2s, box-shadow 0.3s;
  z-index: 2;
}

/* Orb highlight */
.tai-orb::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 20%;
  width: 30%;
  height: 25%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.6) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Orb inner glow pulse */
.tai-orb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
  animation: tai-orb-inner 2s ease-in-out infinite alternate;
}

@keyframes tai-orb-idle {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 30px rgba(168,85,247,0.5), 0 0 60px rgba(124,58,237,0.3); }
  50%       { transform: scale(1.04); box-shadow: 0 0 40px rgba(168,85,247,0.7), 0 0 80px rgba(124,58,237,0.4); }
}

@keyframes tai-orb-inner {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

/* Orb states */
.tai-voice-ui.tai-listening .tai-orb {
  animation: tai-orb-listening 0.6s ease-in-out infinite alternate;
}
@keyframes tai-orb-listening {
  from { transform: scale(1);    box-shadow: 0 0 35px rgba(168,85,247,0.6); }
  to   { transform: scale(1.08); box-shadow: 0 0 55px rgba(168,85,247,0.9), 0 0 90px rgba(124,58,237,0.5); }
}

.tai-voice-ui.tai-speaking .tai-orb {
  animation: tai-orb-speaking 0.4s ease-in-out infinite alternate;
}
@keyframes tai-orb-speaking {
  from { transform: scale(1);    box-shadow: 0 0 40px rgba(192,132,252,0.7); }
  to   { transform: scale(1.1);  box-shadow: 0 0 70px rgba(192,132,252,1),   0 0 110px rgba(124,58,237,0.6); }
}

.tai-voice-ui.tai-thinking .tai-orb {
  animation: tai-orb-thinking 1.5s ease-in-out infinite;
}
@keyframes tai-orb-thinking {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25%       { transform: scale(1.03) rotate(2deg); }
  75%       { transform: scale(1.03) rotate(-2deg); }
}

/* Greeting intro animation */
.tai-orb.tai-greeting-anim {
  animation: tai-orb-greeting 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes tai-orb-greeting {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Audio-reactive scale (set via JS) */
.tai-orb { --tai-audio-scale: 1; }

/* ============================================================
   EQUALIZER VISUALIZER
   ============================================================ */
.tai-eq-container {
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 140px;
  width: 200px;
}

.tai-voice-ui.tai-eq-mode .tai-orb-container { display: none; }
.tai-voice-ui.tai-eq-mode .tai-eq-container  { display: flex; }

.tai-eq-bar {
  width: 10px;
  background: linear-gradient(to top, var(--tai-orb-primary), var(--tai-orb-glow));
  border-radius: 4px 4px 2px 2px;
  min-height: 4px;
  transition: height 0.05s ease;
  box-shadow: 0 0 6px rgba(168,85,247,0.4);
}

/* Idle animation for EQ bars */
.tai-voice-ui:not(.tai-active) .tai-eq-bar {
  animation: tai-eq-idle 1.8s ease-in-out infinite alternate;
}

.tai-eq-bar:nth-child(1)  { animation-delay: 0.0s; }
.tai-eq-bar:nth-child(2)  { animation-delay: 0.1s; }
.tai-eq-bar:nth-child(3)  { animation-delay: 0.2s; }
.tai-eq-bar:nth-child(4)  { animation-delay: 0.05s; }
.tai-eq-bar:nth-child(5)  { animation-delay: 0.15s; }
.tai-eq-bar:nth-child(6)  { animation-delay: 0.25s; }
.tai-eq-bar:nth-child(7)  { animation-delay: 0.08s; }
.tai-eq-bar:nth-child(8)  { animation-delay: 0.18s; }
.tai-eq-bar:nth-child(9)  { animation-delay: 0.12s; }
.tai-eq-bar:nth-child(10) { animation-delay: 0.22s; }
.tai-eq-bar:nth-child(11) { animation-delay: 0.06s; }
.tai-eq-bar:nth-child(12) { animation-delay: 0.16s; }
.tai-eq-bar:nth-child(13) { animation-delay: 0.09s; }
.tai-eq-bar:nth-child(14) { animation-delay: 0.19s; }
.tai-eq-bar:nth-child(15) { animation-delay: 0.03s; }
.tai-eq-bar:nth-child(16) { animation-delay: 0.13s; }

@keyframes tai-eq-idle {
  from { height: 8px; }
  to   { height: 30px; }
}

/* ── Status Label ── */
.tai-status-label {
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.3px;
  padding: 0 20px 8px;
  min-height: 22px;
  transition: color 0.3s;
}
.tai-light .tai-status-label { color: rgba(0,0,0,0.45); }

.tai-voice-ui.tai-listening  .tai-status-label { color: var(--tai-orb-secondary); }
.tai-voice-ui.tai-speaking   .tai-status-label { color: var(--tai-orb-glow); }
.tai-voice-ui.tai-thinking   .tai-status-label { color: rgba(255,255,255,0.7); }

/* ── Speech Bubble ── */
.tai-speech-bubble-wrap {
  display: flex;
  justify-content: center;
  padding: 4px 20px 16px;
  min-height: 48px;
}

.tai-speech-bubble {
  position: relative;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--tai-text);
  max-width: 85%;
  text-align: center;
  line-height: 1.4;
  transition: opacity 0.3s, transform 0.3s;
}

.tai-light .tai-speech-bubble {
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.1);
}

/* Tail */
.tai-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(255,255,255,0.12);
}
.tai-light .tai-speech-bubble::after { border-top-color: rgba(0,0,0,0.07); }

.tai-speech-bubble.tai-fade-in {
  animation: tai-bubble-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tai-bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Controls Row ── */
.tai-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 20px 20px;
}

/* Generic control button */
.tai-ctrl-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.tai-ctrl-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(168,85,247,0.5);
}

/* Mute button */
.tai-mute-btn {
  width: 50px;
  height: 50px;
  background: var(--tai-mute);
  color: rgba(255,255,255,0.7);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.tai-mute-btn:hover { background: #4b5563; transform: scale(1.08); }
.tai-mute-btn.tai-muted {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 4px 16px rgba(220,38,38,0.5);
}
.tai-mute-btn.tai-muted:hover { background: #b91c1c; }
.tai-light .tai-mute-btn { background: #d1d5db; color: #374151; }

/* Mic button — large center */
.tai-mic-btn {
  width: 68px;
  height: 68px;
  background: var(--tai-btn);
  color: #fff;
  box-shadow:
    0 6px 20px rgba(124,58,237,0.5),
    0 0 0 0 rgba(124,58,237,0.4);
  animation: tai-mic-pulse 2.5s ease-in-out infinite;
}

.tai-mic-btn:hover {
  background: var(--tai-btn-hover);
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(124,58,237,0.7);
}

.tai-mic-btn.tai-active {
  background: var(--tai-btn-hover);
  animation: tai-mic-active-pulse 0.8s ease-in-out infinite;
}

.tai-mic-btn.tai-connecting {
  animation: tai-mic-spin 1s linear infinite;
}

@keyframes tai-mic-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(124,58,237,0.5), 0 0 0 0 rgba(124,58,237,0.4); }
  50%       { box-shadow: 0 6px 20px rgba(124,58,237,0.5), 0 0 0 8px rgba(124,58,237,0); }
}

@keyframes tai-mic-active-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(124,58,237,0.7), 0 0 0 0 rgba(124,58,237,0.5); }
  50%       { box-shadow: 0 6px 20px rgba(124,58,237,0.7), 0 0 0 12px rgba(124,58,237,0); }
}

@keyframes tai-mic-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Transcript toggle button */
.tai-transcript-btn {
  width: 50px;
  height: 50px;
  background: var(--tai-mute);
  color: rgba(255,255,255,0.7);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.tai-transcript-btn:hover { background: #4b5563; transform: scale(1.08); }
.tai-transcript-btn.tai-active {
  background: var(--tai-accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124,58,237,0.5);
}
.tai-light .tai-transcript-btn { background: #d1d5db; color: #374151; }

/* ── Keyboard Hints ── */
.tai-keyboard-hints {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 0 20px 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}
.tai-light .tai-keyboard-hints { color: rgba(0,0,0,0.3); }

.tai-kbd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tai-kbd kbd {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: monospace;
  color: rgba(255,255,255,0.5);
}
.tai-light .tai-kbd kbd { background: rgba(0,0,0,0.07); border-color: rgba(0,0,0,0.12); color: rgba(0,0,0,0.4); }

/* ── Transcript Panel ── */
.tai-transcript-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--tai-transcript-bg);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.tai-transcript-panel.tai-open {
  max-height: 320px;
}

.tai-light .tai-transcript-panel { border-top-color: rgba(0,0,0,0.08); }

.tai-transcript-inner {
  padding: 16px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.tai-light .tai-transcript-inner { scrollbar-color: rgba(0,0,0,0.15) transparent; }

.tai-transcript-inner::-webkit-scrollbar { width: 4px; }
.tai-transcript-inner::-webkit-scrollbar-track { background: transparent; }
.tai-transcript-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.tai-transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tai-transcript-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
}
.tai-light .tai-transcript-title { color: rgba(0,0,0,0.35); }

.tai-copy-all-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tai-copy-all-btn:hover { background: rgba(255,255,255,0.1); color: var(--tai-text); }
.tai-light .tai-copy-all-btn { border-color: rgba(0,0,0,0.15); color: rgba(0,0,0,0.45); }
.tai-light .tai-copy-all-btn:hover { background: rgba(0,0,0,0.06); }

.tai-transcript-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tai-transcript-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: tai-msg-in 0.3s ease;
}

@keyframes tai-msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tai-transcript-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(255,255,255,0.35);
}
.tai-light .tai-transcript-msg-meta { color: rgba(0,0,0,0.3); }

.tai-transcript-msg-role {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tai-transcript-msg[data-role="assistant"] .tai-transcript-msg-role { color: var(--tai-orb-glow); }
.tai-transcript-msg[data-role="user"]      .tai-transcript-msg-role { color: var(--tai-orb-secondary); }

.tai-transcript-msg-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.3);
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.tai-transcript-msg-copy:hover { color: rgba(255,255,255,0.7); }
.tai-light .tai-transcript-msg-copy { color: rgba(0,0,0,0.25); }
.tai-light .tai-transcript-msg-copy:hover { color: rgba(0,0,0,0.6); }

.tai-transcript-msg-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--tai-text);
  background: rgba(255,255,255,0.05);
  padding: 8px 12px;
  border-radius: 10px;
  word-break: break-word;
}
.tai-light .tai-transcript-msg-text { background: rgba(0,0,0,0.04); }

.tai-transcript-msg[data-role="user"] .tai-transcript-msg-text {
  background: rgba(124,58,237,0.15);
  border-left: 2px solid var(--tai-orb-secondary);
}

.tai-transcript-empty {
  text-align: center;
  color: rgba(255,255,255,0.25);
  font-size: 13px;
  padding: 20px 0;
}
.tai-light .tai-transcript-empty { color: rgba(0,0,0,0.25); }

/* ── Error Banner ── */
.tai-error-banner {
  margin: 0 16px 12px;
  padding: 10px 14px;
  background: rgba(220,38,38,0.15);
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: 10px;
  font-size: 13px;
  color: #fca5a5;
  display: none;
}
.tai-error-banner.tai-visible { display: block; }

/* ── Wake Word Indicator ── */
.tai-wake-word-indicator {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.tai-wake-word-indicator .tai-wake-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: tai-wake-blink 2s ease-in-out infinite;
}
@keyframes tai-wake-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Thinking dots ── */
.tai-thinking-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.tai-thinking-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tai-orb-glow);
  animation: tai-dot-bounce 1.2s ease-in-out infinite;
}
.tai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.tai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tai-dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-5px); opacity: 1; }
}

/* ── Copy toast ── */
.tai-copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,50,0.95);
  color: #e2e8f0;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 99999;
  white-space: nowrap;
}
.tai-copy-toast.tai-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   FLOATING WIDGET
   ============================================================ */
.tai-floating-widget {
  display: none;
  position: fixed;
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.tai-floating-widget[data-enabled="1"] { display: flex; }

.tai-pos-bottom-right { bottom: 24px; right: 24px; }
.tai-pos-bottom-left  { bottom: 24px; left: 24px; }
.tai-pos-top-right    { top: 24px;    right: 24px; }
.tai-pos-top-left     { top: 24px;    left: 24px; }

.tai-widget-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--tai-widget-icon-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 0 0 rgba(124,58,237,0.4);
  animation: tai-widget-pulse 3s ease-in-out infinite;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tai-widget-icon svg { width: 26px; height: 26px; }
.tai-floating-widget:hover .tai-widget-icon { transform: scale(1.1); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }

@keyframes tai-widget-pulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 0 0 rgba(124,58,237,0.4); }
  50%       { box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 0 10px rgba(124,58,237,0); }
}

.tai-widget-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tai-widget-icon-color);
  background: rgba(255,255,255,0.95);
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  white-space: nowrap;
}

/* Floating overlay */
.tai-floating-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tai-floating-overlay.tai-open {
  display: flex;
  animation: tai-overlay-in 0.3s ease;
}

@keyframes tai-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.tai-floating-overlay .tai-voice-ui {
  animation: tai-modal-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tai-modal-in {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.tai-floating-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.7);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 3;
}
.tai-floating-close:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ── Hidden audio element (Meow uses this) ── */
#mwai-audio { display: none; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .tai-voice-ui { border-radius: 16px; }
  .tai-orb-container { width: 160px; height: 160px; }
  .tai-orb { width: 90px; height: 90px; }
  .tai-mic-btn { width: 60px; height: 60px; }
  .tai-mute-btn,
  .tai-transcript-btn { width: 44px; height: 44px; }
}

/* ── Utility ── */
.tai-hidden { display: none !important; }
.tai-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
