/* Independent scanner stylesheet; preserves existing APV and mail screens. */
.scanner-screen .screen-heading { max-width: 760px; }
.scanner-screen .screen-heading h1 { font-size: clamp(2.1rem,5vw,3.4rem); }
.scanner-screen .screen-heading > p:not(.eyebrow) { max-width: 720px; margin: 12px 0 0; line-height: 1.6; }
.search-service-badge { display: inline-flex; align-items: center; margin-top: 15px; padding: 7px 12px; border-radius: 30px; font-size: .75rem; font-weight: 800; color: #835a20; background: #fff4df; border: 1px solid #eadab6; }
.search-service-badge.connected { background: #e2f4e5; color: #246747; border-color: #c4e2ca; }
.scanner-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 19px; align-items: start; }
.scanner-main { display: grid; gap: 17px; min-width: 0; }
.scanner-card,.sds-results { padding: 24px; background: white; border: 1px solid #dce8e4; border-radius: 20px; box-shadow: 0 8px 27px rgba(22,54,42,.05); }
.scanner-card h2 { margin: 0 0 4px; font-size: 1.23rem; }
.scan-header { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 18px; }
.step-circle { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 12px; background: #dfefdf; color: #266351; font-weight: 800; }
.scan-header p { color: #668077; margin: 0; font-size: .83rem; line-height: 1.55; }
.scanner-card label:not(.library-check) { display: block; margin: 10px 0 7px; font-size: .85rem; font-weight: 750; color: #254d4c; }
.scanner-card input:not([type=file]):not([type=checkbox]) { width: 100%; min-width: 0; box-sizing: border-box; padding: 13px 15px; font-size: 1rem; border: 1px solid #cee0d8; background: #f8fbf9; border-radius: 11px; color: #173b3b; }
.scanner-card input:focus { outline: 2px solid #8abda2; outline-offset: 1px; }
.scanner-card #sdsSearchForm { display: grid; gap: 6px; }
.scanner-card #sdsSearchForm .button { margin-top: 12px; }
.scanner-camera-button { background: #20463d; min-height: 52px; margin: 8px 0 17px; }
.scanner-card .camera-consent { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; background: #edf7ef; border: 1px solid #d5ead8; padding: 12px; border-radius: 11px; cursor: pointer; font-size: .79rem !important; line-height: 1.55; }
.camera-consent input { margin-top: 3px; accent-color: #20754f; flex: 0 0 auto; }
.camera-box { border-radius: 16px; overflow: hidden; background: #112f32; color: white; text-align: center; position: relative; padding: 0 0 14px; }
.camera-box video { display: block; width: 100%; aspect-ratio: 4/3; max-height: 300px; object-fit: cover; }
.camera-box p { margin: 9px 0; font-size: .84rem; }
.camera-target { position: absolute; top: 16%; left: 18%; right: 18%; height: 42%; border: 2px solid #d5ffab; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 400px rgba(0,0,0,.17); }
.sds-message { color: #245d4a; background: #e9f5eb; border: 1px solid #c6e1d0; border-radius: 13px; padding: 15px 17px; font-size: .86rem; line-height: 1.65; }
.sds-message.warning { background: #fff6e5; color: #805916; border-color: #ead8ad; }
.sds-message.error { background: #fff0ec; color: #9f3d31; border-color: #f0c7bd; }
.sds-message.success { background: #e6f7e8; color: #206b46; }
.sds-results > h2 { font-size: 1.2rem; margin: 0 0 15px; }
.sds-product-match { padding: 13px; border-radius: 12px; margin-bottom: 15px; background: #eaf6ee; border: 1px solid #b9dcc5; font-size: .85rem; color: #25543f; }
.sds-product-match p { line-height: 1.5; margin: 8px 0; }
.sds-product-match a { color: #245a4d; }
.candidate-list { display: grid; gap: 10px; margin-bottom: 18px; }
.candidate-card { padding: 14px; display: flex; align-items: center; gap: 14px; justify-content: space-between; border-radius: 12px; border: 1px solid #dce8e2; }
.candidate-card.best-match { border-color: #b3d2bd; background: #f3fbf4; }
.candidate-card h3 { font-size: .96rem; margin: 5px 0; color: #19443c; overflow-wrap: anywhere; }
.candidate-card p { margin: 0 0 5px; font-size: .8rem; color: #667e76; line-height: 1.5; overflow-wrap: anywhere; }
.candidate-card a { font-size: .8rem; color: #236952; }
.candidate-tag { font-size: .71rem; font-weight: 800; color: #4c8069; text-transform: uppercase; }
.empty-state { padding: 15px; border: 1px solid #d4e5d7; border-radius: 11px; background: #f8fcf8; font-size: .86rem; line-height: 1.6; }
.empty-state a { display: inline-block; margin: 6px 12px 0 0; font-weight: 800; }
.chemical-library { background: #f5faf5; border-color: #bfdac7; }
.library-count { margin: 0 0 12px; font-size: .85rem; font-weight: 800; color: #245e47; }
.chemical-library-items { display: grid; gap: 8px; margin-bottom: 13px; }
.chemical-library-item { display: flex; gap: 10px; justify-content: space-between; align-items: center; border-radius: 10px; border: 1px solid #dce8dc; background: white; padding: 10px 12px; }
.chemical-library-item strong { font-size: .82rem; display: block; }
.chemical-library-item small { font-size: .72rem; color: #5d7770; }
.chemical-library-item button { padding: 8px 10px; border: 1px solid #cbdccb; background: #f4faf5; border-radius: 8px; cursor: pointer; }
.library-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.library-actions .button { min-height: 40px; font-size: .8rem; padding: 10px 12px; }
.library-import { position: relative; cursor: pointer; }
.library-import input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.library-result-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.library-result-actions button { font-size: .77rem; }
.pdf-url-row { display: flex; gap: 9px; }
.pdf-url-row input { flex: 1; }
.scanner-card label.file-pdf-label { margin-top: 17px; }
.file-pdf-label input { display: block; max-width: 100%; margin-top: 7px; font-size: .79rem; }
.label-ocr-panel { margin-top: 18px; padding: 12px 14px; border: 1px dashed #b5d6c4; border-radius: 13px; background: #f5faf6; }
.label-ocr-panel .field-help { font-size: .77rem; line-height: 1.5; }
.label-ocr-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.label-ocr-options button { background: #fff; border: 1px solid #b7d9c6; border-radius: 9px; padding: 9px; color: #1d5240; cursor: pointer; max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.ocr-panel { border: 1px solid #c5dcd2; border-radius: 13px; background: #f6faf8; padding: 15px; margin: 15px 0; }
.ocr-panel h3 { margin: 0 0 6px; font-size: 1rem; }
.ocr-panel p { margin: 6px 0 10px; font-size: .82rem; line-height: 1.6; color: #537365; }
.ocr-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ocr-actions select { max-width: 140px; padding: 10px; background: white; color: #173f35; border: 1px solid #b6d3c3; border-radius: 9px; }
.ocr-actions .button { min-height: 39px; padding: 8px 13px; }
.scanner-aside { display: grid; gap: 14px; }
.aside-tip { background: #eaf5eb; color: #1f4b3c; padding: 20px; border-radius: 16px; border: 1px solid #cfe3d2; }
.aside-tip h3 { margin: 0 0 8px; font-size: 1.03rem; }
.aside-tip p { margin: 0 0 12px; font-size: .84rem; line-height: 1.6; color: #537562; }
.aside-tip a { color: #236a56; font-weight: 800; font-size: .8rem; }
.aside-warning { background: #fff5e4; border-color: #eed9b5; }
.aside-warning h3 { color: #8a5717; }
.aside-warning p { color: #8a6a3a; }
.sds-analysis { margin-top: 22px; padding: 25px; border: 1px solid #d2e5d8; border-radius: 20px; background: white; }
.analysis-heading { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.analysis-heading h2 { margin: 0; font-size: 1.45rem; }
.analysis-badge { border-radius: 24px; padding: 7px 12px; background: #fff3dc; color: #785419; font-weight: 800; font-size: .74rem; }
.analysis-badge.success { background: #e6f6e9; color: #2d704b; }
.analysis-badge.danger { background: #fff0ed; color: #a34734; }
.analysis-source { font-size: .8rem; color: #71817c; overflow-wrap: anywhere; }
.analysis-warnings { display: grid; gap: 9px; }
.analysis-alert { background: #edf8ee; color: #2b5b45; padding: 14px; line-height: 1.6; font-size: .85rem; border-radius: 11px; border: 1px solid #c7e4ce; }
.analysis-alert.warning { background: #fff6e7; color: #7a541e; border-color: #ebd9b0; }
.analysis-alert.danger { background: #fff0ec; color: #974537; border-color: #ecc5c0; }
.analysis-alert p { margin: 5px 0 0; }
.ppe-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 20px; }
.ppe-card { padding: 17px; background: #f9fcfa; border: 1px solid #d9e6dd; border-radius: 13px; }
.ppe-card h3 { margin: 8px 0 6px; font-size: 1rem; }
.ppe-card p { margin: 0; font-size: .82rem; color: #455f53; line-height: 1.6; overflow-wrap: anywhere; }
.ppe-card.no-excerpt { border-style: dashed; }
.ppe-card.ocr-unverified { border-color: #e2d2ae; background: #fffcf3; }
.ppe-icon { background: #e2f2e3; color: #216b50; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; }
.raw-extract { margin-top: 20px; border-top: 1px solid #e0e8e0; padding-top: 16px; }
.raw-extract summary { font-weight: 800; font-size: .85rem; cursor: pointer; }
.raw-extract pre { font-size: .8rem; background: #f4f8f4; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; padding: 14px; border-radius: 10px; }
.document-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.analysis-footnote { font-size: .78rem; line-height: 1.65; color: #6d8179; }
.save-chemical-panel { background: #eef8ef; border: 1px solid #cde4d1; padding: 17px; border-radius: 14px; margin: 14px 0 21px; }
.save-chemical-panel h3 { margin: 0; font-size: 1.04rem; }
.save-chemical-panel p { color: #4f7360; font-size: .84rem; line-height: 1.55; }
.save-chemical-panel .library-check { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0; font-size: .82rem; }
.save-chemical-panel .library-check input { margin-top: 3px; accent-color: #287252; }
.update-notice { position: fixed; z-index: 99; left: max(14px,calc((100vw - 750px)/2)); right: max(14px,calc((100vw - 750px)/2)); bottom: max(16px,env(safe-area-inset-bottom)); padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 18px; background: #f2faef; border: 2px solid #9ac8a1; border-radius: 17px; box-shadow: 0 18px 65px rgba(13,37,41,.22); }
.update-notice p { margin: 5px 0 0; font-size: .83rem; }
.update-actions { display: flex; gap: 8px; }
@media(max-width:920px) { .scanner-layout { grid-template-columns: 1fr; } .scanner-aside { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:650px) { .scanner-card,.sds-results,.sds-analysis { padding: 17px; } .scanner-aside,.ppe-grid { grid-template-columns: 1fr; } .candidate-card { flex-direction: column; align-items: stretch; } .pdf-url-row { flex-direction: column; } .update-notice { display: grid; } .update-actions .button { flex: 1; } }
