/* 보이스 스튜디오 (/voice-studio) — 30슬롯 수집 그리드 + PC 학습 패널 */

.studio-tag.voice {
  background: rgba(245, 181, 68, .12); color: #ffd08a; border-color: rgba(245, 181, 68, .3);
}
.voice-version { font-size: 10.5px; padding: 2px 8px; }

.voice-batch, .voice-datasets { margin-top: 16px; }
.voice-config {
  display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(120px, 1fr));
  gap: 14px; margin-bottom: 14px;
}
.voice-config-train { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.voice-inline { display: flex; gap: 8px; align-items: center; min-width: 0; }
.voice-inline .select, .voice-inline .input { flex: 1; min-width: 0; }
.voice-speed { width: 90px; flex: 0 0 auto !important; }

.voice-bulk {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 12px;
}
.voice-bulk-label { font-size: 11.5px; color: var(--muted-2); font-weight: 600; }
.voice-bulk .voice-inline { flex: 0 0 auto; }
.voice-bulk .select { min-width: 104px; }
.voice-file-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* ---------------------------------------------------------------- slot grid */
.voice-slot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px; max-height: 980px; overflow: auto; padding-right: 4px;
}
.voice-slot {
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 14px;
  padding: 11px 12px 12px; display: grid; gap: 8px; position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.voice-slot.running { border-color: rgba(124, 92, 255, .55); box-shadow: 0 0 0 3px rgba(124, 92, 255, .10); }
.voice-slot.done { border-color: rgba(36, 211, 165, .35); }
.voice-slot.failed { border-color: rgba(255, 96, 118, .4); }
.voice-slot.awaiting { border-style: dashed; }
.voice-slot-head { display: flex; align-items: center; gap: 8px; }
.voice-slot-no {
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--panel-3); border: 1px solid var(--border); border-radius: 8px; padding: 2px 7px;
}
.voice-slot-state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.voice-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.voice-dot.running { background: var(--accent); animation: voicePulse 1.1s infinite; }
.voice-dot.done { background: var(--mint); }
.voice-dot.failed { background: var(--danger); }
.voice-dot.awaiting { background: var(--amber); }
@keyframes voicePulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.voice-slot-row { display: grid; grid-template-columns: 1.15fr .85fr; gap: 7px; }
.voice-slot .input, .voice-slot .select { font-size: 12px; padding: 7px 9px; }
.voice-slot textarea.input { min-height: 56px; resize: vertical; line-height: 1.45; }
.voice-slot-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.voice-slot-foot .btn { font-size: 11px; padding: 4px 8px; }
.voice-slot audio { width: 100%; height: 30px; }
.voice-slot-error { font-size: 11px; color: #ffadb7; line-height: 1.4; max-height: 44px; overflow: auto; }
.voice-slot-meta { font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); }
.voice-src { font-size: 10px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); }
.voice-src.url { color: #b9a8ff; border-color: rgba(124, 92, 255, .35); }
.voice-src.upload { color: #ffd08a; border-color: rgba(245, 181, 68, .35); }

/* ------------------------------------------------------------------ actions */
.voice-actions { display: flex; align-items: center; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.voice-actions-btns { margin-left: auto; display: flex; gap: 8px; }
.voice-progress { flex: 1; min-width: 240px; display: grid; gap: 6px; }
.voice-progress-bar { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; border: 1px solid var(--border-soft); }
.voice-progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7c5cff, #24d3a5); transition: width .35s; }
.voice-progress-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

/* --------------------------------------------------------------- datasets */
.voice-dataset-list { display: grid; gap: 12px; }
.voice-dataset {
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 14px; padding: 12px 14px;
  display: grid; gap: 10px;
}
.voice-dataset-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.voice-dataset-name { font-weight: 650; font-size: 14px; }
.voice-dataset-sub { font-size: 11.5px; color: var(--muted-2); font-family: var(--mono); }
.voice-dataset-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.voice-dataset-actions .btn { font-size: 11px; padding: 4px 9px; }
.voice-clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.voice-clip { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 10px; padding: 7px 8px; display: grid; gap: 4px; }
.voice-clip-label { font-size: 10.5px; color: var(--muted-2); display: flex; justify-content: space-between; gap: 6px; }
.voice-clip-text { font-size: 11px; color: var(--muted); line-height: 1.35; max-height: 30px; overflow: hidden; }
.voice-clip audio { width: 100%; height: 28px; }
.voice-empty { font-size: 12.5px; color: var(--muted-2); padding: 8px 0; }

/* --------------------------------------------------------------------- PC */
.voice-pc-main { margin-top: 16px; }
.voice-pc, .voice-train { display: grid; gap: 12px; align-content: start; }
.voice-pc-actions { margin-top: 2px; }
.voice-pc-health { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.voice-pc-health .v { font-size: 13px; word-break: break-word; }
.voice-train-btn { width: 100%; margin-top: 4px; }
.voice-train-progress { display: grid; gap: 8px; }
.voice-log {
  margin: 0; padding: 10px; max-height: 150px; overflow: auto;
  background: #05070a; border: 1px solid var(--border-soft); border-radius: 10px;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.55; color: #9fb0c8; white-space: pre-wrap;
}
.voice-infer { display: grid; gap: 8px; border-top: 1px dashed var(--border); padding-top: 12px; }
.voice-infer audio { width: 100%; }
.voice-foot { margin: 18px 0 8px; text-align: center; color: var(--muted-2); font-size: 11px; }

@media (max-width: 900px) {
  .voice-config, .voice-config-train { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voice-slot-grid { max-height: none; }
  .voice-actions-btns { margin-left: 0; width: 100%; }
  .voice-actions-btns .btn { flex: 1; }
}

/* per-clip download in the dataset preview */
.voice-clip-dl { color: var(--accent); font-weight: 700; text-decoration: none; padding: 0 2px; }
.voice-clip-dl:hover { color: #c6b9ff; text-decoration: underline; }

/* ------------------------------------------------- 🇰🇷 Zeroth-Korean (SLR40) */
.voice-zeroth-config { grid-template-columns: minmax(190px, .9fr) minmax(220px, 1.6fr) minmax(260px, 1.4fr); }
.voice-zeroth-action { justify-content: flex-end; }
.voice-zeroth-action .btn { width: 100%; justify-content: center; }
.voice-zeroth-note {
  font-size: 11.5px; line-height: 1.55; color: #bfe6c9;
  background: rgba(84, 214, 128, .07); border: 1px solid rgba(84, 214, 128, .24);
  border-radius: 10px; padding: 8px 11px; margin: 4px 0 0;
}
.voice-zeroth-note.warn { color: #ffd9a8; background: rgba(245, 181, 68, .08); border-color: rgba(245, 181, 68, .26); }
.voice-zeroth-note code { font-family: var(--mono); font-size: 11px; }
.voice-mix.flash { animation: voiceMixFlash 1.2s ease-out 1; }
@keyframes voiceMixFlash {
  0% { box-shadow: 0 0 0 2px rgba(84, 214, 128, .55); }
  100% { box-shadow: 0 0 0 2px rgba(84, 214, 128, 0); }
}

/* ------------------------------------------------- 🧬 mix (50 blends) + 🇰🇷 */
.voice-mix { margin-top: 16px; }
.voice-mix-config { grid-template-columns: minmax(200px, 1.4fr) minmax(110px, .7fr) minmax(130px, .8fr) minmax(190px, 1.2fr) minmax(150px, .9fr); }
.voice-ko-toggle { white-space: nowrap; gap: 8px; font-size: 12.5px; }
.voice-ko-note {
  font-size: 11.5px; line-height: 1.5; color: #ffe0a8;
  background: rgba(245, 181, 68, .08); border: 1px solid rgba(245, 181, 68, .26);
  border-radius: 10px; padding: 8px 11px; margin: 0 0 12px;
}
.voice-ko-note.off { color: var(--muted); background: var(--panel-2); border-color: var(--border-soft); }
.voice-mix-actions { margin-bottom: 10px; flex-wrap: wrap; }
.voice-mix-actions .btn { font-size: 12px; }
.voice-mix-progress { margin-bottom: 12px; }
.voice-mix-table-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--panel-2); }
.voice-mix-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.voice-mix-table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--panel-3);
  text-align: left; padding: 7px 8px; font-weight: 650; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.voice-mix-table td { padding: 5px 8px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.voice-mix-table tr:hover td { background: rgba(255, 255, 255, .02); }
.voice-mix-table .mix-no { font-family: var(--mono); color: var(--muted-2); }
.voice-mix-table .mix-name { font-weight: 650; white-space: nowrap; }
.voice-mix-parts { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.voice-mix-part { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 7px; padding: 2px 5px; }
.voice-mix-part b { font-weight: 650; color: #ffd08a; font-size: 11px; }
.voice-mix-part input { width: 52px; font-size: 11px; padding: 2px 4px; text-align: right; }
.voice-mix-table input.input { font-size: 11px; padding: 3px 6px; }
.voice-mix-table .mix-pitch, .voice-mix-table .mix-speed { width: 62px; }
.voice-mix-table .mix-text { width: 100%; min-width: 190px; }
.voice-mix-table td:last-child { width: 38%; }
.voice-mix-results-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 8px; font-size: 12.5px; color: var(--muted); }
.voice-mix-results-head .voice-inline { margin-left: auto; min-width: 280px; }
.voice-mix-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 9px; max-height: 560px; overflow: auto; }
.voice-mix-card { background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 11px; padding: 8px 9px; display: grid; gap: 5px; }
.voice-mix-card-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.voice-mix-card-head .mix-name { font-weight: 650; }
.voice-mix-card-head .voice-mix-badge { margin-left: auto; font-size: 9.5px; color: var(--muted-2); font-family: var(--mono); }
.voice-mix-card .mix-label { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.voice-mix-card audio { width: 100%; height: 28px; }
.voice-mix-card-actions { display: flex; align-items: center; gap: 6px; }
.voice-mix-card-actions .btn { font-size: 10.5px; padding: 2px 7px; }
.voice-mix-card-actions .voice-clip-dl { font-size: 12px; }
.voice-mix-player { width: 100%; margin-top: 10px; }
.voice-ko-preview { display: grid; gap: 8px; border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 14px; }
.voice-ko-preview .input { font-size: 12px; }
@media (max-width: 900px) {
  .voice-mix-config { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voice-mix-results-head .voice-inline { margin-left: 0; min-width: 0; width: 100%; }
}

/* ------------------------------------------------- 🎤 사람이름 TTS 카탈로그 */
.voice-catalog { margin-top: 16px; }
.voice-catalog-progress { margin: 4px 0 14px; }
.voice-catalog-config { grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(104px, 1fr)); }
.voice-catalog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
  gap: 10px; max-height: 620px; overflow: auto; padding: 2px 4px 2px 0;
}
.catalog-card {
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 13px;
  padding: 11px 12px; display: grid; gap: 5px; cursor: pointer; text-align: left;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.catalog-card:hover { border-color: rgba(124, 92, 255, .5); transform: translateY(-1px); }
.catalog-card.selected { border-color: rgba(36, 211, 165, .65); box-shadow: 0 0 0 3px rgba(36, 211, 165, .10); }
.catalog-card-top { display: flex; align-items: baseline; gap: 7px; }
.catalog-uses { font-size: 11px; color: var(--mint, #24d3a5); opacity: .85; margin-top: 2px; }
.catalog-name { font-size: 16px; font-weight: 700; letter-spacing: -.2px; color: var(--text); }
.catalog-id { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.catalog-tag { font-size: 11.5px; color: var(--muted); }
.catalog-recipe { font-size: 10.8px; color: var(--muted-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.catalog-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; font-size: 12px; }
.voice-catalog-detail {
  margin-top: 16px; padding: 14px; border: 1px solid rgba(124, 92, 255, .3);
  border-radius: 14px; background: var(--panel-2); display: grid; gap: 10px;
}
.catalog-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.catalog-detail-name { font-size: 18px; letter-spacing: -.2px; }
.catalog-recipe-box .v { font-size: 12px; line-height: 1.5; }
.voice-curl {
  margin: 0; padding: 10px 12px; border-radius: 10px; background: #0c0e14;
  border: 1px solid var(--border-soft); color: #b7c3d8; font-family: var(--mono);
  font-size: 11px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; overflow: auto;
}
@media (max-width: 720px) {
  .voice-catalog-config { grid-template-columns: 1fr 1fr; }
  .voice-catalog-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: none; }
}

/* Edge-TTS 성우 (무료 · 오라클 직접 합성) */
.edge-voices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 10px 0 6px; }
.edge-card { border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 12px; padding: 12px; display: grid; gap: 6px; background: rgba(255,255,255,.02); }
.edge-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.edge-name { font-weight: 650; font-size: 15px; }
.edge-meta { font-size: 11.5px; color: var(--muted, #9aa4b2); }
.edge-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.edge-tags span { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(36,211,165,.10); color: var(--mint, #24d3a5); }
.edge-actions { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.edge-score { font-size: 11.5px; color: var(--muted, #9aa4b2); }
/* 3항목 검수 점수 배지 (2026-12-04) */
.catalog-score {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.2px;
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #374151;
  vertical-align: middle;
}
.catalog-score.S { background: #064e3b; color: #a7f3d0; border-color: #10b981; }
.catalog-score.A { background: #14532d; color: #bbf7d0; border-color: #22c55e; }
.catalog-score.B { background: #1e3a8a; color: #bfdbfe; border-color: #3b82f6; }
.catalog-score.C { background: #78350f; color: #fde68a; border-color: #f59e0b; }
.catalog-score.D { background: #7f1d1d; color: #fecaca; border-color: #ef4444; }
