:root {
  --stats-primary: 37 99 235;
  --stats-secondary: 244 63 94;
  --stats-slate: 15 23 42;
  --stats-surface: 248 250 252;
  --stats-warning: 217 119 6;
  --stats-danger: 220 38 38;
  --stats-success: 5 150 105;
}

.stats-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: rgb(var(--stats-primary) / 1);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.7rem 1rem;
  text-transform: uppercase;
}

.stats-kicker::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgb(var(--stats-primary) / 1), rgb(var(--stats-secondary) / 0.88));
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.stats-shell {
  position: relative;
}

.wizard-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 32px;
  background:
    radial-gradient(circle at 12% 12%, rgba(37, 99, 235, 0.12), transparent 32%),
    radial-gradient(circle at 88% 88%, rgba(244, 63, 94, 0.11), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.99));
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.08);
}

.wizard-shell::before,
.wizard-shell::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
}

.wizard-shell::before {
  top: -5rem;
  left: -4rem;
  width: 16rem;
  height: 16rem;
  background: rgba(37, 99, 235, 0.18);
}

.wizard-shell::after {
  right: -5rem;
  bottom: -6rem;
  width: 16rem;
  height: 16rem;
  background: rgba(244, 63, 94, 0.14);
}

.wizard-progress {
  position: relative;
  z-index: 1;
  padding: 1.8rem 1.8rem 0;
}

.wizard-progress-copy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
}

.wizard-progress-copy p {
  max-width: 25rem;
}

.wizard-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wizard-steps::before {
  content: "";
  position: absolute;
  left: 2.1rem;
  right: 2.1rem;
  top: 1.35rem;
  height: 2px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.28), rgba(148, 163, 184, 0.56), rgba(148, 163, 184, 0.28));
  z-index: 0;
}

.wizard-step {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 0.75rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.wizard-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.9);
  color: rgba(51, 65, 85, 0.92);
  font-weight: 700;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.wizard-step strong,
.wizard-step small {
  display: block;
}

.wizard-step strong {
  font-size: 0.92rem;
  color: rgba(15, 23, 42, 0.96);
}

.wizard-step small {
  font-size: 0.74rem;
  color: rgba(100, 116, 139, 0.96);
}

.wizard-step.is-active,
.wizard-step.is-complete {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.wizard-step.is-active span,
.wizard-step.is-complete span {
  background: linear-gradient(135deg, rgb(var(--stats-primary) / 0.95), rgb(var(--stats-secondary) / 0.92));
  color: #fff;
}

.wizard-step.is-active {
  background: rgba(255, 255, 255, 0.98);
}

.wizard-step.is-complete {
  background: rgba(239, 246, 255, 0.88);
}

.wizard-step.is-complete span::before {
  content: "\ea5e";
  font-family: remixicon;
  font-size: 0.95rem;
}

.wizard-step.is-complete span {
  font-size: 0;
}

.wizard-panel {
  position: relative;
  z-index: 1;
  padding: 1.6rem 1.8rem 1.9rem;
}

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

.wizard-panel-inner {
  min-height: 26rem;
  animation: wizardFadeIn 240ms ease;
}

.wizard-panel-upload {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes wizardFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.upload-dropzone {
  position: relative;
  border: 2px dashed rgba(37, 99, 235, 0.22);
  border-radius: 28px;
  padding: 3rem 1.5rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08), transparent 45%),
    rgba(255, 255, 255, 0.96);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 18px 44px rgba(15, 23, 42, 0.06);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
  cursor: pointer;
  outline: none;
}

.upload-dropzone:hover,
.upload-dropzone:focus-visible,
.upload-dropzone.is-dragover {
  border-color: rgba(37, 99, 235, 0.56);
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.86), 0 24px 52px rgba(37, 99, 235, 0.12);
}

.upload-dropzone-icon {
  width: 5.25rem;
  height: 5.25rem;
  margin: 0 auto 1.1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(244, 63, 94, 0.12));
  color: rgb(var(--stats-primary) / 1);
  font-size: 2rem;
}

.upload-dropzone-copy p {
  margin-top: 0.35rem;
}

.upload-dropzone-meta {
  margin-top: 1rem;
  font-size: 0.83rem;
  color: rgba(100, 116, 139, 1);
}

.inline-feedback {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(51, 65, 85, 0.94);
  padding: 0.95rem 1rem;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.04);
}

.inline-feedback.hidden {
  display: none !important;
}

