/* ============================================================================
   REPERFORM.CSS — "Re-perform your AI composition with real instruments and
   human feel" (PRO feature). Sits between Step 3 (Stem Split) and Step 4
   (Automatic Processing) in the linear workflow.
   ========================================================================== */

/* ---- the panel shell ----------------------------------------------------- */
.reperform-panel {
  position: relative;
  border: 1px solid var(--border);
  background:
    radial-gradient(1200px 300px at 100% -20%, rgba(255, 107, 53, 0.10), transparent 60%),
    radial-gradient(900px 260px at -10% 120%, rgba(53, 194, 255, 0.08), transparent 60%),
    var(--panel);
  overflow: hidden;
}
.reperform-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  opacity: 0.9;
}

.rp-pro-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ff9a3d);
  color: #1a0d05;
  vertical-align: middle;
  margin-left: 8px;
}

.rp-tagline {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 2px 0 10px;
}
.rp-tagline em {
  font-style: normal;
  color: var(--accent);
}

/* ---- the yes/no prompt --------------------------------------------------- */
.rp-prompt {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  margin-top: 6px;
}
.rp-prompt-text { flex: 1 1 340px; }
.rp-prompt-text h3 { margin: 0 0 4px; font-size: 16px; }
.rp-prompt-text p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.rp-prompt-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.rp-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.rp-btn:hover { border-color: var(--accent-2); }
.rp-btn:active { transform: translateY(1px); }
.rp-btn.primary {
  background: linear-gradient(135deg, var(--accent), #ff8a4d);
  border-color: transparent;
  color: #1a0d05;
}
.rp-btn.ghost { background: transparent; }
.rp-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- mode switch (AUTO / CUSTOM) ---------------------------------------- */
.rp-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 6px;
}
@media (max-width: 640px) { .rp-modes { grid-template-columns: 1fr; } }

.rp-mode {
  text-align: left;
  border: 1.5px solid var(--border);
  background: var(--panel-2);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.rp-mode:hover { border-color: var(--accent-2); }
.rp-mode.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255,107,53,.10), rgba(255,107,53,.02));
}
.rp-mode h4 { margin: 0 0 4px; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.rp-mode .rp-mode-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--text-dim); display: inline-block;
}
.rp-mode.active .rp-mode-dot { border-color: var(--accent); background: var(--accent); }
.rp-mode p { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

/* ---- body sections ------------------------------------------------------- */
.rp-section { margin-top: 18px; }
.rp-section > h4 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* ---- the one step chip ---------------------------------------------------
   Pass 2: every path used to number its own headings a different way. The
   instrumental and vocal paths wrote "1 \u00b7 " as literal text; the sing-along
   path used .sa-step-num, which was defined twice with different results.
   All three now emit the same element, so the number is a real object that
   Pass 3 can drive from the shared step state instead of from prose. */
.rp-step {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
}

/* ---- instrument picker (AUTO) ------------------------------------------- */
.rp-field { margin-bottom: 14px; }
.rp-field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px; }
.rp-select, .rp-input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13.5px;
}
.rp-select:focus, .rp-input:focus { outline: none; border-color: var(--accent-2); }

/* ---- CUSTOM stem list ---------------------------------------------------- */
.rp-stem-list { display: flex; flex-direction: column; gap: 10px; }
.rp-stem-row {
  display: grid;
  grid-template-columns: 26px 1fr 190px;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}
@media (max-width: 640px) { .rp-stem-row { grid-template-columns: 26px 1fr; } .rp-stem-row .rp-stem-inst { grid-column: 2; } }
.rp-stem-row.on { border-color: var(--accent); background: linear-gradient(180deg, rgba(255,107,53,.08), transparent); }
.rp-stem-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.rp-stem-name { font-size: 13.5px; font-weight: 600; }
.rp-stem-name small { display: block; font-weight: 400; color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }
.rp-stem-inst { width: 100%; }

/* ---- sliders ------------------------------------------------------------- */
.rp-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
@media (max-width: 640px) { .rp-sliders { grid-template-columns: 1fr; } }
.rp-slider { display: flex; flex-direction: column; gap: 4px; }
.rp-slider .rp-slider-head { display: flex; justify-content: space-between; font-size: 12.5px; }
.rp-slider .rp-slider-head b { color: var(--text); font-weight: 600; }
.rp-slider .rp-slider-head span { color: var(--accent-2); font-variant-numeric: tabular-nums; }
.rp-slider input[type="range"] { width: 100%; accent-color: var(--accent); }
.rp-slider small { color: var(--text-dim); font-size: 11px; line-height: 1.4; }

/* ---- fidelity preset chips ---------------------------------------------- */
.rp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-chip {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  cursor: pointer;
}
.rp-chip.active { border-color: var(--accent-3); color: var(--text); background: rgba(53,255,158,.08); }

/* ---- progress ------------------------------------------------------------ */
.rp-progress-wrap { margin-top: 16px; display: none; }
.rp-progress-wrap.on { display: block; }
.rp-progress-track {
  height: 8px; border-radius: 999px; background: var(--panel-2);
  border: 1px solid var(--border); overflow: hidden;
}
.rp-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .4s ease;
}
.rp-progress-msg { font-size: 12.5px; color: var(--text-dim); margin-top: 7px; }

