.problem-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  max-width: var(--diagram-max-width);
}

.problem-box {
  border-radius: 14px;
  padding: 1.5rem 2rem;
  text-align: center;
  min-width: 180px;
  flex: 1;
}

.problem-box-muted {
  background: var(--color-bg-mid);
  border: 2px solid var(--color-text-inactive);
}

.problem-box-accent {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  border: 2px solid var(--color-primary);
}

.problem-box-title {
  font-family: var(--font-display);
  font-size: var(--card-title);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.problem-box-muted .problem-box-title {
  color: var(--color-text-secondary);
}

.problem-box-sub {
  font-family: var(--font-mono);
  font-size: var(--card-sub);
  color: var(--color-primary);
}

.problem-box-muted .problem-box-sub {
  color: var(--color-text-inactive);
}

.problem-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-text-inactive);
  font-family: var(--font-mono);
  font-size: 1rem;
  flex-shrink: 0;
}

.problem-arrow-line {
  width: 40px;
  height: 2px;
  background: var(--color-text-inactive);
  position: relative;
}

.problem-arrow-line::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border-left: 8px solid var(--color-text-inactive);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.problem-arrow-dashed .problem-arrow-line {
  background: repeating-linear-gradient(
    90deg,
    var(--color-text-inactive) 0px,
    var(--color-text-inactive) 6px,
    transparent 6px,
    transparent 12px
  );
}

.problem-arrow-dashed .problem-arrow-line::after {
  border-left-color: var(--color-text-inactive);
}

.problem-arrow-solid .problem-arrow-line {
  background: var(--color-primary);
  width: 50px;
}

.problem-arrow-solid .problem-arrow-line::after {
  border-left-color: var(--color-primary);
}

.problem-constraints {
  border-radius: 14px;
  padding: 1.5rem;
  text-align: left;
  border: 2px dashed var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 5%, transparent);
  flex: 1;
  min-width: 180px;
}

.problem-constraints-item {
  font-family: var(--font-mono);
  font-size: var(--card-title);
  color: var(--color-text);
  padding: 0.3rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.problem-constraints-item::before {
  content: "→";
  color: var(--color-primary);
  font-weight: 700;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .problem-diagram {
    flex-direction: column;
    gap: 1rem;
  }
  .problem-arrow {
    transform: rotate(90deg);
  }
  .problem-box {
    min-width: unset;
    width: 100%;
  }
  .problem-constraints {
    width: 100%;
  }
}
