/* Voice avatar widget (scoped) */

.voice-widget {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .voice-widget {
    grid-template-columns: 1fr;
  }
}

.voice-avatar-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
}

.voice-avatar-wrap model-viewer {
  width: 100%;
  height: 420px;
  border-radius: 18px;
  border: 1px solid rgba(122, 73, 136, 0.35);
  background: transparent;
}

.voice-hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.voice-panel {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.voice-chat {
  flex: 1;
  min-height: 210px;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.15);
}

.voice-msg {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  margin-bottom: 10px;
  line-height: 1.35;
}

.voice-msg:last-child { margin-bottom: 0; }

.voice-msg .voice-role {
  font-weight: 700;
  margin-bottom: 4px;
}

.voice-msg.user {
  border-color: rgba(122, 73, 136, 0.45);
  background: rgba(122, 73, 136, 0.10);
}

.voice-msg.assistant {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-hold-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.voice-hold-label {
  font-size: 0.92rem;
  opacity: 0.9;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none; /* don't steal long-press gestures */
}

.voice-hold {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  white-space: nowrap;
  justify-content: center;
}

.voice-hold-icon {
  display: block;
}

.voice-hold.is-recording {
  outline: 2px solid rgba(122, 73, 136, 0.60);
  outline-offset: 2px;
}

.voice-status {
  opacity: 0.9;
  font-size: 0.95rem;
}

.voice-hint {
  opacity: 0.85;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Slightly adjust for light theme if your site supports it */
html[data-theme="light"] .voice-chat {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .voice-msg.assistant {
  border-color: rgba(0, 0, 0, 0.10);
  background: rgba(0, 0, 0, 0.03);
}
