:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#101e40;background:#fff;font-synthesis:none;--blue:#0669ff;--line:#d5dfeb;--muted:#536785}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,.button{font-size:14px;font-weight:550;line-height:1.3;min-height:43px;border:1px solid #cbd8e9;border-radius:7px;background:#fff;color:#13284b;padding:11px 14px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:5px;transition:background .15s,border-color .15s}button:hover,.button:hover{background:#f1f6fd;border-color:#87a6d6}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #8db9ff;outline-offset:3px}button:disabled{opacity:.4;cursor:not-allowed}.primary{background:var(--blue);border-color:var(--blue);color:white}.primary:hover{background:#0059dd;color:white}.outline{color:#005be7;border-color:var(--blue)}header{height:76px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 30px}.brand{font-size:26px;letter-spacing:.3px;font-weight:800;text-decoration:none;color:#101e40}.brand span{border-left:1px solid var(--line);padding-left:18px;margin-left:10px;color:var(--muted);font-size:23px;letter-spacing:-.5px}main{max-width:1560px;margin:auto;padding:0 20px}.intro{text-align:center;padding:34px 0 24px}h1{font-size:clamp(28px,3.5vw,48px);line-height:1.16;letter-spacing:-1.8px;margin:0 0 10px;font-weight:750}.intro p{font-size:22px;color:var(--muted);margin:0}.steps{list-style:none;display:flex;justify-content:center;gap:48px;padding:0;margin:0 0 26px}.steps li{display:flex;align-items:center;gap:16px;font-size:16px;font-weight:600;color:var(--muted)}.steps span{display:grid;place-items:center;border-radius:50%;background:#e9eef4;border:1px solid var(--line);width:38px;height:38px}.steps .active{color:#101e40}.steps .active span{background:var(--blue);color:#fff;border-color:var(--blue)}.workspace{display:grid;grid-template-columns:250px minmax(0,1fr) 300px;gap:9px;align-items:stretch;min-height:630px}.panel{border:1px solid var(--line);border-radius:8px;min-width:0}.rail,.inspector{padding:20px 17px}h2,legend{font-size:20px;font-weight:700;letter-spacing:-.5px;margin:0 0 16px}.rail>button{width:100%}#count{font-size:13px;color:var(--muted)}#rail-empty{padding:148px 16px 0;text-align:center;color:var(--muted);line-height:1.6}#rail-empty svg{width:43px;height:53px;fill:none;stroke:#9caabd;stroke-width:3;stroke-linejoin:round}#rail-empty p{margin:14px 0 8px}small{font-size:13px;line-height:1.5;color:#7185a2}.canvas{background:#f0f4f8;display:flex;align-items:center;justify-content:center;padding:24px;position:relative}.canvas.dragging{outline:3px solid var(--blue)}#empty{border:1.5px dashed #bacce1;border-radius:9px;width:100%;max-width:596px;text-align:center;padding:56px 16px 42px}#empty h2{font-size:24px;letter-spacing:-.6px;margin:24px 0 9px}#empty p{color:var(--muted);margin:0 0 27px}.scanner{width:74px;height:74px;fill:none;stroke:#43516a;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.scanner .beam{stroke:var(--blue);stroke-width:5}.upload-actions{display:flex;justify-content:center;gap:15px;margin-bottom:25px}.upload-actions button{min-height:50px;padding:12px 20px}fieldset{border:0;padding:0;margin:0;min-width:0}legend{padding:0;margin-bottom:18px}label{display:block;font-size:14px;color:var(--muted);margin-bottom:9px}fieldset>label{margin-top:18px}fieldset>label:first-of-type{margin-top:0}.modes{display:flex;gap:5px}.modes button{font-size:12px;padding:10px 7px;flex:1}.modes button[aria-pressed=true],.tabs button[aria-pressed=true]{border-color:var(--blue);color:var(--blue);background:#f8fbff}fieldset>button{width:100%;margin-top:8px}.text-button{border:0;background:transparent;color:var(--muted);font-size:12px;min-height:30px}input:not([type=checkbox]),select,textarea{width:100%;border:1px solid #cbd8e9;border-radius:6px;background:#fff;padding:11px 12px;color:#15294b;min-width:0;font-size:14px}.export{margin-top:24px;padding-top:22px;border-top:1px solid var(--line)}.export-buttons{display:flex;gap:12px;margin:22px 0 12px}.export-buttons button{flex:1}#share{width:100%}#export-note{display:block;margin-top:12px}footer{text-align:center;color:#7185a2;font-size:13px;line-height:1.7;padding:26px 5px}footer span{font-size:12px}#status{padding:12px 16px;margin:0 0 12px;border:1px solid #cbdcf5;border-radius:8px;background:#f3f7ff;color:#234a7f;font-size:14px}#status.error{border-color:#e3b6af;background:#fff5f3;color:#943d2a}#editor{width:100%;align-self:stretch;display:flex;flex-direction:column}.preview-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:16px}.tabs{display:flex;gap:6px}.tabs button{min-height:34px;padding:7px 12px}.compare{display:flex;align-items:center;gap:5px;font-size:12px;margin:0}#image-view{flex:1;display:flex;align-items:center;justify-content:center;min-height:360px}#image-wrap{position:relative;line-height:0;max-width:100%}#preview{display:block;max-width:100%;max-height:530px;width:auto;height:auto;object-fit:contain;box-shadow:0 5px 25px #11264418;user-select:none}#image-wrap.cropping{touch-action:none;cursor:crosshair}#crop-box{position:absolute;border:2px solid var(--blue);background:#0669ff20;pointer-events:none}#text-view{flex:1}#ocr-text{resize:vertical;min-height:420px;line-height:1.7}#text-view p,.page-info,#crop-actions p{font-size:12px;color:var(--muted);line-height:1.5}.page-info{margin:16px 0 0;text-align:center}.page-item{margin-top:14px;display:grid;grid-template-columns:1fr;gap:4px}.page-select{display:flex;width:100%;justify-content:flex-start;text-align:left;padding:8px;gap:12px}.page-select[aria-current=true]{border-color:var(--blue);background:#f3f7ff}.page-select img{width:43px;height:58px;object-fit:contain;background:#edf1f6}.page-select span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.page-actions{display:flex;justify-content:flex-end;gap:4px}.page-actions button{font-size:12px;padding:5px 9px;min-height:29px}.rail #reset{margin-top:15px}dialog{width:min(440px,calc(100% - 28px));border:1px solid var(--line);border-radius:14px;padding:28px;color:#101e40;box-shadow:0 24px 100px #101e4033}dialog::backdrop{background:#101e4055}dialog p{font-size:14px;color:var(--muted);line-height:1.6}dialog button,dialog .button{width:100%;margin-top:12px}dialog .close{float:right;width:30px;padding:0;margin:-12px -12px 0 0;border:0;font-size:25px}.busy{cursor:progress}[hidden]{display:none!important}@media(min-width:1500px){.workspace{min-height:670px}}@media(max-width:1100px){.workspace{grid-template-columns:180px minmax(0,1fr) 250px}.rail,.inspector{padding:18px 12px}.canvas{padding:16px}.upload-actions{flex-direction:column;align-items:center}.intro p{font-size:19px}.steps{gap:26px}.modes button{font-size:11px;padding:9px 4px}}@media(max-width:780px){header{height:64px;padding:0 16px}.brand{font-size:21px}.brand span{font-size:19px;padding-left:11px;margin-left:6px}.back{font-size:12px;padding:9px;min-height:36px}main{padding:0 14px}.intro{padding:27px 4px 20px}h1{font-size:31px;letter-spacing:-1px}.intro p{font-size:16px;line-height:1.55;max-width:320px;margin:auto}.steps{gap:8px;justify-content:space-between;margin-bottom:20px}.steps li{font-size:10px;gap:5px}.steps span{width:23px;height:23px;flex-shrink:0;font-size:11px}.workspace{display:flex;flex-direction:column;gap:12px}.rail{padding:14px}.rail h2{font-size:16px;display:inline;margin-right:10px}.rail>button{width:auto;min-height:36px;font-size:12px;padding:8px 12px}#rail-empty{display:none}#page-list{display:flex;gap:10px;overflow-x:auto}.page-item{min-width:130px;max-width:150px}.rail #reset{margin-top:8px}.canvas{padding:16px;min-height:365px}#empty{padding:35px 12px 28px}#empty h2{font-size:21px}#empty p{font-size:14px}.scanner{width:60px;height:60px}.upload-actions{flex-direction:row;gap:8px}.upload-actions button{font-size:12px;padding:11px 12px;min-height:44px}.inspector{padding:20px}.modes button{font-size:13px}.inspector fieldset>button{min-height:44px}.export{margin-top:20px}.preview-toolbar{flex-wrap:wrap}#image-view{min-height:280px}#preview{max-height:470px}#ocr-text{min-height:330px}footer{font-size:11px}.page-actions button{min-height:36px}#crop-actions button{margin:4px 0}.export-buttons button,#share{min-height:48px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

