/* ============================================================================
   VOICE-CAPTURE.CSS -- Guided voice capture modal
   ----------------------------------------------------------------------------
   A full-screen modal that walks the user through: mic check -> range test ->
   read a script -> vowel warm-up -> build the model. Matches the studio theme
   (dark panels, orange/cyan accents). All classes are namespaced `vcs-`.
   ========================================================================== */

.vcs-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;                 /* toggled to flex by JS */
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 16px 40px;
  overflow-y: auto;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(255,107,53,0.10), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(53,194,255,0.10), transparent 60%),
    rgba(6,7,10,0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: vcs-fade 0.16s ease;
}
@keyframes vcs-fade { from { opacity: 0; } to { opacity: 1; } }

.vcs-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  background:
    radial-gradient(700px 220px at 100% -30%, rgba(53,194,255,0.10), transparent 60%),
    radial-gradient(600px 200px at -10% 130%, rgba(255,107,53,0.08), transparent 60%),
    linear-gradient(180deg, #23262e 0%, #191c22 12%, #14161b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 24px 60px rgba(0,0,0,0.6);
  animation: vcs-rise 0.18s ease;
}
@keyframes vcs-rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.vcs-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  opacity: 0.9;
}

/* ---- header -------------------------------------------------------------- */
.vcs-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.vcs-title {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
}
.vcs-voice-slot { margin-left: auto; display: inline-flex; align-items: center; }
.vcs-x {
  margin-left: 6px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.vcs-x:hover { border-color: var(--accent); color: var(--text); background: #262b34; }

/* ---- step rail ----------------------------------------------------------- */
.vcs-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.vcs-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}
.vcs-step i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  background: #0d0f13;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.vcs-step.on {
  color: var(--text);
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255,107,53,0.16), rgba(255,107,53,0.04));
  box-shadow: 0 0 0 1px rgba(255,107,53,0.28) inset;
}
.vcs-step.on i { background: var(--accent); border-color: var(--accent); color: #1a0d05; }
.vcs-step.done { color: var(--accent-3); border-color: rgba(53,255,158,0.35); }
.vcs-step.done i { background: rgba(53,255,158,0.16); border-color: rgba(53,255,158,0.5); color: var(--accent-3); }

/* ---- body ---------------------------------------------------------------- */
.vcs-body { min-height: 120px; }

.vcs-lead {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 12px;
}
.vcs-lead b { color: #fff; }

.vcs-tips {
  margin: 0 0 14px;
  padding: 12px 14px 12px 30px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(10,12,16,0.45);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
}
.vcs-tips li { margin: 0; }
.vcs-tips b { color: var(--text); }

.vcs-note {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 8px 0 0;
}
.vcs-ok {
  font-size: 12.5px;
  color: var(--accent-3);
  line-height: 1.55;
  margin: 10px 0 0;
}
.vcs-ok b { color: #b7ffd8; }

/* ---- CTA row ------------------------------------------------------------- */
.vcs-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.vcs-cta .vcs-btn.primary { margin-left: auto; }

/* ---- buttons ------------------------------------------------------------- */
.vcs-btn {
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: linear-gradient(180deg, #2c313b, #20242c);
  border: 1px solid #0c0e12;
  border-radius: 9px;
  padding: 9px 14px;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease, opacity .12s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.vcs-btn:hover:not(:disabled) { background: linear-gradient(180deg, #343a46, #262b34); }
.vcs-btn:active:not(:disabled) { transform: translateY(1px); }
.vcs-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.vcs-btn.primary {
  background: linear-gradient(180deg, var(--accent), #e0561f);
  border-color: #a83c12;
  color: #1a0d05;
  font-weight: 700;
}
.vcs-btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ff834f, #ef6128); }
.vcs-btn.rec { background: linear-gradient(180deg, #3a1e1e, #2a1414); border-color: #7a2a2a; color: #ff8a8a; }
.vcs-btn.rec.on { background: linear-gradient(180deg, #e0433f, #a92a27); border-color: #ff6b53; color: #fff; }
.vcs-btn.rec.on { animation: vcs-rec-pulse 1.1s infinite; }
@keyframes vcs-rec-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(224,67,63,0.0); } 50% { box-shadow: 0 0 0 4px rgba(224,67,63,0.18); } }

/* ---- range test ---------------------------------------------------------- */
.vcs-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 4px 0 14px;
}
.vcs-range-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(10,12,16,0.45);
}
.vcs-range-box.done { border-color: rgba(53,255,158,0.4); background: rgba(53,255,158,0.05); }
.vcs-range-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); font-weight: 700; }
.vcs-range-val { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: 0.01em; }
.vcs-range-box.done .vcs-range-val { color: var(--accent-3); }

/* ---- live meter ---------------------------------------------------------- */
.vcs-live {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(10,12,16,0.45);
  margin: 4px 0 0;
}
.vcs-live-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); font-weight: 700; }
.vcs-live.live { border-color: rgba(53,217,138,0.5); }
.vcs-live.live .vcs-live-lbl::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #35d98a;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(53,217,138,0.6);
  animation: vcs-pulse 1.6s infinite;
}
@keyframes vcs-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(53,217,138,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(53,217,138,0); }
  100% { box-shadow: 0 0 0 0 rgba(53,217,138,0); }
}
.vcs-meter-note { font-size: 12px; font-weight: 700; color: var(--text); min-width: 84px; }
.vcs-meter {
  position: relative;
  flex: 1 1 140px;
  height: 10px;
  border-radius: 999px;
  background: #0d0f13;
  border: 1px solid #0a0c10;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}
.vcs-meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.08s linear, background 0.15s ease;
}
.vcs-meter-fill.near { background: linear-gradient(90deg, #ffb454, #ff9a3d); }
.vcs-meter-fill.ok { background: linear-gradient(90deg, var(--accent-3), #35d98a); }
.vcs-rec-time { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-dim); min-width: 40px; }

/* ---- line input volume --------------------------------------------------- */
.vcs-gain {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(10,12,16,0.45);
  margin: 10px 0 0;
}
.vcs-gain-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); font-weight: 700; white-space: nowrap; }
.vcs-gain input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #262b34, var(--accent));
  outline: none;
  cursor: pointer;
}
.vcs-gain input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  cursor: pointer;
}
.vcs-gain input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: pointer;
}
.vcs-gain-val {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 56px;
  text-align: right;
}