/* ---- result -------------------------------------------------------------- */
.rp-result { margin-top: 18px; display: none; }
.rp-result.on { display: block; }
.rp-result-card {
  border: 1px solid var(--accent-3);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(53,255,158,.07), transparent);
  padding: 16px 18px;
}
.rp-result-card h4 { margin: 0 0 4px; font-size: 15px; }
.rp-result-card p { margin: 0 0 12px; color: var(--text-dim); font-size: 12.5px; }
.rp-result-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rp-download-link {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
  padding: 9px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.rp-download-link:hover { border-color: var(--accent-3); }

.rp-audio { width: 100%; margin-top: 12px; }

/* ---- gate / upsell ------------------------------------------------------- */
.rp-gate {
  display: none;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: rgba(255,107,53,.06);
  font-size: 13px;
  line-height: 1.55;
}
.rp-gate.on { display: block; }
.rp-gate b { color: var(--accent); }

.rp-error {
  display: none;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  background: rgba(255,77,94,.10);
  border: 1px solid var(--danger);
  color: #ffd7db;
  font-size: 13px;
}
.rp-error.on { display: block; }

.rp-note { font-size: 11.5px; color: var(--text-dim); margin-top: 10px; line-height: 1.5; }

/* ---- Re-Performance Fidelity Gate ---------------------------------------- */
.rp-fidelity {
  margin-top: 16px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
}
.rp-fid-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rp-fid-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.rp-fid-verdict {
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  padding: 2px 9px; border-radius: 999px; border: 1px solid transparent;
}
.rp-fid-verdict.ok { color: #7ef0b0; border-color: #2ecc71; background: rgba(46, 204, 113, 0.08); }
.rp-fid-verdict.warn { color: #f0c674; border-color: #d9a441; background: rgba(217, 164, 65, 0.08); }
.rp-fid-verdict.bad { color: #ff9b8a; border-color: #e74c3c; background: rgba(231, 76, 60, 0.10); }
.rp-fid-sub { font-size: 11px; color: var(--text-dim); margin: 6px 0 10px; line-height: 1.5; }
.rp-fid-score { display: grid; grid-template-columns: 64px 1fr 46px; align-items: center; gap: 10px; margin-bottom: 10px; }
.rp-fid-score-label { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.rp-fid-score-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.rp-fid-score-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #2ecc71, #7ef0b0); transition: width 0.5s ease; }
.rp-fid-score-val { font-size: 12px; font-weight: 700; text-align: right; color: var(--text); }
.rp-fid-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; }
.rp-fid-check {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; padding: 4px 8px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid transparent;
}
.rp-fid-check.ok { border-color: rgba(46, 204, 113, 0.35); }
.rp-fid-check.warn { border-color: rgba(217, 164, 65, 0.45); }
.rp-fid-check.bad { border-color: rgba(231, 76, 60, 0.5); }
.rp-fid-check-label { color: var(--text-dim); }
.rp-fid-check-val { font-weight: 700; }
.rp-fid-check.ok .rp-fid-check-val { color: #7ef0b0; }
.rp-fid-check.warn .rp-fid-check-val { color: #f0c674; }
.rp-fid-check.bad .rp-fid-check-val { color: #ff9b8a; }
.rp-fid-note { font-size: 11.5px; color: var(--text-dim); margin-top: 10px; line-height: 1.55; }
.rp-fid-note b.ok { color: #7ef0b0; }
.rp-fid-note b.warn { color: #f0c674; }
.rp-fid-note b.bad { color: #ff9b8a; }
.rp-fid-banner {
  margin-top: 14px; padding: 11px 14px; border-radius: 10px;
  border: 1px solid rgba(217, 164, 65, 0.5); background: rgba(217, 164, 65, 0.10);
  color: #f0c674; font-size: 12px; line-height: 1.5;
}
/* Multi-stage (Direct AI Vocal Humanization) fidelity panel */
.rp-fid-stages { display: grid; gap: 10px; margin: 2px 0 4px; }
.rp-fid-stage {
  border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 10px;
  padding: 10px 12px; background: rgba(255, 255, 255, 0.02);
}
.rp-fid-stage-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rp-fid-stage-name { flex: 1; font-size: 12px; font-weight: 700; color: var(--text); }
.rp-fid-stage-score { font-size: 11.5px; font-weight: 700; color: var(--text-dim); }
.rp-fid-stage .rp-fid-verdict { font-size: 10px; padding: 1px 7px; }
.rp-fid-stage .rp-fid-checks { margin-top: 2px; }

/* ---- "how it works" strip ------------------------------------------------ */
.rp-how {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0 4px;
}
@media (max-width: 720px) { .rp-how { grid-template-columns: 1fr 1fr; } }
.rp-how-step {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  padding: 11px 12px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.45;
}
.rp-how-step b { display: block; color: var(--text); font-size: 12.5px; margin-bottom: 3px; }
.rp-how-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #1a0d05; font-weight: 800; font-size: 11px;
  margin-right: 6px;
}

/* ---- per-module "How it works" collapsible ------------------------------- */
.rp-more {
  margin: 8px 0 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.015);
}
.rp-more > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-dim);
  user-select: none;
}
.rp-more > summary::-webkit-details-marker { display: none; }
.rp-more > summary:hover { color: var(--text); }
.rp-more-chev { margin-left: auto; font-size: 10px; transition: transform .2s ease; }
.rp-more[open] > summary { border-bottom: 1px solid var(--border); }
.rp-more[open] .rp-more-chev { transform: rotate(180deg); }
.reperform-panel .rp-more .hint { margin: 12px 0 0; padding: 0 13px; }
.reperform-panel .rp-more .rp-how { margin: 10px 13px 13px; }

/* ---- hero advertising badge --------------------------------------------- */
.badge.rp-hero-badge {
  background: linear-gradient(135deg, var(--accent), #ff9a3d);
  color: #1a0d05;
  font-weight: 700;
  border-color: transparent;
}

/* ==========================================================================
   DEDICATED RE-PERFORMANCE STUDIO PAGE (reperform.html)
   Upload dropzone + file info + isolate checkbox.
   ========================================================================== */
.rp-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.rp-dropzone:hover,
.rp-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(255, 107, 53, .06);
}
.rp-dropzone-inner { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.rp-dropzone-icon { font-size: 34px; line-height: 1; }
.rp-dropzone-text { text-align: left; font-size: 14px; color: var(--text); }
.rp-dropzone-text small { display: block; color: var(--text-dim); font-size: 12px; margin-top: 3px; }
.rp-link { color: var(--accent-2); text-decoration: underline; }

.rp-file-info {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rp-file-info .rp-file-name { font-weight: 600; }
.rp-file-info .rp-file-meta { color: var(--text-dim); font-size: 12px; }
.rp-file-info .rp-file-clear {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 7px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
}
.rp-file-info .rp-file-clear:hover { color: var(--danger); border-color: var(--danger); }
.rp-file-info .rp-copyright {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}
.rp-file-info .rp-copyright:empty { display: none; }
.rp-file-info .rp-copyright.scanning { color: var(--accent-2); border-color: var(--accent-2); }
.rp-file-info .rp-copyright.ok { color: var(--accent-3); border-color: var(--accent-3); }
.rp-file-info .rp-copyright.warn { color: #ffb020; border-color: #ffb020; }
.rp-file-info .rp-copyright.blocked { color: var(--danger); border-color: var(--danger); }

.rp-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 4px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.45;
}
.rp-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }

/* "Keep cover art" (147): thumbnail preview of the art detected in the upload. */
.rp-keep-cover { align-items: center; }
.rp-cover-thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border); background: #0b0f17; flex: 0 0 auto;
}

/* Studio page: give the panel a little more breathing room */
.reperform-panel .rp-section { margin-top: 20px; }
.reperform-panel .rp-section > h4 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* ---- Step 4: engine / fidelity-upgrade controls ---- */
.rp-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  vertical-align: middle;
}
.rp-hint { margin: 5px 0 0; font-size: 11.5px; color: var(--text-dim); line-height: 1.45; }
.rp-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.45;
}
.rp-toggle input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }
.rp-toggle em { display: block; font-style: normal; font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.rp-toggle.disabled { opacity: .45; cursor: not-allowed; }
.rp-toggle.disabled input { cursor: not-allowed; }
#rp-engine-section .rp-slider { margin-top: 14px; }

/* ==========================================================================
   Module tabs (Instrumental / Vocal) — Phase 2
   ========================================================================== */
.rp-tabs {
  display: flex;
  gap: 10px;
  margin: 4px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.rp-tab {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, transform .1s;
}
.rp-tab:hover { border-color: var(--accent-2); }
.rp-tab:active { transform: translateY(1px); }
.rp-tab.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(53,255,158,.10), rgba(255,154,61,.06));
  box-shadow: 0 0 0 1px rgba(53,255,158,.18) inset;
}
.rp-tab-ico { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.rp-tab-txt { display: flex; flex-direction: column; gap: 2px; }
.rp-tab-txt b { font-size: 14px; }
.rp-tab-txt small { font-size: 11.5px; color: var(--text-dim); line-height: 1.35; }
.rp-tab.active .rp-tab-txt b { color: var(--accent-2); }
.rp-tab .rp-pro-badge { margin-left: auto; }

/* Voice model picker row */
.vr-model-row { display: flex; gap: 8px; align-items: stretch; }
.vr-model-row .rp-select { flex: 1 1 auto; }
.vr-refresh {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 0 12px;
  font-size: 16px;
  line-height: 1;
}
#rp-module-vocal .rp-slider { margin-top: 14px; }

@media (max-width: 720px) {
  .rp-tab { flex: 1 1 100%; }
}

/* ============================================================================
   "Choose Your Step (more info)" collapsible hero box
   ========================================================================== */
.rp-choose {
  margin: 14px 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255,107,53,.07), rgba(53,194,255,.05)),
    var(--panel-2);
  overflow: hidden;
}
.rp-choose > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  user-select: none;
  transition: background .15s;
}
.rp-choose > summary::-webkit-details-marker { display: none; }
.rp-choose > summary:hover { background: rgba(255,255,255,.03); }
.rp-choose-ico { font-size: 18px; line-height: 1; }
.rp-choose-more { font-size: 12px; font-weight: 600; color: var(--accent-2); }
.rp-choose-chev {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  transition: transform .2s ease;
}
.rp-choose[open] .rp-choose-chev { transform: rotate(180deg); }
.rp-choose-body {
  padding: 0 16px 15px;
  border-top: 1px solid var(--border);
}
.rp-choose-body p {
  margin: 13px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
}
.rp-choose-body p b { color: var(--text); }

