/**
 * site/css/voice-advisor.css
 * Ambient Hologram Waveform, Contextual Auto-Switcher Toast, Particle Shimmer & Voice Resonance
 */

:root {
  --persona-accent: #34f5c5;
  --persona-glow: rgba(52, 245, 197, 0.5);
  --persona-bg: #00241b;
}

/* ===============================
   Contextual Auto-Proactive Switcher Toast
   =============================== */
.persona-suggestion-toast {
  position: fixed;
  bottom: 90px;
  left: 24px;
  z-index: 9998;
  display: none;
  align-items: center;
  gap: 12px;
  background: rgba(0, 36, 27, 0.95);
  border: 1.5px solid var(--persona-accent);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(52, 245, 197, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-width: 420px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.persona-suggestion-toast.show {
  display: flex !important;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.persona-suggestion-toast.hide {
  animation: toastSlideOut 0.35s ease forwards;
}

.persona-suggestion-toast.toast-aoife {
  border-color: #34f5c5;
  box-shadow: 0 12px 35px rgba(0,0,0,0.6), 0 0 20px rgba(52, 245, 197, 0.25);
}

.persona-suggestion-toast.toast-eimear {
  border-color: #fbbf24;
  box-shadow: 0 12px 35px rgba(0,0,0,0.6), 0 0 20px rgba(251, 191, 36, 0.25);
}

.persona-suggestion-toast.toast-declan {
  border-color: #38bdf8;
  box-shadow: 0 12px 35px rgba(0,0,0,0.6), 0 0 20px rgba(56, 189, 248, 0.25);
}

.toast-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid #34f5c5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  text-align: left;
}

.toast-title {
  font-size: 0.72rem;
  font-weight: 800;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.8rem;
  color: #e2e8f0;
  line-height: 1.35;
}

.toast-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-toast-switch {
  background: #34f5c5;
  color: #001711;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn-toast-switch:hover {
  transform: scale(1.05);
}

.btn-toast-dismiss {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.btn-toast-dismiss:hover {
  color: #ffffff;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.95); }
}

/* ===============================
   Particle Shimmer Layer
   =============================== */
#personaParticleLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
  border-radius: 28px;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 6s linear infinite;
  pointer-events: none;
}

@keyframes particleFloat {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { opacity: 0.85; }
  85% { opacity: 0.6; }
  100% { transform: translateY(-130px) scale(1.1); opacity: 0; }
}

.particle-aoife {
  background: rgba(52, 245, 197, 0.85);
  box-shadow: 0 0 12px rgba(30, 143, 75, 0.8);
}

.particle-eimear {
  background: rgba(251, 191, 36, 0.85);
  box-shadow: 0 0 12px rgba(242, 201, 76, 0.8);
}

.particle-declan {
  background: rgba(56, 189, 248, 0.85);
  box-shadow: 0 0 12px rgba(0, 180, 255, 0.8);
}

/* ===============================
   Persona Voice Resonance Glow
   =============================== */
.wash-resonate {
  filter: brightness(1.18) saturate(1.15) !important;
  transition: filter 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ===============================
   Persona Accent Edge Glow
   =============================== */
.modal-container.persona-edge-aoife {
  box-shadow: 0 0 16px rgba(30, 143, 75, 0.55), 0 25px 60px rgba(0, 0, 0, 0.8) !important;
  border-color: rgba(52, 245, 197, 0.8) !important;
}

.modal-container.persona-edge-eimear {
  box-shadow: 0 0 16px rgba(242, 201, 76, 0.55), 0 25px 60px rgba(0, 0, 0, 0.8) !important;
  border-color: rgba(251, 191, 36, 0.8) !important;
}

.modal-container.persona-edge-declan {
  box-shadow: 0 0 16px rgba(0, 180, 255, 0.55), 0 25px 60px rgba(0, 0, 0, 0.8) !important;
  border-color: rgba(56, 189, 248, 0.8) !important;
}

/* ===============================
   Background Color Wash Layer & Ambient Drift
   =============================== */
#personaColorWash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: transparent;
  background-size: 200% 200%;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), background 0.8s ease, filter 0.45s ease;
  z-index: 0;
  border-radius: 28px;
  animation: washDrift 12s ease-in-out infinite alternate;
}

@keyframes washDrift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.colorwash-aoife {
  background: linear-gradient(135deg, rgba(30, 143, 75, 0.45), rgba(30, 143, 75, 0.25), rgba(30, 143, 75, 0.15)) !important;
}

.colorwash-eimear {
  background: linear-gradient(135deg, rgba(242, 201, 76, 0.45), rgba(242, 201, 76, 0.25), rgba(242, 201, 76, 0.15)) !important;
}

.colorwash-declan {
  background: linear-gradient(135deg, rgba(0, 180, 255, 0.45), rgba(0, 180, 255, 0.25), rgba(0, 180, 255, 0.15)) !important;
}

.colorwash-animate-in { opacity: 1 !important; }
.colorwash-animate-out { opacity: 0 !important; }

/* ===============================
   Card Ripple Orb
   =============================== */
.persona-ripple-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%) scale(0);
  animation: personaRippleAnim 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

