.camera-module-wrap { min-height: 0; height: calc(100vh - 220px); display: flex; align-items: center; justify-content: center; padding: 6px 0 0; }
.camera-module { width: min(760px, 100%); max-height: 100%; border: 1px solid #aeb1b8; border-radius: 16px; background: #fff; padding: 18px 22px 20px; box-shadow: 0 10px 24px rgba(21, 32, 54, .08); display: flex; flex-direction: column; }
.camera-module h3 { margin: 0 0 6px; color: #171717; font-size: 1.18rem; font-weight: 700; text-align: center; }
.camera-module p { margin: 0; color: #4a4a50; font-size: .9rem; text-align: center; }
.scan-pending-note { margin: 8px 0 0; color: #6d4b08; font-size: .83rem; font-weight: 700; }
.camera-frame-wrap { margin-top: 12px; display: flex; justify-content: center; flex: 1; min-height: 0; }
.camera-frame {
    width: min(340px, 90%, 38vh);
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    border: 2px solid #0c4fa7;
    background: radial-gradient(circle at 18% 20%, rgba(70, 95, 135, .42) 0%, rgba(32, 38, 52, .9) 44%, #0f1119 100%);
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
}
.camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}
.camera-canvas { display: none; }
.camera-frame::before { content: ""; position: absolute; inset: 14% 14%; border: 2px dashed rgba(255,255,255,.72); border-radius: 14px; }
.camera-frame::after { content: ""; position: absolute; left: 14%; right: 14%; top: 50%; height: 2px; background: rgba(106, 222, 255, .92); box-shadow: 0 0 14px rgba(106, 222, 255, .75); }
.camera-frame span { position: relative; z-index: 1; color: #dfefff; font-size: 1rem; font-weight: 600; background: rgba(5, 13, 30, .48); padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.26); }

.camera-module-footer { margin-top: 10px; display: flex; justify-content: center; align-items: center; gap: 10px; color: #5c5d65; font-size: .84rem; }
.camera-dot { width: 8px; height: 8px; border-radius: 50%; background: #0c4fa7; }

.scan-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 18, 40, 0.54);
    z-index: 500;
}
.scan-modal {
    position: fixed;
    inset: 0;
    z-index: 510;
    display: grid;
    place-items: center;
    padding: 24px;
}
.scan-modal-card {
    width: min(720px, calc(100vw - 32px));
    border: 1px solid #d7dce6;
    border-radius: 18px;
    background: #f9fbff;
    box-shadow: 0 18px 44px rgba(8, 24, 52, 0.22);
    overflow: hidden;
}
.scan-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 10px;
    background: linear-gradient(180deg, #eef4ff 0%, #f9fbff 100%);
    border-bottom: 1px solid #dce4f1;
}
.scan-modal-kicker {
    margin: 0 0 2px;
    color: #5874a4;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.scan-modal-head h3 {
    margin: 0;
    color: #173c74;
    font-size: 1rem;
    font-weight: 700;
}
.scan-modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid #c8d5ea;
    border-radius: 10px;
    background: #fff;
    color: #20457f;
    font-size: 1.35rem;
    line-height: 1;
}
.scan-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 12px 16px 8px;
}
.scan-modal-field {
    border: 1px solid #dde5f1;
    border-radius: 10px;
    background: #fff;
    padding: 7px 10px;
    min-width: 0;
}
.scan-modal-field-highlight {
    border-color: #f0c36b;
    background: linear-gradient(180deg, #fff8ea 0%, #fff2d7 100%);
    box-shadow: 0 8px 18px rgba(208, 148, 31, 0.14);
}
.scan-modal-field-wide { grid-column: 1 / -1; }
.scan-modal-field b {
    display: block;
    margin-bottom: 2px;
    color: #5874a4;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.scan-modal-field span {
    display: block;
    color: #20314c;
    font-size: .84rem;
    line-height: 1.25;
    word-break: break-word;
}
.scan-modal-field-highlight b {
    color: #9a5a00;
}
.scan-modal-field-highlight span {
    color: #4c2d00;
    font-size: .92rem;
    font-weight: 700;
}
.scan-modal-footer {
    padding: 0 16px 14px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.scan-driver-select {
    min-width: 220px;
    border: 1px solid #c9d6ea;
    border-radius: 10px;
    background: #fff;
    color: #183f75;
    font-size: .86rem;
    padding: 8px 10px;
}
.scan-modal-footer .choices {
    flex: 1 1 300px;
    min-width: 280px;
    max-width: 420px;
}
.scan-modal-footer .choices__inner {
    min-height: 36px;
    border-radius: 10px;
    border-color: #c9d6ea;
    padding: 6px 10px;
}
.scan-modal-footer .choices__list--single {
    padding: 1px 18px 1px 0;
}
.scan-modal-footer .choices__list--dropdown {
    z-index: 20;
}
.scan-modal-footer .choices.is-open .choices__list--dropdown {
    top: auto;
    bottom: calc(100% + 6px);
}
.scan-modal-footer .choices__input {
    font-size: .92rem;
}
.scan-modal-action {
    border: 1px solid #0c56b4;
    border-radius: 999px;
    background: #0c56b4;
    color: #fff;
    font-size: .86rem;
    font-weight: 700;
    padding: 7px 14px;
    white-space: nowrap;
}
.scan-modal-action-secondary {
    background: #fff;
    color: #0c56b4;
}
.scan-modal-action[disabled] {
    opacity: .65;
    cursor: not-allowed;
}
.scan-modal-note {
    margin: 0;
    padding: 0 16px 12px;
    color: #1e4f92;
    font-size: .8rem;
    text-align: left;
}
.scan-modal-note.is-error { color: #9b2f2f; }
.scan-modal-note.is-success { color: #1f6a37; }
body.scan-modal-open { overflow: hidden; }

@media (max-width: 840px) {
    .scan-modal {
        padding: 12px;
        align-items: stretch;
    }

    .scan-modal-card {
        width: 100%;
    }

    .scan-modal-grid {
        grid-template-columns: 1fr;
        padding: 10px 12px 8px;
        gap: 8px;
    }

    .scan-modal-footer {
        padding: 0 14px 14px;
        justify-content: stretch;
    }

    .scan-modal-footer .choices,
    .scan-modal-action {
        width: 100%;
        max-width: none;
    }
}
