.web-qr-scanner-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    color: #fff;
}

.web-qr-scanner-shell {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    overflow: hidden;
    background: #000;
}

.web-qr-scanner-video,
.web-qr-scanner-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.web-qr-scanner-video {
    object-fit: cover;
}

.web-qr-scanner-shade {
    background: linear-gradient(to bottom, rgba(0, 0, 0, .65), transparent 28%, transparent 67%, rgba(0, 0, 0, .75));
}

.web-qr-scanner-header,
.web-qr-scanner-footer,
.web-qr-scanner-center {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
}

.web-qr-scanner-header {
    top: 0;
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.5rem 1rem;
    text-align: center;
}

.web-qr-scanner-title {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
}

.web-qr-scanner-center {
    top: 50%;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
}

.web-qr-scanner-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    text-align: center;
}

.web-qr-scanner-loading[hidden] {
    display: none;
}

.web-qr-scanner-spinner {
    width: 3rem;
    height: 3rem;
    border: .25rem solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 9999px;
    animation: web-qr-scanner-spin .8s linear infinite;
}

.web-qr-scanner-viewfinder {
    display: none;
    width: min(68vw, 18rem);
    aspect-ratio: 1;
    border: 3px solid rgba(255, 255, 255, .95);
    border-radius: 1rem;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .2);
}

.web-qr-scanner-viewfinder.is-ready {
    display: block;
}

.web-qr-scanner-footer {
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    text-align: center;
}

.web-qr-scanner-instructions {
    margin: 0;
    color: #fff;
}

.web-qr-scanner-cancel {
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
    padding: .75rem 1rem;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: .5rem;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.web-qr-scanner-cancel:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

@keyframes web-qr-scanner-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .web-qr-scanner-spinner { animation-duration: 1.6s; }
}
