/* Rule mappings — layout aligned with auto-templating editor */

html,
body.mapping-app {
  height: 100%;
  overflow: hidden;
}

.mapping-app {
  --surface-canvas: #e2e8f0;
  --shadow-viewer: 0 8px 32px rgba(15, 23, 42, 0.12);
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg, #f1f5f9);
}

/* Nav chrome: see pipeline.css body.rules-app / .mapping-body */

.mapping-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* —— Toolbar (editor-top style) —— */
.mapping-toolbar {
  flex-shrink: 0;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  z-index: 10;
}

.mapping-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 16px;
}

.mapping-toolbar-row + .mapping-toolbar-row {
  border-top: 1px solid var(--border, #e2e8f0);
  padding-top: 10px;
  padding-bottom: 12px;
  background: var(--surface-subtle, #f8fafc);
}

.mapping-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
  flex: 1;
}

.mapping-title-text {
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text, #0f172a);
}

.mapping-run-chip {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  color: var(--text-muted, #64748b);
  max-width: min(360px, 45vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-run-chip code {
  font-size: 0.7rem;
  color: var(--text, #0f172a);
}

.mapping-tool-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#toolbar-actions {
  gap: 10px;
}

#toolbar-actions .mapping-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}

#toolbar-actions .mapping-link:hover {
  text-decoration: none;
  border-color: rgba(19, 99, 223, 0.35);
  background: var(--accent-soft, #e8f1ff);
}

#toolbar-actions .mapping-link-danger {
  margin-left: 2px;
  padding-left: 14px;
  border-color: rgba(185, 28, 28, 0.22);
  background: #fef2f2;
  position: relative;
}

#toolbar-actions .mapping-link-danger::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: var(--border-strong, #cbd5e1);
}

#toolbar-actions .mapping-link-danger:hover {
  border-color: rgba(185, 28, 28, 0.4);
  background: #fee2e2;
  color: #991b1b;
}

#toolbar-actions > .btn-editor {
  margin-left: 6px;
  position: relative;
}

#toolbar-actions > .btn-editor::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 22px;
  background: var(--border-strong, #cbd5e1);
}

#toolbar-actions > .btn-editor ~ .btn-editor {
  margin-left: 0;
}

#toolbar-actions > .btn-editor ~ .btn-editor::before {
  display: none;
}

button.mapping-link {
  line-height: 1.25;
}

.mapping-toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-strong, #cbd5e1);
  margin: 0 4px;
  flex-shrink: 0;
}

.mapping-app .btn-editor {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}

.mapping-app .btn-editor:active:not(:disabled) {
  transform: scale(0.98);
}