@keyframes personaRippleAnim {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(25); opacity: 0; }
}

/* ===============================
   Cinematic Persona Card Transitions
   =============================== */
.persona-card, .esh-onboarding-card {
  transition: box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.6s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: #00241b;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 22px 18px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  z-index: 2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.persona-card:active, .esh-onboarding-card:active {
  transform: scale(0.97) !important;
}

.persona-card:hover, .esh-onboarding-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.6);
}

.persona-card.halo-fade-out, .esh-onboarding-card.halo-fade-out {
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  transform: scale(0.98);
}

[data-persona="aoife"].halo-fade-in, [data-persona="aoife"].active-halo {
  box-shadow: 0 0 22px 8px rgba(30, 143, 75, 0.55) !important;
  border-color: rgba(30, 143, 75, 0.8) !important;
  animation: aoifeBloom 1.6s ease-out forwards !important;
}

@keyframes aoifeBloom {
  0% { box-shadow: 0 0 0 0 rgba(30, 143, 75, 0); }
  60% { box-shadow: 0 0 26px 10px rgba(30, 143, 75, 0.7); }
  100% { box-shadow: 0 0 22px 8px rgba(30, 143, 75, 0.55); }
}

[data-persona="eimear"].halo-fade-in, [data-persona="eimear"].active-halo {
  box-shadow: 0 0 22px 8px rgba(242, 201, 76, 0.55) !important;
  border-color: rgba(242, 201, 76, 0.8) !important;
  animation: eimearBloom 1.6s ease-out forwards !important;
}

@keyframes eimearBloom {
  0% { box-shadow: 0 0 0 0 rgba(242, 201, 76, 0); }
  60% { box-shadow: 0 0 26px 10px rgba(242, 201, 76, 0.7); }
  100% { box-shadow: 0 0 22px 8px rgba(242, 201, 76, 0.55); }
}

[data-persona="declan"].halo-fade-in, [data-persona="declan"].active-halo {
  box-shadow: 0 0 22px 8px rgba(0, 180, 255, 0.55) !important;
  border-color: rgba(0, 180, 255, 0.8) !important;
  animation: declanBloom 1.6s ease-out forwards !important;
}

@keyframes declanBloom {
  0% { box-shadow: 0 0 0 0 rgba(0, 180, 255, 0); }
  60% { box-shadow: 0 0 26px 10px rgba(0, 180, 255, 0.7); }
  100% { box-shadow: 0 0 22px 8px rgba(0, 180, 255, 0.55); }
}

.primary-action { transition: transform 0.4s ease, opacity 0.4s ease; }
.primary-action.cta-pop { transform: translateY(-2px); opacity: 1; }

.persona-badge {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  color: #34f5c5;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 6px;
  transition: opacity 0.3s ease;
}

