.topup-receipt {
    max-width: 580px;
    margin: 0 auto;
    padding: clamp(14px, 4vw, 24px);
    border: 1px solid #e0e8dd;
    border-radius: 20px;
    background: #fff;
    color: #19271a;
    box-shadow: 0 14px 38px -26px #27492a69;
    text-align: left;
}
#orderPaymentReceipt {
    scroll-margin-top: 90px;
}
#orderPaymentQr[hidden], #orderPaymentReceipt[hidden] { display: none; }
.topup-receipt__header { display: flex; align-items: center; gap: 10px; }
.topup-receipt__header h4 { margin: 0 0 3px; font-size: 1rem; font-weight: 750; }
.topup-receipt__header p { margin: 0; color: #576357; font-size: .82rem; }
.topup-receipt__check {
    display: grid; place-items: center; flex: 0 0 32px; height: 32px;
    border-radius: 50%; background: #e7f4d9; color: #336318; font-weight: 800;
}
.topup-receipt__details {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px; margin: 12px 0; padding: 10px 12px;
    border-radius: 11px; background: #f6f8f4; font-size: .78rem;
}
.topup-receipt__details div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; }
.topup-receipt__details dt { color: #5c685c; font-weight: 500; }
.topup-receipt__details dd { margin: 0; color: #212d22; font-weight: 700; overflow-wrap: anywhere; }
.topup-progress {
    padding: clamp(14px, 4vw, 22px);
    border: 1px solid #d8e7ce;
    border-radius: 15px;
    background: linear-gradient(145deg, #f1f8ec, #f9fcf7 74%);
    color: #243721;
}
.topup-progress h5 { margin: 0; font-size: clamp(1rem, 3.5vw, 1.18rem); font-weight: 750; }
.topup-progress ol {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    margin: 13px 0 10px;
    list-style: none;
}
.topup-progress li { position: relative; padding-top: 10px; color: #596456; font-size: .77rem; }
.topup-progress li::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    border-radius: 99px;
    background: #dce7d6;
    content: "";
}
.topup-progress li.is-active { color: #214a13; font-weight: 700; }
.topup-progress li.is-active::before, .topup-progress li.is-done::before { background: #70ad41; }
.topup-progress[data-outcome=""] li.is-active::before {
    background: linear-gradient(105deg, #437e34 25%, #bcf78a 48%, #437e34 72%);
    background-size: 230% 100%;
    animation: topup-scan 1.65s linear infinite;
}
.topup-progress[data-outcome="failed"] li.is-active::before { background: #b34638; }
.topup-progress[data-outcome="review"] li.is-active::before { background: #ad741c; }
.topup-progress__status {
    color: #20311b; margin: 0; min-height: 2.7em; font-size: .94rem; font-weight: 600; line-height: 1.45;
}
.topup-progress[data-outcome=""] .topup-progress__text::after {
    display: inline-block; width: 2px; height: 1em; margin-left: 3px;
    vertical-align: -.13em; background: #5a963c; content: "";
    animation: topup-cursor .85s steps(1) infinite;
}
.topup-progress__announcement {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.topup-progress__clock {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    padding-top: 9px;
    border-top: 1px solid #dce9d7;
    color: #4e614b;
    font-size: .78rem;
}
.topup-progress__clock strong {
    color: #254320;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}
.topup-progress__clock small { grid-column: 1 / -1; font-size: .75rem; }
.topup-progress__clock small:empty { display: none; }
.topup-progress__celebration {
    position: relative;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #deebd4;
    border-radius: 11px;
    background: #eaf5e2;
    color: #2b4b22;
}
.topup-progress__celebration p { margin: 0 0 8px; font-size: .85rem; font-weight: 650; }
.topup-progress__listen {
    padding: 4px 9px;
    border: 1px solid #b9d5ad;
    border-radius: 7px;
    background: #f7fcf5;
    color: #285119;
    font: inherit;
    font-size: .77rem;
    cursor: pointer;
}
.topup-progress__listen:focus-visible { outline: 2px solid #39751e; outline-offset: 2px; }
.topup-progress__burst { position: absolute; pointer-events: none; inset: 0; overflow: visible; }
.topup-progress__burst i {
    position: absolute; top: 35%; left: 50%; width: 6px; height: 8px;
    border-radius: 2px; background: var(--piece-color);
    animation: topup-confetti 1.1s cubic-bezier(.2, .65, .25, 1) both;
}
@keyframes topup-confetti {
    0% { opacity: 0; transform: translate(-50%, -20%) scale(.3); }
    22% { opacity: 1; }
    75% { opacity: .9; }
    100% { opacity: 0; transform: translate(var(--piece-x), var(--piece-y)) rotate(var(--piece-turn)); }
}
@keyframes topup-scan { from { background-position: 100% 0; } to { background-position: -80% 0; } }
@keyframes topup-cursor { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .topup-progress[data-outcome=""] li.is-active::before { animation: none; }
    .topup-progress[data-outcome=""] .topup-progress__text::after { display: none; }
    .topup-progress__burst { display: none; }
}

/* Floating order progress */
.topup-fab{
    position:fixed;right:16px;bottom:266px;z-index:10001;display:flex;align-items:center;gap:8px;
    min-height:44px;max-width:calc(100vw - 32px);padding:6px 12px 6px 7px;border:1px solid #d7e9c6;
    border-radius:999px;background:#f7fdf0;color:#315900;font:inherit;font-size:13px;font-weight:700;
    box-shadow:0 6px 20px rgba(36,70,23,.14);cursor:pointer;
}
.topup-fab[hidden],#topupFabDismiss[hidden]{display:none;}
.topup-fab__icon{
    display:grid;place-items:center;width:27px;height:27px;flex:0 0 27px;
    border-radius:50%;background:#e4f3d5;color:#315900;font-size:17px;
}
.topup-fab[data-outcome=""] .topup-fab__icon{animation:topup-fab-spin 2s linear infinite;}
@keyframes topup-fab-spin{to{transform:rotate(360deg);}}
.topup-fab[data-outcome="review"],.topup-fab[data-outcome="failed"]{
    border-color:#f0d69f;background:#fffbeb;color:#783f06;
}
.topup-fab[data-outcome="review"] .topup-fab__icon,.topup-fab[data-outcome="failed"] .topup-fab__icon{
    background:#fef0cb;color:#783f06;
}
#topupDialog{
    box-sizing:border-box;width:min(390px,calc(100% - 28px));max-height:calc(100dvh - 28px);
    padding:18px;border:1px solid #e5e7eb;border-radius:18px;background:#fff;color:#111827;
    box-shadow:0 16px 48px rgba(15,23,42,.18);overflow:auto;
}
#topupDialog::backdrop{background:rgba(15,23,42,.44);}
#topupDialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;}
#topupDialog h2{margin:2px 0 4px;font-size:18px;font-weight:700;}
#topupDialogCode{margin:0;color:#6b7280;font-size:13px;overflow-wrap:anywhere;}
#topupDialog header button{
    width:44px;height:44px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;color:#374151;
    font-size:24px;line-height:1;cursor:pointer;
}
#topupDialogSteps{display:grid;gap:9px;margin:16px 0;padding:0;list-style:none;}
#topupDialogSteps li{display:flex;align-items:center;gap:8px;color:#586170;font-size:13px;}
#topupDialogSteps li::before{content:"";width:18px;height:18px;display:grid;place-items:center;border:1px solid #d1d5db;border-radius:50%;flex:none;}
#topupDialogSteps li.is-done::before{content:"✓";border-color:#315900;background:#315900;color:#fff;font-size:11px;}
#topupDialogSteps li[aria-current="step"]{color:#315900;font-weight:700;}
#topupDialogSteps li[aria-current="step"]::before{border:5px solid #dcebc9;background:#568615;}
#topupDialog[data-outcome="failed"] li[aria-current="step"]{color:#783f06;}
#topupDialog[data-outcome="failed"] li[aria-current="step"]::before{border-color:#fef0cb;background:#b45309;}
#topupDialogStatus{margin:0;padding:12px;border-radius:10px;background:#f3f7ef;color:#315900;font-size:14px;overflow-wrap:anywhere;}
#topupDialog:is([data-outcome="review"],[data-outcome="failed"]) #topupDialogStatus{background:#fffbeb;color:#783f06;}
#topupFabDismiss{
    display:block;margin:12px 0 0 auto;min-height:44px;padding:0 14px;border:0;border-radius:10px;
    background:#315900;color:#fff;font-size:13px;font-weight:700;cursor:pointer;
}
.topup-fab:focus-visible,#topupDialog button:focus-visible{outline:2px solid #568615;outline-offset:2px;}
@media(max-width:480px){.topup-fab{bottom:260px;}}
@media(prefers-reduced-motion:reduce){.topup-fab[data-outcome=""] .topup-fab__icon{animation:none;}}