.mapping-app .btn-editor:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mapping-app .btn-editor.primary {
  background: var(--accent, #1363df);
  color: #fff;
}

.mapping-app .btn-editor.primary:hover:not(:disabled) {
  background: var(--accent-hover, #0f55bf);
}

.mapping-app .btn-editor.secondary {
  background: var(--surface, #fff);
  color: #475569;
  border: 1px solid var(--border-strong, #cbd5e1);
}

.mapping-app .btn-editor.secondary:hover:not(:disabled) {
  background: var(--surface-subtle, #f8fafc);
  border-color: var(--text-muted, #64748b);
}

.mapping-app .tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  font-variant-numeric: tabular-nums;
}

.mapping-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent, #1363df);
  text-decoration: none;
}

.mapping-link:hover {
  text-decoration: underline;
}

button.mapping-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.mapping-link-danger {
  color: #b91c1c;
}

.mapping-link-danger:hover {
  color: #991b1b;
}

.mapping-sidebar-views {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.mapping-view-tab {
  flex: 1;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface-subtle, #f8fafc);
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}

.mapping-view-tab:hover {
  color: var(--text, #0f172a);
  border-color: var(--border-strong, #cbd5e1);
}

.mapping-view-tab.is-active {
  color: var(--accent, #1363df);
  border-color: rgba(19, 99, 223, 0.35);
  background: var(--accent-soft, #e8f1ff);
}

.mapping-viewer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 48px 24px;
  text-align: center;
}

.mapping-viewer-empty[hidden] {
  display: none !important;
}

.mapping-viewer-empty-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text, #0f172a);
}

.mapping-viewer-pdf-only-note {
  margin: 0 0 10px;
  padding: 10px 14px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
}

.mapping-viewer-pdf-only-note[hidden] {
  display: none;
}

.mapping-viewer-empty-hint {
  margin: 0;
  max-width: 36ch;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted, #64748b);
}

.mapping-rules-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mapping-rules-panel[hidden] {
  display: none !important;
}

#sidebar-view-mappings[hidden] {
  display: none !important;
}

.mapping-rule-rows {
  max-height: none;
}

.mapping-rule-rows .run-rule-textarea {
  font-size: 0.8125rem;
  min-height: 2.5rem;
  field-sizing: content;
}

.mapping-map-select {
  min-width: 140px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.8125rem;
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
}

.mapping-map-select:focus {
  outline: none;
  border-color: var(--accent, #1363df);
  box-shadow: 0 0 0 3px var(--accent-soft, #e8f1ff);
}

/* —— Main workspace —— */
.mapping-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
}

.mapping-runs-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface, #fff);
  border-right: 1px solid var(--border, #e2e8f0);
}

.mapping-runs-label {
  flex-shrink: 0;
  padding: 14px 14px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}

.mapping-runs-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 14px;
}

.mapping-runs-scroll .run-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mapping-runs-scroll .run-list-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text, #0f172a);
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.mapping-runs-scroll .run-list-item:hover {
  background: var(--surface-subtle, #f8fafc);
}

.mapping-runs-scroll .run-list-item.is-active {
  background: var(--accent-soft, #e8f1ff);
  border-color: rgba(19, 99, 223, 0.25);
}

.mapping-runs-scroll .run-item-title {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.35;
  word-break: break-word;
  margin-bottom: 4px;
}

.mapping-runs-scroll .run-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  line-height: 1.35;
}

.mapping-runs-scroll .run-item-field-aliases {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent, #2563eb);
  text-decoration: none;
}

.mapping-runs-scroll .run-item-field-aliases:hover {
  text-decoration: underline;
}

.mapping-runs-empty {
  padding: 16px 8px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted, #64748b);
}

/* Center: viewer or placeholder */
.mapping-center {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mapping-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(300px, 400px);
  overflow: hidden;
}

.mapping-stage[hidden] {
  display: none !important;
}

.mapping-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface-canvas, #e2e8f0);
  background-image: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.06) 1px, transparent 0);
  background-size: 20px 20px;
}

.mapping-placeholder[hidden] {
  display: none !important;
}

.mapping-placeholder-icon {
  font-size: 1.5rem;
  color: var(--accent, #1363df);
  opacity: 0.35;
  margin-bottom: 12px;
}

.mapping-placeholder-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text, #0f172a);
}

.mapping-placeholder-hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
  max-width: 28ch;
  line-height: 1.5;
}

/* Viewer (matches templating editor) */
.mapping-viewer-wrap {
  overflow: auto;
  min-height: 0;
  background: var(--surface-canvas, #e2e8f0);
  background-image: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.06) 1px, transparent 0);
  background-size: 20px 20px;
  padding: 24px 20px;
  border-right: 1px solid var(--border, #e2e8f0);
}

.mapping-viewer {
  position: relative;
  margin: 0 auto;
  width: fit-content;
  box-shadow: var(--shadow-viewer);
  background: #fff;
  border-radius: 4px;
}

.mapping-viewer #page-image {
  display: block;
  max-width: none;
  background: #fff;
  user-select: none;
  border-radius: 4px;
}

.mapping-viewer #bbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.mapping-viewer #bbox-overlay .bbox {
  pointer-events: auto;
}

/* Right sidebar */
.mapping-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface, #fff);
  overflow: hidden;
}

.mapping-sidebar-panels {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 18px 24px;
}

.mapping-sidebar-rule-picker {
  margin-bottom: 18px;
}

.mapping-sidebar-rule-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  margin-bottom: 6px;
}

.mapping-sidebar-rule-select {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

.mapping-panel-heading {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
}

.mapping-panel-lead {
  margin: 0 0 14px;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
}

.mapping-field-row {
  margin-bottom: 14px;
}

.mapping-field-row label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  margin-bottom: 6px;
}

.mapping-field-row select,
.mapping-field-row textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.mapping-field-row select:focus,
.mapping-field-row textarea:focus {
  outline: none;
  border-color: var(--accent, #1363df);
  box-shadow: 0 0 0 3px var(--accent-soft, #e8f1ff);
}

#rule-select {
  width: 100%;
}

.map-rule-full {
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface-subtle, #f8fafc);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 4.5rem;
  max-height: 10rem;
  overflow-y: auto;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text, #0f172a);
  white-space: pre-wrap;
  word-break: break-word;
}

.mapping-sophia-check {
  margin-top: 4px;
}

.mapping-sophia-template-line {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted, #64748b);
}

.mapping-sophia-template-line code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  color: var(--text, #0f172a);
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 4px;
  padding: 1px 6px;
}

#check-type-select,
#check-data-type-select {
  width: 100%;
}

