/* Platform scenes after the product illustrations on rain.xyz/product/*: a rounded, softly tinted panel
   and frosted white components on it — a white rim, a darker lower edge (Rain's pink, here graphite), a
   soft inner shade and a wide soft shadow; thin graphite lines with dots at the ends; green for success.
   Every scene is drawn on a fixed 440×300 stage centred in the panel. */
.pv {
  --ink: #1d1e21; --mute: #8b9098; --faint: #b5b9c0; --dark: #1c1d20; --ok: #2ea44f; --amber: #c9922c;
  --pv-bg: #eef0f3;
  position: relative; height: 320px; margin: 16px 16px 0; overflow: hidden;
  color: var(--ink); font: 400 15px/1.35 var(--font-head); letter-spacing: -.01em; contain: layout paint; isolation: isolate;
}
.pv *, .pv *::before, .pv *::after { box-sizing: border-box; }
.pv svg { display: block; flex: none; }
.pv strong, .pv b { font-weight: 500; }
.pv small { font-size: 13px; color: var(--mute); }
.pv-stage { position: absolute; left: 50%; top: 50%; width: 440px; height: 300px; transform: translate(-50%, -50%) scale(var(--pv-s, 1)); }

/* the frosted component */
.pv .g {
  position: absolute; border: 1px solid var(--line, #e4e7ec);
  background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 22px -12px rgba(16, 24, 40, .12);
}
.pv .pill { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 22px; border-radius: 999px; color: var(--ink); font-size: 15px; font-weight: 500; white-space: nowrap; }
.pv-panel { border-radius: 24px; }
.pv-coin { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--stroke, #cad0d9); border-radius: 50%; color: #3a3d42; }
.pv-coin svg { width: 18px; height: 18px; }
.pv-link { position: absolute; inset: 0; width: 440px; height: 300px; overflow: visible; }
.pv-link path { fill: none; stroke: var(--dark); stroke-width: 1.5; }
.pv-link circle { fill: var(--dark); }
.pv-runner { position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--dark); offset-rotate: 0deg; offset-distance: 0; opacity: 0; }

/* ---------------------------------------------------------------- Funding instructions (deposit details) */
.pv-deposit { left: 50px; top: -1px; width: 370px; }
.pv-panel__head { display: flex; align-items: center; justify-content: space-between; margin: 0 22px; padding: 20px 2px 16px; border-bottom: 1px solid rgba(20, 22, 26, .08); font-size: 16px; font-weight: 500; }
.pv-panel__head svg { width: 20px; height: 20px; color: var(--ink); }
.pv-rows { padding: 8px 10px 12px; }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; height: 44px; padding: 0 14px; border-radius: 12px; color: var(--mute); white-space: nowrap; transition: background .3s, color .3s; }
.pv-row strong { display: flex; align-items: center; gap: 10px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pv-row.is-hot { background: rgba(20, 22, 26, .045); color: var(--ink); }
.pv-copy { position: relative; display: grid; place-items: center; width: 18px; height: 18px; color: var(--mute); cursor: pointer; }
.pv-copy svg { width: 16px; height: 16px; }
.pv-copy__done { position: absolute; inset: -5px; display: grid; place-items: center; border-radius: 7px; background: #e4f4e9; color: var(--ok); opacity: 0; transform: scale(.7); transition: opacity .25s, transform .25s; }
.pv-copy.is-done .pv-copy__done { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- First and third party (recent payouts) */
.pv-list { left: 40px; top: 8px; width: 364px; }
.pv-list__head { padding: 20px 24px 8px; color: var(--mute); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.pv-list__rows { height: 198px; margin-bottom: 10px; padding: 0 12px; overflow: hidden; }
.pv-tx { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; height: 62px; padding: 0 12px; transition: margin .7s cubic-bezier(.3, .9, .25, 1), opacity .6s; }
.pv-tx.is-new { margin-top: -62px; opacity: 0; }
.pv-av { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line, #e4e7ec); border-radius: 50%; background: #f4f5f7; color: #4e5258; font-size: 13px; font-weight: 600; }
.pv-tx__who { display: grid; gap: 1px; min-width: 0; }
.pv-tx__who strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.pv-tx__amt { display: grid; justify-items: end; gap: 1px; }
.pv-tx__amt strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.pv-status { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.pv-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); transition: background .3s; }
.pv-tx.is-sending .pv-status i { background: var(--amber); animation: pv-blink 1s ease-in-out infinite; }
@keyframes pv-blink { 50% { opacity: .35; } }

/* ---------------------------------------------------------------- Quote first (send / receive) */
.pv-quote { width: 282px; height: 104px; padding: 16px 22px; border-radius: 24px; }
.pv-quote--send { left: 36px; top: 16px; }
.pv-quote--get { left: 150px; top: 154px; }
.pv-quote > div { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.pv-quote strong { font-size: 17px; }
.pv-caret svg { width: 15px; height: 15px; color: var(--ink); stroke-width: 2.2; }
.pv-amount { margin-left: auto; font-size: 20px; font-variant-numeric: tabular-nums; }
.pv-cursor { display: inline-block; width: 1.5px; height: 20px; margin-left: 3px; background: var(--dark); vertical-align: -3px; opacity: 0; }
.pv[data-phase="typing"] .pv-cursor { animation: pv-caret .7s steps(1) infinite; }
@keyframes pv-caret { 50% { opacity: 1; } }
.pv-balance .pv-link path { stroke-dasharray: 160; stroke-dashoffset: 160; transition: stroke-dashoffset 1.2s cubic-bezier(.4, 0, .2, 1); }
.pv-balance .pv-link circle { opacity: 0; transition: opacity .3s; }
.pv[data-phase="loading"] .pv-link circle:first-of-type { opacity: 1; }
.pv[data-phase="loading"] .pv-link path, .pv[data-phase="ready"] .pv-link path { stroke-dashoffset: 0; }
.pv[data-phase="ready"] .pv-link circle { opacity: 1; transition-delay: .1s; }
.pv[data-phase="loading"] .pv-result { color: var(--faint); animation: pv-blink .8s ease-in-out infinite; }
.pv[data-phase="typing"] .pv-result { color: var(--faint); }

/* ---------------------------------------------------------------- Accounts in your name (wire → payee) */
.pv .pv-wire { left: 30px; top: 24px; z-index: 2; padding: 0 20px 0 10px; }
.pv-wire b { margin-left: 8px; color: var(--mute); font-variant-numeric: tabular-nums; }
.pv-payee { left: 150px; top: 122px; z-index: 2; width: 272px; padding: 18px 22px; }
.pv-runner--wire { z-index: 1; }
.pv-payee strong { display: block; margin: 4px 0 2px; font-size: 19px; }
.pv-payee__acc { color: var(--mute); font: 12px var(--font-mono); }
.pv-match { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 5px 11px 5px 6px; border-radius: 999px; background: #e3f3e8; color: #23823f; font-size: 13px; font-weight: 500; opacity: 0; transform: translateY(4px); }
.pv-match svg { width: 18px; height: 18px; color: var(--ok); }
/* the dot leaves from under the wire pill and slips under the card; then the name is matched */
.ui--run .pv-runner--wire { animation: pv-wire 5s linear infinite; }
.ui--run .pv-match { animation: pv-match 5s ease infinite; }
@keyframes pv-wire { 0%, 8% { offset-distance: 0; opacity: 1; animation-timing-function: cubic-bezier(.55, 0, .3, 1); } 50%, 100% { offset-distance: 100%; opacity: 1; } }
@keyframes pv-match { 0%, 50% { opacity: 0; transform: translateY(4px); } 58%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }

/* ---------------------------------------------------------------- Banks and methods (sliding pills) */
.pv-stage--wide { left: 0; top: 0; width: 100%; height: 100%; transform: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.pv-marquee { position: absolute; left: 0; right: 0; height: 56px; overflow: visible; }
.pv-marquee:nth-child(1) { top: 50px; } .pv-marquee:nth-child(2) { top: 132px; } .pv-marquee:nth-child(3) { top: 214px; }
.pv-marquee__track { display: flex; gap: 12px; width: max-content; }
.ui--run .pv-marquee__track { animation: pv-marquee var(--dur) linear infinite; animation-direction: var(--dir); }
@keyframes pv-marquee { to { transform: translateX(-50%); } }
.pv .pv-chip { position: relative; height: 48px; padding: 0 20px 0 16px; font-size: 15px; }
.pv-chip svg { width: 20px; height: 20px; color: var(--ink); }
.pv-chip--ok svg { color: var(--ok); }

/* ---------------------------------------------------------------- One balance, many rails (circuit) */
.pv-circuit { position: absolute; inset: 0; width: 440px; height: 300px; overflow: visible; }
.pv-circuit path { stroke: rgba(28, 29, 32, .3); stroke-width: 1.3; }
.pv-circuit circle { fill: #2a2c30; }
.pv-hubtile { position: absolute; left: 168px; top: 98px; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 104px; height: 104px; border: 1.5px solid #3a3d42; border-radius: 26px; background: linear-gradient(180deg, #2c2e32 0%, #111214 100%); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 22px 40px -16px rgba(0, 0, 0, .5); }
.pv-hubtile svg { width: 34px; height: 34px; }
.pv-hubtile b { font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.pv-runner--in, .pv-runner--out { width: 6px; height: 6px; }
.ui--run .pv-runner--in { animation: pv-in 4.4s cubic-bezier(.55, 0, .35, 1) infinite; animation-delay: calc(var(--i) * .5s); }
.ui--run .pv-runner--out { animation: pv-out 4.4s cubic-bezier(.55, 0, .35, 1) infinite; animation-delay: calc(var(--i) * .5s); }
@keyframes pv-in { 0% { offset-distance: 0; opacity: 0; } 6% { opacity: 1; } 40% { offset-distance: 100%; opacity: 1; } 44%, 100% { offset-distance: 100%; opacity: 0; } }
@keyframes pv-out { 0%, 50% { offset-distance: 0; opacity: 0; } 56% { opacity: 1; } 90% { offset-distance: 100%; opacity: 1; } 94%, 100% { offset-distance: 100%; opacity: 0; } }
.ui--run .pv-hubtile { animation: pv-beat 4.4s ease-in-out infinite; }
@keyframes pv-beat { 0%, 38%, 58%, 100% { transform: scale(1); } 46% { transform: scale(1.05); } }

/* ---------------------------------------------------------------- V2: Named & multicurrency */
.pv-multi { left: 26px; top: 26px; width: 388px; padding: 26px 28px 22px; }
.pv-multi__name { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.pv-multi__name strong { font-size: 23px; letter-spacing: -.015em; }
.pv-multi__ok svg { width: 22px; height: 22px; color: var(--ok); }
.pv-multi__cur { display: flex; gap: 8px; margin: 20px 0 18px; padding-top: 18px; border-top: 1px solid rgba(20, 22, 26, .08); }
.pv-cur { display: grid; place-items: center; height: 38px; padding: 0 16px; border: 1px solid var(--line, #e4e7ec); border-radius: 999px; background: #fff; color: var(--ink); font-size: 15px; font-weight: 500; transition: background-color .35s, color .35s, border-color .35s; }
.pv[data-c="0"] .pv-cur[data-c="0"], .pv[data-c="1"] .pv-cur[data-c="1"], .pv[data-c="2"] .pv-cur[data-c="2"], .pv[data-c="3"] .pv-cur[data-c="3"] { border-color: var(--dark); background: var(--dark); color: #fff; }
.pv-multi__rows { position: relative; height: 50px; }
.pv-multi__row { position: absolute; inset: 0; display: grid; gap: 3px; opacity: 0; transform: translateY(5px); transition: opacity .4s, transform .4s; }
.pv-multi__row span { color: var(--mute); font-size: 14px; }
.pv-multi__row b { font: 500 14px var(--font-mono); font-variant-numeric: tabular-nums; }
.pv[data-c="0"] .pv-multi__row[data-c="0"], .pv[data-c="1"] .pv-multi__row[data-c="1"], .pv[data-c="2"] .pv-multi__row[data-c="2"], .pv[data-c="3"] .pv-multi__row[data-c="3"] { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- V2: Worldwide SWIFT (flag chips) */
.pv-chip--flag img { width: 22px; height: 16px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(20, 30, 50, .08); }

/* ---------------------------------------------------------------- V2: USDT or USDC, in and out */
.pv-coins { position: absolute; left: 50%; top: 26px; display: flex; gap: 16px; transform: translateX(-50%); }
.pv .pv-coinbig { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 104px; height: 104px; border-radius: 50%; color: var(--ink); }
.pv-coinbig svg { width: 36px; height: 36px; }
.pv-coinbig b { font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.pv-dirs { position: absolute; left: 50%; top: 152px; display: flex; gap: 10px; transform: translateX(-50%); }
.pv .pv-dir { position: relative; height: 42px; gap: 8px; padding: 0 18px 0 12px; font-size: 14px; opacity: .55; transition: opacity .4s, box-shadow .4s; }
.pv-dir__ico { display: grid; place-items: center; }
.pv-dir__ico svg { width: 18px; height: 18px; }
.pv[data-d="0"] .pv-dir[data-d="0"], .pv[data-d="1"] .pv-dir[data-d="1"] { opacity: 1; box-shadow: 0 0 0 1.5px var(--dark), 0 10px 22px -12px rgba(16, 24, 40, .2); }
.pv-chains { position: absolute; left: 50%; top: 222px; display: flex; gap: 8px; transform: translateX(-50%); }
.pv .pv-chain { position: relative; height: 36px; gap: 7px; padding: 0 13px 0 11px; font-size: 13px; }
.pv-chain i { width: 6px; height: 6px; border-radius: 50%; background: #c6cad0; transition: background .35s, box-shadow .35s; }
.pv[data-k="0"] .pv-chain[data-k="0"] i, .pv[data-k="1"] .pv-chain[data-k="1"] i, .pv[data-k="2"] .pv-chain[data-k="2"] i, .pv[data-k="3"] .pv-chain[data-k="3"] i, .pv[data-k="4"] .pv-chain[data-k="4"] i { background: var(--ok); box-shadow: 0 0 0 3px rgba(46, 164, 79, .16); }

/* ---------------------------------------------------------------- assembling on scroll
   A scene stays empty until it is properly on screen; then its parts come in one after another (opacity,
   a short rise, a little blur) and its lines draw, and only after that the loop starts. The parts move with
   `translate`, not `transform`, so they keep the transforms that place them. The stagger applies only while
   pv--entering is on (product-ui.js takes it off after the entrance), so later state changes are not delayed. */
.pv:not(.pv--in) .pv-stage > :not(svg):not(.pv-runner) { opacity: 0; translate: 0 14px; filter: blur(5px); }
.pv--entering .pv-stage > :not(svg):not(.pv-runner) { transition: opacity .6s ease, translate .8s cubic-bezier(0.23, 1, 0.32, 1), filter .6s ease; transition-delay: calc(var(--o, 0) * 80ms); }
.pv-nameplate .pv-link path, .pv-circuit path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.pv-nameplate:not(.pv--in) .pv-link path, .pv-hub:not(.pv--in) .pv-circuit path { stroke-dashoffset: 1; }
.pv--entering :is(.pv-link, .pv-circuit) path { transition: stroke-dashoffset 1s cubic-bezier(0.77, 0, 0.175, 1) .15s; }
.pv:not(.pv--in) :is(.pv-link, .pv-circuit) circle { opacity: 0; }
.pv--entering.pv-nameplate .pv-link circle, .pv--entering .pv-circuit circle { transition: opacity .3s ease .75s; }
/* the scenes that answer the pointer say so */
@media (hover: hover) and (pointer: fine) {
  .pv-cur, .pv-dir, .pv-chain { cursor: pointer; }
}

.pv:not(.ui--run), .pv:not(.ui--run) * { animation-play-state: paused !important; }
@media (max-width: 600px) {
  .pv { height: 280px; margin: 12px 12px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pv *, .pv *::before { animation: none !important; transition: none !important; }
  .pv-match { opacity: 1; transform: none; }
  .pv-runner { display: none; }
}
