/* Bharat Auravistas — Free Voice AI Assistant (light premium) */
#ba-voice-root {
  --ba-accent: #9a7b3c;
  --ba-accent-soft: #f5efe3;
  --ba-ink: #1a1a1a;
  --ba-muted: #6b6b6b;
  --ba-panel: #ffffff;
  --ba-surface: #f7f7f5;
  --ba-line: #e8e6e1;
  --ba-text: #1a1a1a;
  --ba-user: #1f1f1f;
  font-family: "Avenir LT Std", Avenir, "Segoe UI", sans-serif;
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  overflow: visible;
  z-index: 1000002;
  isolation: isolate;
  pointer-events: none;
}

#ba-voice-root * {
  box-sizing: border-box;
}

#ba-voice-root .ba-voice-fab,
#ba-voice-root .ba-voice-panel {
  pointer-events: auto;
}

.ba-voice-fab {
  position: fixed;
  right: 20px;
  left: auto;
  bottom: 50px;
  top: auto;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: #ac8a44;
  color: #ffffff !important;
  cursor: pointer;
  box-shadow: 2px 2px 3px #999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 1000003;
  padding: 0;
  overflow: visible;
}

.ba-fab-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
}

.ba-fab-label {
  display: none;
}

.ba-voice-fab:hover {
  transform: translateY(-2px);
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.25);
  color: #ffffff !important;
}

.ba-voice-fab svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  flex-shrink: 0;
}

.ba-voice-fab.is-listening {
  animation: ba-pulse 1.4s ease-in-out infinite;
  background: #9a7b3c;
  color: #ffffff !important;
}

.ba-voice-fab.is-speaking {
  background: #8a6d32;
  color: #ffffff !important;
}

@keyframes ba-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(172, 138, 68, 0.45); }
  50% { box-shadow: 0 0 0 14px rgba(172, 138, 68, 0); }
}

.ba-voice-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #101830;
  color: #ffffff !important;
  font-size: 9px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  letter-spacing: 0.02em;
}

.ba-wake-hint {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 9px 14px;
  border-radius: 14px;
  background: #101830;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  box-shadow: 0 10px 28px rgba(16, 24, 48, 0.28);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  animation: ba-wake-hint-float 2.8s ease-in-out infinite;
}

.ba-wake-hint strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.ba-wake-hint span {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.82;
  line-height: 1.2;
}

.ba-wake-hint::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #101830;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 2px;
}

@keyframes ba-wake-hint-float {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50% { transform: translateY(-50%) translateX(-4px); }
}

#ba-voice-root:has(.ba-voice-panel.is-open) .ba-wake-hint,
.ba-voice-fab.is-listening .ba-wake-hint,
.ba-voice-fab.is-speaking .ba-wake-hint {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ba-voice-panel {
  position: fixed;
  right: 20px;
  bottom: 130px;
  width: min(360px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 240px));
  background: var(--ba-panel) !important;
  color: var(--ba-text) !important;
  -webkit-text-fill-color: var(--ba-text);
  border: 1px solid var(--ba-line);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(26, 26, 26, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000004;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 28px, 0) scale(0.92);
  transform-origin: bottom right;
  transition:
    opacity 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.18s,
    box-shadow 0.2s ease;
  will-change: transform, opacity;
}

.ba-voice-panel.is-fast-open {
  transition:
    opacity 0.1s ease-out,
    transform 0.12s cubic-bezier(0.2, 0.9, 0.3, 1),
    visibility 0.1s,
    box-shadow 0.12s ease;
}

.ba-voice-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  box-shadow: 0 28px 64px rgba(26, 26, 26, 0.18);
}

.ba-voice-panel.is-open .ba-voice-header,
.ba-voice-panel.is-open .ba-voice-status,
.ba-voice-panel.is-open .ba-voice-actions,
.ba-voice-panel.is-open .ba-hint {
  animation: ba-panel-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ba-voice-panel.is-fast-open.is-open .ba-voice-header,
.ba-voice-panel.is-fast-open.is-open .ba-voice-status,
.ba-voice-panel.is-fast-open.is-open .ba-voice-actions,
.ba-voice-panel.is-fast-open.is-open .ba-hint {
  animation: none;
  opacity: 1;
  transform: none;
}

.ba-voice-panel.is-open .ba-voice-messages {
  animation: none;
}

.ba-voice-panel.is-open .ba-voice-header { animation-delay: 0.02s; }
.ba-voice-panel.is-open .ba-voice-status { animation-delay: 0.04s; }
.ba-voice-panel.is-open .ba-voice-actions { animation-delay: 0.06s; }
.ba-voice-panel.is-open .ba-hint { animation-delay: 0.08s; }

@keyframes ba-panel-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ba-voice-fab.is-tease {
  animation: ba-fab-tease 0.85s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes ba-fab-tease {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-8px) scale(1.08); }
  55% { transform: translateY(-2px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

.ba-voice-panel,
.ba-voice-panel *:not(.ba-msg):not(.ba-msg *) {
  color: var(--ba-text);
}

.ba-voice-panel .ba-msg {
  -webkit-text-stroke-width: 0;
}

.ba-voice-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ba-line);
  background: #ffffff;
  flex-shrink: 0;
}

.ba-voice-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ba-accent-soft);
  border: 1px solid #eadfca;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
}

