.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(12, 13, 16, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.modal-title {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.modal-footer {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-raised);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
}

.bind-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.bind-category-btn {
  padding: var(--space-md);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  transition: all var(--transition-fast);
}

.bind-category-btn:hover {
  border-color: var(--border-highlight);
  background: var(--bg-surface-active);
}

.bind-category-btn.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.bind-category-title {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-primary);
}

.bind-category-desc {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.bind-options-pane {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.wizard-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) 0;
  text-align: center;
}

.wizard-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  border: 2px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: var(--space-lg);
  position: relative;
}

.wizard-icon-wrap.pulsing::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  opacity: 0.8;
  animation: pulseRipple 1.5s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes pulseRipple {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.wizard-title {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.wizard-instruction {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.5;
  margin-bottom: var(--space-lg);
}

.wizard-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  width: 0%;
}

.wizard-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  margin-top: var(--space-md);
}

.wizard-status-badge.in-progress {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.wizard-status-badge.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.wizard-status-badge.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.firmware-log {
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

.firmware-pick {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  color: var(--warning);
  font-size: var(--font-xs);
}
