/* placed.js: the button that placed a trade turns green with a tick drawing itself, then is itself again. Before that,
   from the tap, a pending state: a pressed fill, the label dimmed and a small spinner (round 1: every tap is
   acknowledged at once, never 3 s of nothing) */
.pt-host { position: relative; overflow: hidden; }
.pt-host > :not(.pt-ok) { transition: opacity 160ms ease; }
/* final pass r9 (critic: "for 3 seconds there's just a hairline moving along the bottom"): the whole wait reads as
   pressed: a darker fill, the label dimmed, and a small spinner at its right end (the labels sit left), until the tick (or the error) */
.pt-wait { filter: brightness(0.7) saturate(0.85); }
.pt-wait > :not(.pt-ok) { opacity: 0.28; }
.pt-wait::after { content: ""; position: absolute; inset: auto; left: auto; top: 50%; right: 14px; bottom: auto; width: 18px; height: 18px; margin: -9px 0 0 0; box-sizing: border-box; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; opacity: 0.95; pointer-events: none; animation: ptSpin 700ms linear infinite; }
@keyframes ptSpin { to { transform: rotate(360deg); } }
/* the tick: the label steps out while it shows and comes back only after it has faded */
.pt-on { color: transparent !important; }
.pt-on > :not(.pt-ok) { opacity: 0; }
.pt-on.pt-wait { filter: none; }
.pt-on::after { display: none; }
.pt-ok { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; background: var(--ob-up, #30d158); border-radius: inherit; pointer-events: none; animation: ptIn 160ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.pt-ok svg { width: 30px; height: 30px; max-height: 70%; fill: none; stroke: #000; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; animation: ptDraw 300ms 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards, ptPop 280ms 330ms ease-out; }
.pt-ok.out { opacity: 0; transition: opacity 200ms ease; }
@keyframes ptIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes ptDraw { to { stroke-dashoffset: 0; } }
@keyframes ptPop { 0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .pt-ok, .pt-ok svg { animation: none; } .pt-ok svg { stroke-dashoffset: 0; }
  .pt-wait::after { animation-duration: 1600ms; }
}

/* success is its own green (--ob-ok), separate from the P&L / Up green (vihan, 18 Nov) */
.pt-ok { background: var(--ob-ok, #10b981); }
.pt-ok svg { stroke: #fff; }
