/* Flow-based wizard layout, gated on body.wizard-flow: a flex column so the card
   fills and the legal note sits as a normal footer, replacing the vh min-height
   math. Remove the class to fall back to the original layout. */

body.wizard-flow {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.wizard-flow #wizard-container {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0 !important;
}

body.wizard-flow .wizard-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

body.wizard-flow .wizard-legal-note {
  position: static;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0.6rem 1.6rem;
  padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
}

body.wizard-flow .bulk-stage-1,
body.wizard-flow .decor-stage {
  min-height: 0;
}

/* mobile: bounded height chain so the active step scrolls inside the card */
@media screen and (max-width: 1023px) {
  body.wizard-flow .wizard-wrapper {
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  body.wizard-flow .bulk-stage-1 {
    height: 100%;
    min-height: 0;
  }

  body.wizard-flow .stage-1-splide,
  body.wizard-flow .stage-1-splide > .splide__track {
    height: 100%;
    overflow: hidden;
  }

  body.wizard-flow .stage-1-splide > .splide__track > .splide__list {
    height: 100%;
    align-items: stretch;
  }

  body.wizard-flow .bulk-stage-1 .step {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    justify-content: flex-start;
    scrollbar-width: none; /* keep scrolling, hide the bar */
  }

  body.wizard-flow .bulk-stage-1 .step::-webkit-scrollbar {
    display: none;
  }

  /* OTP steps (lottie pawn) must not be scroll containers: iOS Safari drops their
     content from compositing. They are short and fit without scrolling. */
  body.wizard-flow .bulk-stage-1 .step.step-otp-end,
  body.wizard-flow .bulk-stage-1 .step.step-login {
    overflow: visible;
  }

  .bulk-stage-1 .step .sizer {
    padding-bottom: 3rem;
  }
}
