@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap');
:root{--ink:#12233f;--muted:#6b7b92;--purple:#4f46e5;--border:#e0e7f0;--bg:#f6f9fc;--shadow:0 18px 50px rgba(20,35,65,.09)}*{box-sizing:border-box}body{margin:0;background:var(--bg);font:15px 'DM Sans',sans-serif;color:var(--ink)}button,input,textarea{font:inherit}button{cursor:pointer}a{color:inherit;text-decoration:none}.topbar{height:76px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 max(24px,calc((100vw - 1220px)/2))}.brand{display:flex;align-items:center;gap:12px}.brand-icon{display:grid;place-items:center;width:44px;height:44px;background:linear-gradient(145deg,#1882df,#5143db);color:white;border-radius:12px;font-size:19px}.brand strong,.brand small{display:block}.brand strong{font-size:18px;letter-spacing:-.7px}.brand small{font-size:11px;color:var(--muted)}.home,.outline{border:1px solid var(--border);border-radius:10px;background:#fff;padding:11px 15px;font-weight:700;font-size:13px}.home:hover,.outline:hover{border-color:#a5b4fc;background:#f7f8ff}.wrap{max-width:1220px;margin:auto;padding:38px 24px 80px;min-height:calc(100vh - 140px)}.auth-view{display:grid;grid-template-columns:1fr 450px;gap:70px;align-items:center;min-height:610px}.intro h1{font-size:clamp(40px,5vw,66px);line-height:1.1;letter-spacing:-2.7px;margin:20px 0}.intro h1 em{font-style:normal;color:var(--purple)}.intro>p{font-size:17px;line-height:1.85;color:var(--muted);max-width:540px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:1.5px;color:#4f46e5}.feature{display:flex;align-items:center;gap:14px;margin:21px 0;font-weight:600}.feature i{background:#ecebff;color:#4f46e5;padding:12px;border-radius:11px}.auth-card,.box,.customer-card{background:white;border:1px solid var(--border);border-radius:22px;box-shadow:var(--shadow);padding:30px}.auth-card{text-align:center}.auth-icon{width:56px;height:56px;border-radius:16px;display:grid;place-items:center;background:#eae9ff;color:var(--purple);font-size:24px;margin:0 auto 14px}.auth-card h2,.customer-card h1{margin:5px 0;font-size:24px;letter-spacing:-.8px}.muted{color:var(--muted);font-size:13px;line-height:1.6}.tabs{display:flex;background:#f1f4f9;padding:4px;border-radius:13px;margin:25px 0}.tab{flex:1;border:0;background:transparent;border-radius:10px;padding:12px 8px;font-weight:800;font-size:12px;color:#52647f}.tab.active{background:white;color:var(--purple);box-shadow:0 2px 8px #0000000c}.stack{text-align:left;display:flex;flex-direction:column;gap:16px}.stack label{font-weight:700;font-size:12px}.stack label small{font-weight:500;color:var(--muted)}.stack input,.stack textarea,.share-link input{display:block;width:100%;border:1px solid #d7e0ec;border-radius:11px;padding:13px 14px;margin-top:7px;outline:none;background:white;color:var(--ink);font-size:14px}.stack input:focus,.stack textarea:focus{border-color:var(--purple);box-shadow:0 0 0 3px #4f46e51b}.primary{border:0;border-radius:11px;background:linear-gradient(115deg,#5d50ed,#4338ca);color:white;font-weight:800;padding:14px 17px;box-shadow:0 5px 15px #4f46e533}.primary:hover{filter:brightness(1.07)}.hidden{display:none!important}.alert{padding:13px 17px;background:#fff3f3;border:1px solid #ffc6c6;color:#ad2828;border-radius:11px;margin-bottom:18px}.alert.good{background:#ecfdf5;border-color:#a7f3d0;color:#047857}.page-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.page-head h1{margin:7px 0;font-size:32px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:24px}.stat{background:white;border:1px solid var(--border);padding:22px;border-radius:16px}.stat span,.stat strong{display:block}.stat span{color:var(--muted);font-size:12px;font-weight:700}.stat strong{font-size:31px;margin-top:6px}.dash-grid{display:grid;grid-template-columns:370px 1fr;gap:24px;align-items:start}.box h2{font-size:18px;margin:0 0 10px}.box h2 i{color:var(--purple);margin-right:8px}.qr{display:flex;justify-content:center;padding:20px;background:white;border:1px dashed #cbd5e1;border-radius:14px;margin:20px 0}.qr img,.qr canvas{max-width:100%}.share-link{display:flex;gap:8px}.share-link input{margin:0;min-width:0}.btn-row{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}.btn-row button{flex:1}.queue-head{display:flex;justify-content:space-between;align-items:start;gap:12px}.jobs-list{margin-top:20px}.empty{text-align:center;padding:60px 15px;border:1px dashed #cbd5e1;border-radius:14px;color:var(--muted)}.job{padding:16px 0;border-bottom:1px solid var(--border)}.job:last-child{border-bottom:0}.job-top{display:flex;justify-content:space-between;gap:12px}.job strong{font-size:14px}.job p{color:var(--muted);font-size:12px;overflow-wrap:anywhere;margin:7px 0}.pill{font-size:11px;border-radius:20px;padding:5px 10px;background:#e0f2fe;color:#0369a1;font-weight:800;white-space:nowrap}.pill.printed{background:#dcfce7;color:#15803d}.job-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:13px}.job-actions button{padding:8px 12px;font-size:12px}.job-actions .danger{color:#b91c1c}.customer-card{max-width:570px;margin:30px auto;text-align:center}.customer-card h1{font-size:30px}.customer-card form{margin-top:28px}.privacy-note{font-size:12px;color:#66758b;background:#f1f5f9;padding:12px;border-radius:10px;line-height:1.6}.canvas-holder{overflow:auto;max-height:470px;background:#e2e8f0;border:1px solid var(--border);border-radius:12px;margin:10px 0;touch-action:none}.canvas-holder canvas{display:block;max-width:100%;margin:auto;cursor:crosshair;touch-action:none}.image-editor{padding:14px;border:1px solid #c7d2fe;border-radius:12px}.success{padding:35px 10px}.success>i{font-size:50px;color:#059669}.success h2{margin:12px 0}footer{text-align:center;color:#94a3b8;font-size:12px;padding:20px}@media(max-width:900px){.auth-view{grid-template-columns:1fr;gap:20px}.intro{display:none}.dash-grid{grid-template-columns:1fr}.wrap{padding:25px 16px 65px}}@media(max-width:500px){.topbar{padding:0 16px;height:65px}.brand strong{font-size:15px}.home{font-size:11px;padding:9px}.auth-card,.box,.customer-card{padding:20px}.stats{gap:8px}.stat{padding:13px}.stat strong{font-size:24px}.page-head h1{font-size:25px}.queue-head{flex-wrap:wrap}}

/* UniiTools portal palette, dotted backdrop, Comic Neue and responsive embedding */
:root{--ink:#112449;--muted:#60728d;--purple:#00878b;--border:#cfdeea;--bg:#effaf9;--shadow:0 14px 35px rgba(15,38,70,.08)}
body{background-color:var(--bg);background-image:radial-gradient(#a8c7d0 1px,transparent 1px);background-size:21px 21px;font-family:'Comic Neue',cursive}
button,input,textarea{font-family:inherit}
.topbar{background:#121a2b;border-bottom:2px solid #087d88}
.brand strong{color:#fff}.brand small{color:#b6d5e1}
.brand-icon,.primary{background:linear-gradient(120deg,#008e92,#075c78)}
.brand-icon{color:#fff}.home{background:#18273c;color:#e4f3f7;border-color:#40546c}
.home:hover{background:#234059;color:white}
.eyebrow,.box h2 i,.intro h1 em,.tab.active{color:#00878b}
.feature i,.auth-icon{background:#ddf7ee;color:#00878b}
.primary{box-shadow:0 5px 14px #03677e33}
.stack input:focus,.stack textarea:focus{border-color:#00878b;box-shadow:0 0 0 3px #00878b1f}
body.embed .topbar,body.embed footer{display:none}
body.embed .wrap{max-width:1150px;padding:8px 4px 18px;min-height:0}
body.embed .auth-view{min-height:610px}
body.embed{background:transparent}
@media(max-width:900px){body.embed .auth-view{min-height:0}}
@media(max-width:520px){body.embed .wrap{padding:6px 0 15px}.job-actions button{flex:1 1 44%}}

/* Scan & Print — customer-first mobile upload screen; shop dashboard untouched. */
body.sp-customer-mode{overflow-x:hidden}
body.sp-customer-mode .wrap{width:100%;max-width:none;padding:18px clamp(12px,3vw,40px) 32px;min-height:calc(100dvh - 76px)}
body.sp-customer-mode .customer-card{max-width:none;width:100%;margin:0 auto;border-radius:20px;padding:clamp(16px,2.5vw,30px);text-align:left}
body.sp-customer-mode .customer-card>.auth-icon{margin:0 0 10px;width:46px;height:46px}
body.sp-customer-mode .customer-card h1{font-size:clamp(24px,4vw,36px)}
body.sp-customer-mode #uploadForm{max-width:1100px;margin:20px auto 0;gap:18px}
body.sp-customer-mode #uploadForm>label,body.sp-customer-mode #singleDocumentFields>label{font-size:15px}
body.sp-customer-mode #uploadForm input,body.sp-customer-mode #uploadForm textarea{font-size:16px;min-height:51px}
body.sp-customer-mode #customerFile{border:2px dashed #8fbdc6;background:#f1fbfb;padding:18px 14px;cursor:pointer;min-height:74px}
body.sp-customer-mode #submitUpload{min-height:58px;font-size:16px}
body.sp-customer-mode .sp-upload-modes{margin:2px 0 16px;gap:12px}
body.sp-customer-mode .sp-mode{min-height:60px;font-size:14px}
body.sp-customer-mode .sp-customer-guide{background:#eaf8f7;color:#075c64;border-radius:10px;padding:12px 15px;font-size:14px;font-weight:600;line-height:1.65}
body.sp-customer-mode .privacy-note{font-size:12px;line-height:1.65}
.sp-selected-document{display:flex;gap:15px;align-items:center;border:1px solid #badbdc;background:#f6fcfc;border-radius:15px;padding:12px;margin:13px 0}
.sp-selected-preview{width:92px;height:100px;flex:none;display:grid;place-items:center;background:#e6f1f5;border-radius:10px;color:#087b88;overflow:hidden;font-size:34px}
.sp-selected-preview img{width:100%;height:100%;object-fit:contain}
.sp-selected-text{min-width:0;display:grid;gap:7px;overflow-wrap:anywhere}
.sp-selected-text strong{font-size:14px}
.sp-selected-text span{color:#576a78;font-size:12px}
/* Legacy duplicate simple-crop editor is deliberately unavailable: use the full-screen, one-preview editor. */
#customerView #imageEditor{display:none!important}
@media(max-width:740px){
 body.sp-customer-mode .topbar{min-height:58px;height:auto;padding:10px 14px}
 body.sp-customer-mode .wrap{padding:0 0 20px;min-height:calc(100dvh - 58px)}
 body.sp-customer-mode .customer-card{border:0;box-shadow:none;border-radius:0;min-height:calc(100dvh - 58px);padding:18px 14px 30px}
 body.sp-customer-mode .sp-upload-modes{flex-direction:row}
 body.sp-customer-mode .sp-mode{padding:12px 7px;min-height:64px}
 body.sp-customer-mode #uploadForm{max-width:none}
 body.sp-customer-mode #singleDocumentFields,body.sp-customer-mode #idDocumentFields{width:100%}
 body.sp-customer-mode .sp-selected-preview{width:78px;height:96px}
 body.sp-customer-mode .brand small{display:none}
 body.sp-customer-mode .privacy-note{font-size:11px}
}
@media(max-width:380px){body.sp-customer-mode .sp-mode{font-size:12px}.sp-selected-document{gap:9px}}

/* Clear three-way upload choice, including a document plus two-sided ID in one step. */
.sp-upload-modes{flex-wrap:wrap}
.sp-upload-modes .sp-mode{flex:1 1 150px;min-height:55px;border-width:2px}
.sp-flow-tip{background:#eefaf7;border:1px solid #b6ded5;border-radius:12px;padding:12px 14px;margin:-4px 0 14px;color:#154a50;font-size:13px;line-height:1.6}
.sp-file-viewer{position:fixed;inset:0;z-index:100100;background:rgba(7,18,33,.82);padding:clamp(5px,1.5vw,18px);display:flex;align-items:center;justify-content:center}
.sp-file-view-panel{background:#fff;border-radius:14px;width:min(1100px,100%);height:min(95dvh,100%);display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px #0006}
.sp-file-view-head{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #dce5ec;gap:12px}
.sp-file-view-head button{min-height:45px}
.sp-file-view-body{flex:1;min-height:0;overflow:auto;background:#eef3f7;text-align:center;display:flex;align-items:center;justify-content:center;flex-direction:column}
.sp-file-view-body iframe{border:0;width:100%;height:100%;background:#fff}
.sp-file-view-body img{max-width:100%;max-height:100%;object-fit:contain}
.sp-view-help{padding:8px 12px;margin:0;font-size:12px;color:#516575}
.sp-pdf-fallback{padding:7px 12px;font-size:13px;text-decoration:underline;color:#075d79}
@media(max-width:620px){.sp-file-viewer{padding:0}.sp-file-view-panel{width:100%;height:100dvh;border-radius:0}.sp-upload-modes .sp-mode{flex:1 1 100%;font-size:14px}}

/* PDF.js canvas renders reliably even when browser PDF iframe viewers are blocked. */
.sp-pdf-view-nav{display:flex;align-items:center;justify-content:center;gap:14px;padding:9px;background:#fff;border-bottom:1px solid #dde6ed}
.sp-pdf-view-nav button{min-height:44px;padding:8px 16px}
.sp-pdf-view-body{min-height:0}
.sp-file-view-body{justify-content:flex-start!important;padding:12px!important;overscroll-behavior:contain!important}
.sp-file-view-body canvas{display:block;max-width:100%;height:auto;margin:0 auto;background:white;box-shadow:0 4px 22px #0002}
.sp-file-view-body img{margin:auto}
@media(max-width:740px){.sp-file-view-body{padding:6px!important}.sp-pdf-view-nav{gap:5px}.sp-pdf-view-nav button{padding:8px;flex:1}}

/* Scan & Print V3: reliable no-popup View and Print document rendering. */
.sp-view-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
#spViewPrint{min-height:46px;padding:10px 18px;font-size:15px}
#spFileViewer .sp-print-page{display:block;max-width:100%;height:auto;margin:0 auto 14px;background:#fff;box-shadow:0 2px 10px #0002}
#spFileViewer .sp-file-view-body{display:block!important;overflow:auto!important;text-align:center}
@media(max-width:620px){#spFileViewer .sp-file-view-head{flex-wrap:wrap}#spFileViewer .sp-view-actions{width:100%;justify-content:space-between}#spViewPrint{flex:1}}
@media print{
 @page{margin:8mm}
 html,body{overflow:visible!important;height:auto!important;margin:0!important;background:white!important}
 body>*:not(#spFileViewer){display:none!important}
 #spFileViewer{position:static!important;inset:auto!important;display:block!important;background:white!important;padding:0!important;overflow:visible!important;height:auto!important;min-height:0!important}
 #spFileViewer .sp-file-view-panel{position:static!important;display:block!important;width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;border:0!important;box-shadow:none!important;border-radius:0!important}
 #spFileViewer .sp-file-view-head,#spFileViewer #spViewNav,#spFileViewer #spViewStatus{display:none!important}
 #spFileViewer .sp-file-view-body{display:block!important;overflow:visible!important;background:white!important;padding:0!important;margin:0!important;max-height:none!important}
 #spFileViewer .sp-print-page{display:block!important;width:auto!important;max-width:100%!important;max-height:260mm!important;height:auto!important;object-fit:contain!important;break-after:page!important;page-break-after:always!important;margin:0 auto!important;box-shadow:none!important}
 #spFileViewer .sp-print-page:last-child{break-after:auto!important;page-break-after:auto!important}
}

/* Print isolation: only the prepared document sheet, never UniiTools page chrome. */
#spPrintSheet{display:none}
@media print{
 @page{size:A4 portrait;margin:8mm}
 html,body{width:100%!important;min-height:0!important;height:auto!important;overflow:visible!important;margin:0!important;padding:0!important;background:#fff!important}
 body.sp-printing > *:not(#spPrintSheet){display:none!important}
 body.sp-printing #spPrintSheet{display:block!important;position:static!important;width:100%!important;min-height:0!important;overflow:visible!important;visibility:visible!important;background:white!important;margin:0!important;padding:0!important}
 body.sp-printing .sp-paper-page{width:194mm!important;height:281mm!important;box-sizing:border-box!important;margin:0!important;padding:0!important;display:flex!important;align-items:center!important;justify-content:center!important;break-after:page!important;page-break-after:always!important;overflow:hidden!important;background:white!important}
 body.sp-printing .sp-paper-page:last-child{break-after:auto!important;page-break-after:auto!important}
 body.sp-printing .sp-print-image{width:auto!important;height:auto!important;max-width:194mm!important;max-height:281mm!important;object-fit:contain!important;display:block!important;margin:auto!important;box-shadow:none!important;border:0!important}
 body.sp-printing .sp-id-sheet{flex-direction:column!important;gap:10mm!important}
 body.sp-printing .sp-id-print-image{width:150mm!important;max-width:150mm!important;height:auto!important;max-height:100mm!important;object-fit:contain!important;margin:0!important}
 body.sp-printing #spFileViewer{display:none!important}
}