.inline-feedback.error {
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(254, 242, 242, 0.94);
  color: rgba(153, 27, 27, 0.96);
}

.inline-feedback.warning {
  border-color: rgba(217, 119, 6, 0.2);
  background: rgba(255, 251, 235, 0.95);
  color: rgba(146, 64, 14, 0.96);
}

.summary-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.summary-chip,
.stat-chip,
.wizard-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.88);
  color: rgba(51, 65, 85, 0.94);
}

.wizard-pill {
  color: rgb(var(--stats-primary) / 1);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.12);
}

.wizard-pill.neutral {
  color: rgba(51, 65, 85, 0.92);
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.18);
}

.stat-chip {
  background: rgba(239, 246, 255, 0.88);
  color: rgba(29, 78, 216, 0.95);
}

.field-group {
  display: grid;
  gap: 0.55rem;
}

.field-group span,
.control-card-header h4 {
  font-size: 0.94rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.96);
}

.field-input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.96);
  background: rgba(255, 255, 255, 0.98);
  color: rgba(15, 23, 42, 0.96);
  padding: 0.85rem 1rem;
  font-size: 0.96rem;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field-input:hover,
.field-input:focus {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.field-input.multi {
  min-height: 8.3rem;
  padding-right: 0.65rem;
}

.field-input option {
  padding: 0.35rem 0.45rem;
}

.panel-table-wrap {
  overflow-x: auto;
}

.profile-table {
  width: 100%;
  border-collapse: collapse;
}

.profile-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 250, 252, 0.98);
  padding: 1rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(71, 85, 105, 0.95);
  border-bottom: 1px solid rgba(226, 232, 240, 0.96);
}

.profile-table thead th.text-right,
.profile-table tbody td.text-right {
  text-align: right;
}

.profile-table tbody td {
  padding: 1rem;
  border-bottom: 1px solid rgba(241, 245, 249, 0.98);
  vertical-align: top;
  color: rgba(51, 65, 85, 0.96);
}

.profile-table tbody tr:hover {
  background: rgba(248, 250, 252, 0.82);
}

.column-name {
  font-weight: 700;
  color: rgba(15, 23, 42, 0.98);
}

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.86);
  color: rgba(51, 65, 85, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.type-badge.numeric {
  background: rgba(219, 234, 254, 0.95);
  color: rgba(30, 64, 175, 0.98);
}

.type-badge.categorical {
  background: rgba(241, 245, 249, 0.96);
  color: rgba(71, 85, 105, 0.95);
}

.type-badge.binary {
  background: rgba(220, 252, 231, 0.94);
  color: rgba(21, 128, 61, 0.98);
}

.type-badge.ordinal {
  background: rgba(254, 249, 195, 0.96);
  color: rgba(133, 77, 14, 0.98);
}

.type-badge.ignore {
  background: rgba(248, 250, 252, 0.96);
  color: rgba(100, 116, 139, 0.92);
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
}

.wizard-actions-end {
  align-items: center;
  justify-content: flex-end;
}

.wizard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 9999px;
  padding: 0.9rem 1.25rem;
  font-weight: 700;
  border: 1px solid transparent;
  min-width: 10.75rem;
  cursor: pointer;
}

.wizard-btn.primary {
  background: linear-gradient(135deg, rgb(var(--stats-primary) / 1), rgb(var(--stats-secondary) / 0.95));
  color: #fff;
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.22);
}

.wizard-btn.secondary {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(203, 213, 225, 0.96);
  color: rgba(51, 65, 85, 0.96);
}

.wizard-btn:hover {
  transform: translateY(-1px);
}

.control-card,
.review-card {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.96);
  padding: 1.35rem;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.control-card-header,
.review-card-header {
  margin-bottom: 1rem;
}

.control-card-header p,
.review-card-header p {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(100, 116, 139, 0.96);
}

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

.segmented-grid-dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-grid label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  border-radius: 18px;
  border: 1px solid rgba(203, 213, 225, 0.96);
  background: rgba(248, 250, 252, 0.96);
  color: rgba(51, 65, 85, 0.96);
  font-weight: 700;
  text-align: center;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.segmented-grid label:hover {
  transform: translateY(-1px);
}

.segmented-grid input:checked + label {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(239, 246, 255, 0.96);
  color: rgb(var(--stats-primary) / 1);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.spec-summary-card {
  display: grid;
  gap: 0.75rem;
}

.spec-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(241, 245, 249, 0.96);
  padding-bottom: 0.75rem;
}