.ba-voice-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ba-voice-title {
  flex: 1;
  min-width: 0;
}

.ba-voice-title strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ba-ink) !important;
  -webkit-text-fill-color: var(--ba-ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ba-voice-title span,
.ba-voice-title .ba-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #1a7f4b !important;
  -webkit-text-fill-color: #1a7f4b;
  margin-top: 3px;
}

.ba-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: ba-online-pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes ba-online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

.ba-voice-close {
  border: 1px solid var(--ba-line);
  background: var(--ba-surface);
  color: var(--ba-ink) !important;
  -webkit-text-fill-color: var(--ba-ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 10px;
}

.ba-voice-close:hover {
  background: #efefed;
}

.ba-voice-status {
  padding: 10px 18px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--ba-accent) !important;
  -webkit-text-fill-color: var(--ba-accent);
  min-height: 26px;
  flex-shrink: 0;
}

.ba-voice-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  background: var(--ba-surface);
}

.ba-msg {
  max-width: 92%;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transform: none;
  filter: none;
}

.ba-msg.bot {
  align-self: flex-start;
  background: #ffffff !important;
  border: 1px solid var(--ba-line);
  border-bottom-left-radius: 4px;
  color: #1a1a1a !important;
  -webkit-text-fill-color: #1a1a1a !important;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04);
}

.ba-msg.user {
  align-self: flex-end;
  background: var(--ba-user) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-bottom-right-radius: 4px;
}

.ba-voice-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 10px;
  border-top: 1px solid transparent;
  background: linear-gradient(180deg, rgba(245, 239, 227, 0.55) 0%, #ffffff 48%);
  flex-shrink: 0;
}

.ba-lang-picker,
.ba-lang-btn,
.ba-resume-picker {
  display: none !important;
}

.ba-voice-fab.is-wake {
  box-shadow: 0 0 0 0 rgba(172, 138, 68, 0.35);
  animation: ba-wake-pulse 2.2s ease-in-out infinite;
}

@keyframes ba-wake-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(172, 138, 68, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(172, 138, 68, 0); }
}

/* Human presence strip — conversation feel, not hard buttons */
.ba-presence {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 4px 2px;
  margin: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  color: var(--ba-ink);
  font: inherit;
}

.ba-presence:focus-visible {
  outline: 2px solid rgba(154, 123, 60, 0.45);
  outline-offset: 4px;
  border-radius: 16px;
}

.ba-presence-orb {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.ba-presence-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(94, 184, 239, 0.35);
  opacity: 0;
  transform: scale(0.78);
}

.ba-presence.is-listening .ba-presence-ring,
.ba-presence.is-speaking .ba-presence-ring {
  animation: ba-presence-breathe 2.4s ease-out infinite;
}

.ba-presence.is-listening .ba-presence-ring--delay,
.ba-presence.is-speaking .ba-presence-ring--delay {
  animation-delay: 1.1s;
}

.ba-presence.is-speaking .ba-presence-ring {
  border-color: rgba(62, 160, 220, 0.45);
}

