/* The receipt prints its two ledger effects in reading order. */
.moment-visual .receipt-item {
  position: relative;
  isolation: isolate;
  font-variant-numeric: tabular-nums;
}
.receipt-item .sale-outgoing,
.receipt-item .sale-delta { display: none; pointer-events: none; }
.moment-visual .sale-posted .receipt-item strong { color: #105e33; }
.sale-posted .receipt-item .sale-delta {
  position: absolute;
  right: 0;
  bottom: 0;
  display: block;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 650;
  color: #27643d;
}
.sale-posted .receipt-status.complete > span {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  flex: none;
  background: #087a34;
}
.sale-posted .receipt-status.complete > span::after {
  content: '';
  width: 7px;
  height: 4px;
  margin-top: -2px;
  border: solid white;
  border-width: 0 0 1.6px 1.6px;
  transform: rotate(-45deg);
}
.moment-explain #sample-reset:not([hidden]) {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  margin-top: 28px;
}
@media(max-width: 500px) {
  /* Keep the effect beside its trigger on short screens. */
  .moment-card .moment-visual { flex-direction: column; }
}
@media(max-width: 760px) {
  .moment-explain #sample-reset:not([hidden]) { min-height: 49px; }
}
@media (prefers-reduced-motion: no-preference) {
  .sale-posted .receipt-line {
    transform-origin: left;
    animation: sale-rule .46s cubic-bezier(.2,.8,.2,1) both;
  }
  .sale-posted .receipt-item {
    --sale-beat: .12s;
  }
  .sale-posted .receipt-item + .receipt-item { --sale-beat: .34s; }
  .sale-posted .receipt-item::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0 -6px;
    border-radius: 7px;
    background: #daf2df;
    transform-origin: left;
    pointer-events: none;
    animation: sale-row-light .8s ease-out var(--sale-beat) both;
  }
  .sale-posted .receipt-item .sale-outgoing {
    display: block;
    position: absolute;
    right: 0;
    top: 50%;
    font: inherit;
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
    color: #203d29;
    animation: sale-old-value .25s ease-in var(--sale-beat) both;
  }
  .sale-posted .receipt-item strong {
    animation: sale-new-value .42s cubic-bezier(.2,.8,.2,1) calc(var(--sale-beat) + .1s) both;
  }
  .sale-posted .receipt-item .sale-delta {
    animation: sale-new-value .35s ease-out calc(var(--sale-beat) + .2s) both;
  }
  .sale-posted .receipt-status.complete {
    animation: sale-confirmation .4s cubic-bezier(.18,.75,.25,1) .68s both;
  }
  .sale-posted .receipt-status.complete > span::after {
    animation: sale-check .23s ease-out .78s both;
  }
}
@keyframes sale-rule {
  from { transform: scaleX(.08); border-color: #087a34; }
  to { transform: scaleX(1); }
}
@keyframes sale-row-light {
  0% { transform: scaleX(.25); opacity: 0; }
  30% { transform: scaleX(1); opacity: .9; }
  100% { transform: scaleX(1); opacity: 0; }
}
@keyframes sale-old-value {
  from { opacity: 1; transform: translateY(-50%); }
  to { opacity: 0; transform: translateY(-120%); }
}
@keyframes sale-new-value {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes sale-confirmation {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes sale-check {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}
@media (prefers-reduced-motion: reduce) {
  .moment-visual .receipt-card,
  .moment-visual .receipt-card *,
  .moment-visual .receipt-card *::before,
  .moment-visual .receipt-card *::after {
    animation: none !important;
    transition: none !important;
  }
}