/* ---- reading ------------------------------------------------------------- */
.vcs-read-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.vcs-read-head b { color: var(--text); }

.vcs-prog {
  height: 8px;
  border-radius: 999px;
  background: #0d0f13;
  border: 1px solid #0a0c10;
  overflow: hidden;
  margin: 0 0 14px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}
.vcs-prog > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.vcs-passage {
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 11px;
  background: rgba(10,12,16,0.5);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  letter-spacing: 0.002em;
}

/* ---- vowel warm-up ------------------------------------------------------- */
.vcs-vowel {
  text-align: center;
  padding: 18px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(10,12,16,0.45);
  margin: 0 0 14px;
}
.vcs-vowel-big {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.vcs-vowel-say { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.vcs-vowel-target { font-size: 12.5px; color: var(--text); margin-top: 10px; }
.vcs-vowel-target b { color: var(--accent-2); }

/* ---- train summary ------------------------------------------------------- */
.vcs-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
.vcs-summary > span {
  flex: 1 1 120px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10,12,16,0.45);
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.vcs-summary > span b { display: block; font-size: 18px; color: var(--text); }

.vcs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.vcs-input {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: #12141a;
  border: 1px solid #0c0e12;
  border-radius: 9px;
  padding: 10px 12px;
  width: 100%;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.vcs-input:focus { outline: 1px solid var(--accent); }

/* ---- status line --------------------------------------------------------- */
.vcs-status {
  font-size: 12.5px;
  color: var(--text-dim);
  min-height: 18px;
  line-height: 1.5;
  margin-top: 12px;
}
.vcs-status.ok { color: #7fe0a0; }
.vcs-status.err { color: #ff9a9a; }

/* ---- training quality picker --------------------------------------------- */
.vcs-q-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 700;
  margin: 2px 0 8px;
}
.vcs-quality {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 10px;
}
.vcs-qbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10,12,16,0.45);
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.vcs-qbtn b { font-size: 13px; color: var(--text); }
.vcs-qbtn span { font-size: 11px; }
.vcs-qbtn:hover { border-color: #3a4150; }
.vcs-qbtn.on {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255,107,53,0.16), rgba(255,107,53,0.06));
}
.vcs-qbtn.on b { color: var(--accent-2); }

/* ---- larger progress bar for the in-progress step ------------------------ */
.vcs-prog-lg { height: 12px; }
.vcs-prog-lg > i { transition: width 0.6s ease; }

/* ---- floating background-training pill ----------------------------------- */
.vcs-pill {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 350;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: #1b1f27;
  color: var(--text);
  font: 600 13px/1 system-ui, -apple-system, sans-serif;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  cursor: pointer;
  max-width: calc(100vw - 36px);
}
.vcs-pill b { color: var(--accent-2); }
.vcs-pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: vcs-pill-pulse 1.3s infinite;
}
@keyframes vcs-pill-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ---- self-contained toast (fallback when Social.toast is absent) --------- */
.vcs-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 3400;
  display: none;
  background: #1e222b;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 10px;
  font: 14px/1.4 system-ui, sans-serif;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  max-width: 90vw;
  text-align: center;
}
.vcs-toast.ok { border-color: #2f7d4f; color: #c9f2d8; }
.vcs-toast.err { border-color: #ff6b35; color: #ffd9c9; }

/* ---- clean sound-check report card --------------------------------------- */
.vcs-sc {
  margin: 4px 0 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(10,12,16,0.5);
}
.vcs-sc.green { border-color: rgba(53,255,158,0.4); box-shadow: inset 0 0 0 1px rgba(53,255,158,0.06); }
.vcs-sc.amber { border-color: rgba(255,180,84,0.45); box-shadow: inset 0 0 0 1px rgba(255,180,84,0.06); }
.vcs-sc.red   { border-color: rgba(255,107,53,0.5); box-shadow: inset 0 0 0 1px rgba(255,107,53,0.08); }

.vcs-sc-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.vcs-sc-pill::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.vcs-sc-pill.green { color: #35ff9e; background: rgba(53,255,158,0.12); border: 1px solid rgba(53,255,158,0.4); }
.vcs-sc-pill.amber { color: #ffb454; background: rgba(255,180,84,0.12); border: 1px solid rgba(255,180,84,0.42); }
.vcs-sc-pill.red   { color: #ff8a6b; background: rgba(255,107,53,0.13); border: 1px solid rgba(255,107,53,0.5); }

.vcs-sc-row {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.vcs-sc-row:first-of-type { border-top: 0; }
.vcs-sc-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #35d98a;
  box-shadow: 0 0 0 3px rgba(53,217,138,0.14);
}
.vcs-sc-row.bad .vcs-sc-dot { background: #ff6b35; box-shadow: 0 0 0 3px rgba(255,107,53,0.16); }
.vcs-sc-lbl { font-size: 13px; color: var(--text); font-weight: 600; }
.vcs-sc-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.vcs-sc-row.bad .vcs-sc-val { color: #ffb08a; }
.vcs-sc-note {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  min-width: 62px;
  text-align: right;
}
.vcs-sc-row.bad .vcs-sc-note { color: #ff9a72; }
.vcs-sc-tips { margin-top: 12px; }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 560px) {
  .vcs-sc-row { grid-template-columns: 16px 1fr auto; }
  .vcs-sc-note { grid-column: 2 / 4; text-align: left; min-width: 0; }
  .vcs-range { grid-template-columns: 1fr; }
  .vcs-passage { font-size: 15px; padding: 14px; }
  .vcs-vowel-big { font-size: 42px; }
  .vcs-cta .vcs-btn.primary { margin-left: 0; }
  .vcs-cta .vcs-btn { flex: 1 1 auto; }
}
