.p3scan-wrap { position: relative; background: #000; border-radius: 8px; overflow: hidden; margin: 0 auto 1rem; }
.p3scan-wrap--single { width: 100%; max-width: 340px; aspect-ratio: 1 / 1; }
.p3scan-wrap--triple { width: 100%; max-width: 480px; aspect-ratio: 16 / 7; }
.p3scan-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.p3scan-corner { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.p3scan-corner::before, .p3scan-corner::after,
.p3scan-corner span::before, .p3scan-corner span::after {
    content: ''; position: absolute; width: 22px; height: 22px;
    border-color: #1DD0D5; border-style: solid;
}
.p3scan-corner::before       { top: 10px;    left: 10px;  border-width: 3px 0 0 3px; }
.p3scan-corner::after        { top: 10px;    right: 10px; border-width: 3px 3px 0 0; }
.p3scan-corner span::before  { bottom: 10px; left: 10px;  border-width: 0 0 3px 3px; }
.p3scan-corner span::after   { bottom: 10px; right: 10px; border-width: 0 3px 3px 0; }
.p3scan-line {
    position: absolute; left: 10%; right: 10%; height: 2px; background: #e53935;
    animation: p3scanSweep 1.8s linear infinite;
}
@keyframes p3scanSweep { 0% { top: 10%; } 50% { top: 88%; } 100% { top: 10%; } }
.p3scan-steps { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }
.p3scan-step {
    width: 28px; height: 28px; border-radius: 50%; border: 2px solid #aaa;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; color: #aaa;
}
.p3scan-step.active { border-color: #1DD0D5; color: #1DD0D5; font-weight: 700; }
.p3scan-step.done   { border-color: #198754; background: #198754; color: #fff; }

/* html5-qrcode overrides */
.p3scan__reader { position: relative; width: 100%; max-width: 500px; margin: 0 auto; }
.p3scan__reader video { width: 100%; height: auto; display: block; border-radius: 8px; z-index: 1; }
.p3scan__reader #qr-shaded-region { display: none; } /* hide library's UI overlay */
/* Scan overlays */
.p3scan-start-prompt {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
    color: #fff;
}
.p3scan-start-prompt__text {
    font-size: 1.05rem;
    color: #fff;
}
/* Triple-scan countdown overlay */
.p3scan3-countdown {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}
.p3scan3-countdown__num {
    font-size: 5rem;
    font-weight: 700;
    color: #1DD0D5;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.p3scan3-countdown__text {
    font-size: 1.1rem;
    color: #fff;
}
/* Scan success toast */
.scan-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    background: #1DD0D5;
    color: #fff;
    border-radius: 16px;
    padding: 1.4rem 2.2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    box-shadow: 0 6px 32px rgba(0,0,0,0.35);
    min-width: 180px;
    text-align: center;
}
.scan-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.scan-toast__icon { font-size: 2.8rem; line-height: 1; }
.scan-toast__text { font-size: 1.15rem; font-weight: 700; }
/* Step circles: done = teal filled */
.p3scan-step.done { background: #1DD0D5; border-color: #1DD0D5; color: #fff; }