/* Asset Tree Voice Agent v1.5.0
   A call surface, not a chat box: dark plum panel, mic-reactive orb,
   launcher-origin spring open. Colours come from the plugin's settings page. */

.ath-sv-root {
  --sv-purple: #6a2c91;
  --sv-purple-deep: #4e1f6b;
  --sv-green: #7fb53b;
  --sv-right: 110px;

  --sv-ink: #0c1024;
  --sv-ink-2: #1a2044;
  --sv-hair: rgba(255, 255, 255, 0.12);
  --sv-dim: rgba(255, 255, 255, 0.62);
  --sv-dimmer: rgba(255, 255, 255, 0.42);
  --sv-spring: cubic-bezier(0.2, 1.1, 0.3, 1);

  position: fixed;
  z-index: 99998;
  bottom: 22px;
  right: var(--sv-right);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

.ath-sv-root *,
.ath-sv-root *::before,
.ath-sv-root *::after {
  box-sizing: border-box;
}

/* Zero-specificity reset: neutralises theme button styles without
   out-specifying the component rules below. */
:where(.ath-sv-root button) {
  margin: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

:where(.ath-sv-root a) {
  text-decoration: none;
  box-shadow: none;
}

.ath-sv-root :focus-visible {
  outline: 2px solid var(--sv-green);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Launcher ─────────────────────────────────────────────── */

.ath-sv-dock {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s var(--sv-spring);
}

.ath-sv-dock.is-in {
  opacity: 1;
  transform: none;
}

.ath-sv-dock.is-out {
  opacity: 0;
  transform: translateY(8px) scale(0.94);
  pointer-events: none;
}

.ath-sv-launcher {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 20px 9px 9px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(140deg, var(--sv-purple) 0%, var(--sv-purple-deep) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 10px 30px -8px rgba(30, 8, 46, 0.7);
  transition: transform 0.25s var(--sv-spring), box-shadow 0.25s ease;
}

.ath-sv-launcher:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 16px 36px -10px rgba(30, 8, 46, 0.8);
}

.ath-sv-launcher:active {
  transform: translateY(-1px);
}

.ath-sv-badge {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 36% 28%, #ffffff 0%, #fdf6fb 36%, #eef4ff 70%, #dbe6fa 100%);
  box-shadow:
    inset 0 5px 10px -5px rgba(255, 255, 255, 0.95),
    inset 0 -8px 14px -7px rgba(88, 116, 190, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.ath-sv-badge .ath-sv-blob {
  filter: blur(9px);
}

.ath-sv-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(150, 190, 255, 0.6);
  animation: ath-sv-halo 2.9s ease-out infinite;
}

@keyframes ath-sv-halo {
  0% { box-shadow: 0 0 0 0 rgba(160, 198, 255, 0.65); }
  70%, 100% { box-shadow: 0 0 0 13px rgba(160, 198, 255, 0); }
}

.ath-sv-badge img {
  position: relative;
  z-index: 2;
  width: 27px;
  height: auto;
  display: block;
  transition: opacity 0.2s ease;
}

/* Equaliser bars replace the mark on hover — a voice cue, not decoration. */
.ath-sv-bars {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ath-sv-launcher:hover .ath-sv-bars { opacity: 1; }
.ath-sv-launcher:hover .ath-sv-badge img { opacity: 0; }

.ath-sv-bars i {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: #1c2b0c;
  animation: ath-sv-eq 0.9s ease-in-out infinite;
}

.ath-sv-bars i:nth-child(2) { animation-delay: 0.15s; }
.ath-sv-bars i:nth-child(3) { animation-delay: 0.3s; }
.ath-sv-bars i:nth-child(4) { animation-delay: 0.45s; }

@keyframes ath-sv-eq {
  0%, 100% { height: 6px; }
  50% { height: 17px; }
}

.ath-sv-launcher-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.ath-sv-launcher-text b {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.ath-sv-launcher-text span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
}

.ath-sv-dismiss {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(23, 9, 31, 0.55);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.ath-sv-dock:hover .ath-sv-dismiss,
.ath-sv-dismiss:focus-visible { opacity: 1; }
.ath-sv-dismiss:hover { background: rgba(23, 9, 31, 0.85); }

/* ── Panel ────────────────────────────────────────────────── */

.ath-sv-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(358px, calc(100vw - 32px));
  border-radius: 22px;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(120% 80% at 50% 0%, var(--sv-ink-2) 0%, var(--sv-ink) 62%);
  box-shadow:
    0 0 0 1px var(--sv-hair) inset,
    0 30px 70px -20px rgba(6, 10, 28, 0.85);
  transform-origin: 88% 100%;
  opacity: 0;
  transform: translateY(18px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.42s var(--sv-spring);
}

.ath-sv-panel.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.ath-sv-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 15px 13px;
  border-bottom: 1px solid var(--sv-hair);
}

.ath-sv-head-mark {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 36% 28%, #ffffff 0%, #fbf3fa 40%, #e9f0ff 100%);
  box-shadow: inset 0 -6px 12px -6px rgba(88, 116, 190, 0.5);
}

.ath-sv-head-mark img { width: 23px; height: auto; display: block; }

.ath-sv-ident { flex: 1 1 auto; min-width: 0; }

.ath-sv-ident b {
  display: block;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.ath-sv-ident span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--sv-dim);
}

.ath-sv-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sv-dimmer);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.ath-sv-panel[data-state="live"] .ath-sv-dot,
.ath-sv-panel[data-state="quiet"] .ath-sv-dot {
  background: var(--sv-green);
  box-shadow: 0 0 0 3px rgba(127, 181, 59, 0.22);
}

.ath-sv-icon-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--sv-dim);
  font-size: 16px;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease;
}

.ath-sv-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ── Stage ────────────────────────────────────────────────── */

.ath-sv-stage {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 30px 22px 22px;
}

.ath-sv-panel[data-state="connecting"] .ath-sv-stage,
.ath-sv-panel[data-state="live"] .ath-sv-stage,
.ath-sv-panel[data-state="quiet"] .ath-sv-stage { display: flex; }


.ath-sv-orb {
  --sv-amp: 0;
  position: relative;
  width: 172px;
  height: 172px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

/* Outer halo — the blue bloom the sphere sits inside. */
.ath-sv-halo {
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(150, 190, 255, 0.9) 30%,
    rgba(74, 128, 255, 0.72) 44%,
    rgba(28, 84, 220, 0.4) 56%,
    rgba(16, 71, 196, 0.14) 68%,
    transparent 80%
  );
  filter: blur(18px);
  transform: scale(calc(0.94 + var(--sv-amp) * 0.14));
  opacity: calc(0.78 + var(--sv-amp) * 0.22);
  transition: transform 0.12s linear, opacity 0.2s linear;
  animation: ath-sv-halo-breathe 6s ease-in-out infinite;
}

@keyframes ath-sv-halo-breathe {
  0%, 100% { filter: blur(18px); }
  50% { filter: blur(24px); }
}

/* Waves — rings that ripple outward from the sphere as it hears you. */
.ath-sv-wave {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1.5px solid rgba(173, 205, 255, 0.85);
  opacity: 0;
  animation: ath-sv-ripple 3.2s cubic-bezier(0.22, 0.7, 0.3, 1) infinite;
  animation-play-state: paused;
}

.ath-sv-wave--2 { animation-delay: 1.05s; }
.ath-sv-wave--3 { animation-delay: 2.1s; }

.ath-sv-panel[data-state="live"] .ath-sv-wave,
.ath-sv-panel[data-state="quiet"] .ath-sv-wave,
.ath-sv-panel[data-state="connecting"] .ath-sv-wave {
  animation-play-state: running;
}

@keyframes ath-sv-ripple {
  0% { transform: scale(0.92); opacity: 0; }
  18% { opacity: calc(0.28 + var(--sv-amp) * 0.5); }
  100% { transform: scale(1.42); opacity: 0; }
}

/* The sphere itself. */
.ath-sv-sphere {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 42% 34%, #ffffff 0%, #fdf8fd 26%, #f6f2ff 58%, #e4ecfb 100%);
  box-shadow:
    inset 0 10px 22px -10px rgba(255, 255, 255, 0.95),
    inset 0 -16px 30px -14px rgba(88, 116, 190, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 14px 34px -12px rgba(24, 52, 128, 0.5);
  transform: scale(calc(1 + var(--sv-amp) * 0.075));
  transition: transform 0.1s linear;
}

/* Colour waves drifting under the glass. */
.ath-sv-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(12px);
  will-change: transform;
}

.ath-sv-blob--pink {
  width: 74%;
  height: 74%;
  left: -10%;
  top: 8%;
  background: radial-gradient(circle, rgba(255, 62, 146, 0.98) 0%, rgba(254, 130, 190, 0.62) 42%, transparent 70%);
  animation: ath-sv-drift-a 9s ease-in-out infinite;
  opacity: calc(0.82 + var(--sv-amp) * 0.18);
}

.ath-sv-blob--blue {
  width: 84%;
  height: 84%;
  right: -14%;
  top: -4%;
  background: radial-gradient(circle, rgba(74, 152, 255, 0.95) 0%, rgba(160, 206, 255, 0.6) 44%, transparent 72%);
  animation: ath-sv-drift-b 11s ease-in-out infinite;
  opacity: calc(0.8 + var(--sv-amp) * 0.2);
}

.ath-sv-blob--violet {
  width: 66%;
  height: 66%;
  left: 22%;
  bottom: -18%;
  background: radial-gradient(circle, rgba(168, 132, 255, 0.6) 0%, transparent 70%);
  animation: ath-sv-drift-c 13s ease-in-out infinite;
}

@keyframes ath-sv-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(14%, 12%, 0) scale(1.12); }
  66% { transform: translate3d(6%, -10%, 0) scale(0.94); }
}

