/* --------------------------------------------------- voice mode overlay */

.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(circle at 50% 30%, #163326 0%, #0b1d15 55%, #071410 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
.voice-overlay[hidden] { display: none; }

.voice-top {
  width: 100%;
  display: flex;
  justify-content: center;
}
.voice-status {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.02em;
  min-height: 1.3em;
  text-align: center;
}

/* Only rendered with ?vdebug=1 -- a live read of what the speech gate is
   actually seeing, for tuning thresholds against a real mic. */
.voice-debug {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  opacity: 0.75;
  margin-top: 6px;
  white-space: pre;
  text-align: center;
}
.voice-debug[hidden] { display: none; }

.voice-orb-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.voice-orb {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4fd18b, var(--green) 55%, var(--green-dark) 100%);
  box-shadow: 0 0 40px 10px rgba(45, 200, 130, 0.35);
  transition: transform 0.09s ease-out, box-shadow 0.2s ease-out, background 0.3s ease;
  transform: scale(1);
}
.voice-orb.thinking {
  background: radial-gradient(circle at 35% 30%, #ffd27a, var(--amber) 55%, #8a5000 100%);
  box-shadow: 0 0 40px 10px rgba(255, 178, 60, 0.3);
  animation: voice-think-spin 1.1s linear infinite;
}
.voice-orb.speaking {
  animation: voice-speak-pulse 0.6s ease-in-out infinite;
}
.voice-orb.error {
  background: radial-gradient(circle at 35% 30%, #ff8f8f, var(--red) 55%, #7a0f1e 100%);
  box-shadow: 0 0 40px 10px rgba(244, 42, 65, 0.3);
}
@keyframes voice-think-spin {
  0%, 100% { transform: scale(0.94) rotate(0deg); }
  50% { transform: scale(1.02) rotate(180deg); }
}
@keyframes voice-speak-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.voice-transcript {
  max-width: 640px;
  text-align: center;
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.92);
  min-height: 1.6em;
  padding: 0 12px;
  margin-top: 18px;
}

.voice-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: 100%;
}
.voice-ctrl-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}
.voice-ctrl-btn:hover { background: rgba(255,255,255,0.16); }
.voice-ctrl-btn svg { width: 22px; height: 22px; }
.voice-ctrl-btn.close-btn { background: rgba(244, 42, 65, 0.85); border-color: transparent; }
.voice-ctrl-btn.close-btn:hover { background: var(--red); }
.voice-ctrl-btn.muted { background: rgba(244, 42, 65, 0.85); border-color: transparent; }
