.client-scan-upload { margin-top: 16px; min-width: 0; color: #203d63; font-size: 12px; letter-spacing: 0; }
/* Capture shell follows public-scan-focus; all overrides are cabinet gate-scoped. */
.client-scan-upload--capture .client-scan-purpose--capture,
.client-scan-upload--capture .client-scan-examples { display: none; }
.client-scan-focus,
.client-scan-upload--capture .client-scan-upload__page { overflow: hidden; border: 1px solid #d9e5f3; border-radius: 16px; background: #fff; box-shadow: 0 16px 38px -32px rgba(7,29,67,.55); }
.client-scan-focus__header,
.client-scan-upload--capture .client-scan-upload__page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e7eef7; padding: 13px 16px; background: #f9fbfe; }
.client-scan-focus__heading { margin: 0; color: #17385f; font-size: 15px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; min-width: 0; }
.client-scan-focus__position { color: #7388a2; font-size: 12px; font-weight: 700; white-space: nowrap; }
.client-scan-focus__media,
.client-scan-upload--capture .client-scan-upload__thumbnail { position: relative; display: flex; min-height: clamp(240px, 40dvh, 420px); align-items: center; justify-content: center; overflow: hidden; background: linear-gradient(145deg,#f5f8fc,#edf3fa); }
.client-scan-focus__empty { display: flex; width: min(100%, 470px); flex-direction: column; align-items: center; padding: 30px 20px; text-align: center; }
.client-scan-focus__empty-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 18px; background: #e7f0fd; color: #164f9d; font-size: 23px; }
.client-scan-focus__empty strong { margin-top: 16px; color: #17385f; font-size: 16px; }
.client-scan-focus__warning { margin: 7px 0 0; color: #b42336; font-size: 12px; line-height: 1.55; font-weight: 800; }
.client-scan-focus__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.client-scan-focus__actions > button { min-height: 44px; max-width: 100%; overflow-wrap: anywhere; }
.client-scan-upload--capture .client-scan-upload__thumbnail img { max-width: 100%; width: auto; max-height: min(50dvh, 500px); object-fit: contain; transition: transform .18s ease; }
.client-scan-upload--capture .client-scan-upload__tools { display: flex; flex-wrap: wrap; align-items: center; }
.client-scan-upload--capture .client-scan-upload__tools button { flex: 0 0 44px; }
.client-scan-upload--capture .client-scan-upload__page-number { display: none; }
/* Public focus tools/media geometry. The bounded filmstrip is intentional in a modal. */
.client-scan-upload--capture .client-scan-upload__thumbnail { padding: 0; }
.client-scan-upload--capture .client-scan-upload__tools { gap: 6px; border-top: 1px solid #e6edf6; padding: 10px 12px; background: #fff; }
.client-scan-upload--capture .client-scan-upload__tools button { width: 44px; min-width: 44px; min-height: 44px; border-color: #d9e5f3; border-radius: 10px; color: #365273; font-size: 16px; }
.client-scan-upload--capture .client-scan-upload__tools button:last-child { margin-left: auto; color: #a13b44; }
.client-scan-upload--capture .client-scan-upload__tools button:hover:not(:disabled),
.client-scan-upload--capture .client-scan-upload__tools button:focus-visible { border-color: #7ea4d6; background: #f4f8fd; color: #0b3f86; outline: none; }
.client-scan-upload--capture .client-scan-upload__tools button:disabled { opacity: .38; }
.client-scan-upload--capture .client-scan-upload__page-header { flex-wrap: wrap; }
.client-scan-upload--capture .client-scan-upload__page-menu { position: static; flex: 1 0 100%; width: 100%; max-width: 100%; max-height: min(240px, 40dvh); box-shadow: none; }
.client-scan-upload--capture .client-scan-board { border-color: #e1eaf5; border-radius: 13px; background: #f8fbff; padding: 10px; }
.client-scan-upload--capture .client-scan-upload__filmstrip { grid-template-columns: repeat(auto-fill, minmax(min(104px, 100%), 1fr)); gap: 10px; }
.client-scan-upload--capture .client-scan-upload__film,
.client-scan-upload--capture .client-scan-board__add { height: 156px; }
.client-scan-activity { min-width: 0; padding: 10px 12px; color: #526d8d; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.client-scan-activity__label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.client-scan-activity__label strong { flex: 0 0 auto; color: #17385f; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.client-scan-activity[data-state="failed"] { color: #b42336; }
.client-scan-activity progress { display: block; width: 100%; height: 7px; margin-top: 5px; border: 0; border-radius: 999px; overflow: hidden; background: #dce7f4; appearance: none; -webkit-appearance: none; }
.client-scan-activity progress::-webkit-progress-bar { background: #dce7f4; }
.client-scan-activity progress::-webkit-progress-value { background: #1f66b3; transition: width .25s ease; }
.client-scan-activity progress::-moz-progress-bar { background: #1f66b3; }
.client-scan-activity progress:indeterminate { background: linear-gradient(90deg, #dce7f4 35%, #1f66b3 45%, #1f66b3 55%, #dce7f4 65%); background-size: 220% 100%; animation: scan-pending 1.5s linear infinite; }
.client-scan-activity progress:indeterminate::-webkit-progress-bar,
.client-scan-activity progress:indeterminate::-moz-progress-bar { background: transparent; }
.client-scan-phase { padding: 10px 12px; border-left: 3px solid #1f66b3; background: #f1f7fe; color: #365273; }
.client-scan-workspace.client-scan-workspace--capture { height: 100dvh; height: var(--client-scan-viewport-height, 100dvh); top: var(--client-scan-viewport-top, 0px); bottom: auto; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
.client-scan-workspace--capture .client-scan-workspace__dialog { max-height: 100%; }
.client-scan-workspace--capture .client-scan-workspace__body { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .client-scan-activity progress, .client-scan-upload--capture * { animation: none !important; transition: none !important; } }
@media (max-height: 500px) and (orientation: landscape) { .client-scan-focus__media, .client-scan-upload--capture .client-scan-upload__thumbnail { min-height: 180px; } }
/* Match the public toolbar's existing mobile/narrow-window breakpoints. */
@media (max-width: 900px) {
    .client-scan-upload--capture .client-scan-upload__tools { flex-wrap: nowrap; gap: 4px; padding: 10px 8px; }
    .client-scan-upload--capture .client-scan-upload__tools button { width: 40px; min-width: 40px; height: 40px; min-height: 40px; flex: 0 1 40px; padding: 7px; }
    .client-scan-upload--capture .client-scan-upload__tools button:last-child { margin-left: 0; }
}
@media (max-width: 479px) {
    .client-scan-upload--capture .client-scan-focus__media,
    .client-scan-upload--capture .client-scan-upload__thumbnail { min-height: 310px; }
}
@media (max-width: 359px) {
    .client-scan-upload--capture .client-scan-upload__tools { gap: 3px; padding-right: 6px; padding-left: 6px; }
    .client-scan-upload--capture .client-scan-upload__tools button { width: 34px; min-width: 34px; height: 38px; min-height: 38px; flex-basis: 34px; padding: 6px; font-size: 14px; }
}
@media (min-width: 360px) and (max-width: 379px) {
    .client-scan-upload--capture .client-scan-upload__tools button { width: 36px; min-width: 36px; flex-basis: 36px; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .client-scan-upload--capture .client-scan-focus__media,
    .client-scan-upload--capture .client-scan-upload__thumbnail { min-height: 180px; }
    .client-scan-upload--capture .client-scan-focus__empty { padding-block: 20px; }
}
.client-scan-upload__pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; margin-top: 12px; }
.client-scan-upload__page { border: 1px solid #dce7f4; border-radius: 8px; overflow: hidden; min-width: 0; background: white; }
.client-scan-upload__thumbnail { width: 100%; min-height: 160px; display: flex; align-items: center; justify-content: center; padding: 8px; background: #f6f9fd; }
.client-scan-upload__thumbnail img { display: block; width: 100%; height: auto; object-fit: contain; }
img.client-scan-upload__thumbnail { display: block; height: auto; min-height: 0; object-fit: contain; }
.client-scan-upload button.client-scan-upload__thumbnail:disabled { opacity: 1; }
.client-scan-upload__tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px; background: #f8fbff; border-top: 1px solid #dce7f4; }
.client-scan-upload__page-number { grid-column: 1 / -1; font-size: 14px; line-height: 1.4; font-weight: 800; overflow-wrap: anywhere; }
.client-scan-upload__tools button { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 44px; border: 1px solid #d7e3f2; border-radius: 8px; background: #fff; color: #203d63; font-size: 14px; }
.client-scan-upload__tools button:hover:not(:disabled) { background: #eef3fa; }
.client-scan-upload__tools button:focus-visible { outline: 2px solid #1f66b3; outline-offset: 2px; }
.client-scan-upload button:disabled { opacity: .45; cursor: not-allowed; }
.client-scan-upload__transfer { min-height: 190px; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 12px; overflow-wrap: anywhere; }
.client-scan-upload progress { width: 100%; accent-color: #1f66b3; }
.client-scan-upload__error { color: #b14e4e; margin: 8px 0; }
.client-scan-upload__preview { margin-top: 16px; min-width: 0; }
.client-scan-upload__preview img { display: block; max-width: 100%; max-height: 70vh; margin: 12px auto; object-fit: contain; }
.client-scan-upload__pdf canvas { display: block; width: 100%; height: auto; margin: 12px auto; border: 1px solid #dce7f4; }
.client-scan-upload__confirm { margin-top: 12px; padding: 12px 0; border-top: 1px solid #dce7f4; }
.client-scan-upload__retake { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 0 12px 12px; background: #f8fbff; }
.client-scan-upload__retake > .client-scan-guide__actions { grid-column: 1 / -1; margin: 0; }
.client-scan-upload__retake > button { min-height: 44px; padding: 8px 12px; font-size: 12px; }
.client-scan-upload__pdf-scroll { overflow: auto; max-height: 70vh; overscroll-behavior: contain; }
.client-scan-upload__pdf-scroll canvas { max-width: none; }
.client-scan-upload__correction { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; margin: 0; font-size: 12px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; cursor: pointer; }
.client-scan-upload__correction input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: #1f66b3; }
.client-scan-modal { overscroll-behavior: contain; }
.client-scan-upload__filmstrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; max-height: 300px; max-height: min(300px, 42dvh); overflow-y: auto; overscroll-behavior: contain; padding: 3px; align-content: start; }
.client-scan-upload__film { position: relative; display: block; width: 100%; height: 136px; padding: 6px; border: 2px solid #dce7f4; border-radius: 12px; background: #fff; color: #203d63; touch-action: pan-y; user-select: none; -webkit-touch-callout: none; }
.client-scan-upload__film[aria-pressed="true"] { border-color: #1f66b3; background: #edf5ff; }
.client-scan-upload__film img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.client-scan-upload__film--moving { outline: 2px dashed #1f66b3; outline-offset: -5px; }
.client-scan-upload__film--failed { border-color: #b14e4e; }
.client-scan-upload__film-item { min-width: 0; }
.client-scan-upload__film-ghost { opacity: .3; }
.client-scan-board { min-width: 0; margin-top: 12px; padding: 12px; border: 1px solid #d8e5f5; border-radius: 14px; background: linear-gradient(135deg, #f8fbff 0%, #f5f9fe 100%); }
.client-scan-board--drop { border-color: #7ca8dd; background: #edf5ff; box-shadow: inset 0 0 0 1px #cfe2fb; }
.client-scan-board__toolbar { position: relative; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-bottom: 6px; color: #5a718f; }
.client-scan-board__toolbar button { min-height: 44px; font-size: 12px; line-height: 1.3; }
.client-scan-board__position-select { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 100%; padding: 10px 12px; border: 1px solid #c8d8eb; border-radius: 6px; background: #fff; color: #203d63; text-align: left; }
.client-scan-board__position-select span { min-width: 0; overflow-wrap: anywhere; }
.client-scan-board__position-select i { flex: 0 0 auto; font-size: 10px; }
.client-scan-board__status { margin: 0 0 8px; font-size: 12px; line-height: 1.4; color: #203d63; }
.client-scan-board__tile-image { display: flex; align-items: center; justify-content: center; width: 100%; height: 76px; color: #8a9bb4; font-size: 22px; }
.client-scan-board__tile-number { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin-top: 2px; font-size: 12px; line-height: 16px; touch-action: none; cursor: grab; }
.client-scan-board__tile-number i { color: #5a718f; font-size: 12px; }
.client-scan-upload__film-item.client-scan-upload__film-chosen .client-scan-upload__film { border-color: #1f66b3; background: #edf5ff; box-shadow: 0 4px 12px #203d6326; }
.client-scan-upload__film-item.client-scan-upload__film-chosen .client-scan-board__tile-number { cursor: grabbing; }
.client-scan-board__tile-state { position: absolute; top: 5px; right: 5px; display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: 4px; background: #fff; color: #203d63; font-size: 11px; line-height: 14px; }
.client-scan-upload__film--failed .client-scan-board__tile-state { color: #b14e4e; }
.client-scan-upload__film progress { appearance: none; -webkit-appearance: none; position: absolute; bottom: 3px; left: 5px; width: calc(100% - 10px); height: 3px; border: 0; border-radius: 3px; overflow: hidden; background: #dce7f4; color: #1f66b3; }
.client-scan-upload__film progress::-webkit-progress-bar { background: #dce7f4; }
.client-scan-upload__film progress::-webkit-progress-value { background: #1f66b3; }
.client-scan-upload__film progress::-moz-progress-bar { background: #1f66b3; }
.client-scan-upload__film progress:indeterminate { background: linear-gradient(90deg, #dce7f4 0%, #dce7f4 35%, #1f66b3 45%, #1f66b3 55%, #dce7f4 65%); background-size: 220% 100%; animation: scan-pending 1.5s linear infinite; }
.client-scan-upload__film progress:indeterminate::-webkit-progress-bar { background: transparent; }
.client-scan-upload__film progress:indeterminate::-moz-progress-bar { background: transparent; }
@keyframes scan-pending { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .client-scan-upload__film progress:indeterminate { animation: none; } }
.client-scan-board__order-menu, .client-scan-upload__page-menu { position: absolute; right: 0; top: 100%; z-index: 7; width: 248px; max-width: 100%; max-height: min(240px, 40vh); overflow-y: auto; padding: 6px; border: 1px solid #c8d8eb; border-radius: 8px; background: #fff; box-shadow: 0 12px 32px #071d4333; }
.client-scan-board__order-menu p { margin: 6px 8px; font-size: 12px; line-height: 1.4; }
.client-scan-board__order-menu button, .client-scan-upload__page-menu button { display: block; width: 100%; min-height: 44px; padding: 8px; border-radius: 6px; font-size: 12px; line-height: 1.4; text-align: left; background: #fff; color: #203d63; }
.client-scan-board__order-menu button:hover, .client-scan-board__order-menu button[aria-selected="true"], .client-scan-upload__page-menu button:hover { background: #eef5ff; }
.client-scan-upload__page-header { position: relative; display: flex; justify-content: flex-end; padding: 8px; background: #f6f9fd; }
.client-scan-upload__page-header > button { min-height: 44px; padding: 8px 12px; font-size: 12px; line-height: 1.4; }
.client-scan-upload__page-menu { right: 8px; max-width: calc(100% - 16px); }
.client-scan-upload__page-menu button:focus-visible { outline: 2px solid #1f66b3; outline-offset: -2px; }
.client-scan-board__add { min-width: 0; height: 136px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed #9db8dd; border-radius: 14px; background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); color: #203d63; padding: 8px; transition: border-color .2s ease, background .2s ease, color .2s ease; }
.client-scan-board__add:hover:not(:disabled) { border-color: #5f96d3; background: #f5f9ff; color: #1f66b3; }
.client-scan-board__add > i { font-size: 22px; }
.client-scan-board__add > span { font-size: 12px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.client-scan-board--empty .client-scan-upload__filmstrip { grid-template-columns: minmax(0, 1fr); }
.client-scan-board__add-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 10px; }
.client-scan-board__add-choices .client-scan-guide__button { min-width: 0; padding: 8px; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.client-scan-board .client-scan-guide__limits { margin: 8px 3px 0; font-size: 11px; line-height: 1.4; }
.client-scan-board button:focus-visible { outline: 2px solid #1f66b3; outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .client-scan-upload__film { cursor: grab; } }
.client-scan-upload__pages { grid-template-columns: minmax(0, 1fr); }
.client-scan-upload__transfer { min-height: 64px; }
.client-scan-workspace { position: fixed; inset: 0; z-index: 10020; display: flex; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: #071d4366; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
html[data-client-scan-open], html[data-client-scan-open] body { background: #9eabbc; }
.client-scan-workspace__dialog { width: 100%; max-width: 760px; max-height: 100%; display: flex; flex-direction: column; min-height: 0; background: #fff; border: 1px solid #e2eaf5; border-radius: 16px; box-shadow: 0 24px 72px #071d4333; color: #203d63; }
.client-scan-workspace__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e2eaf5; flex: 0 0 auto; }
.client-scan-workspace__header--purpose { flex-wrap: wrap; }
.client-scan-workspace__header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.client-scan-workspace__header h2 { font-size: 18px; line-height: 1.3; font-weight: 800; overflow-wrap: anywhere; }
.client-scan-workspace__body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 0 20px 16px; }
.client-scan-workspace__loading { padding: 16px 0 24px; }
.client-scan-workspace__skeleton-media { height: 190px; border-radius: 8px; background: #f5f7fa; }
.client-scan-workspace__loading p { margin: 12px 0 24px; color: #5a718f; font-size: 12px; line-height: 1.4; text-align: center; }
.client-scan-workspace__skeleton-lines { display: grid; gap: 10px; margin-bottom: 18px; }
.client-scan-workspace__skeleton-lines span { height: 12px; background: #edf2f8; border-radius: 4px; }
.client-scan-workspace__skeleton-lines span:first-child { width: 42%; height: 18px; }
.client-scan-workspace__skeleton-lines span:last-child { width: 85%; }
.client-scan-workspace__skeleton-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.client-scan-workspace__skeleton-actions span { height: 44px; border: 1px solid #e2eaf5; background: #f5f7fa; border-radius: 8px; }
.client-scan-workspace__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 16px; }
.client-scan-workspace__navigation { display: flex; flex: 0 0 100%; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; }
.client-scan-workspace__navigation > button { min-width: 0; }
.client-scan-workspace__navigation > button:last-child { margin-left: auto; }
.client-scan-workspace__options { margin-top: 16px; border-top: 1px solid #e2eaf5; padding-top: 16px; }
body[data-client-upload-open] { overflow: hidden; }
@media (max-width: 479px) {
    .client-scan-workspace__skeleton-media { height: 160px; }
    .client-scan-workspace__header { padding: 16px 12px; }
    .client-scan-workspace__body { padding: 0 12px 16px; }
    .client-scan-workspace__header h2 { font-size: 16px; }
}