/* ============================================================================
   Live Sing-Along recorder
   ========================================================================== */
.sa-recorder {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 4px;
}
.rp-btn.sa-rec.recording {
  background: linear-gradient(135deg, #ff4d4d, #ff7a3d);
  border-color: #ff4d4d;
  color: #1a0505;
  animation: sa-pulse 1.1s ease-in-out infinite;
}
@keyframes sa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,77,77,.5); }
  50% { box-shadow: 0 0 0 8px rgba(255,77,77,0); }
}
.sa-timer {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: .04em;
}
.sa-take {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}
.sa-take .rp-file-name { font-weight: 600; }
.sa-take .rp-file-meta { color: var(--text-dim); font-size: 12px; }
.sa-take .rp-file-clear {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.sa-take .rp-file-clear:hover { color: var(--danger); border-color: var(--danger); }
#rp-module-singalong .rp-slider { margin-top: 14px; }

/* ============================================================================
   Sing-Along "Arrangement" DAW editor (wavesurfer.js lanes + regions)
   Ported from the Collaboration Studio (.cb-daw*) into the Live Sing-Along
   module so a singer can break the song into verse / chorus sections and loop
   each one before recording.
   ========================================================================== */
.sa-daw { position: relative; margin-top: 14px; border: 1px solid var(--border); border-radius: 14px; background: #0d1015; padding: 14px; }
.sa-daw-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sa-daw-title { font-weight: 800; font-size: .95rem; }
.sa-daw-spacer { flex: 1 1 auto; }

/* source toggle (Song / Lead vocal / Instrumental) */
.sa-daw-src { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #101319; }
.sa-seg { appearance: none; border: none; background: transparent; color: var(--text-dim); font: inherit; font-size: .78rem; font-weight: 700; padding: 7px 12px; cursor: pointer; border-right: 1px solid var(--border); }
.sa-seg:last-child { border-right: none; }
.sa-seg:hover:not(:disabled) { color: var(--text); background: rgba(53,194,255,.08); }
.sa-seg.is-on { background: rgba(53,194,255,.18); color: #d6efff; }
.sa-seg:disabled { opacity: .4; cursor: not-allowed; }

/* lanes */
.sa-daw-lanes { position: relative; display: flex; flex-direction: column; gap: 8px; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #101319, #0b0e13); border: 1px solid var(--border); padding: 8px; }
.sa-lane { display: flex; align-items: stretch; gap: 8px; }
.sa-lane[hidden] { display: none; }
.sa-lane-tag { flex: 0 0 84px; display: flex; align-items: center; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.sa-lane-wave { position: relative; flex: 1 1 auto; min-width: 0; border-radius: 8px; background: rgba(255,255,255,.02); }
.sa-lane-main .sa-lane-wave { min-height: 92px; }
.sa-lane-ref { min-height: 48px; }
.sa-lane-canvas { display: block; width: 100%; height: 48px; border-radius: 8px; }
.sa-lane-playhead { position: absolute; top: 0; bottom: 0; width: 2px; left: 0; background: var(--accent-3); box-shadow: 0 0 8px rgba(53,255,158,.7); pointer-events: none; opacity: .85; }
.sa-marker-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: .85rem; pointer-events: none; padding: 0 16px; text-align: center; z-index: 8; }

/* wavesurfer region chrome */
.sa-daw .wavesurfer-region { border-radius: 8px; border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); overflow: hidden; }
.sa-daw .wavesurfer-region:hover { border-color: rgba(255,255,255,.4); }
.sa-daw .wavesurfer-region.is-selected { border-color: var(--accent-3); box-shadow: 0 0 0 2px rgba(53,255,158,.45), inset 0 0 0 1px rgba(0,0,0,.25); z-index: 6; }
.sa-daw .wavesurfer-handle { background: rgba(255,255,255,.5); width: 3px; }
.sa-daw .wavesurfer-region.is-selected .wavesurfer-handle { background: var(--accent-3); }

/* region labels */
.sa-region-label { position: absolute; top: 3px; left: 6px; right: 6px; font-size: .66rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: #eef3ff; text-shadow: 0 1px 3px rgba(0,0,0,.85); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 6; }
.sa-region-verse { color: #cfe6ff; }
.sa-region-chorus { color: #ffd2b3; }
.sa-region-bridge { color: #dcc8ff; }
.sa-region-intro, .sa-region-outro { color: #c2ccda; }

/* transport + tools */
.sa-daw-transport, .sa-daw-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.sa-daw-time { font-variant-numeric: tabular-nums; font-size: .82rem; font-weight: 700; }
.sa-daw-tools #saDawSave { margin-left: auto; }
.sa-daw-type { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-dim); }
.sa-daw-type select { background: #101319; color: var(--text); border: 1px solid var(--border); border-radius: 9px; padding: 6px 8px; font: inherit; font-size: .8rem; font-weight: 700; }
.sa-daw-type select:focus { outline: none; border-color: var(--accent-2); }
.sa-marker-snap { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-dim); }
.sa-marker-snap input { accent-color: var(--accent-3); }
.sa-marker-count { font-size: .8rem; font-weight: 700; color: var(--accent-3); }
.sa-marker-count.dim { color: var(--text-dim); font-weight: 600; }
.sa-marker-count.warn { color: #ffc440; }
.sa-marker-help { font-size: .8rem; margin: 10px 0 0; }

/* mini buttons */
.sa-mini { font-size: .78rem; font-weight: 700; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: #101319; color: var(--text); cursor: pointer; font-family: inherit; }
.sa-mini:hover { border-color: var(--accent-2); }
.sa-mini.is-on { border-color: var(--accent-3); color: #c7ffe4; background: rgba(53,255,158,.12); }
.sa-mini:disabled { opacity: .4; cursor: not-allowed; }

/* toast (appended inside .sa-daw by the module) */
.sa-daw-toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%) translateY(12px); background: #101319; border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.45); opacity: 0; transition: opacity .2s, transform .2s; z-index: 30; font-size: .86rem; max-width: 90%; pointer-events: none; text-align: center; }
.sa-daw-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.sa-daw-toast.err { border-color: rgba(255,77,94,.5); color: #ffb3bb; }
.sa-daw-toast.ok { border-color: rgba(53,255,158,.5); color: #c6ffe4; }
.sa-daw-toast.warn { border-color: rgba(255,196,64,.55); color: #ffe6b3; }

@media (max-width: 640px) {
  .sa-lane-tag { flex-basis: 62px; font-size: .6rem; }
  .sa-daw-tools #saDawSave { margin-left: 0; width: 100%; }
  .sa-daw-src { width: 100%; }
  .sa-seg { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .sa-daw-toast { transition: none; }
}

/* ============================================================================
   INSTRUMENTAL LIKENESS MATCH  (the .lk-* module)
   ========================================================================== */
.lk-drop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
@media (max-width: 640px) { .lk-drop-grid { grid-template-columns: 1fr; } }

.lk-drop {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #14171f, #0f1218);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .12s;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.lk-drop:hover { border-color: var(--accent-2); }
.lk-drop.dragover { border-color: var(--accent-3); background: rgba(53,255,158,.07); }
.lk-drop.filled { border-style: solid; border-color: var(--accent-2); background: linear-gradient(180deg, #161a24, #101319); }
.lk-drop-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .01em;
}
.lk-drop-label b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  margin-right: 8px;
  font-size: 12px;
  background: linear-gradient(135deg, var(--accent), #ff9a3d);
  color: #1a0d05;
}
.lk-drop-label.b b { background: linear-gradient(135deg, var(--accent-2), #6db6ff); color: #041322; }
.lk-drop-hint { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.lk-drop-hint b { color: var(--text); font-weight: 700; }
.lk-drop-hint small { display: block; color: var(--text-dim); font-size: 11px; margin-top: 3px; }

.lk-result { margin-top: 18px; }
.lk-verdict {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  background:
    radial-gradient(700px 200px at 100% -30%, rgba(255,107,53,.10), transparent 60%),
    var(--panel);
}
.lk-verdict-head { font-size: 16px; font-weight: 800; color: var(--text); }
.lk-verdict-sub { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin-top: 6px; }
.lk-verdict-flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lk-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.lk-flag.yes { color: #c6ffe4; border-color: rgba(53,255,158,.5); background: rgba(53,255,158,.10); }
.lk-flag.no { color: #ffd7db; border-color: rgba(255,77,94,.45); background: rgba(255,77,94,.08); }

.lk-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 12px; }

.lk-frame {
  width: 100%;
  height: 78vh;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0b0e13;
  display: block;
}
@media (max-width: 640px) { .lk-frame { height: 68vh; min-height: 420px; } }

/* ============================================================================
   VERSE-BY-VERSE RECORDER (Sing-Along) — ported from the Collaboration Studio
   (collab.css Step-5 mixer). The wrapper uses .sa-vbv*; the inline mixer reuses
   the .cb-* classes verbatim so the two studios share one look.
   ============================================================================ */
.sa-vbv { display: flex; flex-direction: column; gap: 14px; }
.sa-vbv-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sa-vbv-title { font-weight: 800; font-size: .95rem; }
.sa-vbv-list { display: flex; flex-direction: column; gap: 12px; }
.sa-vbv-hint { font-size: .84rem; margin: 0; line-height: 1.5; }
.sa-vbv-sec { }
.sa-vbv-mixer { grid-column: 1 / -1; }

/* base form controls the mixer relies on */
.cb-input, .cb-select, .cb-textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: #101319; color: var(--text); font-size: .95rem; font-family: inherit;
}
.cb-select { appearance: none; -webkit-appearance: none; background-image: none; cursor: pointer; }
.cb-input:focus, .cb-select:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(53,194,255,.15); }
.cb-select:disabled { opacity: .5; cursor: not-allowed; }

/* ---- section row ---------------------------------------------------------- */
.cb-sec { display: grid; grid-template-columns: 150px minmax(210px, auto) 1fr; gap: 14px; align-items: center; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--panel-2); }
.cb-sec.chorus { border-left: 3px solid var(--accent); }
.cb-sec:not(.chorus) { border-left: 3px solid var(--accent-2); }
.cb-sec-head { display: flex; flex-direction: column; gap: 5px; }
.cb-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; width: fit-content; }
.cb-badge.chorus { background: rgba(255,107,53,.14); border: 1px solid rgba(255,107,53,.45); color: #ffc4a3; }
.cb-badge.verse { background: rgba(53,194,255,.12); border: 1px solid rgba(53,194,255,.4); color: #c9ecff; }
.cb-sec-time { font-size: .74rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cb-sec-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cb-sec-cast { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cb-sec-cast .cb-select { width: auto; min-width: 128px; font-size: .85rem; padding: 8px 10px; }
.cb-warn { font-size: .72rem; font-weight: 700; color: #ffd9a3; }

.cb-take { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cb-take-empty { justify-content: flex-end; }
.cb-take-audio { width: 190px; height: 34px; }
.cb-take-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cb-take-singer { font-size: .82rem; font-weight: 700; }
.cb-take-locked { font-size: .76rem; font-weight: 700; color: var(--accent-3); }
.cb-take-wait { font-size: .74rem; color: var(--text-dim); }

.cb-mini { font-size: .78rem; font-weight: 700; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: #101319; color: var(--text); cursor: pointer; font-family: inherit; }
.cb-mini:hover { border-color: var(--accent-2); }
.cb-mini.rec { border-color: rgba(255,77,94,.5); color: #ffb3bb; }
.cb-mini.recording { border-color: var(--danger); background: rgba(255,77,94,.14); color: #ffd0d5; animation: cb-pulse 1s ease-in-out infinite; }
@keyframes cb-pulse { 50% { opacity: .55; } }

.cb-audio { width: 100%; height: 36px; }

.cb-sec-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.cb-sec-mixer { grid-column: 1 / -1; }
.cb-mini.mixer-toggle { border-color: rgba(53,194,255,.4); color: #cfeaff; }
.cb-mini.mixer-toggle:hover { border-color: var(--accent-2); background: rgba(53,194,255,.1); }
.cb-mini.danger { border-color: rgba(255,77,94,.45); color: #ffb3bb; }
.cb-mini.danger:hover { border-color: var(--danger); background: rgba(255,77,94,.12); }
.cb-mini.is-on { border-color: var(--accent-3); color: #c7ffe4; background: rgba(53,255,158,.12); }
.cb-mini:disabled { opacity: .4; cursor: not-allowed; }
.cb-mode-badge { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); background: var(--panel-2); }
.cb-mode-badge.rvc { color: #cfeaff; border-color: rgba(53,194,255,.4); }
.cb-mode-badge.live { color: #ffc4a3; border-color: rgba(255,107,53,.45); }
.cb-mode-badge.auto { color: var(--text-dim); }

/* ---- inline mixer --------------------------------------------------------- */
.cb-mx { margin-top: 4px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(180deg, #12151c, #0d1015); padding: 14px; }
.cb-mx[hidden] { display: none; }
.cb-mx-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cb-mx-title { font-weight: 800; font-size: .92rem; }
.cb-mx-range { font-size: .76rem; font-variant-numeric: tabular-nums; }
.cb-mx-x { margin-left: auto; background: transparent; border: 1px solid var(--border); color: var(--text-dim); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: .85rem; line-height: 1; }
.cb-mx-x:hover { border-color: var(--danger); color: #ffb3bb; }

.cb-mx-strips { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.cb-mx-strip { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 92px; padding: 10px 8px; border: 1px solid var(--border); border-radius: 12px; background: #0d1015; }
.cb-mx-strip-label { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.cb-mx-meter { display: flex; flex-direction: column-reverse; gap: 2px; width: 16px; height: 84px; }
.cb-mx-seg { flex: 1; border-radius: 2px; background: rgba(255,255,255,.07); }
.cb-mx-seg.on.seg-green { background: var(--accent-3); box-shadow: 0 0 6px rgba(53,255,158,.5); }
.cb-mx-seg.on.seg-yellow { background: #ffcf6b; box-shadow: 0 0 6px rgba(255,207,107,.5); }
.cb-mx-seg.on.seg-red { background: var(--danger); box-shadow: 0 0 6px rgba(255,77,94,.5); }
.cb-mx-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cb-mx-val { font-size: .72rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cb-mx-strip-btns { display: flex; gap: 6px; }
.cb-mx-mini { font-size: .68rem; font-weight: 800; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: #101319; color: var(--text-dim); cursor: pointer; font-family: inherit; }
.cb-mx-mini:hover { border-color: var(--accent-2); color: var(--text); }
.cb-mx-mini.on { border-color: var(--accent-3); color: var(--accent-3); background: rgba(53,255,158,.1); }

.cb-mx-mode { margin-top: 14px; }
.cb-mx-mode-label { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; font-weight: 700; color: var(--text-dim); }
.cb-mx-mode-label .cb-select { max-width: 460px; }
.cb-mx-transport { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cb-mx-transport[hidden] { display: none; }
.cb-mx-live { margin-top: 12px; }
.cb-mx-live[hidden] { display: none; }
.cb-mx-timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent); }
.cb-mx-hint { font-size: .8rem; margin: 10px 0 0; }

/* ---- count-in overlay ----------------------------------------------------- */
.cb-countin {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(6, 10, 20, 0.72);
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.cb-countin-num {
  font-size: 128px;
  font-weight: 800;
  line-height: 1;
  color: #ff8a3d;
  text-shadow: 0 0 40px rgba(255, 138, 61, 0.55);
  animation: cb-countin-pop 0.28s ease-out;
}
.cb-countin-cap {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
@keyframes cb-countin-pop {
  0% { transform: scale(0.6); opacity: 0.2; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 640px) {
  .cb-sec { grid-template-columns: 1fr; }
  .cb-sec-cast, .cb-take, .cb-take-empty { justify-content: flex-start; }
  .cb-take-audio { width: 100%; }
  .cb-mx-strips { gap: 10px; }
  .cb-mx-strip { min-width: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  .cb-mini.recording { animation: none; }
  .cb-countin-num { animation: none; }
}

/* ---- Sing-Along: "Upload your own stems" — the recommended, front-and-center path -- */
.sa-own {
  margin: 2px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sa-own.recommended {
  border-color: rgba(53, 255, 158, 0.45);
  background:
    linear-gradient(180deg, rgba(53, 255, 158, 0.08) 0%, rgba(53, 255, 158, 0.015) 55%, transparent 100%),
    var(--panel-2);
  box-shadow: 0 0 0 1px rgba(53, 255, 158, 0.08), 0 14px 34px -22px rgba(53, 255, 158, 0.75);
}
.sa-own-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.sa-own-toggle:hover { background: rgba(255, 255, 255, 0.03); }
.sa-own-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #06231a;
  background: var(--accent-3);
  border-radius: 999px;
  padding: 3px 9px;
}
.sa-own-label { flex: 1; }
.sa-own-caret { transition: transform 0.18s ease; color: var(--text-dim); }
.sa-own.open .sa-own-caret { transform: rotate(180deg); }
.sa-own-body { padding: 2px 15px 15px; border-top: 1px solid var(--border); }
.sa-own-body .rp-note { margin: 12px 0 14px; line-height: 1.55; }
.sa-own-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 4px;
}
@media (max-width: 640px) {
  .sa-own-grid { grid-template-columns: 1fr; }
}
.sa-own-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.sa-own-field > span { font-weight: 600; color: var(--text); }
.sa-own-field em {
  font-style: normal;
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-left: 4px;
}
.sa-own-field input[type="file"] { font-size: 11px; color: var(--text-dim); }
.sa-own-field.has-file > span { color: var(--accent-3); }
.sa-own-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.sa-own-actions .rp-note { margin: 0; }

/* "or drop the full song" divider between the upload card and the dropzone */
.sa-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 14px;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sa-or::before,
.sa-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================================
   §233 — Live Sing-Along path re-themed to match the Vocal Enhancer
   (modular gray plates, neon accents, uppercase caps, VE-style controls).
   Scoped to #rp-module-singalong so the rest of the studio is untouched.
   ============================================================================ */
#rp-module-singalong{
  --sa-tone:#22d3ff; --sa-dyn:#ff2e7e; --sa-space:#a56bff; --sa-sfx:#ff9a2e;
  --sa-gray-1:#272b32; --sa-gray-2:#1d2027; --sa-gray-line:#33383f;
  --sa-text:#eef2f8; --sa-muted:#8b95a7; --sa-muted-2:#5a6472;
  --sa-line:#1d222b; --sa-accent:var(--sa-tone);
}

/* ---- tagline ---- */
#rp-module-singalong .rp-tagline{ font-size:15px; color:var(--sa-text); }
#rp-module-singalong .rp-tagline em{ color:var(--sa-tone); font-style:normal; text-shadow:0 0 14px rgba(34,211,255,.5); }

/* ---- each step is a VE-style module card ---- */
#rp-module-singalong .rp-section{
  position:relative; margin-top:18px; padding:16px 16px 18px;
  border:1px solid var(--sa-gray-line); border-radius:14px;
  background:linear-gradient(180deg,#16191f,#0b0d11);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.045), 0 22px 50px -40px rgba(0,0,0,.95);
}
#rp-module-singalong .rp-section::before{
  content:""; position:absolute; top:0; left:14px; right:14px; height:2px;
  background:linear-gradient(90deg,transparent,var(--sa-accent),transparent); opacity:.9;
}
#rp-module-singalong .rp-section > h4{
  margin:0 0 14px; font-size:12.5px; font-weight:800; letter-spacing:1.8px;
  text-transform:uppercase; color:var(--sa-text);
  display:flex; align-items:center; gap:10px;
}
/* Accents are keyed to the SECTION, not to its position. The old
   nth-of-type() rules counted .rk3-route and .rk-mods as divs 1 and 2, so
   every section shifted by two: "Bring your song" and "Break it into
   sections" inherited the pink --sa-dyn accent, and #sa-cast picked up the
   orange --sa-sfx accent (which is why the Record button was orange).
   Id selectors are DOM-order independent. */
#rp-module-singalong #sa-blend-section{ --sa-accent:var(--sa-sfx); }
#rp-module-singalong #sa-processing{ --sa-accent:var(--sa-space); }

/* ---- notes ---- */
#rp-module-singalong .rp-note{ color:var(--sa-muted); }
#rp-module-singalong .rp-note b{ color:var(--sa-text); }
#rp-module-singalong .rp-hint{ color:var(--sa-muted); }

/* ---- buttons ---- */
#rp-module-singalong .rp-btn{
  border:1px solid var(--sa-gray-line); border-radius:9px; color:#e7edf6;
  background:linear-gradient(180deg,var(--sa-gray-1),var(--sa-gray-2));
  font-weight:700; letter-spacing:.4px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.4);
}
#rp-module-singalong .rp-btn:hover{ border-color:#3a4a63; color:#fff; }
#rp-module-singalong .rp-btn.primary{
  background:linear-gradient(180deg,color-mix(in srgb,var(--sa-accent) 55%,#fff),var(--sa-accent));
  border-color:transparent; color:#04121a;
  box-shadow:0 0 18px color-mix(in srgb,var(--sa-accent) 40%,transparent), inset 0 1px 0 rgba(255,255,255,.45);
}
#rp-module-singalong .rp-btn.primary:hover{
  box-shadow:0 0 26px color-mix(in srgb,var(--sa-accent) 60%,transparent), inset 0 1px 0 rgba(255,255,255,.55);
}
#rp-module-singalong .rp-btn.ghost{ background:transparent; }

/* ---- badges ---- */
#rp-module-singalong .rp-badge{
  color:var(--sa-accent); border:1px solid color-mix(in srgb,var(--sa-accent) 45%,transparent);
  background:color-mix(in srgb,var(--sa-accent) 12%,transparent);
  text-shadow:0 0 10px color-mix(in srgb,var(--sa-accent) 50%,transparent);
}

/* ---- STEP 5 sliders -> VE control plates ---- */
#rp-module-singalong .rp-slider{
  margin-top:14px; gap:9px; padding:13px 15px;
  border:1px solid var(--sa-gray-line); border-radius:11px;
  background:linear-gradient(180deg,var(--sa-gray-1),var(--sa-gray-2));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06), inset 0 -1px 0 rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.45);
}
#rp-module-singalong .rp-slider .rp-slider-head b{
  font-size:10.5px; font-weight:800; letter-spacing:1px; text-transform:uppercase; color:#aab4c6;
}
#rp-module-singalong .rp-slider .rp-slider-head span{
  color:var(--sa-accent); font-weight:800; font-size:13px; font-variant-numeric:tabular-nums;
  text-shadow:0 0 10px color-mix(in srgb,var(--sa-accent) 55%,transparent);
}
#rp-module-singalong .rp-slider small{ color:var(--sa-muted-2); font-size:10.5px; }
#rp-module-singalong .rp-slider input[type="range"]{
  -webkit-appearance:none; appearance:none; width:100%; height:10px; border-radius:6px; margin:4px 0;
  background:linear-gradient(180deg,#040507,#0b0d11);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.05), inset 0 3px 8px rgba(0,0,0,.85);
  outline:none; cursor:pointer;
}
#rp-module-singalong .rp-slider input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none; width:24px; height:14px; border-radius:4px;
  background:linear-gradient(180deg,#454c57 0 26%, var(--sa-accent) 26% 74%, #1c2129 74% 100%);
  box-shadow:0 3px 6px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.2), 0 0 0 1px rgba(0,0,0,.6), 0 0 12px color-mix(in srgb,var(--sa-accent) 50%,transparent);
  cursor:grab;
}
#rp-module-singalong .rp-slider input[type="range"]::-moz-range-thumb{
  width:24px; height:14px; border-radius:4px; border:none;
  background:linear-gradient(180deg,#454c57 0 26%, var(--sa-accent) 26% 74%, #1c2129 74% 100%);
  box-shadow:0 3px 6px rgba(0,0,0,.7), 0 0 12px color-mix(in srgb,var(--sa-accent) 50%,transparent);
}
#rp-module-singalong .rp-slider input[type="range"]::-moz-range-track{ height:10px; border-radius:6px; background:#040507; }

/* ---- STEP 5 toggles -> VE switches ---- */
#rp-module-singalong .rp-toggle{
  align-items:center; gap:12px; margin:12px 0; padding:12px 15px;
  border:1px solid var(--sa-gray-line); border-radius:11px;
  background:linear-gradient(180deg,var(--sa-gray-1),var(--sa-gray-2));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06), inset 0 -1px 0 rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.45);
  color:var(--sa-text);
}
#rp-module-singalong .rp-toggle input[type="checkbox"]{
  -webkit-appearance:none; appearance:none; position:relative; flex:0 0 auto; margin:0;
  width:44px; height:23px; border-radius:999px; cursor:pointer;
  background:linear-gradient(180deg,#040507,#0b0d11);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.06), inset 0 2px 6px rgba(0,0,0,.85);
  transition:background .18s, box-shadow .18s;
}
#rp-module-singalong .rp-toggle input[type="checkbox"]::after{
  content:""; position:absolute; top:2px; left:2px; width:19px; height:19px; border-radius:50%;
  background:linear-gradient(180deg,#454c57,#1c2129);
  box-shadow:0 2px 4px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.25);
  transition:transform .18s, background .18s;
}
#rp-module-singalong .rp-toggle input[type="checkbox"]:checked{
  background:linear-gradient(180deg,color-mix(in srgb,var(--sa-accent) 40%,#040507),color-mix(in srgb,var(--sa-accent) 18%,#040507));
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sa-accent) 55%,transparent), 0 0 14px color-mix(in srgb,var(--sa-accent) 40%,transparent);
}
#rp-module-singalong .rp-toggle input[type="checkbox"]:checked::after{
  transform:translateX(21px);
  background:linear-gradient(180deg,color-mix(in srgb,var(--sa-accent) 55%,#fff),var(--sa-accent));
  box-shadow:0 0 12px color-mix(in srgb,var(--sa-accent) 70%,transparent);
}
#rp-module-singalong .rp-toggle em{ color:var(--sa-muted-2); }

/* ---- STEP 1 dropzone ---- */
#rp-module-singalong .rp-dropzone{
  border:1.5px dashed var(--sa-gray-line); border-radius:14px;
  background:linear-gradient(180deg,#14171f,#0f1218);
}
#rp-module-singalong .rp-dropzone:hover,
#rp-module-singalong .rp-dropzone.dragover{
  border-color:var(--sa-tone);
  background:linear-gradient(180deg, rgba(34,211,255,.08), rgba(34,211,255,.02));
  box-shadow:0 0 30px -10px rgba(34,211,255,.7);
}
#rp-module-singalong .rp-dropzone-text small{ color:var(--sa-muted); }
#rp-module-singalong .rp-link{ color:var(--sa-tone); }

/* ---- STEP 1 "upload your own stems" card ---- */
#rp-module-singalong .sa-own{
  border:1px solid var(--sa-gray-line); border-radius:14px;
  background:linear-gradient(180deg,#14171f,#0f1218);
}
#rp-module-singalong .sa-own.recommended{
  border-color:color-mix(in srgb,var(--sa-tone) 45%,transparent);
  background:linear-gradient(180deg, rgba(34,211,255,.07), rgba(34,211,255,.012) 55%, transparent), #101318;
  box-shadow:0 0 0 1px rgba(34,211,255,.06), 0 16px 40px -28px rgba(34,211,255,.8);
}
#rp-module-singalong .sa-own-toggle{ color:var(--sa-text); }
#rp-module-singalong .sa-own-toggle:hover{ background:rgba(255,255,255,.03); }
#rp-module-singalong .sa-own-badge{
  color:#04121a; background:linear-gradient(180deg,color-mix(in srgb,var(--sa-tone) 55%,#fff),var(--sa-tone));
  box-shadow:0 0 12px color-mix(in srgb,var(--sa-tone) 55%,transparent);
}
#rp-module-singalong .sa-own-body{ border-top:1px solid var(--sa-gray-line); }
#rp-module-singalong .sa-own-field > span{ color:var(--sa-text); }
#rp-module-singalong .sa-own-field.has-file > span{ color:var(--sa-tone); }
#rp-module-singalong .sa-or{ color:var(--sa-muted-2); }
#rp-module-singalong .sa-or::before,
#rp-module-singalong .sa-or::after{ background:var(--sa-gray-line); }

/* ---- file info / takes ---- */
#rp-module-singalong .rp-file-info,
#rp-module-singalong .sa-take{
  border:1px solid var(--sa-gray-line); border-radius:10px;
  background:linear-gradient(180deg,var(--sa-gray-1),var(--sa-gray-2));
  color:var(--sa-text);
}
#rp-module-singalong .rp-file-info .rp-file-meta,
#rp-module-singalong .sa-take .rp-file-meta{ color:var(--sa-muted); }

/* ---- STEP 2 DAW chrome ---- */
#rp-module-singalong .sa-daw{
  border:1px solid var(--sa-gray-line); border-radius:14px;
  background:linear-gradient(180deg,#0e1116,#090b0f);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
#rp-module-singalong .sa-daw-title{ color:var(--sa-text); letter-spacing:.5px; }
#rp-module-singalong .sa-daw-lanes{
  border:1px solid var(--sa-gray-line); border-radius:12px;
  background:linear-gradient(180deg,#101319,#0a0c10);
}
#rp-module-singalong .sa-daw-src{ border:1px solid var(--sa-gray-line); border-radius:10px; background:#0b0e13; }
#rp-module-singalong .sa-seg{ color:var(--sa-muted); border-right:1px solid var(--sa-gray-line); }
#rp-module-singalong .sa-seg:hover:not(:disabled){ color:#fff; background:rgba(34,211,255,.08); }
#rp-module-singalong .sa-seg.is-on{ background:linear-gradient(180deg,rgba(34,211,255,.22),rgba(34,211,255,.12)); color:#d6efff; }
#rp-module-singalong .sa-mini{
  border:1px solid var(--sa-gray-line); border-radius:10px; color:#dfe6f1;
  background:linear-gradient(180deg,#20242b,#15181e);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}
#rp-module-singalong .sa-mini:hover{ border-color:#3a4a63; color:#fff; }
#rp-module-singalong .sa-mini.is-on{ border-color:var(--sa-tone); color:#d6efff; background:linear-gradient(180deg,rgba(34,211,255,.2),rgba(34,211,255,.1)); }
#rp-module-singalong .sa-daw-type select,
#rp-module-singalong .cb-select{
  background:#0b0e13; color:var(--sa-text); border:1px solid var(--sa-gray-line); border-radius:9px;
}
#rp-module-singalong .sa-daw-type select:focus,
#rp-module-singalong .cb-select:focus{ border-color:var(--sa-tone); box-shadow:0 0 0 3px rgba(34,211,255,.15); }
#rp-module-singalong .sa-marker-snap input{ accent-color:var(--sa-tone); }
#rp-module-singalong .sa-marker-count{ color:var(--sa-tone); }
#rp-module-singalong .sa-lane-tag{ color:var(--sa-muted); }
#rp-module-singalong .sa-lane-playhead{ background:var(--sa-tone); box-shadow:0 0 8px rgba(34,211,255,.7); }

/* ---- STEP 3 verse-by-verse ---- */
#rp-module-singalong .sa-vbv-title{ color:var(--sa-text); letter-spacing:.5px; }
#rp-module-singalong .cb-sec{
  border:1px solid var(--sa-gray-line); border-radius:14px;
  background:linear-gradient(180deg,var(--sa-gray-1),var(--sa-gray-2));
}
#rp-module-singalong .cb-sec.chorus{ border-left:3px solid var(--sa-sfx); }
#rp-module-singalong .cb-sec:not(.chorus){ border-left:3px solid var(--sa-tone); }
#rp-module-singalong .cb-mini{
  border:1px solid var(--sa-gray-line); border-radius:10px; color:#dfe6f1;
  background:linear-gradient(180deg,#20242b,#15181e);
}
#rp-module-singalong .cb-mini:hover{ border-color:#3a4a63; color:#fff; }

/* ---- STEP 4 recorder ---- */
#rp-module-singalong .sa-rec{
  background:linear-gradient(180deg,#ff5a7a,#ff2e7e); border-color:transparent; color:#1a0410;
  box-shadow:0 0 18px rgba(255,46,126,.4), inset 0 1px 0 rgba(255,255,255,.4);
}
#rp-module-singalong .sa-timer{ color:var(--sa-dyn); text-shadow:0 0 12px rgba(255,46,126,.5); }

/* ---- fidelity / progress / gate ---- */
#rp-module-singalong .rp-progress-track{ background:#040507; border:1px solid var(--sa-gray-line); }
#rp-module-singalong .rp-progress-fill{ background:linear-gradient(90deg,var(--sa-tone),var(--sa-space)); }
#rp-module-singalong .rp-fidelity{
  border:1px solid var(--sa-gray-line); border-radius:12px;
  background:linear-gradient(180deg,var(--sa-gray-1),var(--sa-gray-2));
}
#rp-module-singalong .rp-gate{
  border:1px dashed color-mix(in srgb,var(--sa-tone) 55%,transparent);
  background:color-mix(in srgb,var(--sa-tone) 7%,transparent);
}
#rp-module-singalong .rp-gate b{ color:var(--sa-tone); }

/* ---- "how it works" ---- */
#rp-module-singalong .rp-more{ border:1px solid var(--sa-gray-line); border-radius:12px; background:rgba(255,255,255,.015); }
#rp-module-singalong .rp-more > summary{ color:var(--sa-muted); }
#rp-module-singalong .rp-more > summary:hover{ color:var(--sa-text); }
#rp-module-singalong .rp-more[open] > summary{ border-bottom:1px solid var(--sa-gray-line); }
#rp-module-singalong .rp-how-step{
  border:1px solid var(--sa-gray-line); border-radius:10px;
  background:linear-gradient(180deg,var(--sa-gray-1),var(--sa-gray-2)); color:var(--sa-muted);
}
#rp-module-singalong .rp-how-step b{ color:var(--sa-text); }
#rp-module-singalong .rp-how-num{
  background:linear-gradient(180deg,color-mix(in srgb,var(--sa-tone) 55%,#fff),var(--sa-tone));
  color:#04121a; box-shadow:0 0 12px color-mix(in srgb,var(--sa-tone) 50%,transparent);
}

/* ============================================================================
   §242: Re-Production Studio Step-3 sing-along (collab-style arrangement +
   cast-the-parts blocks). The DAW + cast cards reuse the .sa-daw / .sa-vbv /
   .cb-sec styles above; these are the wrapping "step block" styles.
   ========================================================================== */
.sa-block { margin-top: 20px; }
.sa-block-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.sa-block-head h4 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 1.04rem; font-weight: 800; }
.sa-block-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sa-note { font-size: .86rem; color: var(--text-dim); margin: 0 0 10px; line-height: 1.55; max-width: 78ch; }
/* Unscoped step number badge (the sing-along module scopes its own copy). */
.sa-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 8px; flex: 0 0 auto;
  font-size: .8rem; font-weight: 800;
  background: rgba(53,194,255,.16); border: 1px solid rgba(53,194,255,.42); color: #cfeaff;
}
/* The cast card's "Sing with" voice select (injected by studio-singalong.js). */
.sa-vbv-sec .cb-sec-cast .sa-cast-voice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sa-vbv-sec .cb-sec-cast .sa-cast-voice label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.sa-vbv-sec .cb-sec-cast .sa-cast-voice select { width: auto; min-width: 168px; font-size: .85rem; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: #101319; color: var(--text); font-family: inherit; }
.sa-vbv-sec .cb-sec-cast .sa-cast-reg { font-size: .72rem; color: var(--text-dim); }

/* ============================================================================
   §247 — Step 3 record-mode switch (One take vs Verse-by-verse) + one-take UI
   ============================================================================ */
.sa-record-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 4px 0 16px;
}
.sa-mode-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s, transform .1s;
}
.sa-mode-btn:hover { border-color: var(--accent-2); }
.sa-mode-btn:active { transform: translateY(1px); }
.sa-mode-btn.is-on {
  border-color: var(--accent);
  background:
    radial-gradient(420px 120px at 0% -20%, rgba(255,107,53,.16), transparent 70%),
    var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(255,107,53,.35);
}
.sa-mode-ico { font-size: 1.5rem; line-height: 1; flex: 0 0 auto; }
.sa-mode-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sa-mode-body b { font-size: .95rem; font-weight: 800; }
.sa-mode-body small { font-size: .78rem; color: var(--text-dim); line-height: 1.35; }
.sa-mode-btn.is-on .sa-mode-body b { color: var(--accent); }

.sa-onetake {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    radial-gradient(700px 200px at 100% -30%, rgba(255,107,53,.08), transparent 60%),
    var(--panel);
}
.sa-onetake[hidden] { display: none; }
.sa-ot-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sa-ot-title { font-weight: 800; font-size: 1rem; }
.sa-ot-time { margin-left: auto; font-variant-numeric: tabular-nums; font-size: .85rem; }
.sa-ot-guide { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sa-ot-guide .cb-select { width: auto; min-width: 96px; }
.sa-ot-transport { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sa-ot-transport .rp-btn.primary.recording {
  border-color: var(--danger, #ff4d5e);
  background: rgba(255,77,94,.16);
  color: #ffd0d5;
  animation: cb-pulse 1s ease-in-out infinite;
}
.sa-ot-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent-3);
  font-size: .95rem;
  min-width: 56px;
}
.sa-ot-status {
  font-size: .86rem;
  color: var(--text-dim);
  line-height: 1.5;
  min-height: 1.2em;
}
.sa-ot-status.ok { color: var(--accent-3); }
.sa-ot-status.warn { color: #ffc440; }
.sa-ot-status.rec { color: #ff9a9a; }
.sa-ot-take {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #101319;
}
.sa-ot-take[hidden] { display: none; }
.sa-ot-take audio { flex: 1 1 260px; min-width: 0; height: 36px; }
.sa-ot-take-name { font-size: .82rem; }

/* [hidden] must win over the display rules above (this sheet loads late). */
.sa-vbv[hidden] { display: none; }

@media (max-width: 640px) {
  .sa-record-mode { grid-template-columns: 1fr; }
}
