/* MARASIPOS cinematic product story — demo pointer + flow trails.
 *
 * The pointer is a visual arrow that lives INSIDE #hero (position:absolute
 * in the section — never fixed), so it scrolls away with the hero and can
 * never follow the viewport. Pure transform/opacity motion. Never created
 * on touch devices or under prefers-reduced-motion (JS gates creation too). */

/* ---------- demo pointer: a real desktop arrow ---------- */
.lp-ptr {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 90;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.38s ease;
  will-change: transform;
}
.lp-ptr.is-on { opacity: 1; }
.lp-ptr__in {
  display: block;
  transform-origin: 0 0;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lp-ptr__svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 2px 5px rgba(2, 6, 20, 0.55)) drop-shadow(0 0 1px rgba(2, 6, 20, 0.7));
  transition: filter 0.3s ease;
}
.lp-ptr__svg path {
  fill: #ffffff;
  stroke: #0a1633;
  stroke-width: 1.1;
  stroke-linejoin: round;
}
/* subtle brand glow only while pointing at something interactive */
.lp-ptr.is-hover .lp-ptr__svg {
  filter: drop-shadow(0 2px 5px rgba(2, 6, 20, 0.55)) drop-shadow(0 0 7px rgba(94, 234, 212, 0.9));
}
.lp-ptr.is-hover .lp-ptr__in { transform: scale(1.07); }
/* satisfying click: fast compress, springy release */
.lp-ptr.is-press .lp-ptr__in {
  transform: scale(0.85);
  transition-duration: 0.07s;
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.lp-ptr__rip {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(94, 234, 212, 0.85);
  transform: translate(-42%, -36%) scale(0.35);
  opacity: 0.9;
  animation: lpPtrRip 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: none;
}
@keyframes lpPtrRip {
  100% { transform: translate(-42%, -36%) scale(1.9); opacity: 0; }
}

/* ---------- hover feedback: mirror the element's real hover ---------- */
.is-demo-hover {
  filter: brightness(1.14);
  transition: filter 0.25s ease, transform 0.25s var(--lp-ease, ease),
              border-color 0.25s ease, background-color 0.25s ease;
}
.pos__tile.is-demo-hover {
  transform: translateY(-3px);
  border-color: rgba(20, 184, 166, 0.5);
  background: rgba(20, 184, 166, 0.09);
}
.pos__rail span.is-demo-hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--lp-on-dark, #ddfff5);
}
.pos-tbl.is-demo-hover {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.5);
  background: rgba(20, 184, 166, 0.09);
}
.pos-kc.is-demo-hover {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.45);
}
.lp-list__row.is-demo-hover {
  transform: translateX(-4px);
  background: rgba(255, 255, 255, 0.07);
}
.pos__seg i.is-demo-hover {
  border-color: rgba(94, 234, 212, 0.5);
  color: var(--lp-on-dark, #ddfff5);
}
.pos__pay.is-demo-hover { transform: translateY(-2px); }

/* ---------- click acknowledgement ring on the pressed target ---------- */
.pos__tile.is-demo-fire,
.pos__rail span.is-demo-fire,
.pos-tbl.is-demo-fire,
.pos-kc.is-demo-fire,
.lp-list__row.is-demo-fire,
.pos__seg i.is-demo-fire,
.pos__pay.is-demo-fire { position: relative; }
.is-demo-fire::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid rgba(94, 234, 212, 0.85);
  border-radius: inherit;
  animation: lpFireRing 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: none;
}
@keyframes lpFireRing {
  0% { transform: scale(0.95); opacity: 0; }
  22% { opacity: 1; }
  100% { transform: scale(1.13); opacity: 0; }
}

/* ---------- flow trail: data moving between product screens ---------- */
.lp-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.lp-trail.is-on { opacity: 1; }
.lp-trail__base {
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-dasharray: 5 9;
  animation: lpTrailFlow 1.4s linear infinite;
  filter: drop-shadow(0 0 4px rgba(94, 234, 212, 0.35));
}
.lp-trail__pulse {
  fill: none;
  stroke: #5eead4;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 6 var(--tl, 900);
  animation: lpTrailPulse var(--pt, 3s) linear infinite;
  filter: drop-shadow(0 0 7px rgba(94, 234, 212, 0.7));
}
@keyframes lpTrailFlow { to { stroke-dashoffset: -28; } }
@keyframes lpTrailPulse {
  0% { stroke-dashoffset: 0; }
  74% { stroke-dashoffset: calc(var(--tl, 900) * -1); }
  100% { stroke-dashoffset: calc(var(--tl, 900) * -1); }
}
.lp-trail__dot {
  fill: #5eead4;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 5px rgba(94, 234, 212, 0.8));
  animation: lpNodeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards,
             lpNodeIdle 2.6s ease-in-out infinite;
  animation-delay: var(--nd, 0s), calc(var(--nd, 0s) + 0.9s);
}
@keyframes lpNodeIn {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 0.95; transform: scale(1); }
}
@keyframes lpNodeIdle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.55); }
}