.spec-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.spec-row dt {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(100, 116, 139, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-row dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.96);
  text-align: right;
}

.detail-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding-left: 1.15rem;
  color: rgba(71, 85, 105, 0.95);
}

.detail-list li {
  line-height: 1.6;
}

.detail-list.empty {
  padding-left: 0;
  list-style: none;
}

.review-card-hero {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.review-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.alternative-grid {
  display: grid;
  gap: 0.9rem;
}

.alternative-card {
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(248, 250, 252, 0.96);
  padding: 1rem;
}

.alternative-card h5 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.96);
}

.alternative-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(71, 85, 105, 0.95);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.result-card {
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.96);
  padding: 1.1rem 1.15rem;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.04);
}

.result-card-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(100, 116, 139, 0.96);
}

.result-card-value {
  margin-top: 0.45rem;
  font-size: 1.45rem;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.98);
}

.result-card-copy {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(100, 116, 139, 0.95);
}

.result-stack {
  display: grid;
  gap: 0.9rem;
}

.result-detail-card {
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.96);
  padding: 1rem;
}

.result-detail-card h5 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.96);
}

.result-detail-card p,
.result-detail-card ul {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(71, 85, 105, 0.95);
}

.coef-table {
  width: 100%;
  border-collapse: collapse;
}

.coef-table th,
.coef-table td {
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid rgba(241, 245, 249, 0.96);
  text-align: left;
  font-size: 0.88rem;
  color: rgba(51, 65, 85, 0.96);
}

.coef-table th {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(100, 116, 139, 0.96);
}

.coef-table td strong {
  color: rgba(15, 23, 42, 0.98);
}

.hero-step-list {
  display: grid;
  gap: 0.85rem;
}

.hero-step-list div {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.96);
}

.hero-step-list span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: rgb(var(--stats-primary) / 1);
  font-weight: 700;
}

.hero-step-list strong {
  font-size: 0.92rem;
  color: rgba(15, 23, 42, 0.96);
}

.stats-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(900px 460px at 82% 14%, rgba(37, 99, 235, 0.16), transparent 60%),
    radial-gradient(760px 360px at 10% 86%, rgba(244, 63, 94, 0.16), transparent 56%),
    rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
}

.stats-loader.hidden {
  display: none !important;
}

.stats-loader-card {
  width: min(440px, 100%);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.22);
  text-align: center;
  padding: 1.9rem 1.5rem;
}

.stats-loader-icon {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(244, 63, 94, 0.14));
  color: rgb(var(--stats-primary) / 1);
  font-size: 1.9rem;
}

.stats-loader-icon i {
  animation: spin 1s linear infinite;
}

.stats-loader-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.96);
}

.stats-loader-subtitle {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(71, 85, 105, 0.95);
}

.stats-loader-dots {
  display: inline-flex;
  gap: 0.55rem;
  margin-top: 1rem;
}

.stats-loader-dots span {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.85);
  animation: bob 0.9s ease-in-out infinite;
}

.stats-loader-dots span:nth-child(2) {
  animation-delay: 0.12s;
  background: rgba(244, 63, 94, 0.8);
}

.stats-loader-dots span:nth-child(3) {
  animation-delay: 0.24s;
  background: rgba(37, 99, 235, 0.58);
}

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

@keyframes bob {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (max-width: 1280px) {
  .wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wizard-steps::before {
    display: none;
  }
}

@media (max-width: 1024px) {
  .wizard-progress-copy {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .wizard-progress,
  .wizard-panel {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .wizard-steps {
    grid-template-columns: 1fr;
  }

  .wizard-step {
    padding: 0.75rem;
  }

  .wizard-actions {
    justify-content: stretch;
  }

  .wizard-btn {
    width: 100%;
  }

  .profile-table thead {
    display: none;
  }

  .profile-table,
  .profile-table tbody,
  .profile-table tr,
  .profile-table td {
    display: block;
    width: 100%;
  }

  .profile-table tbody tr {
    padding: 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.96);
  }

  .profile-table tbody td {
    border: 0;
    padding: 0.45rem 0;
  }

  .profile-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(100, 116, 139, 0.95);
  }

  .profile-table thead th.text-right,
  .profile-table tbody td.text-right {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-panel-inner,
  .upload-dropzone,
  .wizard-step,
  .wizard-btn,
  .segmented-grid label,
  .stats-loader-icon i,
  .stats-loader-dots span {
    animation: none !important;
    transition: none !important;
  }
}
