:root{--accent:#c2188b;--ink:#392b35;--muted:#7c6e78;--line:#eadfe7;--bg:#faf5f8;--accent-soft:#ff9cdb}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:var(--bg);font:15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}header{height:88px;border-bottom:1px solid var(--line);padding:0 5%;display:flex;align-items:center;justify-content:space-between;background:#fffafd}.brand{color:var(--accent);text-decoration:none;font-size:26px;font-weight:750;letter-spacing:-1px;display:flex;align-items:center;gap:12px}.logo{font-size:35px}.brand-sub{font-size:9px;letter-spacing:2px;font-weight:650;margin-left:16px;border-left:1px solid #e1c9d9;padding-left:24px;max-width:130px}.local{font-size:12px;color:#a13c7e}main{max-width:1420px;margin:auto;padding:48px 5% 20px}.top{display:flex;align-items:center;justify-content:space-between;gap:20px}.eyebrow,.step{font-size:10px;letter-spacing:1.8px;font-weight:750;color:#7c6e78}h1{font-size:44px;font-weight:550;letter-spacing:-1.8px;line-height:1.1;margin:14px 0}p{color:var(--muted)}button,label.scan,.drop,.quiet{cursor:pointer}button,input,select{font:inherit}button,.scan{border:0;border-radius:7px;padding:11px 16px;font-size:13px;font-weight:650}button:hover,.scan:hover{filter:brightness(.96)}.primary{background:var(--accent);color:white}.secondary{background:#fff;border:1px solid #e4d3df;color:var(--accent)}.quiet{background:transparent;color:var(--accent);font-size:12px;padding:7px;border:0}.delivery{margin:28px 0 18px;display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:12px}.delivery>label{color:var(--muted)}select{border:0;background:transparent;font-weight:650;color:var(--ink);max-width:100%;padding:8px}.delivery>span{margin-left:auto;color:var(--muted)}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:24px}.stat{background:#fff;border:1px solid var(--line);border-radius:10px;padding:20px}.stat:first-child{background:var(--accent);color:#fff}.stat small{display:block;font-size:11px;opacity:.75}.stat strong{font-size:34px;letter-spacing:-1px}.stat span{display:block;font-size:10px;opacity:.7;margin-top:2px}.workspace{display:grid;grid-template-columns:330px 1fr;gap:22px}.panel{background:#fff;border:1px solid var(--line);border-radius:12px;padding:26px}.step{color:#b05d97;display:flex;gap:12px;align-items:center}.step span{color:#806b7a;font-size:9px}h2{font-size:21px;font-weight:650;letter-spacing:-.6px;margin:12px 0}.actions p{font-size:12px;line-height:1.7}.drop{display:flex;flex-direction:column;align-items:center;border:1px dashed #d99ac5;border-radius:9px;background:#fff2fa;padding:18px 8px;color:var(--accent);margin:20px 0 12px;font-size:12px}.drop small{font-size:10px;color:var(--muted);margin-top:5px}.file-icon{font-size:26px}hr{border:0;border-top:1px solid var(--line);margin:26px 0}.scan{display:block;text-align:center;margin:9px 0}#manual{margin-top:20px}label{font-size:12px}.inline{display:flex;gap:8px;margin-top:7px}input{border:1px solid #e4d3df;padding:12px;border-radius:7px;min-width:0;background:#fff;color:var(--ink)}.inline input{width:100%}.note{font-size:10px!important}.result-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.tabs{display:flex;gap:6px;margin:22px 0 16px;border-bottom:1px solid var(--line);overflow:auto}.tabs button{background:none;color:var(--muted);border-radius:0;padding:10px 12px;white-space:nowrap}.tabs button.active{border-bottom:2px solid var(--accent);color:var(--accent)}.search{width:100%;font-size:12px;background:#fdf8fb;margin-bottom:16px}.empty{text-align:center;padding:48px 16px;color:var(--muted)}.empty .big{font-size:40px;opacity:.5}.empty strong{display:block;color:var(--ink);margin-top:10px}.empty p{font-size:12px}.row{display:flex;align-items:center;padding:15px 0;border-bottom:1px solid var(--line);gap:12px}.row .desc{flex:1;min-width:0}.desc strong{font-size:14px}.desc small{display:block;font-size:10px;color:var(--muted);overflow-wrap:anywhere}.badge{border-radius:5px;padding:5px 8px;font-size:10px;white-space:nowrap}.missing{background:#fff1da;color:#996020}.extra{background:#fceae5;color:#a5452c}.ok{background:#fce5f5;color:#a10c72}.count{font-size:13px;min-width:70px;text-align:right}.count small{display:block;font-size:9px;color:var(--muted)}.history-head{display:flex;align-items:center;justify-content:space-between;margin-top:28px}.history-head h3{font-size:13px}.history-head small{font-size:10px;color:var(--muted)}.scanrow{display:flex;align-items:center;gap:10px;font-size:12px;padding:9px 0;border-bottom:1px solid var(--line)}.scanrow span{color:var(--muted);font-size:10px;flex:1}.doc{font-size:11px;padding:8px 0;display:flex;gap:6px;align-items:center;overflow-wrap:anywhere}.doc>span{flex:1}.doc small{display:block;color:var(--muted)}footer{padding:20px 0;color:var(--muted);font-size:11px;display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px}footer>p{max-width:650px}details{width:100%}summary{cursor:pointer}details p{max-width:850px}dialog{border:1px solid var(--line);border-radius:14px;max-width:850px;width:94%;padding:24px;color:var(--ink);max-height:90vh}dialog::backdrop{background:#2f102888}.dialog-top{display:flex;align-items:center;justify-content:space-between}.dialog-top h2{margin:0}:is(#dialog-body,#report-body){margin:20px 0;font-size:13px}:is(#dialog-actions,#report-actions){display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.review{display:grid;grid-template-columns:95px 1fr 80px 28px;gap:7px;margin:8px 0;align-items:center}.review input{width:100%;font-size:12px;padding:9px}.review-head{font-size:10px;color:var(--muted)}.warning{padding:12px;background:#fff4dd;border-radius:7px;color:#886227;font-size:12px}.preview{max-height:190px;max-width:100%;display:block;margin:0 auto 20px;border-radius:8px}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:var(--accent);color:white;padding:12px 20px;border-radius:8px;display:none;z-index:9;max-width:90%;font-size:12px}#busy{position:fixed;inset:0;background:#fff7fcee;z-index:20;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:14px}#busy[hidden]{display:none}.spinner{width:34px;height:34px;border:3px solid #efd4e5;border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}progress{width:100%;height:6px;accent-color:var(--accent)}.success{background:#fce5f5;padding:12px;border-radius:8px;font-size:12px;margin-bottom:10px}.review-page{max-width:100%;max-height:350px;display:block;margin:auto}.full-label{display:block;margin:10px 0}.full-input{width:100%}@media(max-width:950px){.workspace{grid-template-columns:285px 1fr}.panel{padding:20px}.brand-sub{display:none}main{padding:32px 4%}.top h1{font-size:36px}.result-head{align-items:flex-start;flex-direction:column}.stats{gap:8px}.stat{padding:15px}}@media(max-width:690px){header{height:70px;padding:0 5%}.local{font-size:9px}.brand{font-size:23px}.top{display:block}.top>button{margin-top:8px}.top h1{font-size:37px}.top p{font-size:13px}.stats{grid-template-columns:repeat(2,1fr)}.stat strong{font-size:29px}.workspace{display:flex;flex-direction:column}.delivery>span{display:none}.result-head{flex-direction:row}.result-head button{font-size:10px;padding:9px}.row{gap:6px}.badge{font-size:9px;padding:4px}.count{min-width:58px}.review{grid-template-columns:75px 1fr 55px 24px;gap:4px}.review input{padding:7px 4px;font-size:11px}.history-head small{max-width:130px;text-align:right}dialog{padding:16px}.tabs button{padding:9px;font-size:12px}}

/* Keep validation reachable while the document list scrolls, including on iPhone. */
dialog{overflow:hidden;padding:0;max-height:90vh;max-height:90dvh}dialog[open]{display:flex;flex-direction:column}.dialog-top{flex:none;padding:16px 20px;border-bottom:1px solid var(--line)}:is(#dialog-body,#report-body){overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;min-height:0;margin:0;padding:16px 20px}:is(#dialog-actions,#report-actions){flex:none;background:white;border-top:1px solid var(--line);padding:12px 20px;padding-bottom:max(12px,env(safe-area-inset-bottom))}:is(#dialog-actions,#report-actions) button{min-height:48px;touch-action:manipulation}.verification{display:flex;align-items:center;gap:12px;min-height:56px;margin:18px 0 8px;padding:12px;border:1px solid #d99ac5;border-radius:8px;background:#fff2fa;cursor:pointer;font-size:14px;touch-action:manipulation}.verification input[type=checkbox]{flex:0 0 24px;width:24px;height:24px;margin:0;padding:0;accent-color:var(--accent)}.verification:has(input:checked){background:#fce5f5;border-color:var(--accent)}#review-error[hidden]{display:none}:is(#dialog-body,#report-body) input:not([type=checkbox]){font-size:16px}button:focus-visible,.verification:focus-within{outline:3px solid #ec73c4;outline-offset:2px}@media(max-width:690px){dialog{padding:0}.dialog-top,:is(#dialog-body,#report-body){padding:14px}:is(#dialog-actions,#report-actions){padding-left:14px;padding-right:14px}:is(#dialog-actions,#report-actions) button{flex:1}.verification{font-size:13px}}
.pending{background:#fff4dd;color:#886227}#scan-result p{color:var(--accent);margin:6px 0}#scan-result small{display:block;font-size:10px;line-height:1.5}.stat strong{overflow-wrap:anywhere}button,.scan{touch-action:manipulation}
#start-camera{width:100%;font-size:13px}.camera-stage{position:relative;width:min(100%,320px);aspect-ratio:3/4;margin:0 auto;background:#281322;overflow:hidden;border-radius:12px}.camera-stage video{display:block;width:100%;height:100%;object-fit:cover}.camera-guide{position:absolute;left:6%;top:36%;width:88%;height:28%;border:3px solid #ff9cdb;border-radius:10px;box-shadow:0 0 0 1000px #2c0b2455;pointer-events:none}.camera-guide span{position:absolute;bottom:100%;left:0;background:#c2188b;color:white;font-size:12px;padding:5px 8px;border-radius:5px;margin-bottom:8px}.captured .camera-guide{border-color:#ff5ec4}#camera-status{font-weight:650;color:var(--accent);min-height:3em}.camera-help{margin-top:0}.camera-stage~.note{max-width:540px}#camera-result p{margin:5px 0;color:var(--accent)}@media(max-height:760px){.camera-stage{width:min(100%,230px)}}
.camera-batch{padding:14px;margin:12px 0;border:1px solid #d99ac5;border-radius:9px;background:#fff2fa}.camera-batch>p{font-size:12px}.camera-batch .inline{flex-wrap:wrap}.camera-batch input{flex:1;min-width:100px}.camera-batch .primary{min-height:48px}.camera-batch[hidden]{display:none}button:disabled{opacity:.45;cursor:default}:is(#dialog-actions,#report-actions):has(button[title^="Ajouter des cartons"]){justify-content:space-between}

#camera-add-quantity{flex:1 0 100%;order:-1;font-size:15px}#camera-batch{scroll-margin-top:8px}

.camera-count{position:sticky;top:-16px;z-index:2;background:var(--accent);color:white;padding:14px 16px;border-radius:10px;margin-bottom:14px;box-shadow:0 3px 10px #c2188b22}.camera-count small{display:block;font-size:12px;color:#ffe5f6}.camera-count strong{display:block;font-size:34px;line-height:1.3;margin:4px 0}.camera-count strong span{font-size:16px;font-weight:600}@media(max-width:690px){.camera-count{top:-14px}.camera-count strong span{font-size:14px}}

:is(#dialog-body,#report-body):has(#camera-batch:not([hidden])) .camera-stage{display:none}:is(#dialog-body,#report-body):has(#camera-batch:not([hidden])) .camera-help{display:none}:is(#dialog-body,#report-body):has(#camera-batch:not([hidden])) .camera-count{position:static}

#camera-plus-one{flex:1 0 100%;order:-2;font-size:18px;min-height:54px}#camera-add-quantity{font-size:13px;flex:1;order:0}

label.scan[aria-disabled="true"]{opacity:.45;cursor:default;pointer-events:none}#pdf-required[hidden]{display:none}

#camera-finish-control{flex:1 0 100%;order:3;min-height:52px;background:#8b1265;color:white}.finished-report{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;margin-bottom:20px;background:#fce5f5;border:1px solid #d99ac5;border-radius:9px;font-size:13px}.finished-report[hidden]{display:none}.report-summary{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}.report-summary>div{padding:16px;border:1px solid var(--line);border-radius:9px;background:#fff2fa}.report-summary strong{display:block;font-size:32px;color:var(--accent)}.report-summary span{font-size:12px}.report-scroll{overflow-x:auto}.report-table{width:100%;border-collapse:collapse;font-size:13px}.report-table th,.report-table td{text-align:right;padding:12px 8px;border-bottom:1px solid var(--line)}.report-table th:first-child,.report-table td:first-child{text-align:left}.report-table small{display:block;font-size:11px;color:var(--muted);max-width:250px}.report-table td:last-child small{color:inherit}.report-table th{font-size:11px}.report-table td.pending{white-space:nowrap}@media(max-width:690px){.finished-report{align-items:flex-start;flex-direction:column}.report-table td{padding:10px 5px}.report-table small{max-width:150px}}

.pdf-download-link{display:inline-flex;align-items:center;justify-content:center;min-height:48px;border-radius:7px;padding:11px 16px;font-size:13px;font-weight:650;text-decoration:none;touch-action:manipulation}.pdf-download-link:focus-visible{outline:3px solid #ec73c4;outline-offset:2px}@media(max-width:690px){:is(#dialog-actions,#report-actions) .pdf-download-link{flex:1}}

/* Keep the finish action visible before the camera shortcuts on small screens. */
#camera-finish-control{order:-3} :is(#dialog-actions,#report-actions){max-height:45dvh;overflow-y:auto;-webkit-overflow-scrolling:touch} #report-actions>*{min-height:48px;flex:1 1 180px} #report-body{overflow-wrap:anywhere}

#camera-add-reference{flex:1 0 100%;order:-1;min-height:48px;font-size:14px}

.article-summary{margin-top:10px;padding:10px;background:#fff2fa;border:1px solid var(--line);border-radius:8px}.article-summary strong{font-size:12px}.article-summary button{margin-top:8px;min-height:44px;font-size:12px}textarea{font:inherit;border:1px solid var(--line);border-radius:7px;padding:12px;resize:vertical}#article-form .full-input{font-size:16px}

.manual-reference-body{padding:16px 20px;overflow-y:auto;min-height:0;-webkit-overflow-scrolling:touch}.manual-reference-body p{font-size:13px}#manual-reference-dialog{max-width:520px}#manual-reference-form input{font-size:18px}#manual-reference-form button{margin-top:16px;min-height:50px}

#storage-warning[hidden]{display:none}#storage-warning{margin-bottom:20px}
