:root{color-scheme:light;--ink:#142339;--muted:#60718a;--line:#dce4ed;--bg:#f5f8fc;--blue:#276ce3;--navy:#0c233f;--mint:#00a78d;--surface:white;--shadow:0 12px 30px rgba(22,48,84,.06);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-size:14px}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #ffb328;outline-offset:2px}a{color:#185bb6}h1,h2,p{margin:0}[hidden]{display:none!important}.app{max-width:1030px;margin:auto;padding:0 20px}.skip-link{position:absolute;top:-100px;left:12px;z-index:90;background:white;padding:12px}.skip-link:focus{top:12px}.top{min-height:76px;display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:9px}.brand strong{font-size:17px;letter-spacing:-.45px}.brand strong span{color:#2e6588}.brand small{display:block;font-size:9px;font-weight:750;letter-spacing:1.6px;color:#6c7990}.head-links{display:flex;align-items:center;gap:15px}.head-links a{font-size:13px;font-weight:700;text-decoration:none}.preview-label{background:#fff0d4;border:1px solid #ffdda4;border-radius:8px;padding:5px 8px;color:#956106;font-size:10px;font-weight:900;letter-spacing:.5px}main{padding:20px 0 10px;display:grid;gap:16px}.card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:21px;box-shadow:var(--shadow)}h1{font-size:clamp(21px,3vw,27px);letter-spacing:-.65px}h2{font-size:17px;letter-spacing:-.3px}.entry-head,.section-top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.entry-head p,.section-top p{color:var(--muted);font-size:13px;margin-top:6px;line-height:1.5}.local-tag{font-size:11px;background:#e7f8f3;color:#19715d;border-radius:30px;padding:8px 10px;white-space:nowrap;font-weight:750}.fields{display:grid;grid-template-columns:1fr 250px;gap:12px;margin:19px 0 14px}.fields label{font-size:12px;font-weight:760;color:#35465c}.optional{font-weight:500;color:#748298}.fields input,.fields select{display:block;margin-top:6px;width:100%;padding:12px;border:1px solid #cbd6e4;border-radius:9px;background:white;color:var(--ink);min-height:43px}.capture-actions,.export-actions{display:flex;gap:9px;flex-wrap:wrap}.btn{border:1px solid #cbd8e8;border-radius:10px;background:white;color:#203553;font-weight:750;padding:11px 15px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}.btn.primary{background:var(--navy);border-color:var(--navy);color:#fff}.btn.secondary{background:#f5f9ff}.btn.subtle{background:transparent;border-color:transparent;color:#40607d}.btn.danger{color:#ae3842;border-color:#f2cdd2;background:#fff7f7}.btn:hover:not(:disabled){filter:brightness(.95)}.micro{color:var(--muted);font-size:11.5px;margin-top:12px;line-height:1.55}.count{font-size:12px;margin-left:4px;color:#2c6477;background:#e9f6f6;padding:4px 8px;border-radius:7px}.pages{min-height:210px}.page-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(114px,1fr));gap:12px;margin-top:18px}.page-item{background:#f8fafc;border:1px solid #dbe4ef;border-radius:12px;padding:7px;min-width:0}.page-item:hover{border-color:#5e8bd9}.thumb-button{width:100%;padding:0;aspect-ratio:3/4;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;border:0;background:#fff;border-radius:7px;overflow:hidden;position:relative}.thumb-button img{width:100%;height:100%;object-fit:contain}.thumb-button .pdf-icon{font-size:27px}.thumb-button .pdf-sub{font-size:10px;color:var(--muted)}.number{font-size:11px;position:absolute;top:4px;left:4px;color:#193956;background:#eef7ffc9;border-radius:5px;padding:2px 5px;font-weight:850}.page-controls{display:flex;justify-content:space-between;align-items:center;gap:4px;padding-top:5px}.page-controls button{background:white;border:1px solid #dae4ef;color:#36506a;border-radius:6px;min-width:30px;min-height:29px;font-weight:750}.page-controls button:disabled{opacity:.25}.thumb-title{font-size:10px;color:#69788d;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.empty{border:1px dashed #d2deec;border-radius:12px;padding:23px 12px;margin-top:14px;display:grid;justify-items:center;gap:5px;text-align:center;background:#fafcff}.empty-icon{font-size:36px;color:#5b89aa}.empty p{font-size:12px;color:var(--muted)}.recovery{font-size:11px;color:#64788f;margin-top:11px}.size{color:#126a57;white-space:nowrap;font-size:16px}.export-actions{margin-top:16px}.progress{margin-top:12px;display:flex;align-items:center;gap:9px;color:#436077;font-size:11px}.progress-track{height:7px;border-radius:20px;overflow:hidden;background:#e4ebf3;flex:1}.progress-track div{width:0%;height:100%;background:#2aa5a0;transition:width .1s}.bottom{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;border-top:1px solid var(--line);margin-top:12px;padding:18px 0 26px;font-size:11px;color:#70829a}.camera-screen{position:fixed;inset:0;background:#060b11;z-index:50;display:flex;flex-direction:column;color:#fff;overscroll-behavior:contain}.camera-top,.camera-bottom{z-index:2;position:relative;display:flex;align-items:center;justify-content:space-between;padding:16px max(20px,env(safe-area-inset-right));background:rgba(0,0,0,.7);min-height:70px}.camera-top{padding-top:max(16px,env(safe-area-inset-top))}.camera-bottom{display:block;text-align:center;padding-bottom:max(16px,env(safe-area-inset-bottom))}.camera-screen video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.camera-buttons{display:flex;justify-content:space-between;align-items:center;margin-top:16px;max-width:370px;margin-left:auto;margin-right:auto}.camera-text{color:white;background:#ffffff18;border:1px solid #ffffff44;padding:12px 14px;border-radius:10px;min-height:44px}.shutter{width:77px;height:77px;border-radius:50%;background:transparent;border:4px solid white;display:flex;justify-content:center;align-items:center}.shutter span{width:59px;height:59px;background:white;border-radius:50%}.editor-overlay{position:fixed;inset:0;z-index:55;background:#0d1e35ca;display:flex;justify-content:center;align-items:center;padding:12px}.editor-panel{background:white;border-radius:17px;width:min(100%,740px);max-height:96dvh;display:flex;flex-direction:column;overflow:hidden}.editor-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #dce4ed}.editor-header h2{font-size:16px}.editor-visual{display:flex;align-items:center;justify-content:center;background:#e9eef4;overflow:auto;min-height:100px;flex:1;padding:12px}.editor-image-wrap{position:relative;display:inline-flex;max-width:100%;max-height:calc(96dvh - 185px)}.editor-image-wrap img{object-fit:contain;max-width:100%;max-height:calc(96dvh - 185px);display:block;user-select:none}.crop-box{position:absolute;border:2px solid #1b92d9;box-shadow:0 0 0 900px #0006;touch-action:none;cursor:move}.handle{position:absolute;width:19px;height:19px;border-radius:50%;background:white;border:3px solid #1583bc;touch-action:none}.handle.nw{left:-10px;top:-10px;cursor:nwse-resize}.handle.ne{right:-10px;top:-10px;cursor:nesw-resize}.handle.sw{left:-10px;bottom:-10px;cursor:nesw-resize}.handle.se{right:-10px;bottom:-10px;cursor:nwse-resize}.editor-tools{padding:11px 12px;display:grid;gap:8px}.toolgroup{display:flex;justify-content:center;gap:7px;flex-wrap:wrap}.toolgroup.navigation{border-top:1px solid #e2e8f0;padding-top:9px}.pdf-preview{height:100%;max-width:100%;text-align:center}.pdf-preview p{font-size:11px;margin:0 0 7px;color:#50657d}.pdf-preview iframe{width:min(80vw,580px);height:min(65vh,600px);border:1px solid #bac9d9;background:white}.pdf-preview a{font-size:12px;display:block;margin-top:6px}.busy-screen{position:fixed;inset:0;background:#0a1933ac;z-index:90;display:grid;place-items:center;padding:20px}.busy-card{background:white;padding:25px;border-radius:15px;max-width:370px;width:100%;text-align:center;box-shadow:0 12px 40px #0002}.busy-card strong{display:block;margin-top:12px}.busy-card p{font-size:12px;color:var(--muted);margin-top:7px}.spin{width:28px;height:28px;border:3px solid #d4e1f1;border-top-color:#276ce3;border-radius:100%;animation:spin .65s linear infinite;margin:auto}@keyframes spin{to{transform:rotate(360deg)}}.toast{position:fixed;left:50%;bottom:max(17px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:110;max-width:min(94vw,550px);background:#182a44;color:white;padding:13px 17px;border-radius:11px;text-align:center;box-shadow:0 8px 22px #0003;font-size:12px;line-height:1.5}
@media(max-width:670px){.app{padding:0 11px}.top{min-height:64px}.brand strong{font-size:14px}.brand small{font-size:8px}.head-links{gap:9px}.card{padding:14px;border-radius:13px}.local-tag{font-size:9px;padding:6px 7px}.entry-head{gap:8px}h1{font-size:21px}.fields{grid-template-columns:1fr;gap:9px;margin:14px 0}.capture-actions .btn{flex:1 1 43%;padding:11px 9px}.capture-actions .primary{flex-basis:100%}.page-grid{grid-template-columns:repeat(auto-fill,minmax(91px,1fr));gap:8px}.export-actions .btn{flex:1 1 43%;padding:10px 7px}.export-actions .primary{flex-basis:100%}.section-top{gap:7px}.editor-overlay{padding:0}.editor-panel{height:100dvh;max-height:100dvh;border-radius:0}.editor-image-wrap,.editor-image-wrap img{max-height:calc(100dvh - 210px)}.toolgroup .btn{min-height:43px;padding:10px 9px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.001ms!important;scroll-behavior:auto!important;transition:none!important}}
@media(pointer:coarse){.handle{width:30px;height:30px}.handle.nw{left:-15px;top:-15px}.handle.ne{right:-15px;top:-15px}.handle.sw{left:-15px;bottom:-15px}.handle.se{right:-15px;bottom:-15px}}

/* Exam scanner camera controls and image-quality interface — preview v2026.10.18.10 */
.scan-preferences{display:flex;gap:16px;align-items:end;flex-wrap:wrap;margin:-2px 0 15px}
.scan-preferences label{font-size:12px;font-weight:750;color:#35465c}
.scan-preferences select{display:block;min-width:160px;margin-top:5px;padding:9px 11px;min-height:43px;border:1px solid #cbd6e4;border-radius:9px;background:#fff}
.enhance-option{display:flex;align-items:center;gap:8px;padding-bottom:9px;min-height:44px}
.enhance-option input{width:19px;height:19px;accent-color:#217b76}
.size-estimate{font-weight:650;color:#2a796b!important}
.thumb-warning{position:absolute;bottom:4px;left:4px;right:4px;background:#fff4d7;color:#7b4d00;border-radius:5px;font-size:10px;font-weight:700;padding:3px 2px;text-align:center}
.scan-warnings,.editor-warning{color:#8b4e02;font-size:12px;margin-top:8px;line-height:1.4}
.editor-warning{max-width:440px}
.camera-screen{height:100dvh;height:100svh;isolation:isolate}
.camera-screen video{z-index:0;object-fit:contain}
.camera-overlay{position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none}
.camera-top{align-items:stretch;display:flex;flex-direction:column;justify-content:flex-start;gap:8px;flex:none;padding: max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left));background:linear-gradient(#000b,#0008);min-height:0}
.camera-top-line{display:flex;align-items:center;justify-content:space-between;gap:8px}
.cam-count{font-size:15px;font-weight:800;flex:1}
.camera-top .camera-text{font-size:12px;padding:8px 10px;min-height:40px}
.camera-options{display:flex;gap:9px;align-items:center;justify-content:center;flex-wrap:wrap}
.camera-switch{display:flex;gap:5px;align-items:center;background:#ffffff20;border:1px solid #ffffff38;border-radius:9px;padding:7px 11px;min-height:38px;font-size:12px;font-weight:700;white-space:nowrap}
.camera-switch input{accent-color:#65efaf;width:17px;height:17px}
.camera-bottom{margin-top:auto;flex:none;padding:13px max(12px,env(safe-area-inset-right)) max(17px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:linear-gradient(#0009,#000e);position:relative;z-index:2}
#cameraStatus{font-size:13px;font-weight:750;min-height:20px;line-height:1.35;padding:2px 0;color:#f2f6fb}
#cameraStatus[data-tone="good"]{color:#6bf4b3}
#cameraStatus[data-tone="warning"]{color:#ffd285}
.camera-estimate{font-size:11px;color:#c2d5e7;margin-top:4px}
.camera-buttons{margin-top:10px;min-height:82px;max-width:390px}
.camera-buttons .cam-side{min-width:80px;padding:9px 6px;display:flex;flex-direction:column;gap:3px;align-items:center;font-size:18px;font-weight:850}
.camera-buttons .cam-side span{font-size:10px;font-weight:650}
.shutter{height:76px;width:76px;flex:none;background:rgba(0,0,0,.15)}
.shutter:disabled{opacity:.6}
.zoom-panel{position:absolute;z-index:3;right:12px;top:130px;background:#081521c9;color:white;padding:10px 12px;border-radius:10px;min-width:110px;max-width:160px}
.zoom-panel label{font-size:11px;font-weight:750;display:flex;justify-content:space-between;gap:7px}
.zoom-panel input{width:100%;height:28px;accent-color:#a9eacc}
@media(max-width:670px){.scan-preferences{gap:12px}.scan-preferences select{min-width:146px}.camera-screen{height:100dvh;height:100svh}.camera-top .camera-text{padding:8px}.camera-top-line{gap:5px}.camera-switch{font-size:11px}.zoom-panel{top:116px}}
@media(max-height:560px) and (orientation:landscape){.camera-top{padding-top:max(4px,env(safe-area-inset-top));padding-bottom:4px;gap:2px}.camera-options{position:absolute;left:50%;top:5px;transform:translateX(-50%)}.camera-top-line .cam-count{font-size:12px}.camera-bottom{padding-top:4px;padding-bottom:max(5px,env(safe-area-inset-bottom))}.camera-buttons{margin-top:3px;min-height:55px}.shutter{height:55px;width:55px}.shutter span{width:41px;height:41px}.camera-buttons .cam-side{min-height:39px}.zoom-panel{top:55px}}
/* Keep scan notifications clear of the shutter during fullscreen camera capture. */
.camera-screen:not([hidden])~.toast{bottom:calc(132px + env(safe-area-inset-bottom));z-index:51;pointer-events:none}
@media(max-height:560px) and (orientation:landscape){.camera-screen:not([hidden])~.toast{bottom:78px;max-width:45vw;left:15%;font-size:11px;padding:7px}}

/* v2026.10.18.11 — edge-to-edge, rotation-aware camera */
.camera-screen{position:fixed;inset:0;width:100%;height:100vh;height:100dvh;overflow:hidden;isolation:isolate;background:#060b11;touch-action:none}
.camera-screen video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center center;z-index:0;pointer-events:none;transform-origin:center center}
.camera-overlay{position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none}
.camera-gesture{position:absolute;inset:0;z-index:2;touch-action:none;user-select:none;-webkit-user-select:none;overscroll-behavior:none;cursor:crosshair}
.camera-top,.camera-bottom{position:absolute;left:0;right:0;z-index:4;pointer-events:none;background:transparent;min-height:0}
.camera-top{top:0;bottom:auto;margin:0;gap:5px;padding:max(8px,env(safe-area-inset-top)) max(9px,env(safe-area-inset-right)) 22px max(9px,env(safe-area-inset-left));background:linear-gradient(to bottom,rgba(0,0,0,.78),rgba(0,0,0,.37) 66%,transparent)}
.camera-bottom{bottom:0;top:auto;margin:0;padding:25px max(12px,env(safe-area-inset-right)) max(11px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:linear-gradient(to top,rgba(0,0,0,.84),rgba(0,0,0,.38) 73%,transparent)}
.camera-top button,.camera-top label,.camera-bottom button{pointer-events:auto}
.camera-top .camera-text{font-size:12px;padding:7px 9px;min-height:38px;background:rgba(17,22,29,.56);border-color:#ffffff4d}
.camera-top .cam-count{font-size:14px;text-shadow:0 1px 4px #000}
.camera-options{flex-wrap:nowrap;gap:6px}
.camera-switch{padding:6px 9px;background:rgba(17,22,29,.57);min-height:35px;font-size:11px}
.camera-switch input{width:16px;height:16px}
.camera-buttons{margin-top:8px;min-height:69px;max-width:350px}
.shutter{width:69px;height:69px;border:3px solid #fff;box-shadow:0 2px 12px #0008}
.shutter span{width:53px;height:53px}
.camera-buttons .cam-side{min-width:65px;min-height:45px;font-size:17px;padding:6px 8px;background:rgba(17,22,29,.6)}
.camera-buttons .cam-side span{font-size:10px}
#cameraStatus{font-size:12px;min-height:16px;text-shadow:0 1px 3px #000;line-height:1.3}
.camera-estimate{font-size:10px;margin-top:2px;text-shadow:0 1px 3px #000}
.focus-indicator{position:absolute;z-index:3;left:50%;top:50%;width:58px;height:58px;transform:translate(-50%,-50%);border:2px solid #81f6bd;border-radius:8px;box-shadow:0 0 0 1px #0007;pointer-events:none;animation:focus-pop .2s ease-out}
.focus-indicator:before,.focus-indicator:after{content:'';position:absolute;background:#81f6bd;left:50%;top:50%;transform:translate(-50%,-50%)}
.focus-indicator:before{width:14px;height:2px}.focus-indicator:after{width:2px;height:14px}
.focus-indicator[data-supported="false"]{border-color:#d0d9e2}.focus-indicator[data-supported="false"]:before,.focus-indicator[data-supported="false"]:after{background:#d0d9e2}
@keyframes focus-pop{from{opacity:.3;scale:1.15}to{opacity:1;scale:1}}
.camera-indicator{position:absolute;right:16px;top:50%;transform:translateY(-50%);z-index:3;pointer-events:none;background:#121921c9;color:white;padding:9px 12px;border-radius:13px;font-size:14px;font-weight:800;border:1px solid #ffffff45;text-shadow:0 1px 3px #000}
@media(orientation:landscape){.camera-top{padding-top:max(5px,env(safe-area-inset-top));padding-bottom:13px}.camera-top-line{margin-bottom:1px}.camera-options{justify-content:flex-start}.camera-bottom{padding-top:12px;padding-bottom:max(5px,env(safe-area-inset-bottom))}.camera-buttons{margin-top:3px;min-height:55px;max-width:280px}.shutter{width:54px;height:54px}.shutter span{width:40px;height:40px}.camera-buttons .cam-side{font-size:14px;min-height:40px;padding:4px 6px}.camera-estimate{font-size:10px}}
@media(max-height:520px) and (orientation:landscape){.camera-top-line{max-width:100%}.cam-count{max-width:35%}.camera-options{position:static;transform:none;justify-content:flex-start}.camera-top{gap:2px}.camera-switch{min-height:28px;padding:4px 6px}.camera-bottom{padding-top:4px}.camera-buttons{max-width:240px}.camera-bottom #cameraStatus{max-width:65vw;margin:auto}}
.camera-screen:not([hidden])~.toast{bottom:calc(130px + env(safe-area-inset-bottom))}
@media(max-height:520px) and (orientation:landscape){.camera-screen:not([hidden])~.toast{bottom:75px}}

/* v2026.10.18.12: Native-ratio framing: keep the entire camera frame visible. */
.camera-screen{background:#172126}
.camera-backdrop{position:absolute;inset:0;width:100%;height:100%;z-index:0;filter:blur(19px) brightness(.48);transform:scale(1.13);pointer-events:none}
.camera-stage{position:absolute;z-index:1;inset:125px 0 149px;overflow:hidden;touch-action:none}
.camera-stage video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center center;transform-origin:center center;z-index:1}
.camera-stage .camera-overlay{z-index:2}
.camera-stage .camera-gesture{z-index:3}
.camera-stage .focus-indicator{z-index:4}
.camera-top,.camera-bottom{z-index:5}
.camera-diag-panel{position:absolute;z-index:7;right:10px;top:125px;width:min(340px,calc(100vw - 20px));max-height:calc(100dvh - 185px);overflow:auto;background:#14212cf2;border:1px solid #ffffff55;border-radius:12px;padding:13px;color:white;box-shadow:0 8px 25px #0008;text-align:left}
.camera-diag-panel strong{font-size:13px}.camera-diag-panel pre{font-family:ui-monospace,monospace;font-size:10.5px;white-space:pre-wrap;word-break:break-word;line-height:1.6;margin:10px 0}
.camera-diag-panel label{display:block;margin:9px 0;font-size:12px}.camera-diag-panel select{display:block;margin-top:4px;width:100%;min-height:40px;border:1px solid #8795a2;border-radius:6px;background:#eaf3f7;color:#111e2a;padding:5px}
.camera-diag-panel button{border:1px solid #ffffff65;color:#fff;background:#42586c;border-radius:8px;padding:9px 11px;min-height:42px;font-size:12px}
.camera-top-line{gap:6px}.camera-top-line .camera-text{padding:6px 9px}.camera-top-line #cameraDiagBtn{min-width:39px}
@media(orientation:landscape){.camera-stage{inset:51px 0 90px}.camera-diag-panel{top:48px;max-height:calc(100dvh - 60px)}}
@media(max-width:400px){.camera-stage{inset:122px 0 148px}.camera-top .camera-text{font-size:11px}.camera-top-line #torchBtn{padding:5px 7px}}
@media(max-height:520px) and (orientation:landscape){.camera-stage{inset:42px 0 71px}.camera-diag-panel{top:40px}}

/* v2026.10.18.14 — torch-aware capture and restored LED control; colour selection and share subject preserved */
.share-subject{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding:11px 12px;background:#f5f9ff;border:1px solid #dae4f0;border-radius:10px;min-width:0}
.share-subject>div{min-width:0;flex:1}
.share-subject-label{display:block;font-size:11px;color:#566c83;margin-bottom:3px}
.share-subject strong{display:block;font-size:13px;overflow-wrap:anywhere;color:#1b344e}
.share-subject .btn{padding:9px 11px;min-height:42px;flex-shrink:0}
@media(max-width:410px){.share-subject{flex-wrap:wrap}.share-subject .btn{width:100%}}
