/* Chain-only mobile release. Native actions, eligibility, images and charges are unchanged. */
@media screen and (max-width: 1023px) {
  html:has(custom-customizer-chain[data-pog-mobile-chain-step]) {
    .custom-customizer-overlay__dialog[open]:not([data-keyboard-editing]) {
      /* Native categories wrap rows and skip inside viewport, unlike engraving. */
      .custom-customizer-step__panel:not([hidden]):has(custom-customizer-chain .custom-customizer-chain__categories) {
        flex: 1 0 auto;
        min-block-size: 100%;
      }

      .custom-customizer-chain:has(.custom-customizer-chain__categories),
      .custom-customizer-chain__viewport:has(> .custom-customizer-chain__categories),
      .custom-customizer-chain__categories {
        display: flex;
        flex-direction: column;
        flex: 1 0 auto;
      }

      .custom-customizer-chain__categories > .custom-customizer-chain__rows {
        margin-block-end: 8px;
      }

      .custom-customizer-chain__skip:not([hidden]) {
        position: sticky;
        inset-block-end: 0;
        z-index: 2;
        will-change: transform;
        flex: none;
        align-self: stretch;
        justify-content: flex-end;
        inline-size: auto;
        min-block-size: 44px;
        margin-block-start: auto;
        margin-inline: 0;
        padding: 12px 12px 8px;
        border-radius: 0;
        background: #fff;
        white-space: normal;
      }

      .custom-customizer-chain__skip:not([hidden])::before {
        content: "";
        position: absolute;
        inset-block: 0;
        inset-inline: calc(-1 * var(--space-l));
        border-block-start: 1px solid #c9c9c9;
        background: #fff;
        box-shadow: 0 -3px 6px rgb(0 0 0 / 0.06);
        pointer-events: none;
        z-index: -1;
      }
    }
  }
}

/* Port the preview's spacing/footer only while Chain is the active panel. */
@media screen and (max-width: 1023px) {
  .custom-customizer-overlay__dialog[open]:not([data-keyboard-editing]):has(
    .custom-customizer-step__panel:not([hidden]) custom-customizer-chain[data-pog-mobile-chain-step]
  ) {
    .custom-customizer-step { gap: 12px; }
    .custom-customizer-step-wrapper { gap: 0; }
    .custom-customizer-step__body { display: flex; flex-direction: column; }
    .custom-customizer-step__footer { padding-block-start: 8px; box-shadow: none; }
  }
}
