/* ============================================================================
 * Voice Studio Test Console — Tier 0 + Tier S styles
 * Sprint Voice Studio Pro Tasks #10-12. Per ADR-054.
 * ============================================================================ */

/* ── Subnav (6 tabs inside Test Console) ─────────────────────────────────── */
.vs-tc-subnav { display: flex; gap: 4px; margin: 12px 0 24px; flex-wrap: wrap; border-bottom: 1px solid var(--neutral-line); }
.vs-tc-tab {
  background: transparent; border: 0; padding: 10px 14px; cursor: pointer;
  color: var(--neutral-text-mute); font-size: 13px; letter-spacing: 0.02em;
  border-bottom: 2px solid transparent; transition: color 120ms ease, border-color 120ms ease;
}
.vs-tc-tab:hover { color: var(--neutral-text); }
.vs-tc-tab.is-active { color: var(--mc-charcoal, #1a1410); border-bottom-color: var(--mc-brass, #d4be95); font-weight: 600; }

/* ── Loading dots (animated, replaces ⏳ hourglass) ──────────────────────── */
.vs-tc-loading { display: flex; align-items: center; gap: 10px; padding: 20px; color: var(--neutral-text-mute); }
.vs-tc-dots { display: inline-flex; gap: 4px; }
.vs-tc-dots span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--mc-brass, #d4be95);
  animation: vs-tc-bounce 1.2s infinite ease-in-out;
}
.vs-tc-dots span:nth-child(2) { animation-delay: 0.15s; }
.vs-tc-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes vs-tc-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.0); opacity: 1; }
}
.vs-tc-loading-label { font-size: 13px; font-style: italic; }

.vs-tc-pane[hidden] { display: none !important; }

/* ── Generate tab: history sidebar layout ────────────────────────────────── */
.vs-test-grid { display: grid; grid-template-columns: 1fr 1fr 320px; gap: 24px; }
@media (max-width: 1100px) { .vs-test-grid { grid-template-columns: 1fr 1fr; } .vs-tc-history { grid-column: 1 / -1; } }
@media (max-width: 720px)  { .vs-test-grid { grid-template-columns: 1fr; } }

