/* Swagg Brown controller tools (Test My Controller). Dark / gold, matches the studio's controller modals. Prefix: sbct- */
.sbct-modal {
  --sbct-gold: #c4a35a;
  --sbct-ink: #f3ebe0;
  --sbct-muted: rgba(243, 235, 224, 0.68);
  --sbct-line: rgba(255, 255, 255, 0.12);
  --sbct-card: rgba(255, 255, 255, 0.05);
  --sbct-focus: #8ec8ff;
  --sbct-bad: #ff9b8f;
  --sbct-ok: #8fe3a7;
  --sbct-warn: #f0c36b;
  position: fixed; inset: 0; z-index: 10070; display: flex; align-items: center; justify-content: center; padding: 16px;
  color: var(--sbct-ink); font-size: 15px; line-height: 1.45;
}
.sbct-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.66); }
.sbct-modal__panel {
  position: relative; width: min(640px, 100%); max-height: min(90vh, 920px); overflow: auto;
  background: #17141a; border: 1px solid var(--sbct-line); border-radius: 14px; padding: 16px 18px 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; gap: 10px;
}
.sbct-modal__panel:focus { outline: none; }
.sbct-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sbct-title { font-size: 1.12rem; margin: 0; color: var(--sbct-gold); letter-spacing: 0.02em; }
.sbct-sub { margin: 2px 0 0; color: var(--sbct-muted); font-size: 0.88rem; }
.sbct-body { display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.sbct-lead { margin: 0; }
.sbct-list { margin: 0 0 0 18px; padding: 0; color: var(--sbct-muted); font-size: 0.92rem; }
.sbct-meta { margin: 0; color: var(--sbct-muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
.sbct-prompt { margin: 0; font-size: 1.45rem; line-height: 1.25; color: #fff; }
.sbct-label { margin: 0; color: var(--sbct-muted); font-size: 0.9rem; }
.sbct-phase { margin: 0; font-size: 1.1rem; color: var(--sbct-gold); min-height: 1.4em; }
.sbct-phase:empty { display: none; }
.sbct-hint, .sbct-expect { margin: 0; color: var(--sbct-muted); font-size: 0.86rem; }
.sbct-progress { height: 6px; border-radius: 999px; background: var(--sbct-card); overflow: hidden; }
.sbct-progress > span { display: block; height: 100%; background: var(--sbct-gold); transition: width 0.2s ease; }
.sbct-result { margin: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--sbct-line); background: var(--sbct-card); font-weight: 600; }
.sbct-result--pass { border-color: rgba(143, 227, 167, 0.55); color: var(--sbct-ok); }
.sbct-result--wrong_input { border-color: rgba(255, 155, 143, 0.55); color: var(--sbct-bad); }
.sbct-result--timeout { border-color: rgba(240, 195, 107, 0.55); color: var(--sbct-warn); }
.sbct-result--skipped { color: var(--sbct-muted); }
.sbct-live { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-top: 1px solid var(--sbct-line); font-size: 0.82rem; color: var(--sbct-muted); }
.sbct-live__label { white-space: nowrap; }
.sbct-live__msg { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--sbct-ink); overflow-wrap: anywhere; }
.sbct-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 4px; }
.sbct-btn {
  font: inherit; font-size: 0.92rem; cursor: pointer; border-radius: 10px; padding: 8px 14px; min-height: 40px;
  border: 1px solid var(--sbct-line); background: rgba(255, 255, 255, 0.06); color: var(--sbct-ink);
}
.sbct-btn:hover:not([disabled]) { border-color: rgba(255, 255, 255, 0.28); }
.sbct-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.sbct-btn--gold { background: var(--sbct-gold); border-color: var(--sbct-gold); color: #17141a; font-weight: 700; }
.sbct-btn--gold:hover:not([disabled]) { filter: brightness(1.06); }
.sbct-btn--icon { min-height: 34px; padding: 2px 10px; font-size: 1.3rem; line-height: 1; }
.sbct-btn:focus-visible, .sbct-details summary:focus-visible { outline: 2px solid var(--sbct-focus); outline-offset: 2px; }
.sbct-error { margin: 0; color: var(--sbct-bad); }
.sbct-msg { margin: 0; min-height: 1.2em; color: var(--sbct-muted); font-size: 0.9rem; }
.sbct-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.sbct-badge { display: inline-block; font-size: 0.75rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--sbct-line); color: var(--sbct-muted); white-space: nowrap; }
.sbct-badge--pass { color: var(--sbct-ok); border-color: rgba(143, 227, 167, 0.5); }
.sbct-badge--wrong_input { color: var(--sbct-bad); border-color: rgba(255, 155, 143, 0.5); }
.sbct-badge--timeout { color: var(--sbct-warn); border-color: rgba(240, 195, 107, 0.5); }
.sbct-tablewrap { overflow: auto; max-height: 40vh; border: 1px solid var(--sbct-line); border-radius: 8px; }
.sbct-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.sbct-table th, .sbct-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--sbct-line); vertical-align: top; }
.sbct-table th { position: sticky; top: 0; background: #1d1a21; color: var(--sbct-muted); font-weight: 600; }
.sbct-table code { font-size: 0.8rem; }
.sbct-details summary { cursor: pointer; color: var(--sbct-muted); font-size: 0.88rem; }
.sbct-pre { margin: 6px 0 0; max-height: 30vh; overflow: auto; padding: 8px; background: rgba(0, 0, 0, 0.35); border-radius: 8px; font-size: 0.78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .sbct-modal { padding: 8px; }
  .sbct-prompt { font-size: 1.2rem; }
  .sbct-actions { justify-content: stretch; }
  .sbct-actions .sbct-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sbct-progress > span { transition: none; }
}

/* ---- Round 2: mapping workflows (My Mapping, Save Controller Mapping, Audio Setup, Report Issue).
 * Prefix: sbmw- (modals reuse .sbct-modal). Same dark / gold palette. ---------------------------------- */
/* Stacking: these open from the DJ Controllers modal (.ctrl-modal, z-index 12000) and must sit above it
 * (Jog Calibration stays on top at 16000). */
.sbct-modal { z-index: 12100; }
.sbmw-modal { z-index: 12200; }
.sbmw-modal [hidden] { display: none !important; }
.sbmw-panel { gap: 12px; }
.sbmw-panel--wide { width: min(940px, 100%); }
.sbmw-body { display: flex; flex-direction: column; gap: 10px; }
.sbmw-form { display: flex; flex-direction: column; gap: 12px; }
.sbmw-field { display: flex; flex-direction: column; gap: 4px; border: 0; padding: 0; margin: 0; min-width: 0; }
.sbmw-field > span, .sbmw-field > legend { font-size: 0.85rem; color: var(--sbct-muted); }
.sbmw-input, .sbmw-field input:not([type="radio"]):not([type="checkbox"]), .sbmw-field select, .sbmw-field textarea {
  background: rgba(255, 255, 255, 0.06); color: var(--sbct-ink); border: 1px solid var(--sbct-line); border-radius: 8px;
  padding: 8px 10px; font: inherit; min-width: 0; width: 100%; box-sizing: border-box;
}
.sbmw-input:focus, .sbmw-field input:focus, .sbmw-field select:focus, .sbmw-field textarea:focus { outline: 2px solid var(--sbct-focus); outline-offset: 2px; }
.sbmw-check, .sbmw-radio { display: flex; gap: 8px; align-items: flex-start; font-size: 0.92rem; }
.sbmw-radio { padding: 8px 10px; border: 1px solid var(--sbct-line); border-radius: 10px; background: var(--sbct-card); }
.sbmw-radio small { display: block; color: var(--sbct-muted); font-weight: normal; }
.sbmw-radio.is-disabled { opacity: 0.6; }
.sbmw-where { gap: 8px; }
.sbmw-muted { margin: 0; color: var(--sbct-muted); font-size: 0.88rem; }
.sbmw-note { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(196, 163, 90, 0.12); border: 1px solid rgba(196, 163, 90, 0.35); font-size: 0.9rem; }
.sbmw-good { margin: 0; color: var(--sbct-ok); }
.sbmw-errors { display: flex; flex-direction: column; gap: 4px; }
.sbmw-list { margin: 4px 0 0 18px; padding: 0; font-size: 0.9rem; }
.sbmw-result { margin: 0; min-height: 1.2em; }
.sbmw-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sbmw-toolbar .sbmw-input { flex: 1 1 240px; width: auto; }
.sbmw-groups { display: flex; flex-direction: column; gap: 6px; }
.sbmw-group { border: 1px solid var(--sbct-line); border-radius: 10px; background: var(--sbct-card); }
.sbmw-group > summary { cursor: pointer; padding: 8px 12px; font-weight: 600; color: var(--sbct-gold); list-style-position: inside; }
.sbmw-group > summary:focus-visible { outline: 2px solid var(--sbct-focus); outline-offset: 2px; }
.sbmw-count { font-weight: normal; color: var(--sbct-muted); font-size: 0.82rem; margin-left: 6px; }
.sbmw-section { padding: 0 10px 8px; }
.sbmw-section > h4 { margin: 8px 2px 4px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sbct-muted); }
.sbmw-row {
  display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(160px, 1.4fr) auto; gap: 6px 10px; align-items: center;
  padding: 6px 4px; border-top: 1px solid var(--sbct-line); font-size: 0.9rem;
}
.sbmw-row__btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sbmw-kind { color: var(--sbct-muted); font-size: 0.72rem; margin-left: 4px; }
.sbmw-mini { min-height: 30px; padding: 3px 9px; font-size: 0.8rem; }
.sbmw-jognote { font-size: 0.8rem; }
.sbmw-rule { margin-top: 4px; font-size: 0.85rem; color: var(--sbct-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sbmw-tag { display: inline-block; font-size: 0.7rem; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--sbct-line); margin-left: 4px; }
.sbmw-tag--changed { color: var(--sbct-gold); border-color: rgba(196, 163, 90, 0.6); }
.sbmw-tag--added { color: var(--sbct-ok); border-color: rgba(143, 227, 167, 0.5); }
.sbmw-tag--cleared { color: var(--sbct-bad); border-color: rgba(255, 155, 143, 0.5); }
.sbmw-editor { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 10px; padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(196, 163, 90, 0.35); }
.sbmw-editor[hidden] { display: none; }
.sbmw-editor .sbct-actions, .sbmw-editor .sbct-error, .sbmw-editor .sbmw-params { grid-column: 1 / -1; }
.sbmw-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 10px; }
.sbmw-review { border-top: 1px solid var(--sbct-line); padding-top: 8px; }
.sbmw-review h4 { margin: 0 0 6px; color: var(--sbct-gold); }
.sbmw-footer { position: sticky; bottom: -14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 0 4px; background: #17141a; border-top: 1px solid var(--sbct-line); }
.sbmw-footer .sbct-actions { margin-top: 0; }
.sbmw-toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 12300; max-width: min(640px, calc(100vw - 24px));
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px;
  background: #211d26; border: 1px solid #c4a35a; color: #f3ebe0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 0.92rem;
}
.sbmw-toast__actions { display: flex; gap: 4px; flex-wrap: wrap; }
.sbmw-toast .sbct-btn { min-height: 32px; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.06); color: #f3ebe0; border-radius: 10px; font: inherit; cursor: pointer; }
/* The controller screen (controller-ui.js, ctrl-* from the studio stylesheet) */
.ctrl-live__summary { line-height: 1.6; }
.ctrl-live__actions { flex-wrap: wrap; }
.ctrl-live__list { margin: 4px 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ctrl-live__list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) {
  .sbmw-row { grid-template-columns: 1fr; }
  .sbmw-row__btns { justify-content: flex-start; }
  .sbmw-footer { position: static; }
}
