:root{--bg:#f5f6f3;--ink:#24342f;--muted:#75817b;--line:#e1e6df;--green:#1b6758;--soft:#edf5ef;--mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px}button,a,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.4}button:focus-visible,a:focus-visible,pre:focus-visible{outline:3px solid #64ae94;outline-offset:3px}[hidden]{display:none!important}.topbar{height:76px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 4vw}.brand{text-decoration:none;color:var(--ink);font-size:25px;font-weight:700;display:flex;align-items:center;gap:10px;letter-spacing:-.8px}.brand-icon{background:var(--green);color:white;border-radius:8px;width:34px;height:34px;text-align:center;line-height:34px;font-size:28px;font-weight:400}.brand-sub{font-size:11px;font-weight:500;letter-spacing:.8px;margin-left:16px;padding-left:20px;border-left:1px solid var(--line);color:var(--muted)}.local-note{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}.local-note i{width:6px;height:6px;border-radius:50%;background:#478c71}main{max-width:1660px;margin:auto;padding:36px 4vw 18px}.intro{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px}.eyebrow{font-size:10px;letter-spacing:1.5px;font-weight:650;color:var(--muted)}h1{font-size:clamp(23px,2.3vw,33px);letter-spacing:-1px;font-weight:550;margin:10px 0}p{color:var(--muted);line-height:1.6;margin:0}.step-note{color:var(--muted);font-size:11px;white-space:nowrap}.step-note span{margin:0 9px;color:#aab5ad}.workspace{display:grid;grid-template-columns:1fr 1fr;gap:22px;min-height:610px;height:calc(100vh - 264px)}.panel{background:white;border:1px solid var(--line);border-radius:14px;overflow:hidden;display:flex;flex-direction:column;min-width:0;box-shadow:0 4px 16px #24342f04}.panel-head{display:flex;justify-content:space-between;align-items:center;padding:22px 24px;border-bottom:1px solid var(--line);flex-shrink:0}h2{font-size:18px;font-weight:550;letter-spacing:-.4px;margin:7px 0 0}.button{border:1px solid transparent;border-radius:8px;padding:10px 15px;font-size:12px;font-weight:550;display:inline-flex;align-items:center;justify-content:center;gap:24px;transition:background .15s}.primary{color:#fff;background:var(--green)}.primary:hover:not(:disabled){background:#124b40}.secondary{background:white;border-color:var(--line);color:var(--ink)}.dropzone{margin:20px 24px 0;min-height:166px;border:1px dashed #b8c9bd;border-radius:10px;background:#f9fbf8;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--muted)}.dropzone:hover,.dropzone.dragover{background:var(--soft);border-color:var(--green)}.dropzone strong{color:var(--ink);font-weight:550;font-size:15px}.dropzone small{font-size:11px;margin-top:5px}.upload-icon{font-size:25px;color:var(--green);margin-bottom:2px}.source-placeholder{flex:1;min-height:180px;display:flex;flex-direction:column;justify-content:center;align-items:center;color:var(--muted);gap:6px}.source-placeholder p{font-size:13px}.source-placeholder small{font-size:11px;color:#9aa39d}.paper-stack{position:relative;height:66px;width:60px;margin-bottom:16px}.paper-stack span{position:absolute;width:46px;height:60px;border:1px solid #dde5dc;background:#fafcf9;border-radius:4px;transform:rotate(-14deg);left:0;top:3px}.paper-stack span:nth-child(2){transform:rotate(12deg);left:12px}.paper-stack span:last-child{transform:none;left:7px;top:0;display:grid;place-items:center;color:#a1b9a8;font-size:25px}.extract-bar{padding:17px 24px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;flex-shrink:0;background:#fcfdfb}.extract-bar>span{font-size:12px;color:var(--muted)}.document-info{margin:18px 24px 4px;display:flex;align-items:center;gap:12px;flex-shrink:0}.file-badge{font-size:10px;background:var(--soft);color:var(--green);padding:12px 8px;border-radius:6px;font-weight:700}.document-info div{min-width:0}.document-info strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:550}.document-info div>span{display:block;font-size:11px;color:var(--muted);margin-top:5px}.selection-toolbar{padding:15px 24px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;color:var(--muted);flex-shrink:0}.text-button{background:none;border:none;color:var(--muted);padding:6px 7px;font-size:11px}.text-button:hover:not(:disabled){color:var(--green);background:var(--soft);border-radius:4px}.page-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:0 24px 20px;overflow-y:auto;align-content:start}.page-card{position:relative;display:block;border:1px solid var(--line);background:#fafbf9;border-radius:8px;cursor:pointer;overflow:hidden;transition:border-color .12s}.page-card:hover{border-color:#8aa99a}.page-card.selected{border:2px solid var(--green);background:var(--soft)}.page-card input{position:absolute;top:9px;right:9px;z-index:1;width:18px;height:18px;accent-color:var(--green);cursor:pointer}.thumb{height:178px;padding:12px 10px 0;display:flex;align-items:center;justify-content:center;background:#eef0ec}.thumb img{max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 1px 5px #0002;background:white}.page-card.selected .thumb{background:#e5eee7}.page-caption{padding:10px;display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted)}.page-caption small{color:var(--green);visibility:hidden;font-size:9px}.selected .page-caption{color:var(--green);font-weight:600}.selected .page-caption small{visibility:visible}.format-tag{font-family:var(--mono);font-size:11px;color:var(--muted);border:1px solid var(--line);border-radius:5px;padding:5px 8px}.output-toolbar{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:10px 15px;gap:8px;flex-shrink:0}.tabs{display:flex;background:#f1f3ef;border-radius:6px;padding:3px;gap:2px}.tabs button{background:transparent;border:0;padding:7px 10px;border-radius:4px;color:var(--muted);font-size:11px;white-space:nowrap}.tabs .active{background:white;color:var(--green);box-shadow:0 1px 3px #0001}.output-actions{display:flex}.result-placeholder{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px}.code-icon{font-family:var(--mono);font-size:30px;color:#86a693;margin-bottom:24px}.result-placeholder h3{font-weight:500;font-size:18px;margin:0 0 10px}.result-placeholder p{font-size:12px}.result-placeholder strong{font-weight:550}.sample{text-align:left;font-family:var(--mono);font-size:11px;line-height:1.9;background:#f7f9f5;border:1px solid #e9eee5;border-radius:8px;padding:16px 24px;margin-top:26px;color:#6c7770;min-width:230px}.sample>span{color:var(--green)}.sample small{display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:10px;color:#9aa39d;margin-top:8px}.output-foot{border-top:1px solid var(--line);display:flex;justify-content:space-between;padding:16px 24px;color:var(--muted);font-size:10px;flex-shrink:0}.output-foot>span:last-child{font-family:var(--mono)}.result-meta{padding:13px 24px;background:#f5faf5;border-bottom:1px solid var(--line);font-size:11px;color:var(--green);flex-shrink:0}.warnings{background:#fff8e8;color:#8b6622;font-size:11px;line-height:1.5;padding:12px 24px;max-height:120px;overflow:auto;flex-shrink:0}.warnings p{color:inherit}.warnings details{margin-top:5px}pre{margin:0;padding:20px 24px;font:11px/1.8 var(--mono);color:#33473e;overflow:auto;flex:1;tab-size:2;background:#fdfefb;min-height:0}.json-key{color:#1b6758}.json-string{color:#7a6642}.json-number{color:#5767a1}.json-null{color:#9b6988}.bottom-note{display:flex;justify-content:space-between;gap:16px;color:var(--muted);font-size:10px;padding:17px 0}.processing{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:var(--muted);font-size:12px}.processing strong{color:var(--ink);font-weight:500}.spinner{width:28px;height:28px;border:2px solid #dce8de;border-top-color:var(--green);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}#notice{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:var(--ink);color:white;padding:14px 22px;border-radius:8px;box-shadow:0 4px 24px #0003;max-width:90vw;font-size:12px;z-index:10}#notice.error{background:#94463a}.busy .page-card{pointer-events:none;opacity:.7}@media(min-width:1500px){.page-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(max-width:1100px){.step-note{display:none}.page-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.output-toolbar{flex-wrap:wrap}}@media(max-width:750px){main{padding:25px 18px}.topbar{padding:0 18px;height:65px}.brand-sub{margin-left:5px;padding-left:12px}.local-note{font-size:10px}.intro{margin-bottom:22px}.intro p{font-size:12px}.workspace{grid-template-columns:1fr;height:auto;min-height:0}.source{height:650px}.output{height:640px}.page-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.thumb{height:150px}.panel-head{padding:18px}.bottom-note{flex-direction:column;gap:5px}.extract-bar{padding:15px 18px}}@media(max-width:410px){.page-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.brand-sub{display:none}}

/* Keep thumbnails at their natural row height inside the scrollable pane. */
.page-grid{grid-auto-rows:218px;flex:1;min-height:0}.page-card{min-height:218px}
@media(max-width:750px){.page-grid{grid-auto-rows:190px}.page-card{min-height:190px}}