@keyframes ath-sv-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  40% { transform: translate3d(-16%, 14%, 0) scale(1.1); }
  70% { transform: translate3d(-6%, -8%, 0) scale(0.92); }
}

@keyframes ath-sv-drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-12%, -16%, 0) scale(1.18); }
}

/* Specular highlight — the cue that reads as glass rather than a flat disc. */
.ath-sv-gloss {
  position: absolute;
  left: 14%;
  top: 8%;
  width: 48%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 70%);
  filter: blur(4px);
  transform: rotate(-18deg);
}

.ath-sv-sphere::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 118%, rgba(255, 255, 255, 0.55) 0%, transparent 42%);
  pointer-events: none;
}

/* ATH monogram, riding on top of the glass. */
.ath-sv-orb-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.85));
  pointer-events: none;
  z-index: 2;
}

.ath-sv-orb-logo img { width: 100%; height: auto; display: block; }

/* Connecting: a sweep, because there is nothing measurable yet. */
.ath-sv-sweep {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(150, 190, 255, 0.9) 60deg, transparent 135deg);
  opacity: 0;
  filter: blur(2px);
  transition: opacity 0.3s ease;
}

.ath-sv-panel[data-state="connecting"] .ath-sv-sweep {
  opacity: 0.9;
  animation: ath-sv-spin 1.1s linear infinite;
}

