/* If there is more than one step, add a vertical line between them */
.steps:has(li:nth-child(n+2)) {
  position: relative;
  z-index: var(--z-index--base);

  &::after {
    content: "";
    position: absolute;
    top: var(--space--small);
    bottom: calc(var(--space--large) * -1);
    left: 50%;
    transform: translateX(-50%);
    width: var(--border-width--thick);
    background-color: var(--color--grayscale--03);
    z-index: var(--z-index--basement);
  }
}

.step {
  display: flex;
  position: relative;
  margin-bottom: var(--space--medium);

}

.step--empty .step__textarea {
  border: var(--border--error);
}

.step__number {
  position: absolute;
  top: var(--space--small);
  left: var(--space--small);

  font-size: var(--font-size--x-small);
  font-weight: var(--font-weight--normal);
}

.step__textarea {
  flex: 1;
  padding: 2.25rem var(--space--small) var(--space--small);
  resize: none;
  min-height: 4.25rem;
  field-sizing: content;

  border-radius: var(--border-radius--base);
  background-color: var(--color--background-light);
}

@supports not (field-sizing: content) {
  .step__textarea {
    /* Fallback: allow manual vertical resizing when auto-grow is unsupported */
    resize: vertical;
    display: block;
  }
}

.step__delete {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0.125rem;
  right: 0.125rem;
  padding: var(--space--x-small);

  color: var(--color--text-alt);
}