/* ---------- safety: never on touch / reduced motion ---------- */
@media (hover: none), (pointer: coarse) {
  .lp-ptr { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-ptr,
  .lp-trail { display: none !important; }
}

/* ============================================================
   THE JOURNEY OF ONE ORDER — story layer (scenes 01–03)
   A light point assembles a QR code, the customer's phone builds
   ORDER #1042, then the phone dissolves to light and the real POS
   resolves from depth. Driven by data-story on .lp-stage:
   light → qr → phone → orb → pos → (unset = resting composition).
   Motion budget: transform / opacity / filter only.
   ============================================================ */
.lp-story {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.lp-story__sc {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.42s ease;
}
.lp-stage[data-story="light"] .lp-story__sc.is-light,
.lp-stage[data-story="qr"] .lp-story__sc.is-qr,
.lp-stage[data-story="phone"] .lp-story__sc.is-phone,
.lp-stage[data-story="orb"] .lp-story__sc.is-orb { opacity: 1; }
/* the phone scene stays up under orb so it can collapse INTO the orb */
.lp-stage[data-story="orb"] .lp-story__sc.is-phone { transition-duration: 0.2s; }

/* ---- scene 01: the point of light ---- */
.lp-story__sp {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #c8fff4 34%, rgba(94, 234, 212, 0) 72%);
  box-shadow:
    0 0 22px 7px rgba(94, 234, 212, 0.55),
    0 0 90px 34px rgba(27, 99, 224, 0.26);
  transform: scale(0.4);
}
.lp-stage[data-story="light"] .lp-story__sp {
  animation: lpSpIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both,
             lpSpPulse 1.35s ease-in-out 0.7s infinite;
}
@keyframes lpSpIn {
  from { transform: scale(0.1); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes lpSpPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.5); filter: brightness(1.45); }
}

/* ---- scene 02: the QR code emerges from the light ---- */
.lp-story-qr {
  position: relative;
  width: clamp(148px, 36%, 216px);
  aspect-ratio: 1;
  padding: 10px;
  border-radius: 16px;
  background: rgba(4, 7, 15, 0.78);
  border: 1px solid rgba(94, 234, 212, 0.35);
  box-shadow: 0 0 0 1px rgba(10, 22, 53, 0.9), 0 18px 50px rgba(2, 6, 20, 0.55);
  overflow: hidden;
}
.lp-story-qr__svg { display: block; width: 100%; height: 100%; }
.lp-story-qr__svg path { fill: #eafffb; }
.lp-stage[data-story="qr"] .lp-story-qr {
  animation: lpQrIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes lpQrIn {
  0% { opacity: 0; transform: scale(0.5); filter: blur(16px) brightness(2.2); }
  55% { opacity: 1; filter: blur(0) brightness(1.35); }
  100% { opacity: 1; transform: scale(1); filter: blur(0) brightness(1); }
}
.lp-story-qr__scan {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 8%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(to left, rgba(94, 234, 212, 0), #5eead4, rgba(94, 234, 212, 0));
  box-shadow: 0 0 14px rgba(94, 234, 212, 0.95);
  opacity: 0;
}
.lp-stage[data-story="qr"] .lp-story-qr__scan {
  animation: lpScan 1.02s ease-in-out 0.55s 2;
}
@keyframes lpScan {
  0% { opacity: 0; transform: translateY(0); }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { opacity: 0; transform: translateY(calc(clamp(148px, 36%, 216px) * 0.78)); }
}
.lp-story__cap {
  position: absolute;
  bottom: 12%;
  font-size: 12.5px;
  font-weight: 700;
  color: #5eead4;
  padding: 7px 16px;
  border-radius: var(--lp-r-pill, 999px);
  background: rgba(4, 7, 15, 0.72);
  border: 1px solid rgba(20, 184, 166, 0.4);
  opacity: 0;
}
.lp-stage[data-story="qr"] .lp-story__cap {
  animation: lpCapIn 0.5s ease 0.7s both;
}
@keyframes lpCapIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---- scene 03: the customer's phone builds ORDER #1042 ---- */
.lp-story__sc.is-phone { perspective: 950px; }
.lp-story-phone {
  position: relative;
  width: clamp(168px, 40%, 236px);
  border-radius: 26px;
  padding: 30px 15px 16px;
  background: linear-gradient(165deg, rgba(14, 27, 58, 0.97), rgba(6, 12, 28, 0.99));
  border: 1px solid rgba(126, 170, 255, 0.42);
  box-shadow:
    0 34px 74px rgba(2, 6, 20, 0.62),
    0 0 0 6px rgba(10, 22, 53, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform-origin: 50% 42%;
}
.lp-story-phone__notch {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 54px;
  height: 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  transform: translateX(-50%);
}
.lp-story-phone__in { display: grid; gap: 8px; }
.lp-story-phone__in .k {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #5eead4;
  opacity: 0;
}
.lp-story-phone__in > b {
  font-family: Consolas, monospace;
  font-size: 25px;
  font-weight: 800;
  color: var(--lp-on-dark, #ddfff5);
  line-height: 1;
  opacity: 0;
}
.lp-story-phone__in ul { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 5px; }
.lp-story-phone__in li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--lp-on-dark-dim, #b9cbE8);
  padding-bottom: 5px;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.14);
  opacity: 0;
}
.lp-story-phone__in li i { font-style: normal; color: var(--lp-on-dark-faint, #8aa0c6); }
.lp-story-phone__tot {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  color: var(--lp-on-dark, #ddfff5);
  opacity: 0;
}
.lp-story-phone__tot em { font-style: normal; color: #5eead4; }
.lp-story-phone__go {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  padding: 9px 10px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(27, 99, 224, 0.85), rgba(20, 184, 166, 0.85));
  color: #f4fffd;
  opacity: 0;
}
.lp-stage[data-story="phone"] .lp-story-phone {
  animation: lpPhoneIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes lpPhoneIn {
  from { opacity: 0; transform: translateY(52px) rotateX(26deg) scale(0.9); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.lp-stage[data-story="phone"] .lp-story-phone__in .k { animation: lpElIn 0.4s ease 0.42s both; }
.lp-stage[data-story="phone"] .lp-story-phone__in > b { animation: lpElIn 0.4s ease 0.54s both; }
.lp-stage[data-story="phone"] .lp-story-phone__in li:nth-child(1) { animation: lpElIn 0.4s ease 0.74s both; }
.lp-stage[data-story="phone"] .lp-story-phone__in li:nth-child(2) { animation: lpElIn 0.4s ease 0.9s both; }
.lp-stage[data-story="phone"] .lp-story-phone__in li:nth-child(3) { animation: lpElIn 0.4s ease 1.06s both; }
.lp-stage[data-story="phone"] .lp-story-phone__tot { animation: lpElIn 0.4s ease 1.34s both; }
.lp-stage[data-story="phone"] .lp-story-phone__go {
  animation: lpElIn 0.4s ease 1.62s both, lpGoGlow 1.1s ease 2.1s 1;
}
@keyframes lpElIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
@keyframes lpGoGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(94, 234, 212, 0); }
  50% { box-shadow: 0 0 22px rgba(94, 234, 212, 0.55); filter: brightness(1.2); }
}

/* ---- scene 03: the phone collapses into a light orb ---- */
.lp-stage[data-story="orb"] .lp-story-phone {
  animation: lpPhoneOut 0.55s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes lpPhoneOut {
  to { opacity: 0; transform: scale(0.14) translateY(6px); filter: blur(10px); }
}
.lp-story__orb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: radial-gradient(120% 160% at 30% 20%, #ffffff, #5eead4 46%, #1b63e0 120%);
  box-shadow: 0 0 26px 6px rgba(94, 234, 212, 0.5), 0 0 80px 24px rgba(27, 99, 224, 0.25);
  opacity: 0;
}
.lp-story__orb b {
  font-family: Consolas, monospace;
  font-size: 13.5px;
  font-weight: 800;
  color: #04101f;
}
.lp-stage[data-story="orb"] .lp-story__orb {
  animation: lpOrbFly 1.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes lpOrbFly {
  0% { opacity: 0; transform: translateY(-46px) scale(0.4); }
  26% { opacity: 1; }
  70% { opacity: 1; transform: translateY(6px) scale(1.06); }
  100% { opacity: 0; transform: translateY(16px) scale(1.5); filter: blur(4px); }
}

/* ---- the POS resolves from depth (scene 03 → 04) ---- */
.lp-stage[data-story] .pos {
  opacity: 0;
  transform: scale(0.93);
  filter: blur(14px);
  transition: opacity 0.62s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.75s ease;
}
.lp-stage[data-story="pos"] .pos,
.lp-stage[data-story="done"] .pos {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
/* chips + toast wait for the POS */
.lp-stage[data-story] .lp-chip,
.lp-stage[data-story] .lp-toast { opacity: 0; }
.lp-stage[data-story="pos"] .lp-chip,
.lp-stage[data-story="pos"] .lp-toast {
  opacity: 1;
  transition: opacity 0.5s ease 0.45s;
}

/* impact: the finished order lands */
.pos.is-impact { animation: lpImpact 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes lpImpact {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(94, 234, 212, 0); }
  34% { transform: scale(1.014); box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.55), 0 0 54px rgba(20, 184, 166, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(94, 234, 212, 0); }
}

/* ---- mobile: same story, lighter ---- */
@media (max-width: 767px) {
  .lp-story-qr { width: clamp(120px, 46%, 170px); }
  .lp-story-phone { width: clamp(150px, 56%, 200px); }
  .lp-story__cap { bottom: 8%; font-size: 11.5px; }
}

/* ============================================================
   STORY v2 — chapters, voice, live tracking, the invoice finale
   ============================================================ */

/* ---- phone scene: a live voice call builds the order ---- */
.lp-story-phone__call {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 800;
  color: #5eead4;
  opacity: 0;
}
.lp-story-phone__call .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
  flex: none;
}
.lp-story-phone__call .wv { display: inline-flex; align-items: center; gap: 2px; height: 12px; margin-inline-start: auto; }
.lp-story-phone__call .wv i {
  width: 2.5px;
  height: 100%;
  border-radius: 2px;
  background: #5eead4;
  transform: scaleY(0.3);
}
.lp-stage[data-story="phone"] .lp-story-phone__call { animation: lpElIn 0.4s ease 0.35s both; }
.lp-stage[data-story="phone"] .lp-story-phone__call .wv i { animation: lpVoiceBar 0.7s ease-in-out infinite alternate; }
.lp-story-phone__call .wv i:nth-child(2) { animation-delay: 0.12s !important; }
.lp-story-phone__call .wv i:nth-child(3) { animation-delay: 0.24s !important; }
.lp-story-phone__call .wv i:nth-child(4) { animation-delay: 0.08s !important; }
.lp-story-phone__call .wv i:nth-child(5) { animation-delay: 0.2s !important; }
@keyframes lpVoiceBar { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }

/* the order lines arrive as they are spoken */
.lp-stage[data-story="phone"] .lp-story-phone__in > b { animation-delay: 0.5s; }
.lp-stage[data-story="phone"] .lp-story-phone__in li:nth-child(1) { animation-delay: 1.15s; }
.lp-stage[data-story="phone"] .lp-story-phone__in li:nth-child(2) { animation-delay: 1.4s; }
.lp-stage[data-story="phone"] .lp-story-phone__in li:nth-child(3) { animation-delay: 1.65s; }
.lp-stage[data-story="phone"] .lp-story-phone__tot { animation-delay: 2.3s; }
.lp-stage[data-story="phone"] .lp-story-phone__go { animation: lpElIn 0.4s ease 2.65s both, lpGoGlow 1.1s ease 3s 1; }

/* speech bubbles beside the phone */
.lp-story-bubble {
  position: absolute;
  z-index: 2;
  /* sized to the free space beside the phone (phone = 40% of the stage) */
  max-width: min(29%, 200px);
  padding: 9px 12px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--lp-on-dark, #ddfff5);
  border-radius: 14px;
  background: rgba(9, 16, 36, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px rgba(2, 6, 20, 0.5);
  opacity: 0;
}
.lp-story-bubble__who {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
  color: var(--lp-on-dark-faint, #6ea396);
}
.lp-story-bubble.is-cust {
  top: 7%;
  inset-inline-start: 0;
  border-start-end-radius: 4px;
  border-color: rgba(126, 170, 255, 0.4);
}
.lp-story-bubble.is-cust .lp-story-bubble__who { color: #7eaaff; }
.lp-story-bubble.is-staff {
  bottom: 16%;
  inset-inline-end: 0;
  border-end-start-radius: 4px;
  border-color: rgba(20, 184, 166, 0.45);
  background: rgba(8, 30, 34, 0.94);
}
.lp-story-bubble.is-staff .lp-story-bubble__who { color: #5eead4; }
.lp-stage[data-story="phone"] .lp-story-bubble.is-cust { animation: lpBubbleIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both; }
.lp-stage[data-story="phone"] .lp-story-bubble.is-staff { animation: lpBubbleIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 1.95s both; }
@keyframes lpBubbleIn {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

/* ---- story HUD: chapter bars + subtitle above the stage ---- */
.lp-storyhud {
  position: absolute;
  z-index: 8;
  inset-inline: 3%;
  bottom: calc(100% + 16px);
  display: grid;
  gap: 9px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.lp-stage.has-hud .lp-storyhud { opacity: 1; transform: none; }
.lp-storyhud__bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.lp-storyhud__bars i {
  display: block;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.lp-storyhud__bars b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(to left, #5eead4, #1b63e0);
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.6);
  transform: scaleX(0);
  transform-origin: 100% 50%;   /* fills right → left with the reading direction */
}
.lp-storyhud__bars i.is-done b { transform: scaleX(1); transition: transform 0.3s ease; }
.lp-storyhud__bars i.is-on b { transform: scaleX(1); transition: transform var(--d, 3s) linear; }
.lp-storyhud__cap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--lp-on-dark, #ddfff5);
  text-shadow: 0 2px 12px rgba(2, 6, 20, 0.8);
}
.lp-storyhud__n {
  flex: none;
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  color: #5eead4;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.38);
  background: rgba(20, 184, 166, 0.1);
}
.lp-storyhud__t.is-swap { animation: lpCapSwap 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.lp-storyhud__n.is-swap { animation: lpCapSwap 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes lpCapSwap {
  from { opacity: 0; transform: translateY(8px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
.lp-storyhud.is-end .lp-storyhud__t { color: #5eead4; }

/* ---- picture-in-picture: the customer's phone follows the order ---- */
.lp-pip {
  position: absolute;
  z-index: 7;
  top: -5%;
  inset-inline-end: -5%;
  width: 118px;
  padding: 18px 11px 11px;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(14, 27, 58, 0.97), rgba(6, 12, 28, 0.99));
  border: 1px solid rgba(126, 170, 255, 0.4);
  box-shadow: 0 22px 50px rgba(2, 6, 20, 0.6), 0 0 0 4px rgba(10, 22, 53, 0.6);
  display: grid;
  gap: 5px;
  opacity: 0;
  transform: translateY(14px) scale(0.86) rotate(4deg);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.lp-stage.has-pip .lp-pip { opacity: 1; transform: rotate(-3deg); }
/* its job ends at "delivered": it bows out as the invoice prints in its corner */
.lp-stage.has-pip.is-rcpt .lp-pip { opacity: 0; transform: translateY(-10px) scale(0.9) rotate(-6deg); }
.lp-pip__notch {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 30px;
  height: 4px;
  margin-left: -15px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
}
.lp-pip__k { font-size: 9.5px; font-weight: 800; color: var(--lp-on-dark-faint, #6ea396); }
.lp-pip__no { font-family: Consolas, monospace; font-size: 16px; font-weight: 800; color: var(--lp-on-dark, #ddfff5); line-height: 1; }
.lp-pip__steps { list-style: none; margin: 3px 0 0; padding: 0; display: grid; gap: 3px; }
.lp-pip__steps li {
  position: relative;
  padding-inline-start: 14px;
  font-size: 10px;
  font-weight: 700;
  color: var(--lp-on-dark-faint, #6ea396);
  transition: color 0.3s ease;
}
.lp-pip__steps li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.lp-pip__steps li.is-done { color: var(--lp-on-dark-dim, #9fd8c9); }
.lp-pip__steps li.is-done::before { background: #14b8a6; border-color: #14b8a6; }
.lp-pip__steps li.is-on { color: #5eead4; }
.lp-pip__steps li.is-on::before {
  background: #5eead4;
  border-color: #5eead4;
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.25);
}
.lp-pip__st {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  padding: 5px 6px;
  border-radius: 8px;
  color: #f4fffd;
  background: linear-gradient(135deg, rgba(27, 99, 224, 0.85), rgba(20, 184, 166, 0.85));
}
.lp-pip__st.is-bump { animation: lpPipBump 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes lpPipBump {
  0% { transform: scale(0.9); filter: brightness(1.5); }
  100% { transform: none; filter: none; }
}

/* ---- the finale: the invoice prints out over the cart ---- */
.lp-story-rcpt {
  position: absolute;
  z-index: 7;
  top: 15%;
  left: 3.5%;
  width: min(230px, 36%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lp-stage.is-rcpt .lp-story-rcpt { opacity: 1; }
.lp-story-rcpt__slot {
  position: relative;
  z-index: 2;
  display: block;
  height: 8px;
  margin: 0 -6px;
  border-radius: 6px;
  background: #0b1430;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -2px 0 rgba(94, 234, 212, 0.55), 0 6px 14px rgba(2, 6, 20, 0.6);
}
.lp-story-rcpt__clip { overflow: hidden; margin-top: -3px; padding: 0 4px 14px; }
.lp-story-rcpt__paper {
  padding: 13px 12px 18px;
  color: #0a1633;
  background: linear-gradient(to bottom, #e8f1fb, #fbfdff 18%);
  box-shadow: 0 16px 34px rgba(2, 6, 20, 0.55);
  display: grid;
  gap: 5px;
  transform: translateY(-102%);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 10px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 10px 100%;
}
.lp-stage.is-rcpt .lp-story-rcpt__paper {
  /* thermal-printer feed: quick bursts, not one smooth slide */
  animation: lpRcptFeed 1.7s linear 0.15s forwards, lpRcptTear 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 2.1s forwards;
}
@keyframes lpRcptFeed {
  0% { transform: translateY(-102%); }
  14% { transform: translateY(-84%); }
  22% { transform: translateY(-80%); }
  38% { transform: translateY(-58%); }
  46% { transform: translateY(-54%); }
  64% { transform: translateY(-30%); }
  72% { transform: translateY(-26%); }
  92% { transform: translateY(-3%); }
  100% { transform: translateY(0); }
}
@keyframes lpRcptTear {
  from { translate: 0 0; rotate: 0deg; }
  to { translate: 0 6px; rotate: -2.5deg; }
}
.lp-story-rcpt__h { font-size: 12px; font-weight: 800; text-align: center; }
.lp-story-rcpt__no {
  font-family: Consolas, monospace;
  font-size: 9.5px;
  text-align: center;
  color: #46536e;
  padding-bottom: 5px;
  border-bottom: 1px dashed #c7d2e3;
}
.lp-story-rcpt__row { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: #24324f; }
.lp-story-rcpt__row span:last-child { font-family: Consolas, monospace; }
.lp-story-rcpt__row.is-vat { color: #46536e; padding-top: 4px; border-top: 1px dashed #c7d2e3; }
.lp-story-rcpt__row.is-tot { font-size: 12px; font-weight: 800; color: #0a1633; }
.lp-story-rcpt__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 9.5px;
  font-weight: 800;
  color: #0f766e;
}
.lp-story-rcpt__qr {
  width: 30px;
  height: 30px;
  flex: none;
  border: 2px solid #0a1633;
  background: repeating-conic-gradient(#0a1633 0 25%, #fbfdff 0 50%) 0 0 / 6px 6px;
}

/* ---- mobile ---- */
@media (max-width: 999px) {
  .lp-stage { margin-top: 64px; }
}
@media (max-width: 767px) {
  .lp-stage { margin-top: 84px; }   /* room for a two-line subtitle */
  .lp-storyhud { inset-inline: 0; bottom: calc(100% + 14px); }
  .lp-storyhud__cap { font-size: 12.5px; }
  .lp-story-bubble { font-size: 11px; max-width: 42%; padding: 7px 10px 8px; }
  .lp-story-bubble.is-cust { top: 6%; }
  .lp-story-bubble.is-staff { bottom: 10%; }
  .lp-pip { width: 92px; top: -8%; inset-inline-end: -2%; padding: 15px 9px 9px; }
  .lp-pip__no { font-size: 13px; }
  .lp-story-rcpt { width: 46%; top: 10%; }
}

/* ---- reduced motion: never show the story layer ---- */
@media (prefers-reduced-motion: reduce) {
  .lp-story, .lp-storyhud, .lp-pip, .lp-story-rcpt { display: none !important; }
}
