/* Audio page: voice engines, MeloTTS languages, the Captions tool and Extract audio. Builds on studio.css. */

.engines { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.engine { display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: left; }
.engine:hover { background: var(--surface-2); }
.engine small { font-size: 11.5px; color: var(--muted); }
.engine strong { font-size: 14px; font-weight: 600; }
.engine span { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.engine[aria-checked="true"] { border-color: var(--accent); background: rgba(255, 191, 47, 0.07); }
.engine[aria-checked="true"] small { color: var(--accent); }

.field-note { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.field.off input[type="range"] { opacity: 0.35; }
.field.off .f-head output { color: var(--dim); }

.avatar.tag { font-size: 13px; letter-spacing: 0.04em; }
.vcard .native { color: var(--text); font-weight: 500; }

/* ---------- captions ---------- */
.dropzone {
  display: grid; justify-items: center; gap: 8px; text-align: center; padding: 48px 20px 42px;
  border: 1.5px dashed var(--line-2); border-radius: 16px; background: radial-gradient(120% 100% at 50% 0%, #19191c 0%, #111113 70%);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone svg { width: 54px; height: 54px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; margin-bottom: 4px; }
.dropzone strong { font-size: clamp(28px, 3vw, 40px); }
.dropzone .muted { font-size: 14px; max-width: 50ch; }
.dz-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.dz-actions label { cursor: pointer; }
.dropzone.compact { grid-template-columns: auto 1fr auto; justify-items: start; text-align: left; padding: 14px 18px; gap: 2px 14px; }
.dropzone.compact svg { grid-row: 1 / span 2; width: 30px; height: 30px; margin: 0; }
.dropzone.compact strong { font-size: 22px; word-break: break-word; }
.dropzone.compact .muted { font-size: 12.5px; }
.dropzone.compact .dz-actions { grid-column: 3; grid-row: 1 / span 2; margin: 0; }
.stage.dragging .dropzone { border-color: var(--accent); background: rgba(255, 191, 47, 0.05); }

.parts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.part { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.part .n { font: 800 18px/1 var(--display); color: var(--muted); min-width: 22px; }
.part .span { color: var(--muted); font-size: 12.5px; }
.part .st { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.part .meter { grid-column: 1 / -1; }
.part.sending { border-color: var(--line-2); }
.part.sending .st { color: var(--text); }
.part.done .st, .part.done .n { color: var(--accent); }
.part.done .meter-fill { width: 100%; }
.part.error { border-color: var(--hot); }
.part.error .st { color: var(--hot); }

#cap-go-inline { display: none; }
.cap-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cap-field textarea { min-height: 320px; font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; white-space: pre-wrap; }
.cap-field .f-head { gap: 12px; }
#cap-result .side-note { margin-top: 10px; }

/* ---------- extract audio ---------- */
/* five tabs in the 340 px panel */
.side-tabs { gap: 12px; padding-left: 12px; padding-right: 12px; }
.side-tabs button { font-size: 13px; white-space: nowrap; }
.engines.fmts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fmts .engine { gap: 3px; padding: 10px 10px 9px; }
.fmts .engine span { font-size: 11px; }
.fmts .engine strong { font: 900 24px/1 var(--display); letter-spacing: 0.02em; }
.fmts .engine[aria-checked="true"] strong { color: var(--accent); }
.engine.off { opacity: 0.45; cursor: not-allowed; }
#ext-kbps { margin-top: 2px; }
#ext-kbps button { font-variant-numeric: tabular-nums; }
.btn-accent.small { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.ext-rights { margin: 10px 2px 0; font-size: 12.5px; }
#ext-files .lib-head { margin-top: 22px; }
#ext-go-inline { display: none; }

.xq { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.xcard { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: border-color 0.2s; }
.xcard.busy { border-color: var(--line-2); }
.xcard.done { border-color: rgba(255, 191, 47, 0.5); }
.xcard.error { border-color: rgba(255, 79, 109, 0.6); }
.xc-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.xc-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--accent); display: grid; place-items: center; }
.xc-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.xcard.error .xc-ico { color: var(--hot); }
.xc-head strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xc-meta { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.xc-x { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.xc-x:hover { background: var(--surface-3); color: var(--text); }
.xc-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.xc-body { display: grid; gap: 10px; }
.xc-body:empty { display: none; }

.xc-wave { position: relative; height: 68px; border-radius: 10px; background: #0e0e10; touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.xc-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.xc-h, .xc-ph { position: absolute; top: 0; bottom: 0; }
.xc-h { width: 22px; margin-left: -1px; transform: translateX(-50%); cursor: ew-resize; outline: none; z-index: 2; }
.xc-h::before { content: ''; position: absolute; left: 10px; top: 4px; bottom: 4px; width: 2px; border-radius: 1px; background: #fff; }
.xc-h::after { content: ''; position: absolute; left: 6px; top: 50%; width: 10px; height: 24px; margin-top: -12px; border-radius: 4px; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.xc-h:focus-visible::after { box-shadow: 0 0 0 2px var(--accent); }
.xc-ph { width: 2px; margin-left: -1px; background: var(--hot); pointer-events: none; z-index: 1; }

.xc-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.xc-row .vplay { width: 36px; height: 36px; flex: none; }
.xc-time, .xc-lenw { display: grid; gap: 2px; }
.xc-time small, .xc-lenw small { font-size: 11px; color: var(--muted); }
.xt { width: 96px; background: #0e0e10; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; color: var(--text); font: 600 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; outline: none; }
.xt:focus { border-color: var(--accent); }
.xc-len { font: 600 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 7px 0; }
.xc-dl { margin-left: auto; }
.xc-dl.stale { background: var(--surface-3); color: var(--text); }
.xc-foot { display: grid; gap: 6px; }
.xc-status { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.xcard.done .xc-status { color: var(--text); }
.xc-status.err { color: var(--hot); }
.xc-foot .meter { height: 3px; }

@media (max-width: 900px) {
  .dropzone { padding: 30px 16px 26px; }
  .dropzone strong { font-size: 28px; }
  .dropzone.compact { grid-template-columns: auto 1fr; }
  .dropzone.compact .dz-actions { grid-column: 1 / -1; grid-row: auto; margin-top: 6px; }
  #cap-go-inline:not([hidden]) { display: inline-flex; }
  #ext-go-inline:not([hidden]) { display: inline-flex; }
  .xc-wave { height: 60px; }
  .xc-row { gap: 8px; }
  .xt { width: 86px; }
  .xc-dl { margin-left: 0; width: 100%; }
  .cap-field textarea { min-height: 240px; font-size: 12.5px; }
}

/* ---------- master ---------- */
/* five tabs: let the row scroll sideways inside the panel instead of squeezing */
.side-tabs { overflow-x: auto; scrollbar-width: none; }
.side-tabs::-webkit-scrollbar { display: none; }
.f-label { font-size: 12px; font-weight: 600; color: var(--muted); margin: 4px 2px -2px; letter-spacing: 0.02em; }
.engines.mst-chars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mst-chars .engine strong, .mst-dests .engine strong { font: 900 20px/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; }
.mst-chars .engine[aria-checked="true"] strong, .mst-dests .engine[aria-checked="true"] strong { color: var(--accent); }
.mst-dests .engine small { font-variant-numeric: tabular-nums; }
.mst-hint strong { color: var(--text); }
#mst-meter { margin-top: 10px; height: 3px; }
.mst-report { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.mst-report dt, .mst-report dd { margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); }
.mst-report dt:first-of-type, .mst-report dt:first-of-type + dd { border-top: 0; }
.mst-report dt { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mst-report dd { font-size: 13.5px; }
.mst-report dd strong { display: block; font-variant-numeric: tabular-nums; font-weight: 600; }
.mst-report dd span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.mst-after { margin-top: 12px; }
.mst-after dt { color: var(--accent); }
.mst-quiet { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 79, 109, 0.6); color: var(--text); font-size: 14px; }
.mst-ab { display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "play seg fair" "pos pos time"; gap: 10px 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.mst-play { grid-area: play; width: 44px; height: 44px; }
.mst-seg { grid-area: seg; display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.mst-seg button { border: 0; background: transparent; color: var(--muted); padding: 9px 14px; font-weight: 700; font-size: 13px; min-height: 40px; }
.mst-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.mst-fair { grid-area: fair; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); justify-self: end; }
.mst-fair input { accent-color: var(--accent); width: 16px; height: 16px; }
#mst-pos { grid-area: pos; }
#mst-time { grid-area: time; font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.mst-ab + .side-note { margin-top: 8px; }
.mst-export { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
#mst-measured { margin-top: 10px; }
@media (max-width: 900px) {
  .mst-ab { grid-template-columns: auto 1fr; grid-template-areas: "play seg" "fair fair" "pos time"; }
  .mst-fair { justify-self: start; }
  .mst-report { grid-template-columns: 96px minmax(0, 1fr); }
  .mst-export > * { flex: 1 1 100%; justify-content: center; }
}
