#setupWizard {
  position: fixed;
  inset: 88px 16px auto auto;
  width: min(560px, calc(100vw - 32px));
  max-width: 100%;
  max-height: calc(100dvh - 104px);
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  color: #e6edf3;
  background: transparent;
}

#setupWizard::backdrop { background: rgba(2, 8, 18, 0.78); backdrop-filter: blur(5px); }

.setup-dialog {
  max-height: calc(100dvh - 104px);
  overflow: auto;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid #2f6a98;
  border-radius: 16px;
  background: linear-gradient(160deg, #0f2238, #09172a 74%);
  box-shadow: 0 20px 60px #000b;
}

.setup-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0; padding: 0 0 12px; border: 0; background: none; }
.setup-header h2 { margin: 0; color: #7cf3ff; font-size: clamp(20px, 4vw, 25px); }
.setup-eyebrow { margin: 0 0 5px; color: #829bb5; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.setup-intro { margin: 8px 0 18px; color: #b9cce0; line-height: 1.5; }
.setup-dialog h3 { margin: 10px 0 8px; color: #eff8ff; font-size: 18px; }
.setup-dialog button { border: 1px solid #2f6a98; border-radius: 8px; color: #eaf5ff; background: linear-gradient(#1a3f5e, #102a44); cursor: pointer; }
.setup-dialog button:hover:not(:disabled) { filter: brightness(1.15); }
.setup-dialog button:focus-visible, .setup-dialog select:focus-visible, .setup-dialog input:focus-visible { outline: 2px solid #7cf3ff; outline-offset: 2px; }
.setup-dialog button:disabled { cursor: not-allowed; opacity: .48; }
.setup-dialog .primary { color: #fff; font-weight: 700; background: linear-gradient(#2f7fd6, #163f7e); border-color: #5aa6e6; }
.setup-open { white-space: nowrap; }
#recPart { white-space: nowrap; }
#recPart.on { color: #fff; border-color: #ff8388; background: linear-gradient(#b82e3a, #761c27); }

.setup-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.setup-audio-stage[hidden] { display: none; }
.setup-choice {
  min-height: 124px;
  padding: 14px;
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 6px 10px;
  text-align: left;
}
.setup-choice-featured { grid-column: 1 / -1; min-height: 96px; border-color: #5aa6e6 !important; background: linear-gradient(145deg, #174a79, #102a44) !important; }
.setup-choice-icon { grid-row: 1 / span 2; font-size: 23px; }
.setup-choice strong { line-height: 1.35; }
.setup-choice small { color: #9bb0c7; font-size: 12px; line-height: 1.4; }
.setup-step[hidden] { display: none; }
.setup-back { padding: 5px 8px; margin-bottom: 2px; font-size: 12px; }
.setup-progress { display: grid; grid-template-columns: auto minmax(90px, 1fr); align-items: center; gap: 12px; margin: 8px 0 16px; color: #9bb0c7; font-size: 11px; font-weight: 700; }
.setup-progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: #04101e; }
.setup-progress-track span { display: block; width: 33.33%; height: 100%; border-radius: inherit; background: #7cf3ff; transition: width 160ms ease; }
.setup-guide { margin: 8px 0 12px; padding: 12px 14px; border: 1px solid #214466; border-left: 3px solid #7cf3ff; border-radius: 8px; color: #d6e5f5; background: #0a1a2c; line-height: 1.55; }
.setup-guide ol, .setup-guide ul { margin: 6px 0 0; padding-left: 21px; }
.setup-warning { margin: 10px 0; padding: 11px 13px; border: 1px solid #8d6b23; border-radius: 8px; color: #f5e6bd; background: #2c2415; line-height: 1.5; }
.setup-signal-path { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 14px 0; color: #7cf3ff; font-size: 16px; font-weight: 700; }
.setup-signal-path div { min-width: 120px; display: grid; gap: 3px; padding: 10px 12px; border: 1px solid #2f6a98; border-radius: 9px; color: #eaf5ff; background: #0a1a2c; text-align: center; }
.setup-signal-path small { color: #9bb0c7; font-size: 11px; font-weight: 500; }
.setup-input-controls { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 8px; margin: 12px 0 4px; }
.setup-input-controls label { color: #b9cce0; font-weight: 600; }
.setup-dialog select { min-width: 0; padding: 8px 10px; border: 1px solid #2f6a98; border-radius: 7px; color: #eaf5ff; background: #09172a; }
.setup-input-controls button { padding: 8px 10px; }
.setup-help { margin: 8px 0 12px; color: #9bb0c7; font-size: 12px; line-height: 1.5; }
.setup-test-row { display: flex; flex-wrap: wrap; gap: 8px; }
.setup-test-row button, .setup-actions button { padding: 8px 11px; }
.setup-meter-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: center; gap: 10px; margin: 12px 0 7px; }
.setup-meter { height: 14px; overflow: hidden; border: 1px solid #31536f; border-radius: 99px; background: #030914; }
.setup-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #35d07f 0 60%, #f0cf4c 78%, #ef655c 100%); transition: width 75ms linear; }
#setupMeterText { min-width: 150px; color: #a9c8e6; font-size: 12px; font-variant-numeric: tabular-nums; }
.setup-confirm { display: flex; align-items: flex-start; gap: 8px; color: #d6e5f5; font-size: 13px; line-height: 1.4; }
.setup-confirm input { margin-top: 2px; accent-color: #39a0ff; }
.setup-take-name { display: grid; gap: 6px; margin: 10px 0 13px; color: #d6e5f5; font-size: 13px; font-weight: 700; }
.setup-take-name input { width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid #2f6a98; border-radius: 7px; color: #eaf5ff; background: #09172a; font: inherit; font-weight: 500; }
.setup-take-name small { color: #9bb0c7; font-size: 11px; font-weight: 400; line-height: 1.45; }
.setup-troubleshooting { margin: 10px 0; padding: 10px 12px; border-radius: 8px; color: #f5e6bd; background: #2c2415; font-size: 12px; line-height: 1.5; }
.setup-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 15px; }
.setup-status { min-height: 18px; margin: 8px 0 0; color: #7cf3ff; font-size: 12px; line-height: 1.45; }
.setup-device-list { margin: 11px 0; padding: 11px 13px; border: 1px solid #214466; border-radius: 8px; color: #cfe1f3; background: #0a1a2c; font-size: 13px; line-height: 1.55; }
.setup-device-list ul { margin: 4px 0 0; padding-left: 20px; }
.setup-footer { margin: 17px 0 0; padding-top: 12px; border-top: 1px solid #193956; color: #8198b0; font-size: 11px; line-height: 1.5; }

@media (max-width: 560px) {
  #setupWizard { inset: 70px 8px 8px; width: auto; max-height: none; }
  .setup-dialog { height: 100%; max-height: none; }
  .setup-choice-grid { grid-template-columns: 1fr; }
  .setup-choice { min-height: auto; }
  .setup-input-controls { grid-template-columns: 1fr; }
  .setup-input-controls button { justify-self: start; }
  .setup-meter-row { grid-template-columns: 1fr; }
  #setupMeterText { min-width: 0; }
  .setup-signal-path { gap: 5px; font-size: 12px; }
  .setup-signal-path div { min-width: 88px; padding: 8px; }
}
