/* Floating Lena — iridescent orb asset + consent modal (ElevenLabs-minimal) */

#lena-root {
  position: relative;
  z-index: 60;
}

.lena-launcher {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.9rem 0.55rem 0.55rem;
  border: 1px solid rgba(20, 20, 15, 0.1);
  border-radius: var(--radius-pill);
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(20, 20, 15, 0.04),
    0 8px 28px rgba(20, 20, 15, 0.12);
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.2s var(--ease);
}

.lena-launcher:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(20, 20, 15, 0.06),
    0 12px 36px rgba(20, 20, 15, 0.16);
}

.lena-launcher.is-open {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
}

.lena-orb-wrap {
  display: block;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}

.lena-orb-wrap--lg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

/* Aura hook kept for markup; no motion — outer orb must stay still */
.lena-orb-aura {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  animation: none;
}

.lena-orb-wrap--lg .lena-orb-aura {
  inset: 0;
}

.lena-orb-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 1;
  transform: none;
}

.lena-launcher-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding-right: 0.25rem;
}

.lena-panel {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 70;
  width: min(340px, calc(100vw - 1.5rem));
  max-height: min(520px, calc(100dvh - 2rem));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(20, 20, 15, 0.1);
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(20, 20, 15, 0.04),
    0 18px 48px rgba(20, 20, 15, 0.16);
  overflow: hidden;
  animation: lena-rise 0.35s var(--ease);
}

.lena-panel[hidden] {
  display: none !important;
}

.lena-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.45rem;
}

.lena-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.lena-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.lena-close:hover {
  background: var(--bg);
}

.lena-body {
  flex: 1;
  overflow: auto;
  padding: 0.25rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lena-call-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0 0.65rem;
}

.lena-call-btn {
  position: relative;
  width: 168px;
  height: 168px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.lena-call-btn.is-speaking .lena-orb-wrap--lg {
  filter: brightness(1.06) saturate(1.12);
}

.lena-call-btn.is-live .lena-orb-wrap--lg {
  filter: saturate(1.1);
}

.lena-call-icon {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  color: #14140f;
  display: grid;
  place-items: center;
  box-shadow:
    0 1px 2px rgba(20, 20, 15, 0.06),
    0 6px 18px rgba(20, 20, 15, 0.1);
}

.lena-call-icon svg {
  display: block;
  margin: 0;
}

.lena-hint {
  margin: 1.2rem 0 0;
  max-width: 15rem;
  color: var(--ink-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.lena-phone-fallback {
  margin: 0.85rem 0 0;
  padding: 1rem 1rem 1.05rem;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(252, 207, 246, 0.35) 0%, rgba(20, 20, 15, 0.04) 55%);
  border: 1px solid rgba(20, 20, 15, 0.08);
  text-align: center;
  width: 100%;
}

.lena-phone-label {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.lena-phone-num {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.lena-phone-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.lena-phone-actions .btn {
  width: 100%;
  min-height: 44px;
}

.lena-fallback-buy {
  margin-top: 0.15rem;
}

.lena-tel-link {
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  order: 3;
}

.lena-tel-link:hover {
  color: var(--ink);
}

.lena-after-call {
  margin: 0.85rem 0 0;
  padding: 1rem 1rem 1.1rem;
  border-radius: 16px;
  background: #0a0a0c;
  color: #fafafa;
  text-align: center;
  width: 100%;
}

.lena-after-call[hidden] {
  display: none;
}

.lena-after-call-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(252, 207, 246, 0.9);
}

.lena-after-call-copy {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(250, 250, 250, 0.82);
}

.lena-after-call .btn-primary {
  width: 100%;
  min-height: 44px;
  background: #fff;
  color: #0a0a0c;
  border-color: #fff;
}

.lena-after-call .btn-primary:hover {
  background: #fccff6;
  border-color: #fccff6;
  color: #0a0a0c;
}

.lena-transcript {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 110px;
  overflow: auto;
}

.lena-transcript:empty {
  display: none;
}

.lena-line {
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.4;
  max-width: 90%;
}

.lena-line-user {
  align-self: flex-end;
  background: var(--ink);
  color: #fff;
}

.lena-line-assistant {
  align-self: flex-start;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
}

.lena-composer {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.75rem 0.85rem 0.95rem;
  border-top: 1px solid rgba(20, 20, 15, 0.06);
  background: #fff;
}

.lena-composer input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(20, 20, 15, 0.1);
  border-radius: var(--radius-pill);
  padding: 0.7rem 0.95rem;
  background: #f5f5f3;
  color: var(--ink);
}

.lena-composer input::placeholder {
  color: var(--ink-soft);
}

.lena-send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lena-send:hover {
  color: var(--ink);
}

/* Consent modal — ElevenLabs-style */
.lena-consent {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(20, 20, 15, 0.28);
  backdrop-filter: blur(4px);
}

.lena-consent[hidden] {
  display: none !important;
}

.lena-consent-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 1.5rem 1.4rem 1.25rem;
  box-shadow:
    0 0 0 1px rgba(20, 20, 15, 0.06),
    0 24px 60px rgba(20, 20, 15, 0.2);
  animation: lena-rise 0.3s var(--ease);
}

.lena-consent-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--ink);
}

.lena-consent-list {
  margin: 0 0 1.35rem;
  padding: 0 0 0 1.1rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  display: grid;
  gap: 0.55rem;
}

.lena-consent-list a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lena-consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.lena-consent-actions .btn {
  width: 100%;
  min-height: 48px;
}

@keyframes lena-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .lena-launcher-label {
    display: none;
  }

  .lena-launcher {
    padding: 0.55rem;
  }

  .lena-call-btn {
    width: 148px;
    height: 148px;
  }

  .lena-call-icon {
    width: 52px;
    height: 52px;
  }

  .lena-consent-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lena-panel,
  .lena-consent-card {
    animation: none;
  }

  .lena-orb-aura {
    animation: none;
    opacity: 0.55;
    transform: scale(1);
  }
}