@keyframes ba-presence-breathe {
  0% {
    opacity: 0.55;
    transform: scale(0.82);
  }
  70% {
    opacity: 0;
    transform: scale(1.35);
  }
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

.ba-presence-core {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #5eb8ef;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 6px 16px rgba(70, 140, 190, 0.28);
  display: grid;
  place-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ba-presence.is-listening .ba-presence-core {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.98),
    0 0 0 5px rgba(94, 184, 239, 0.22),
    0 8px 18px rgba(70, 140, 190, 0.32);
  animation: ba-presence-soft 2.8s ease-in-out infinite;
}

.ba-presence.is-speaking .ba-presence-core {
  animation: ba-presence-soft 1.6s ease-in-out infinite;
}

.ba-presence.is-paused .ba-presence-core,
.ba-presence.is-need-mic .ba-presence-core {
  opacity: 0.98;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 4px 12px rgba(70, 140, 190, 0.18);
  animation: ba-presence-soft 3.5s ease-in-out infinite;
}

@keyframes ba-presence-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Animated aurora globe (moving color wash + grain + phone hub) */
.ba-globe {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
}

.ba-globe-wash {
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 28% 35%, #f6f3a8 0%, transparent 42%),
    radial-gradient(circle at 18% 62%, #9fde6c 0%, transparent 48%),
    radial-gradient(circle at 72% 40%, #3aa0e8 0%, transparent 52%),
    radial-gradient(circle at 58% 78%, #6ec8f5 0%, transparent 46%),
    linear-gradient(135deg, #7ed0f5 0%, #4eb0ef 45%, #3a98e0 100%);
  animation: ba-globe-drift 8s ease-in-out infinite;
}

.ba-globe-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.85;
  mix-blend-mode: soft-light;
}

.ba-globe-blob--a {
  width: 70%;
  height: 70%;
  top: -10%;
  left: -18%;
  background: radial-gradient(circle, #c8eb7a 0%, transparent 70%);
  animation: ba-globe-blob-a 7s ease-in-out infinite;
}

.ba-globe-blob--b {
  width: 65%;
  height: 65%;
  top: 20%;
  right: -22%;
  background: radial-gradient(circle, #2f8fdc 0%, transparent 72%);
  animation: ba-globe-blob-b 9s ease-in-out infinite;
}

.ba-globe-blob--c {
  width: 55%;
  height: 55%;
  bottom: -12%;
  left: 20%;
  background: radial-gradient(circle, #f0ec9a 0%, transparent 70%);
  animation: ba-globe-blob-c 6.5s ease-in-out infinite;
}

.ba-globe-noise {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.42;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 120px 120px;
  mix-blend-mode: overlay;
}

.ba-globe-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: #fff;
  color: #1a1a1a;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(20, 60, 100, 0.18);
  z-index: 2;
}

.ba-globe-center svg {
  display: block;
}

@keyframes ba-globe-drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  33% { transform: translate3d(6%, -4%, 0) rotate(8deg) scale(1.06); }
  66% { transform: translate3d(-5%, 5%, 0) rotate(-6deg) scale(1.04); }
}

@keyframes ba-globe-blob-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18%, 12%) scale(1.15); }
}

@keyframes ba-globe-blob-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-14%, -10%) scale(1.2); }
}

@keyframes ba-globe-blob-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10%, -16%) scale(1.12); }
}

/* Paused / ready — slower aurora */
.ba-presence.is-paused .ba-globe-wash,
.ba-presence.is-need-mic .ba-globe-wash {
  animation-duration: 12s;
}

.ba-presence.is-paused .ba-globe-blob--a,
.ba-presence.is-need-mic .ba-globe-blob--a {
  animation-duration: 11s;
}

.ba-presence.is-paused .ba-globe-blob--b,
.ba-presence.is-need-mic .ba-globe-blob--b {
  animation-duration: 14s;
}

/* Listening — livelier wash */
.ba-presence.is-listening .ba-globe-wash {
  animation-duration: 5.5s;
}

.ba-presence.is-listening .ba-globe-blob--a {
  animation-duration: 4.5s;
}

.ba-presence.is-listening .ba-globe-blob--b {
  animation-duration: 6s;
}

/* Speaking — fastest motion */
.ba-presence.is-speaking .ba-globe-wash {
  animation-duration: 3.8s;
}

.ba-presence.is-speaking .ba-globe-blob--a,
.ba-presence.is-speaking .ba-globe-blob--b,
.ba-presence.is-speaking .ba-globe-blob--c {
  animation-duration: 3.2s;
}

@media (prefers-reduced-motion: reduce) {
  .ba-globe-wash,
  .ba-globe-blob--a,
  .ba-globe-blob--b,
  .ba-globe-blob--c {
    animation: none !important;
  }
}

.ba-presence-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ba-presence-state {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ba-ink) !important;
  -webkit-text-fill-color: var(--ba-ink);
  line-height: 1.25;
}

.ba-presence-hint {
  font-size: 12px;
  color: var(--ba-muted) !important;
  -webkit-text-fill-color: var(--ba-muted);
  line-height: 1.35;
}

.ba-human-call {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 2px;
  text-decoration: none !important;
  color: inherit;
  border-top: 1px solid rgba(232, 230, 225, 0.9);
}