@keyframes ath-sv-spin { to { transform: rotate(360deg); } }

.ath-sv-status {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sv-dim);
  min-height: 15px;
  text-align: center;
}

.ath-sv-timer {
  margin-top: 7px;
  font-size: 26px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ath-sv-panel[data-state="connecting"] .ath-sv-timer { display: none; }

.ath-sv-panel[data-state="live"] .ath-sv-timer,
.ath-sv-panel[data-state="quiet"] .ath-sv-timer { opacity: 1; }

/* ── Consent / message view ───────────────────────────────── */

.ath-sv-note { display: none; padding: 18px 22px 24px; }

.ath-sv-panel[data-state="error"] .ath-sv-note,
.ath-sv-panel[data-state="ended"] .ath-sv-note { display: block; }

.ath-sv-note h2 {
  margin: 0 0 9px;
  padding: 0;
  font-family: inherit;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: #fff;
}

.ath-sv-note p {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--sv-dim);
}

.ath-sv-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ath-sv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s var(--sv-spring), filter 0.2s ease, background 0.2s ease;
}

.ath-sv-btn:hover { transform: translateY(-2px); }
.ath-sv-btn:active { transform: none; }

.ath-sv-btn--primary { background: var(--sv-green); color: #16250a; }
.ath-sv-btn--primary:hover { filter: brightness(1.06); }

.ath-sv-btn--ghost {
  background: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
  font-size: 13px;
  padding: 11px 18px;
}

.ath-sv-btn--ghost:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.ath-sv-btn--danger {
  background: rgba(255, 92, 92, 0.16);
  color: #ff8b8b;
  box-shadow: 0 0 0 1px rgba(255, 92, 92, 0.3) inset;
}

.ath-sv-btn--danger:hover { background: rgba(255, 92, 92, 0.26); color: #ffb3b3; }

.ath-sv-link {
  display: block;
  font-size: 12px;
  text-align: center;
  color: var(--sv-dimmer);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ath-sv-link:hover { color: var(--sv-dim); }

/* Persistent disclosure line — the consent screen is gone, so this carries it. */
.ath-sv-privacy {
  display: none;
  padding: 0 22px 18px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.34);
  text-decoration: none;
}

.ath-sv-panel[data-state="connecting"] .ath-sv-privacy,
.ath-sv-panel[data-state="live"] .ath-sv-privacy,
.ath-sv-panel[data-state="quiet"] .ath-sv-privacy { display: block; }

.ath-sv-privacy:hover {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
}

/* ── Call controls ────────────────────────────────────────── */

.ath-sv-foot {
  display: none;
  gap: 10px;
  padding: 0 22px 22px;
}

.ath-sv-panel[data-state="connecting"] .ath-sv-foot,
.ath-sv-panel[data-state="live"] .ath-sv-foot,
.ath-sv-panel[data-state="quiet"] .ath-sv-foot { display: flex; }

.ath-sv-panel[data-state="connecting"] .ath-sv-foot .ath-sv-btn--ghost {
  display: none;
}

.ath-sv-foot .ath-sv-btn { flex: 1 1 0; padding: 12px 14px; font-size: 13.5px; }

.ath-sv-btn.is-muted { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* ── Mobile: bottom sheet ─────────────────────────────────── */

@media (max-width: 600px) {
  .ath-sv-root {
    right: 16px;
    bottom: 16px;
  }

  .ath-sv-launcher { padding: 9px; }
  .ath-sv-launcher-text { display: none; }

  .ath-sv-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform-origin: 50% 100%;
    transform: translateY(100%);
  }

  .ath-sv-panel.is-open { transform: none; }
  .ath-sv-stage { padding-top: 26px; }
}

/* ── Inline shortcode button ──────────────────────────────── */

.ath-priya-inline-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(140deg, #6a2c91 0%, #4e1f6b 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px -8px rgba(30, 8, 46, 0.6);
  transition: transform 0.2s cubic-bezier(0.2, 1.1, 0.3, 1);
}

.ath-priya-inline-button:hover { transform: translateY(-2px); }

.ath-priya-config-notice {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fdf3d7;
  color: #6b4e00;
  font-size: 13px;
}

/* Sarvam's own UI never shows; our panel drives it. */
.ath-priya-runtime {
  position: fixed !important;
  left: -99999px !important;
  top: -99999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* ── Reduced motion ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ath-sv-root *,
  .ath-sv-root *::before,
  .ath-sv-root *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .ath-sv-dock,
  .ath-sv-panel { transform: none !important; }
}