.vs-tc-history { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--neutral-bg-soft, #fbf7ec); border: 1px solid var(--neutral-line); border-radius: 8px; max-height: 600px; overflow-y: auto; }
.vs-tc-history-head { display: flex; justify-content: space-between; align-items: baseline; }
.vs-tc-history-head h3 { margin: 0; font-size: 15px; }
.vs-tc-history-hint { font-size: 11px; color: var(--neutral-text-mute); cursor: help; }
.vs-tc-history-list { display: flex; flex-direction: column; gap: 8px; }
.vs-tc-history-item { padding: 10px; background: white; border: 1px solid var(--neutral-line); border-radius: 6px; display: flex; flex-direction: column; gap: 4px; }
.vs-tc-history-row1 { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.vs-tc-history-time { color: var(--neutral-text-mute); font-size: 11px; }
.vs-tc-history-text { font-size: 12px; color: var(--neutral-text); font-style: italic; }
.vs-tc-history-meta { font-size: 11px; color: var(--neutral-text-mute); }
.vs-tc-history-actions { display: flex; gap: 4px; margin-top: 6px; }

/* ── Audio cards (Generate result + A/B results) ─────────────────────────── */
.vs-tc-card {
  padding: 14px; background: white; border: 1px solid var(--neutral-line); border-radius: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.vs-tc-card-meta { font-size: 13px; color: var(--neutral-text); }
.vs-tc-card-text { font-size: 12px; color: var(--neutral-text-mute); font-style: italic; }
.vs-tc-audio { width: 100%; margin-top: 4px; }
.vs-tc-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.vs-tc-card-error { border-color: #d4823f; background: #fff7f0; color: #a3501a; }
.vs-tc-error { padding: 16px; background: #fff7f0; border: 1px solid #d4823f; border-radius: 6px; color: #a3501a; font-size: 13px; }

/* ── A/B Compare tab ─────────────────────────────────────────────────────── */
.vs-tc-pane[data-tc-pane=ab-compare] { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
@media (max-width: 800px) { .vs-tc-pane[data-tc-pane=ab-compare] { grid-template-columns: 1fr; } }
.vs-tc-ab-input { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--neutral-bg-soft, #fbf7ec); border: 1px solid var(--neutral-line); border-radius: 8px; }
.vs-tc-ab-voices { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; padding: 8px; background: white; border: 1px solid var(--neutral-line); border-radius: 6px; }
.vs-tc-ab-voice { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.vs-tc-ab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.vs-tc-ab-summary { margin-top: 12px; padding: 8px 12px; background: var(--neutral-bg-soft); border-radius: 6px; font-size: 13px; }

/* ── Sample Library tab ──────────────────────────────────────────────────── */
.vs-tc-sl-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.vs-tc-sl-head h3 { margin: 0; }
.vs-tc-sl-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.vs-tc-sl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.vs-tc-sl-card {
  padding: 14px; background: white; border: 1px solid var(--neutral-line); border-radius: 8px;
  display: flex; flex-direction: column; gap: 8px; transition: border-color 120ms ease;
}
.vs-tc-sl-card:hover { border-color: var(--mc-brass, #d4be95); }
.vs-tc-sl-category { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mc-brass, #b89860); font-weight: 600; }
.vs-tc-sl-label { font-size: 14px; }
.vs-tc-sl-text { font-size: 12px; color: var(--neutral-text-mute); font-style: italic; min-height: 60px; }

/* ── Pronunciation Dict tab ──────────────────────────────────────────────── */
.vs-tc-pd-head { margin-bottom: 16px; }
.vs-tc-pd-head h3 { margin: 0 0 4px 0; }
.vs-tc-pd-form { display: grid; grid-template-columns: 1fr 1fr 180px 180px auto; gap: 8px; margin-bottom: 20px; align-items: center; }
@media (max-width: 800px) { .vs-tc-pd-form { grid-template-columns: 1fr; } }
.vs-tc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vs-tc-table th, .vs-tc-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--neutral-line); }
.vs-tc-table th { font-weight: 600; color: var(--neutral-text-mute); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Dialogue Builder tab ────────────────────────────────────────────────── */
.vs-tc-db-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.vs-tc-db-head h3 { margin: 0; }
.vs-tc-db-head input { max-width: 360px; }
.vs-tc-db-turns { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.vs-tc-db-turn { padding: 14px; background: white; border: 1px solid var(--neutral-line); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.vs-tc-db-turn-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--neutral-text-mute); font-weight: 600; }
.vs-tc-db-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.vs-tc-db-result { margin-bottom: 16px; }
.vs-tc-db-list { display: flex; flex-direction: column; gap: 6px; }
.vs-tc-db-item { padding: 10px 14px; background: var(--neutral-bg-soft); border-radius: 6px; font-size: 13px; }

/* ── Cost Dashboard tab ──────────────────────────────────────────────────── */
.vs-tc-cost-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.vs-tc-cost-head h3 { margin: 0; }
.vs-tc-cost-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.vs-tc-kpi { padding: 16px; background: white; border: 1px solid var(--neutral-line); border-radius: 8px; display: flex; flex-direction: column; gap: 4px; }
.vs-tc-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--neutral-text-mute); }
.vs-tc-kpi-value { font-size: 22px; font-weight: 600; color: var(--mc-charcoal, #1a1410); }
.vs-tc-cost-tops { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
@media (max-width: 720px) { .vs-tc-cost-tops { grid-template-columns: 1fr; } }
.vs-tc-cost-top { padding: 14px; background: var(--neutral-bg-soft); border: 1px solid var(--neutral-line); border-radius: 8px; }
.vs-tc-cost-top h4 { margin: 0 0 8px 0; font-size: 13px; color: var(--neutral-text-mute); text-transform: uppercase; letter-spacing: 0.05em; }
.vs-tc-cost-top ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.vs-tc-cost-trend { padding: 14px; background: var(--neutral-bg-soft); border: 1px solid var(--neutral-line); border-radius: 8px; }
.vs-tc-cost-trend h4 { margin: 0 0 10px 0; font-size: 13px; color: var(--neutral-text-mute); text-transform: uppercase; letter-spacing: 0.05em; }
.vs-tc-trend-bars { display: flex; align-items: flex-end; gap: 4px; height: 100px; padding: 8px 0; overflow-x: auto; }
.vs-tc-trend-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 32px; }
.vs-tc-trend-fill { width: 16px; background: var(--mc-brass, #d4be95); border-radius: 2px 2px 0 0; min-height: 2px; }
.vs-tc-trend-bar span { font-size: 9px; color: var(--neutral-text-mute); }

/* ── Player transport buttons (Rafa 2026-05-11: Play / Pause / Stop) ── */
.vs-tc-card-actions [data-tc-action="pause"][disabled],
.vs-tc-card-actions [data-tc-action="stop"][disabled],
.vs-tc-history-actions [data-tc-pause][disabled],
.vs-tc-history-actions [data-tc-stop][disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.vs-tc-card-actions [data-tc-action="play"],
.vs-tc-history-actions [data-tc-play] {
  min-width: 88px;
  text-align: center;
}

/* ── Sprint 1C: generating-state card (locked-while-generating UX) ── */
.vs-tc-card-generating {
  position: relative;
  border-color: rgba(212, 190, 149, 0.5);
}
.vs-tc-card-generating .vs-tc-gen-status {
  color: var(--accent-brass-dark, #8b6914);
  font-style: italic;
  font-family: var(--font-serif, Georgia, serif);
}
.vs-tc-gen-progress {
  height: 4px;
  background: rgba(212, 190, 149, 0.18);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 12px;
}
.vs-tc-gen-progress-bar {
  height: 100%;
  width: 35%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-brass, #d4be95), var(--accent-brass-dark, #8b6914));
  animation: vsGenProgress 1.4s ease-in-out infinite;
}
@keyframes vsGenProgress {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(120%); }
  100% { transform: translateX(280%); }
}
.vs-tc-card-generating .vs-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Phase 1 Mega Ultra Premium: Acting Instructions chips ── */
.vs-acting-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
}
.vs-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  background: rgba(212, 190, 149, 0.10);
  border: 1px solid rgba(212, 190, 149, 0.35);
  border-radius: 999px;
  font-size: 11.5px;
  font-family: inherit;
  color: var(--accent-brass-dark, #8b6914);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 60ms ease;
  white-space: nowrap;
}
.vs-chip:hover {
  background: rgba(212, 190, 149, 0.20);
  border-color: var(--accent-brass, #d4be95);
}
.vs-chip:active { transform: scale(0.96); }

.vs-tag-future {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(94, 140, 79, 0.14);
  border: 1px solid rgba(94, 140, 79, 0.40);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #3b6d11;
  text-transform: uppercase;
  font-weight: 600;
}

#vs-acting-instructions {
  min-height: 56px;
  font-size: 12.5px;
  resize: vertical;
}


/* ====================================================================
   Speech to Text sub-tab
   ==================================================================== */
.vs-tc-stt-head h3 { margin: 0 0 4px; }
.vs-tc-stt-head .vs-hint { margin: 0 0 16px; color: var(--vs-fg-muted, #9b8e7c); font-size: 13px; }

.vs-tc-stt-uploader {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--vs-border, #2e261b);
  border-radius: 12px;
  background: var(--paper, #fdf8ef);
}

.vs-tc-stt-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 16px;
  color: var(--fg-charcoal, #2a2018);
  border: 2px dashed var(--neutral-line, #d6cdb8);
  border-radius: 10px;
  background: var(--bg-cream, #faf6ee);
  color: var(--vs-fg, #efe6d4);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.vs-tc-stt-dropzone:hover,
.vs-tc-stt-dropzone.is-drag { border-color: var(--accent-brass, #b88f4a); background: rgba(184,143,74,0.08); }
.vs-tc-stt-dropzone-icon { font-size: 28px; color: var(--vs-accent, #d4a14a); }
.vs-tc-stt-dropzone-text { font-weight: 600; color: var(--fg-charcoal, #2a2018); }
.vs-tc-stt-dropzone-meta { font-size: 12px; color: var(--neutral-text-mute, #6b6354); }

.vs-tc-stt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}
.vs-tc-stt-controls .vs-label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--vs-fg-muted, #9b8e7c);
}
.vs-tc-stt-controls .vs-btn-large { padding: 10px 18px; font-size: 14px; }

.vs-tc-stt-result {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.vs-tc-stt-result:empty { display: none; }
.vs-tc-stt-result-head {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.vs-tc-stt-result-body {
  padding: 14px;
  border: 1px solid var(--neutral-line, #d6cdb8);
  border-radius: 10px;
  background: var(--paper, #fdf8ef);
  color: var(--fg-charcoal, #2a2018);
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 14px;
}
.vs-tc-stt-pill {
  display: inline-block; padding: 2px 8px; font-size: 11px;
  background: var(--bg-cream, #faf6ee); border: 1px solid var(--neutral-line, #d6cdb8);
  border-radius: 999px; color: var(--fg-charcoal, #2a2018);
}
.vs-tc-stt-loading { color: var(--neutral-text-mute, #6b6354); font-style: italic; }
.vs-tc-stt-error { color: #e87474; padding: 10px; border: 1px solid #5a2a2a; border-radius: 8px; background: rgba(232,116,116,0.05); }

.vs-tc-stt-hist-title { margin: 22px 0 10px; font-size: 14px; color: var(--neutral-text-mute, #6b6354); text-transform: uppercase; letter-spacing: 0.06em; }
.vs-tc-stt-history { display: flex; flex-direction: column; gap: 8px; }
.vs-tc-stt-empty { color: var(--neutral-text-mute, #6b6354); font-style: italic; padding: 14px; text-align: center; border: 1px dashed var(--neutral-line, #d6cdb8); border-radius: 10px; }
.vs-tc-stt-row {
  padding: 10px 14px;
  border: 1px solid var(--neutral-line, #d6cdb8);
  border-radius: 8px;
  background: var(--paper, #fdf8ef);
}
.vs-tc-stt-row-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; margin-bottom: 6px; }
.vs-tc-stt-row-head strong { margin-right: auto; color: var(--fg-charcoal, #2a2018); }
.vs-tc-stt-when { color: var(--neutral-text-mute, #6b6354); font-size: 11px; }
.vs-tc-stt-row-body { font-size: 13px; line-height: 1.4; color: var(--fg-charcoal, #2a2018); white-space: pre-wrap; }

/* ─── STT history expand buttons ───────────────────────────────── */
.vs-tc-stt-row-head .vs-btn-sm {
  font-size: 11px;
  padding: 3px 10px;
  margin-left: 4px;
}
.vs-tc-stt-row-full {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--neutral-line, #d6cdb8);
  border-radius: 8px;
  background: var(--bg-cream, #faf6ee);
  color: var(--fg-charcoal, #2a2018);
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 13px;
}

/* ─── Factory Reset button (Settings tabs row) ─────────────────── */
.vs-tc-reset-btn {
  margin-left: auto;
  font-size: 12px;
  padding: 4px 12px;
  color: var(--neutral-text-mute, #6b6354);
  border: 1px solid var(--neutral-line, #d6cdb8);
  background: var(--paper, #fdf8ef);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.vs-tc-reset-btn:hover {
  color: var(--fg-charcoal, #2a2018);
  background: var(--bg-cream, #faf6ee);
  border-color: var(--accent-brass, #b88f4a);
}
.vs-tc-settings-tabs {
  display: flex;
  align-items: center;
}