.ba-human-call-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f7f3ea;
  color: #8a6d34;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.ba-human-call-mark svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
}

.ba-human-call-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ba-human-call-copy strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--ba-ink) !important;
  -webkit-text-fill-color: var(--ba-ink);
}

.ba-human-call-copy span {
  font-size: 12px;
  color: var(--ba-muted) !important;
  -webkit-text-fill-color: var(--ba-muted);
}

.ba-human-call:hover .ba-human-call-mark {
  background: #efe4d0;
  transform: translateY(-1px);
}

/* Hide old rectangular control styles if cached markup appears */
.ba-mic-btn,
.ba-call-btn:not(.ba-human-call),
.ba-stop-btn {
  display: none !important;
}

.ba-hint {
  padding: 0 16px 14px;
  font-size: 11px;
  color: var(--ba-muted) !important;
  -webkit-text-fill-color: var(--ba-muted);
  line-height: 1.4;
  flex-shrink: 0;
  text-align: center;
  background: #ffffff;
}

.ba-hint a {
  color: var(--ba-accent) !important;
  -webkit-text-fill-color: var(--ba-accent);
  text-decoration: underline;
  font-weight: 600;
}

.ba-hint a:hover {
  color: #7d6330 !important;
  -webkit-text-fill-color: #7d6330;
}

.ba-lead-box {
  display: none;
  padding: 0 16px 12px;
  border-top: 1px solid var(--ba-line);
  background: #ffffff;
  flex-shrink: 0;
}

.ba-lead-box.is-visible {
  display: block;
}

.ba-lead-box label {
  display: block;
  font-size: 11px;
  color: var(--ba-muted) !important;
  -webkit-text-fill-color: var(--ba-muted);
  margin: 8px 0 4px;
}