.svg-defs{position:absolute;width:0;height:0;overflow:hidden}.icon{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}footer .icon{width:14px;height:14px;vertical-align:-3px;margin-right:5px}button:disabled{opacity:.55}.inspector #restore{margin-top:1px;min-height:24px;padding:4px}.inspector fieldset>label{margin-top:14px}.inspector fieldset>label:first-of-type{margin-top:0}.inspector .export{margin-top:19px;padding-top:19px}

/* Local live camera: the overlay shares the exact video aspect ratio. */
.rail .rail-camera{margin-top:8px;font-size:12px}
#camera-dialog{width:min(620px,calc(100% - 24px));max-height:calc(100svh - 24px);padding:20px;overflow-y:auto}
.camera-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.camera-heading h2{margin:0;font-size:20px}
#camera-close{width:40px;min-height:40px;margin:0;padding:8px;flex-shrink:0}
#camera-dialog .camera-intro{font-size:14px;margin:12px 0;line-height:1.5}
.camera-stage{position:relative;margin:0 auto;background:#111d30;border-radius:10px;overflow:hidden;width:min(100%,var(--camera-width,42svh));aspect-ratio:var(--camera-aspect,3/4)}
#camera-video{display:block;width:100%;height:100%;object-fit:contain}
#camera-overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;fill:none}
#camera-frame{stroke:white;stroke-width:3;stroke-dasharray:12 6;vector-effect:non-scaling-stroke}
#camera-frame.ready{stroke:#42e6a4;stroke-dasharray:none}
#camera-paper{fill:#42e6a412;stroke:#42e6a4;stroke-width:2;vector-effect:non-scaling-stroke}
#camera-progress{width:100%;height:7px;margin-top:14px;accent-color:#16835d}
#camera-status{min-height:42px;margin:10px 0 0;font-weight:600;color:#244264;line-height:1.5}
#camera-dialog .camera-privacy{font-size:11px;line-height:1.5;margin-bottom:0}
@media(max-width:780px){.rail .rail-camera{display:flex;width:100%;margin-top:10px}#camera-dialog{padding:16px}.camera-heading h2{font-size:18px}}