.mapping-sophia-export-name {
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.mapping-sophia-export-input {
  box-sizing: border-box;
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--text, #0f172a);
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
}

.mapping-sophia-export-input:focus {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 1px;
}

.mapping-sophia-export-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.map-current {
  margin-top: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface-subtle, #f8fafc);
  border-radius: 8px;
  padding: 10px;
  min-height: 4rem;
  max-height: 12rem;
  overflow-y: auto;
  font-size: 0.8125rem;
  color: var(--text-muted, #64748b);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.run-rule-source-toggle {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent, #1363df);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-top: 8px;
}

.run-rule-source-panel {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
  padding: 8px 10px;
  margin-top: 6px;
  border-radius: 8px;
  background: var(--surface-subtle, #f8fafc);
  border-left: 3px solid var(--accent, #1363df);
  word-break: break-word;
}

.run-rule-source-panel[hidden] {
  display: none !important;
}

/* Bounding boxes */
.bbox {
  position: absolute;
  border-radius: 4px;
  border: 2px solid rgba(100, 116, 139, 0.45);
  background: rgba(100, 116, 139, 0.08);
  cursor: pointer;
  text-align: left;
  padding: 0;
  overflow: hidden;
}

.bbox:hover {
  border-color: rgba(19, 99, 223, 0.65);
  background: rgba(19, 99, 223, 0.12);
}

.bbox-mapped {
  border-color: rgba(19, 99, 223, 0.85);
  background: rgba(19, 99, 223, 0.2);
}

.bbox-focused {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}

.map-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--accent-soft, #e8f1ff);
  border: 1px solid rgba(19, 99, 223, 0.25);
  color: var(--text, #0f172a);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.75rem;
  cursor: default;
}

.map-chip-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.map-chip-alias-btn {
  flex-shrink: 0;
  border: none;
  background: rgba(255, 255, 255, 0.65);
  color: var(--accent, #1363df);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
}

.map-chip-alias-btn:hover {
  background: #fff;
  color: var(--accent-hover, #0f55bf);
}

.map-chip-add-btn {
  flex-shrink: 0;
  border: none;
  background: rgba(255, 255, 255, 0.65);
  color: var(--success, #166534);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

.map-chip-add-btn:hover {
  background: #fff;
  color: #14532d;
}

.map-chip.map-chip-add-active {
  box-shadow: 0 0 0 2px rgba(19, 99, 223, 0.35);
}

.new-alias-form {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-subtle, #f8fafc);
}

.new-alias-form[hidden] {
  display: none !important;
}

.new-alias-form-lead {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--text, #0f172a);
  line-height: 1.45;
}

.new-alias-field {
  display: block;
  margin-bottom: 10px;
}

.new-alias-field-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  margin-bottom: 5px;
}

.new-alias-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.8125rem;
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
}

.new-alias-input:focus {
  outline: none;
  border-color: var(--accent, #1363df);
  box-shadow: 0 0 0 3px var(--accent-soft, #e8f1ff);
}

.new-alias-textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.new-alias-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.map-chip.map-chip-focused {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.map-chip.map-chip-entity-fallback {
  background: #fffbeb;
  border-color: rgba(180, 83, 9, 0.45);
  color: #92400e;
}

.map-chip.map-chip-entity-fallback.map-chip-focused {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.mapping-fallback-legend {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fffbeb;
  border: 1px solid rgba(180, 83, 9, 0.35);
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 600;
}

.map-chip-remove {
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

.map-chip-remove:hover {
  color: #dc2626;
}

.chip-alias-menu {
  position: fixed;
  z-index: 1000;
  min-width: 240px;
  max-width: min(360px, 92vw);
  max-height: min(320px, 50vh);
  overflow-y: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  padding: 4px 0;
}

.chip-alias-menu[hidden] {
  display: none !important;
}

.chip-alias-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.35;
  padding: 8px 12px;
  color: var(--text, #0f172a);
  cursor: pointer;
}

.chip-alias-option:hover {
  background: var(--accent-soft, #e8f1ff);
}

.chip-alias-option-clear {
  font-weight: 600;
  color: var(--text-muted, #64748b);
  border-bottom: 1px solid var(--border, #e2e8f0);
  margin-bottom: 2px;
}

.chip-alias-option-muted {
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-muted, #64748b);
}

.mapping-app .btn-editor .spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mapping-spin 0.7s linear infinite;
  display: none;
}

.mapping-app .btn-editor.loading .spinner {
  display: inline-block;
}

.mapping-app .btn-editor.loading .btn-text-default {
  display: none;
}

.mapping-app .btn-editor.loading .btn-text-loading {
  display: inline !important;
}

@keyframes mapping-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .mapping-stage {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(45vh, 1fr) auto;
  }

  .mapping-viewer-wrap {
    border-right: none;
    border-bottom: 1px solid var(--border, #e2e8f0);
  }

  .mapping-sidebar {
    max-height: 42vh;
  }
}

@media (max-width: 720px) {
  .mapping-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .mapping-runs-rail {
    max-height: 28vh;
    border-right: none;
    border-bottom: 1px solid var(--border, #e2e8f0);
  }
}