.persona-badge.visible { display: inline-block !important; opacity: 1 !important; }
.persona-modal-overlay.open { display: flex !important; }

/* Floating Launcher */
.voice-advisor-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #00241b 0%, #001711 100%);
  color: #ffffff;
  border: 1.5px solid var(--persona-accent);
  padding: 10px 18px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--persona-glow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
}

.voice-advisor-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.6), 0 0 28px var(--persona-glow);
}

/* Fluid Hologram Pulse Rings */
.hologram-orb-container {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hologram-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #003628;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  position: relative;
  z-index: 2;
  border: 2px solid var(--persona-accent);
  box-shadow: 0 0 14px var(--persona-glow);
  transition: all 0.3s ease;
}

.hologram-wave {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 1.5px solid var(--persona-accent);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.speaking .hologram-avatar { animation: avatarThrob 1.2s infinite ease-in-out; }
.speaking .wave-1 { animation: hologramPulse 1.8s infinite cubic-bezier(0.2, 0.8, 0.2, 1) 0s; }
.speaking .wave-2 { animation: hologramPulse 1.8s infinite cubic-bezier(0.2, 0.8, 0.2, 1) 0.45s; }
.speaking .wave-3 { animation: hologramPulse 1.8s infinite cubic-bezier(0.2, 0.8, 0.2, 1) 0.9s; }

@keyframes hologramPulse {
  0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 8px var(--persona-accent); }
  50% { opacity: 0.5; }
  100% { transform: scale(2.3); opacity: 0; box-shadow: 0 0 25px var(--persona-accent); }
}

@keyframes avatarThrob {
  0%, 100% { transform: scale(1); box-shadow: 0 0 14px var(--persona-glow); }
  50% { transform: scale(1.08); box-shadow: 0 0 26px var(--persona-accent); }
}

/* Modal Drawer */
.voice-advisor-modal {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 400px;
  max-width: 92vw;
  max-height: 82vh;
  background: #001f17;
  color: #fff;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px var(--persona-glow);
  border: 1.5px solid var(--persona-accent);
  overflow: hidden;
  z-index: 10000;
  display: none;
  flex-direction: column;
  backdrop-filter: blur(16px);
}

.voice-advisor-modal.open { display: flex; animation: slideUp 0.3s ease-out; }

/* Hands-Free Minimized Ambient HUD Mode */
.voice-advisor-modal.hands-free-minimized {
  width: auto;
  max-width: 320px;
  bottom: 24px;
  right: 24px;
  border-radius: 35px;
  background: rgba(0, 28, 20, 0.95);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 25px var(--persona-accent);
  padding: 6px 12px;
}

.voice-advisor-modal.hands-free-minimized .voice-chat-body,
.voice-advisor-modal.hands-free-minimized .voice-modal-footer,
.voice-advisor-modal.hands-free-minimized #voice-action-toolbar,
.voice-advisor-modal.hands-free-minimized .eircode-voice-bar {
  display: none !important;
}

