* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #111827;
  padding: 24px;
  border-right: 1px solid #1f2937;
}

.main {
  padding: 24px;
  display: grid;
  gap: 20px;
}

.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 16px;
}

.ops-item {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
}

.grid {
  display: grid;
  gap: 12px;
}

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

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

input, button, select, textarea {
  border-radius: 10px;
  border: 1px solid #334155;
  padding: 10px 12px;
}

input, select, textarea {
  background: #0f172a;
  color: #e2e8f0;
}

textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
}

button {
  background: #2563eb;
  color: white;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

.muted, .small {
  color: #94a3b8;
}

.status {
  margin-top: 12px;
  color: #93c5fd;
}

.list {
  display: grid;
  gap: 10px;
}

.mapping-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #0b1220;
}

.mapping-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.mapping-row-main {
  display: grid;
  grid-template-columns: 1fr 1fr 220px auto;
  gap: 10px;
  align-items: start;
}

.mapping-row-tools {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.mapping-filter {
  display: grid;
  gap: 6px;
}

.mapping-transformer {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #334155;
  border-radius: 10px;
  background: #0f172a;
}

.mapping-field-hints {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mapping-hint-label {
  color: #94a3b8;
  font-size: 12px;
  margin-bottom: 6px;
}

.field-hint-card {
  display: grid;
  gap: 8px;
  min-height: 100%;
  padding: 10px;
  border: 1px solid #1e293b;
  border-radius: 10px;
  background: #0f172a;
}

.field-hint-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.field-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field-meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  color: #bfdbfe;
  background: #172554;
  border: 1px solid #1d4ed8;
}

.mapping-transformer-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mapping-transformer-fields .full-width {
  grid-column: 1 / -1;
}

.mapping-transformer-field {
  display: grid;
  gap: 6px;
}

.mapping-transformer-label {
  color: #94a3b8;
  font-size: 12px;
}

.mapping-transformer-summary {
  color: #93c5fd;
  font-size: 12px;
}

.mapping-bidirectional-toggle {
  align-items: center;
  justify-content: flex-start;
}

.stand-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.stand-setup-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #0f172a;
}

.main-wizard-card {
  position: sticky;
  top: 12px;
  z-index: 5;
}

.main-wizard-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.main-step-button {
  position: relative;
}

.main-step-button.active {
  background: #1d4ed8;
  border-color: #2563eb;
}

.main-step-button.done::after {
  content: "✓";
  margin-left: 6px;
  color: #4ade80;
}

.main-step-panel {
  display: grid;
  gap: 16px;
}

.main-step-panel[hidden] {
  display: none;
}

.main-step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.stand-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.stand-summary,
.stand-checklist {
  display: grid;
  gap: 10px;
}

.stand-summary-item,
.stand-check-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #0b1220;
}

.stand-check-item.ok {
  border-color: #15803d;
}

.stand-check-item.warn {
  border-color: #b45309;
}

.stand-check-item.error {
  border-color: #b91c1c;
}

.stand-check-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.stand-check-badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid currentColor;
}

.danger-button {
  background: #7f1d1d;
}

.danger-button:hover {
  background: #991b1b;
}

.item {
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #0b1220;
}

.item-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.preset-diff {
  display: grid;
  gap: 8px;
}

.preset-compare {
  display: grid;
  gap: 8px;
}

.preset-history {
  display: grid;
  gap: 8px;
}

.preset-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.preset-history-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #1e293b;
  border-radius: 10px;
  background: #0f172a;
}

.preset-history-item.is-current {
  border-color: #2563eb;
}

.preset-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.preset-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary-button {
  background: #1e293b;
  color: #e2e8f0;
}

.secondary-button:hover {
  background: #334155;
}

.item .row {
  margin-top: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.param-chip,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.param-chip {
  background: #172033;
  border: 1px solid #334155;
  color: #cbd5e1;
}

.badge {
  background: #1d4ed8;
  color: #eff6ff;
}

.badge-muted {
  background: #1f2937;
  color: #cbd5e1;
}

.badge-favorite {
  background: #92400e;
  color: #fef3c7;
}

.preset-bulk-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #0f172a;
}

.preset-select-box {
  margin-right: 4px;
}

.preset-import-preview {
  display: grid;
  gap: 10px;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
}

code {
  color: #93c5fd;
}

a {
  color: #93c5fd;
}

@media (max-width: 980px) {
  .layout,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .mapping-row-main,
  .mapping-row-tools,
  .mapping-field-hints,
  .mapping-transformer-fields {
    grid-template-columns: 1fr;
  }
}
