/* LIRENO Voice — Push-to-Talk (über Chatbot-FAB positioniert) */

.lireno-voice {
  --lv-accent: #185fa5;
  --lv-accent-dark: #124a82;
  --lv-danger: #b42318;
  --lv-bg: #ffffff;
  --lv-surface: #f5f4ee;
  --lv-border: #dedad4;
  --lv-text: #1a1a1a;
  --lv-muted: #6b6a63;
  --lv-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  --lv-radius: 14px;
  --lv-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(84px, calc(16px + env(safe-area-inset-bottom) + 68px));
  z-index: 99989;
  font-family: var(--lv-font);
  color: var(--lv-text);
  line-height: 1.45;
}

.lireno-voice[hidden] {
  display: none !important;
}

.lireno-voice__fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--lv-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--lv-shadow);
  transition: transform 0.15s ease, background 0.15s ease;
}

.lireno-voice__fab:hover {
  background: var(--lv-accent-dark);
  transform: scale(1.04);
}

.lireno-voice__panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 140px));
  background: var(--lv-bg);
  border: 1px solid var(--lv-border);
  border-radius: var(--lv-radius);
  box-shadow: var(--lv-shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  pointer-events: none;
}

.lireno-voice.is-open .lireno-voice__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lireno-voice__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--lv-border);
  background: var(--lv-surface);
}

.lireno-voice__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.lireno-voice__close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--lv-muted);
}

.lireno-voice__body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}

.lireno-voice__hint {
  margin: 0 0 10px;
  color: var(--lv-muted);
  font-size: 0.92rem;
}

.lireno-voice__transcript {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--lv-surface);
  border-radius: 8px;
  font-size: 0.95rem;
}

.lireno-voice__approval-title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.lireno-voice__approval-summary {
  margin: 0 0 8px;
  font-size: 0.93rem;
}

.lireno-voice__approval-details {
  margin: 0 0 10px 18px;
  padding: 0;
  font-size: 0.88rem;
  color: var(--lv-muted);
}

.lireno-voice__approval-question {
  margin: 0 0 12px;
  font-weight: 600;
}

.lireno-voice__approval-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.lireno-voice__btn {
  border: 1px solid var(--lv-border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  background: #fff;
}

.lireno-voice__btn--approve {
  background: var(--lv-accent);
  border-color: var(--lv-accent);
  color: #fff;
}

.lireno-voice__btn--reject {
  color: var(--lv-danger);
  border-color: #f2c9c6;
}

.lireno-voice__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lireno-voice__status {
  margin: 10px 0 0;
  min-height: 1.2em;
  font-size: 0.88rem;
  color: var(--lv-muted);
}

.lireno-voice__ptt-wrap {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--lv-border);
  background: var(--lv-surface);
}

.lireno-voice__ptt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 2px solid var(--lv-accent);
  border-radius: 999px;
  padding: 12px 16px;
  background: #fff;
  color: var(--lv-accent);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.lireno-voice__ptt.is-recording {
  background: var(--lv-accent);
  color: #fff;
  animation: lireno-voice-pulse 1.2s ease-in-out infinite;
}

.lireno-voice.is-busy .lireno-voice__ptt {
  opacity: 0.55;
  pointer-events: none;
}

@keyframes lireno-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(24, 95, 165, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(24, 95, 165, 0); }
}

@media (max-width: 480px) {
  .lireno-voice {
    bottom: max(76px, calc(12px + env(safe-area-inset-bottom) + 64px));
  }
  .lireno-voice__panel {
    width: calc(100vw - 24px);
  }
}
