#challenge-container {
  content-visibility: auto;
  contain-intrinsic-size: 760px;
}

/* === Challenge layout === */
.sol-challenge-stack {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.sol-challenge-intro {
  text-align: center;
  max-width: 820px;
  width: 100%;
}

.sol-challenge-grid {
  display: grid;
  gap: 2rem;
}

.sol-challenge-visual {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  height: 100%;
}

.sol-challenge-visual-title {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  color: rgba(241, 245, 255, 0.95);
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* === Blind-pipeline visual (left card) === */
.challenge-pipeline-frame {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 14% 18%, rgba(99, 102, 241, 0.2), transparent 42%),
    radial-gradient(circle at 86% 82%, rgba(56, 189, 248, 0.16), transparent 48%),
    linear-gradient(180deg, #0d1526, #0b1220);
  box-shadow:
    0 24px 80px rgba(2, 8, 23, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: clamp(1.1rem, 1.9vw, 1.5rem);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, Arial, sans-serif;
  color: #f4f8ff;
}

.challenge-pipeline-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(129, 140, 248, 0.14), transparent 55%),
    radial-gradient(circle at 85% 100%, rgba(52, 211, 153, 0.08), transparent 55%);
  pointer-events: none;
  opacity: 0.9;
}

[data-challenge-funnel-visual] {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.challenge-pipeline {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: clamp(1rem, 1.8vw, 1.35rem);
  z-index: 1;
  width: 100%;
  min-height: 0;
}

.challenge-pipeline__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.challenge-pipeline__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  min-height: 2.1rem;
  padding: 0.48rem 0.82rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.challenge-pipeline__pill--neutral {
  color: rgba(213, 227, 255, 0.85);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.challenge-pipeline__pill--warning {
  color: #ffcf72;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.26);
}

.challenge-pipeline__pill-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #7dcfff;
  box-shadow: 0 0 0 0.3rem rgba(125, 207, 255, 0.14);
}

.challenge-pipeline__pill-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
  display: block;
}

.challenge-pipeline__flow {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(0.55rem, 1vw, 0.85rem);
  min-height: 0;
}

.challenge-pipeline__stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.7rem;
  padding: clamp(0.85rem, 1.3vw, 1.1rem);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(14, 22, 37, 0.8), rgba(11, 18, 32, 0.62));
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  animation: challengePipelineFadeIn 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--challenge-pipeline-delay, 0ms);
}

.challenge-pipeline__stage--unknown {
  color: rgba(226, 232, 240, 0.62);
}

.challenge-pipeline__stage--known {
  grid-column: 2 / span 2;
  color: #ecfdf5;
  border-color: rgba(52, 211, 153, 0.36);
  background:
    radial-gradient(circle at 80% 20%, rgba(52, 211, 153, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(10, 30, 30, 0.92), rgba(6, 18, 22, 0.82));
  box-shadow:
    0 16px 40px rgba(16, 185, 129, 0.16),
    inset 0 1px 0 rgba(167, 243, 208, 0.12);
}

.challenge-pipeline__stage-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.challenge-pipeline__stage-chip {
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(226, 232, 240, 0.62);
}

.challenge-pipeline__stage--known .challenge-pipeline__stage-chip {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.42);
  color: #6ee7b7;
}

.challenge-pipeline__stage-icon {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.challenge-pipeline__stage-label {
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(241, 245, 255, 0.85);
  min-width: 0;
}

.challenge-pipeline__stage--known .challenge-pipeline__stage-label {
  color: rgba(209, 250, 229, 0.94);
}

.challenge-pipeline__stage-body {
  display: grid;
  place-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0 0.35rem;
  min-height: 0;
}

.challenge-pipeline__stage-placeholder {
  font-size: clamp(2.2rem, 3.6vw, 2.8rem);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(148, 163, 184, 0.5);
  text-shadow: 0 0 22px rgba(148, 163, 184, 0.14);
}

.challenge-pipeline__stage-number {
  font-size: clamp(2.6rem, 4.4vw, 3.4rem);
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #d1fae5;
  text-shadow: 0 0 22px rgba(52, 211, 153, 0.32);
}

.challenge-pipeline__scanbar {
  position: relative;
  width: 64%;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
}

.challenge-pipeline__scanbar-track {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.25) 0 4px,
    transparent 4px 8px
  );
}

.challenge-pipeline__scanbar-beam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(125, 207, 255, 0.6), transparent);
  animation: challengePipelineScan 2.8s linear infinite;
  animation-delay: var(--challenge-pipeline-delay, 0ms);
}

.challenge-pipeline__stage-foot {
  display: flex;
  justify-content: center;
  color: rgba(148, 163, 184, 0.62);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.2;
}

.challenge-pipeline__stage--known .challenge-pipeline__stage-foot {
  color: rgba(167, 243, 208, 0.85);
}

.challenge-pipeline__connector {
  display: none;
}

.challenge-pipeline__note {
  display: grid;
  grid-template-columns: 2.3rem minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.55);
}

.challenge-pipeline__note-icon {
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.2);
  flex: 0 0 auto;
}

.challenge-pipeline__note-icon-svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}

.challenge-pipeline__note-copy {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.85);
}

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

@keyframes challengePipelineScan {
  0% {
    left: -30%;
  }
  100% {
    left: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .challenge-pipeline__stage,
  .challenge-pipeline__connector {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .challenge-pipeline__scanbar-beam {
    animation: none;
    opacity: 0.35;
  }
}

@media (max-width: 720px) {
  .challenge-pipeline__flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 0.6rem;
  }
  .challenge-pipeline__stage--known {
    grid-column: 1 / span 2;
  }
  .challenge-pipeline__stage-foot {
    font-size: 0.7rem;
  }
  .challenge-pipeline__stage-placeholder {
    font-size: 1.8rem;
  }
  .challenge-pipeline__stage-number {
    font-size: 2.2rem;
  }
}

/* === Diagnostic breakdown card (right card) === */
/* === Challenge responsive layout === */
@media (min-width: 980px) {
  .sol-challenge-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 2.2rem;
  }
  .sol-challenge-visual {
    justify-content: stretch;
  }
  .sol-challenge-visual-frame {
    flex: 1;
  }
}
