/* Пошаговый импорт и обработка документа. */
.document-wizard-overlay {
  --step-done: var(--green);
  --step-active: var(--accent);
  --step-pending: var(--bg-muted);
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: auto;
  background: var(--bg-canvas);
  color: var(--text-primary);
}

.document-wizard-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 130;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: 0 1px 0 var(--border-subtle), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.wizard-nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: 24px;
  color: var(--text-primary);
  text-decoration: none;
}

.wizard-nav-logo-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, #0d9488, #0891b2);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.wizard-nav-logo-text {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.wizard-ws-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-right: 10px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
}

.wizard-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.wizard-nav-link {
  border: 0;
  padding: 6px 14px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 450;
  font-family: inherit;
  cursor: pointer;
}

.wizard-nav-link:hover {
  background: rgba(33, 38, 45, 0.55);
  color: var(--text-secondary);
}

.wizard-nav-link.active {
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-weight: 550;
}

.wizard-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.wizard-mobile-nav {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 140;
  display: none;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.wizard-mobile-nav button {
  width: 100%;
  display: block;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.wizard-mobile-nav button:hover,
.wizard-mobile-nav button.active {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.document-wizard-shell {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  padding-top: 116px;
  padding-bottom: 96px;
}

.progress-strip {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 120;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: 0 1px 0 var(--border-subtle), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.back-to-catalog-btn,
.progress-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.back-to-catalog-btn {
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.back-to-catalog-btn:hover,
.progress-close:hover {
  border-color: var(--bg-muted);
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.progress-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.progress-label {
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.progress-bar-wrap {
  flex: 1;
  min-width: 80px;
  height: 4px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-muted);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), #7c3aed);
  transition: width 0.4s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c3aed;
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 8px rgba(124, 58, 237, 0.6);
  transform: translateY(-50%);
}

.progress-pct {
  min-width: 34px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.progress-close {
  width: 28px;
  height: 28px;
}

.wizard-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 36px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 40px 140px;
  animation: page-enter 0.18s ease-out both;
}

.step-sidebar {
  position: sticky;
  top: 136px;
  width: 248px;
  flex: 0 0 248px;
}

.step-sidebar-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
}

.step-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.step-sidebar-logo-mark {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.step-sidebar-brand {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.step-sidebar-brand span {
  color: var(--text-muted);
  font-weight: 400;
}

.step-sidebar-body {
  padding: 18px 14px 14px;
}

.step-sidebar-section-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0 4px;
  margin-bottom: 14px;
}

.steps-list {
  display: flex;
  flex-direction: column;
  position: relative;
}

.steps-list::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 32px;
  bottom: 40px;
  width: 1px;
  background: var(--border);
  z-index: 0;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}

.step-item:hover {
  background: var(--bg-overlay);
}

.step-item.pending:hover {
  background: rgba(33, 38, 45, 0.6);
}

.step-item.active {
  border-color: rgba(13, 148, 136, 0.2);
  background: var(--accent-glow);
}

.step-item.done {
  color: var(--text-primary);
}

.step-indicator {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--step-pending);
  background: var(--bg-overlay);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  position: relative;
  z-index: 2;
  transition: all 0.2s;
}

.step-item.done .step-indicator {
  border-color: var(--step-done);
  background: var(--step-done);
  color: var(--bg-canvas);
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.15);
}

.step-item.active .step-indicator {
  border-color: var(--step-active);
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.step-item.pending .step-indicator {
  border-color: var(--step-pending);
  background: var(--bg-overlay);
  color: var(--text-muted);
}

.step-item.done .step-name {
  color: var(--text-primary);
}

.step-item.active .step-name {
  color: var(--accent-bright);
  font-weight: 600;
}

.step-item.pending .step-name {
  color: var(--text-muted);
}

.step-item.done .step-status-text {
  color: var(--step-done);
}

.step-item.active .step-status-text {
  color: var(--accent);
}

.step-item.pending .step-status-text {
  color: var(--text-muted);
}

.step-item.done .step-indicator {
  color: #fff;
}

.step-content {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
}

.step-number {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  margin-bottom: 1px;
}

.step-name {
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-status-text {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.sidebar-help {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-overlay);
}

.sidebar-help-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.sidebar-help-text {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.wizard-main {
  flex: 1;
  min-width: 0;
}

.step-pane {
  display: grid;
  gap: 20px;
}

.document-file-step {
  --document-file-step-width: 680px;
}

.document-file-step .step-panel-header,
.document-file-step .document-upload-zone,
.document-file-step .info-callout {
  width: 100%;
  max-width: var(--document-file-step-width);
}

.step-panel-header {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}

.step-panel-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-bright);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.step-panel-eyebrow-line {
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
}

.step-panel-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.2;
}

.step-panel-subtitle {
  max-width: 580px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.document-upload-zone {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-height: 210px;
  padding: 24px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  overflow: hidden;
  transition: all 0.18s ease;
}

.document-upload-zone:hover,
.document-upload-zone.has-file {
  border-color: var(--accent);
  background: rgba(13, 148, 136, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(13, 148, 136, 0.15);
}

.document-upload-zone.has-file {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow:
    0 0 0 1px var(--accent),
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(13, 148, 136, 0.12);
}

.document-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.document-upload-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.document-upload-check svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.document-upload-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 10px;
  background: rgba(88, 166, 255, 0.12);
  transition: all 0.18s;
  flex: 0 0 44px;
}

.document-upload-content {
  display: grid;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.document-upload-name {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.document-upload-tagline {
  max-width: 460px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.document-upload-zone.has-file .document-upload-tagline {
  color: var(--accent-bright);
}

.document-upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.document-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.document-upload-button:hover {
  border-color: var(--blue);
  background: rgba(88, 166, 255, 0.16);
  color: #8cc8ff;
}

.document-upload-drop-hint {
  color: var(--text-muted);
  font-size: 12px;
}

.document-upload-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.document-upload-tag {
  padding: 2px 8px;
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 4px;
  background: rgba(88, 166, 255, 0.1);
  color: #58a6ff;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.config-card,
.info-callout {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.config-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.config-card-header-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
}

.config-card-title {
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 800;
}

.config-card-subtitle {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.config-card-optional {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-required {
  color: var(--red);
}

.config-card-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-group {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.form-label {
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
}

.form-input,
.form-select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-overlay);
  color: var(--text-primary);
  padding: 0 11px;
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-hint {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.info-callout {
  display: flex;
  gap: 12px;
  padding: 14px;
  color: var(--text-secondary);
}

.info-callout-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--accent);
  margin-top: 1px;
}

.info-callout-body {
  display: grid;
  gap: 4px;
}

.info-callout-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.info-callout-text {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.pipeline-error-callout {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--red-border);
  border-radius: 6px;
  background: var(--red-bg);
  color: var(--text-primary);
}

.pipeline-error-callout strong {
  color: var(--red);
  font-size: 13px;
}

.pipeline-error-callout span {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.btn,
.btn-save-draft,
.btn-primary-sm,
.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
}

.btn-back,
.btn-save-draft,
.btn-ghost-sm {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.btn-continue,
.btn-primary-sm {
  border: 1px solid rgba(13, 148, 136, 0.7);
  background: var(--accent);
  color: #fff;
}

.btn-primary-sm,
.btn-ghost-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
}

.btn-save-draft {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-back:hover,
.btn-save-draft:hover,
.btn-ghost-sm:hover {
  border-color: var(--bg-muted);
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.btn-continue:hover,
.btn-primary-sm:hover {
  filter: brightness(1.08);
}

.btn:disabled,
.btn-primary-sm:disabled,
.btn-ghost-sm:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(48, 54, 61, 0.7);
  background: rgba(13, 17, 23, 0.82);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.03),
    0 -8px 32px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.action-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1100px;
  min-height: 52px;
  margin: 0 auto;
  padding: 0 40px;
}

.action-bar-spacer {
  flex: 1;
}

.step-counter {
  color: var(--text-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.step-counter strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.btn {
  min-height: 38px;
  padding: 9px 18px;
  border: none;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
}

.btn-back {
  border: 1px solid var(--border);
  background: var(--bg-overlay);
  color: var(--text-secondary);
}

.btn-back:hover {
  border-color: var(--bg-muted);
  background: var(--bg-muted);
  color: var(--text-primary);
}

.btn-back:disabled,
.btn-back:disabled:hover {
  border-color: var(--border);
  background: var(--bg-overlay);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.35;
}

.btn-save-draft {
  min-height: 38px;
  padding: 9px 12px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}

.btn-save-draft:hover {
  background: rgba(33, 38, 45, 0.6);
  color: var(--text-secondary);
}

.btn-continue {
  padding: 10px 24px;
  border: 1px solid var(--accent-dim);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 1px 4px rgba(13, 148, 136, 0.4);
}

.btn-continue:hover {
  border-color: transparent;
  background: var(--accent-dim);
  box-shadow:
    0 2px 10px rgba(13, 148, 136, 0.5),
    0 0 0 3px var(--accent-ring);
  filter: none;
  transform: translateY(-1px);
}

.btn-continue:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(13, 148, 136, 0.3);
}

.btn-continue:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.document-wizard-file-summary,
.document-wizard-metric {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-overlay);
}

.document-wizard-file-summary span,
.document-wizard-metric span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document-wizard-file-summary strong,
.document-wizard-metric strong {
  color: var(--text-primary);
}

.document-wizard-file-summary small {
  color: var(--text-muted);
}

.document-source-card {
  width: 100%;
}

.document-source-metadata {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.document-wizard-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.document-wizard-query-row {
  grid-template-columns: minmax(0, 1fr) 180px;
}

.wizard-inspector-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  justify-content: flex-end;
  padding: 76px 24px 24px;
  background: rgba(1, 4, 9, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.wizard-inspector-panel {
  width: min(760px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.wizard-inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(13, 148, 136, 0.09), rgba(88, 166, 255, 0.04)),
    var(--bg-surface);
}

.wizard-inspector-header h2 {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.25;
}

.wizard-inspector-header small {
  display: block;
  max-width: 620px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.wizard-inspector-kicker {
  color: var(--accent-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wizard-inspector-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-overlay);
  color: var(--text-muted);
  cursor: pointer;
}

.wizard-inspector-close:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.wizard-inspector-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 18px 20px 22px;
}

.wizard-json-viewer {
  max-height: none;
  min-height: 420px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0b1118;
}

.wizard-chunks-list {
  display: grid;
  gap: 12px;
}

.wizard-inspector-panel .chunk-item {
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--bg-overlay);
}

.wizard-inspector-panel .chunk-item p {
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .document-wizard-navbar {
    padding: 0 16px;
  }

  .wizard-nav-links {
    display: none;
  }

  .wizard-mobile-nav {
    display: block;
  }

  .wizard-nav-logo {
    margin-right: 12px;
  }

  .progress-strip {
    padding: 0 16px;
    gap: 12px;
  }

  .wizard-body {
    display: grid;
    padding: 24px 16px 120px;
  }

  .step-sidebar {
    position: static;
    width: auto;
    flex-basis: auto;
  }

  .step-sidebar-card {
    border-radius: 10px;
  }

  .step-sidebar-header {
    padding: 14px 16px 12px;
  }

  .steps-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .steps-list::before {
    display: block;
    left: calc((100% - 32px) / 10);
    right: calc((100% - 32px) / 10);
    top: 27px;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .step-item {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 8px;
    min-height: 96px;
    padding: 10px 6px 9px;
    text-align: center;
  }

  .sidebar-help {
    display: none;
  }

  .step-content {
    width: 100%;
    padding-top: 0;
  }

  .step-number {
    margin-bottom: 3px;
    font-size: 9.5px;
  }

  .step-name {
    font-size: 11px;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    min-height: 28px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25;
  }

  .step-status-text {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.2;
  }

  .document-upload-zone {
    max-width: none;
    min-height: 180px;
  }

  .document-wizard-review-grid,
  .document-source-metadata,
  .form-row,
  .document-wizard-query-row {
    grid-template-columns: 1fr;
  }

  .wizard-inspector-backdrop {
    padding: 64px 12px 12px;
  }

  .wizard-inspector-panel {
    width: 100%;
  }

  .action-bar-inner {
    padding: 0 16px;
  }
}

@media (max-width: 560px) {
  .wizard-ws-switcher {
    display: none;
  }

  .progress-label,
  .progress-pct,
  .btn-save-draft,
  .step-counter {
    display: none;
  }

  .step-panel-title {
    font-size: 24px;
  }

  .step-item {
    min-height: 88px;
    padding: 9px 4px 8px;
  }

  .step-number {
    font-size: 9px;
  }

  .step-name {
    font-size: 10px;
  }

  .step-status-text {
    font-size: 9.5px;
  }

  .config-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-upload-zone {
    flex-direction: column;
    padding: 18px;
  }

  .document-upload-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .document-upload-button {
    justify-content: center;
    width: 100%;
  }
}
