.voice-selector {
  display: grid;
  gap: 0.45rem;
}

.voice-selector > label {
  font-weight: 700;
}

.voice-selector-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 0.5rem;
  align-items: stretch;
}

.voice-selector-controls button {
  white-space: nowrap;
}

.voice-preview-action {
  border: 1px solid var(--panel-border);
  border-radius: 0.5rem;
  padding: 0.68rem 0.9rem;
  background: #19191b;
  color: var(--text);
  font-weight: 700;
}

.voice-selector audio {
  width: min(100%, 36rem);
}

.voice-selector-feedback {
  min-height: 1.2em;
  color: #a995ff;
}

.voice-upload-dialog {
  width: min(44rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  border: 1px solid var(--panel-border);
  border-radius: 0.75rem;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.voice-upload-dialog::backdrop {
  background: rgba(4, 7, 12, 0.82);
}

.voice-upload-form {
  display: grid;
  gap: 0.9rem;
  padding: 1.2rem;
  max-height: calc(100dvh - 2rem);
  box-sizing: border-box;
  overflow-y: auto;
}

.voice-upload-heading,
.voice-upload-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.voice-upload-action,
.voice-upload-actions .host-action {
  border: 1px solid var(--app-shell-primary);
  border-radius: 0.5rem;
  padding: 0.58rem 1rem;
  color: white;
  background: var(--app-shell-primary);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.voice-upload-action:disabled,
.voice-upload-actions .host-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.voice-upload-heading h3 {
  margin: 0;
}

.voice-upload-close {
  border: 0;
  padding: 0.2rem 0.5rem;
  background: transparent;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
}

.voice-upload-form input,
.voice-upload-form textarea {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: #19191b;
  color: var(--text);
  font: inherit;
}

.voice-upload-form textarea {
  min-height: 5rem;
  resize: vertical;
}

.voice-upload-form audio {
  width: 100%;
}

.voice-audio-editor {
  display: grid;
  gap: 0.8rem;
  border: 1px solid var(--panel-border);
  border-radius: 0.65rem;
  padding: 0.9rem;
  background: #19191b;
}

.voice-audio-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.voice-trim-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.voice-trim-control {
  display: grid;
  gap: 0.4rem;
}

.voice-trim-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.voice-trim-label output {
  color: #a995ff;
  font-variant-numeric: tabular-nums;
}

.voice-trim-control input[type="range"] {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  accent-color: var(--app-shell-primary);
}

.voice-upload-status {
  min-height: 1.4em;
  margin: 0;
  color: #a995ff;
}

@media (max-width: 650px) {
  .voice-selector-controls {
    grid-template-columns: 1fr 1fr;
  }

  .voice-selector-controls select {
    grid-column: 1 / -1;
  }

  .voice-trim-controls {
    grid-template-columns: 1fr;
  }
}
