/* ============================================================================
   private-seller-injected-scene-flash-fix.css
   ----------------------------------------------------------------------------
   FIX: "256-bit SSL / 3-D Secure card flashes in the middle then jumps away"
        on first load of the Private Seller journey.

   ROOT CAUSE
   ----------
   The Identity / Auth / Payment scenes (#psScene8 / #psScene9 / #psScene10)
   are NOT part of the scaffold built by initPrivateSellerModule(). They are
   injected later by private-seller-scenes-extra.js via:

       track.insertAdjacentHTML('beforeend', SCENE10_HTML);   // payment

   The first-mount boot guard in PrivateSeller.cshtml / nav-consistency.css §6
   (`#psModuleRoot.is-booting .ps-scene:not(.ps-scene-active)`) has ALREADY
   been released (3×rAF / 500 ms) by the time this injection runs, and the
   carousel's steady-state windowing relies purely on the `.ps-track`
   transform + `.ps-viewport { overflow:hidden }` clip — there is no per-scene
   visibility gate. So for the single layout/paint frame between
   `insertAdjacentHTML` and the carousel re-confirming the track transform, the
   freshly-parsed payment markup (the "256-bit SSL / 3-D Secure" secure-row)
   paints unclipped at document-flow position → the ghost-card flash.

   FIX (surgical, self-contained, zero steady-state impact)
   --------------------------------------------------------
   private-seller-scenes-extra.js stamps each injected scene with
   `.ps-scene--injecting` AT INSERT TIME and removes it after a double rAF,
   once the track transform has settled (see the JS patch in the task notes).
   This rule hard-hides a scene ONLY while that transient class is present —
   i.e. only for the ~2 boot frames right after injection, long before the
   user can ever navigate to scenes 8–10. It can never affect the slide-in of
   an active scene because the class is gone by then.

   Belt-and-braces: we also clip the track itself while ANY injected scene is
   still pending, closing the escape hatch even if the JS stamp is delayed.
   ============================================================================ */

/* The injected scenes are hidden + removed from layout flow while pending.
   `position:absolute` takes them out of the flex track so a half-inserted
   scene can never widen the track or shift the active scene for a frame. */
body:not([data-pa-flow="agent"]) #psModuleRoot .ps-scene.ps-scene--injecting {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /* content-visibility skips rendering work entirely for the pending frame */
    content-visibility: hidden !important;
}

/* While any injected scene is still settling, keep the whole module clipped so
   nothing can escape the viewport even if a pending scene is mid-transition. */
body:not([data-pa-flow="agent"]) #psModuleRoot:has(.ps-scene--injecting) {
    overflow: hidden !important;
}

/* Fallback for engines without :has() — the JS also toggles this class on the
   track wrapper while injection is in flight (data-ps-injecting="1"). */
body:not([data-pa-flow="agent"]) #psModuleRoot[data-ps-injecting="1"] {
    overflow: hidden !important;
}