.voice-advisor-modal.hands-free-minimized .voice-modal-header {
  border-bottom: none;
  padding: 6px 4px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes eshFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile Anti-Collision Mode */
@media (max-width: 768px) {
  .persona-suggestion-toast {
    left: 12px !important;
    right: 12px !important;
    bottom: 84px !important;
    max-width: calc(100vw - 24px) !important;
    padding: 10px 12px !important;
  }
  .voice-advisor-launcher {
    bottom: 20px !important;
    right: 16px !important;
    padding: 10px 14px !important;
    font-size: 0.75rem !important;
    max-width: 145px !important;
  }
  .voice-advisor-modal {
    right: 12px !important;
    bottom: 76px !important;
    width: calc(100vw - 24px) !important;
    max-height: 75vh !important;
  }
}


/* =========================================================
   Push-to-Talk Spacebar HUD & Audio Visualizer
   ========================================================= */
.spacebar-ptt-hud {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(40px) scale(0.9);
  z-index: 100001;
  background: rgba(0, 24, 18, 0.96);
  border: 2px solid var(--persona-accent, #34f5c5);
  border-radius: 50px;
  padding: 12px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 30px var(--persona-glow, rgba(52, 245, 197, 0.4));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.spacebar-ptt-hud.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.ptt-wave-anim {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
}

.ptt-bar {
  width: 3.5px;
  height: 100%;
  background: var(--persona-accent, #34f5c5);
  border-radius: 2px;
  animation: pttPulse 0.8s infinite ease-in-out alternate;
}

.ptt-bar:nth-child(2) { animation-delay: 0.15s; height: 75%; }
.ptt-bar:nth-child(3) { animation-delay: 0.3s; height: 95%; }
.ptt-bar:nth-child(4) { animation-delay: 0.45s; height: 60%; }
.ptt-bar:nth-child(5) { animation-delay: 0.6s; height: 85%; }

@keyframes pttPulse {
  0% { transform: scaleY(0.3); opacity: 0.5; }
  100% { transform: scaleY(1.3); opacity: 1; }
}

.ptt-text {
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

.ptt-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
}


/* =========================================================
   Mobile Anti-Collision Architecture (Zero Widget Overlap)
   ========================================================= */
@media (max-width: 768px) {
  /* Voice Launcher: Compact Right Island */
  .voice-advisor-launcher, #voice-launcher {
    bottom: 18px !important;
    right: 14px !important;
    padding: 9px 13px !important;
    font-size: 0.74rem !important;
    max-width: 140px !important;
    gap: 6px !important;
    z-index: 9999 !important;
  }

  .voice-advisor-launcher span:last-child {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .hologram-orb-container {
    width: 28px !important;
    height: 28px !important;
  }

  .hologram-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.9rem !important;
  }

  /* Contextual Suggestion Toast: Floats Above the Bottom Islands */
  .persona-suggestion-toast {
    left: 12px !important;
    right: 12px !important;
    bottom: 74px !important;
    max-width: calc(100vw - 24px) !important;
    padding: 10px 14px !important;
    z-index: 9996 !important;
  }

  .toast-message {
    font-size: 0.76rem !important;
    line-height: 1.25 !important;
  }

  .btn-toast-switch {
    font-size: 0.7rem !important;
    padding: 5px 10px !important;
  }

  /* Push-to-Talk HUD: Center Floating Pill */
  .spacebar-ptt-hud {
    bottom: 76px !important;
    max-width: calc(100vw - 32px) !important;
    padding: 10px 18px !important;
    z-index: 100001 !important;
  }

  /* Voice Advisor Modal: Bottom-Sheet Drawer on Mobile */
  .voice-advisor-modal {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 84vh !important;
    border-radius: 24px 24px 0 0 !important;
    border-bottom: none !important;
    z-index: 100000 !important;
    box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.8) !important;
  }

  /* Side Tab Toggle: Elevated & Non-Obstructive */
  #esh-side-tab-toggle {
    top: 38% !important;
    padding: 8px 5px !important;
    font-size: 0.65rem !important;
    z-index: 9995 !important;
  }
}

@media (max-width: 380px) {
  .voice-advisor-launcher, #voice-launcher {
    padding: 9px 10px !important;
    font-size: 0.7rem !important;
    max-width: 125px !important;
  }
}


/* =========================================================
   Role Switch Confirmation Modal Overlay & Card
   ========================================================= */
.role-switch-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 18, 13, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: eshFadeIn 0.25s ease-out forwards;
}

.role-switch-confirm-overlay.open {
  display: flex !important;
}

.role-switch-confirm-card {
  background: #00241b;
  border: 1.5px solid rgba(52, 245, 197, 0.4);
  border-radius: 22px;
  max-width: 480px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(52, 245, 197, 0.2);
  color: #f8fafc;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.btn-confirm-switch {
  font-weight: 900;
  font-size: 0.86rem;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-confirm-switch:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(52, 245, 197, 0.5);
}