.ba-lead-box input {
  width: 100%;
  border: 1px solid var(--ba-line) !important;
  background: var(--ba-surface) !important;
  color: var(--ba-ink) !important;
  -webkit-text-fill-color: var(--ba-ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.ba-lead-box input::placeholder {
  color: #a0a0a0 !important;
  -webkit-text-fill-color: #a0a0a0;
}

.ba-lead-box input:focus {
  border-color: var(--ba-accent) !important;
  background: #ffffff !important;
}

.ba-lead-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.ba-lead-submit,
.ba-lead-cancel {
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ba-lead-submit {
  background: var(--ba-ink) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

.ba-lead-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ba-lead-cancel {
  background: #ffffff !important;
  border: 1px solid var(--ba-line) !important;
  color: var(--ba-ink) !important;
  -webkit-text-fill-color: var(--ba-ink);
}

.ba-lead-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ba-muted) !important;
  -webkit-text-fill-color: var(--ba-muted);
}

.ba-wave {
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.ba-voice-fab.is-listening .ba-wave {
  display: inline-flex;
}

.ba-wave span {
  width: 3px;
  height: 6px;
  background: currentColor;
  border-radius: 2px;
  animation: ba-wave 0.9s ease-in-out infinite;
}

.ba-wave span:nth-child(2) { animation-delay: 0.15s; height: 12px; }
.ba-wave span:nth-child(3) { animation-delay: 0.3s; height: 8px; }
.ba-wave span:nth-child(4) { animation-delay: 0.45s; height: 14px; }

@keyframes ba-wave {
  0%, 100% { transform: scaleY(0.5); opacity: 0.7; }
  50% { transform: scaleY(1.2); opacity: 1; }
}

/* Keep Aura above the site's black modal overlay (z-index 99999) */
html.ba-voice-open:before {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.ba-voice-open,
body.ba-voice-open {
  overflow: hidden !important;
}

@media (max-width: 768px) {
  .ba-voice-fab {
    right: 0;
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 54px;
    height: 160px;
    min-height: 160px;
    border-radius: 16px 0 0 16px;
    border: 2px solid #ffffff;
    border-right: 0;
    background: linear-gradient(180deg, #d4a84b 0%, #c49a3c 45%, #a87f2e 100%);
    color: #ffffff !important;
    box-shadow: -8px 10px 28px rgba(0, 0, 0, 0.32);
    padding: 16px 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: ba-fab-glow 2.6s ease-in-out infinite;
    z-index: 1000005;
    overflow: visible;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .ba-voice-fab::before {
    display: none;
    content: none;
  }

  .ba-voice-fab:hover,
  .ba-voice-fab:active {
    transform: translateY(-50%) translateX(-3px);
    background: linear-gradient(180deg, #e0b456 0%, #d4a84b 50%, #b89234 100%);
    box-shadow: -10px 12px 32px rgba(0, 0, 0, 0.38);
    color: #ffffff !important;
  }

  .ba-fab-inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    position: relative;
    z-index: 1;
  }

  .ba-voice-fab svg {
    width: 26px;
    height: 26px;
    color: #ffffff;
    fill: #ffffff;
    filter: none;
  }

  .ba-fab-label {
    display: block;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: none;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    line-height: 1;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
    /* Prevent WebKit double-paint on vertical rotated text */
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  .ba-voice-fab .ba-wave {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
  }

  .ba-voice-fab.is-listening .ba-fab-inner > svg {
    opacity: 0.35;
  }

  /* One label only — badge + “Ask us” looked like double text */
  .ba-voice-badge {
    display: none !important;
  }

  .ba-wake-hint {
    right: calc(100% + 10px);
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 12px;
    border-radius: 12px;
    max-width: min(150px, calc(100vw - 88px));
    white-space: normal;
  }

  .ba-wake-hint strong {
    font-size: 11px;
  }

  .ba-wake-hint span {
    font-size: 10px;
  }

  @keyframes ba-wake-hint-float {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-3px); }
  }

  .ba-voice-fab.is-listening {
    background: linear-gradient(180deg, #c49a3c 0%, #a87f2e 100%);
    color: #ffffff !important;
    animation: ba-fab-glow 1.3s ease-in-out infinite;
  }

  .ba-voice-fab.is-speaking {
    background: linear-gradient(180deg, #b89234 0%, #956f28 100%);
    color: #ffffff !important;
  }

  .ba-voice-fab.is-tease {
    animation: ba-fab-tease-mobile 0.85s cubic-bezier(0.34, 1.4, 0.64, 1);
  }

  @keyframes ba-fab-glow {
    0%, 100% {
      box-shadow: -8px 10px 28px rgba(0, 0, 0, 0.32), 0 0 0 0 rgba(212, 168, 75, 0.45);
    }
    50% {
      box-shadow: -10px 12px 32px rgba(0, 0, 0, 0.38), 0 0 0 8px rgba(212, 168, 75, 0);
    }
  }

  @keyframes ba-fab-tease-mobile {
    0% { transform: translateY(-50%) translateX(0) scale(1); }
    35% { transform: translateY(-50%) translateX(-8px) scale(1.05); }
    55% { transform: translateY(-50%) translateX(-3px) scale(1.02); }
    100% { transform: translateY(-50%) translateX(0) scale(1); }
  }

  .ba-voice-panel {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: var(--ba-ink) !important;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    transform: translate3d(0, 100%, 0) scale(1);
    transform-origin: center bottom;
    transition:
      opacity 0.16s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.16s;
  }

  .ba-voice-panel.is-fast-open {
    transition:
      opacity 0.08s ease-out,
      transform 0.1s cubic-bezier(0.2, 0.9, 0.3, 1),
      visibility 0.08s;
  }

  .ba-voice-panel.is-open {
    transform: translate3d(0, 0, 0) scale(1);
    box-shadow: none !important;
  }

  #ba-voice-root:has(.ba-voice-panel.is-open) .ba-voice-fab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s;
    animation: none;
  }

  .ba-voice-header {
    padding: 16px 18px;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
  }

  .ba-voice-title strong {
    font-size: 16px;
  }

  .ba-voice-title span,
  .ba-voice-title .ba-online {
    font-size: 13px;
  }

  .ba-voice-close {
    font-size: 28px;
    padding: 6px 10px;
    min-width: 44px;
    min-height: 44px;
  }

  .ba-voice-status {
    padding: 10px 18px 0;
    font-size: 13px;
  }

  .ba-voice-messages {
    padding: 14px 18px;
    -webkit-overflow-scrolling: touch;
  }

  .ba-msg {
    font-size: 15px;
    max-width: 95%;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    transform: translateZ(0);
  }

  .ba-msg.user {
    -webkit-font-smoothing: antialiased;
    font-weight: 500;
  }

  .ba-lead-box {
    padding: 8px 18px 12px;
  }

  .ba-lead-box input {
    font-size: 16px;
    min-height: 46px;
  }

  .ba-voice-actions {
    padding: 14px 18px 10px;
    gap: 12px;
  }

  .ba-presence-state {
    font-size: 16px;
  }

  .ba-presence-hint {
    font-size: 13px;
  }

  .ba-hint {
    padding: 0 18px max(16px, env(safe-area-inset-bottom, 12px));
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .ba-voice-title strong {
    font-size: 16px;
  }

  .ba-msg {
    font-size: 14px;
  }
}