.btn-cancel-switch {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-switch:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}


/* ==========================================================================
   ROLE PICKER MODAL SILKY SMOOTH SLIDE-IN & RESPONSIVE POLISH
   ========================================================================== */
.persona-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 18, 13, 0.88) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  z-index: 1000010 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.persona-modal-overlay.open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.persona-modal-overlay .modal-container {
  background: #001f17 !important;
  border: 1.5px solid rgba(52, 245, 197, 0.35) !important;
  border-radius: 28px !important;
  max-width: 880px !important;
  width: 100% !important;
  max-height: 92vh !important;
  overflow-y: auto !important;
  padding: clamp(24px, 4vw, 40px) !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 30px rgba(52, 245, 197, 0.2) !important;
  text-align: center !important;
  position: relative !important;
  transform: translateY(28px) scale(0.96) !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease, border-color 0.6s ease !important;
}

.persona-modal-overlay.open .modal-container {
  transform: translateY(0) scale(1) !important;
}

.persona-modal-overlay .modal-close-btn {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #94a3b8 !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.2rem !important;
  cursor: pointer !important;
  z-index: 5 !important;
  transition: all 0.2s ease !important;
}

.persona-modal-overlay .modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  transform: rotate(90deg) !important;
}

.persona-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
}

.btn-explore-all-direct {
  background: none !important;
  border: none !important;
  color: #64748b !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  text-decoration: underline !important;
  transition: color 0.2s ease !important;
}

.btn-explore-all-direct:hover {
  color: #34f5c5 !important;
}

/* Landscape Mobile / Short Screens Anti-Collision */
@media (max-height: 550px) {
  .persona-modal-overlay {
    padding: 10px !important;
  }
  .persona-modal-overlay .modal-container {
    max-height: 94vh !important;
    padding: 16px 20px !important;
  }
  .persona-cards-grid {
    gap: 10px !important;
    margin-bottom: 16px !important;
  }
  .persona-card {
    padding: 12px 14px !important;
  }
  .voice-advisor-launcher, #voice-launcher {
    bottom: 12px !important;
    right: 12px !important;
    padding: 8px 14px !important;
    font-size: 0.72rem !important;
    max-width: 145px !important;
    z-index: 9999 !important;
  }
}

/* Mobile Screen Optimization & Modal Polish */
@media (max-width: 768px) {
  .voice-advisor-launcher, #voice-launcher {
    bottom: 76px !important;
    right: 14px !important;
  }

  /* Modal Tightening for 390px / 412px viewports */
  .persona-modal-overlay {
    padding: 12px !important;
  }
  .persona-modal-overlay .modal-container {
    padding: 18px 14px 22px 14px !important;
    max-height: 90vh !important;
  }
  .persona-modal-overlay h2 {
    font-size: 1.35rem !important;
    margin-bottom: 4px !important;
  }
  .persona-subtitle {
    font-size: 0.82rem !important;
    margin-bottom: 12px !important;
    line-height: 1.35 !important;
  }
  .persona-cards-grid,
  .persona-scroll-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding-right: 8px !important;
    margin-bottom: 14px !important;
    overflow-y: auto !important;
    max-height: 54vh !important;
    scrollbar-width: thin !important;
  }
  .persona-card, .esh-onboarding-card {
    padding: 0.85rem 1rem !important;
  }
  .persona-card h3, .esh-onboarding-card h3 {
    font-size: 1rem !important;
    margin: 4px 0 !important;
  }
  .persona-card p, .esh-onboarding-card p {
    font-size: 0.76rem !important;
    line-height: 1.35 !important;
  }
  .persona-card .primary-action, .esh-onboarding-card .primary-action {
    margin-top: 10px !important;
    font-size: 0.78rem !important;
  }
}

/* Backdrop Blur Overlay for Aoife Chat Drawer */
#voice-backdrop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 18, 13, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}

#voice-backdrop-overlay.open {
  display: block;
  opacity: 1;
}
