:root{--ed-navy:#071735;--ed-navy2:#102c5b;--ed-gold:#e9bd5c;--ed-blue:#315fe9;--ed-ink:#17233c;--ed-line:#e2e7f0}
.pdf-editor-page [hidden]{display:none!important}.pdf-editor-page{margin:0;background:#f3f5fa;color:var(--ed-ink);font:14px "DM Sans",Arial,sans-serif;min-height:100vh}
.editor-top{height:64px;background:linear-gradient(100deg,#06142e,#0b2047);border-bottom:1px solid #c79b42;display:flex;align-items:center;justify-content:space-between;padding:0 clamp(14px,3vw,38px);color:#fff}
.editor-top nav{display:flex;gap:22px}.editor-top a{color:#eaf0fa;text-decoration:none}.editor-brand{display:flex;align-items:center;gap:9px;font-size:16px;letter-spacing:1px}.editor-brand span{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,#ffe4a0,#e7b84c);color:#10203d;font:900 22px Manrope}.editor-brand small{font-size:8px;color:#e5c77e;letter-spacing:1.5px;margin-left:5px}
.editor-wrap{max-width:1600px;margin:auto;padding:15px clamp(10px,2vw,26px) 38px}.editor-intro{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 2px 12px}.editor-kicker{font-size:9px;font-weight:900;letter-spacing:2px;color:#a87b26;margin:0}.editor-intro h1{font:900 clamp(26px,3vw,38px) Manrope;margin:4px 0;color:#0a1d3d}.editor-intro p{color:#68758b;max-width:740px;margin:0;line-height:1.55;font-size:12px}.editor-file-btn{display:inline-flex;align-items:center;justify-content:center;border-radius:8px;padding:10px 15px;background:linear-gradient(135deg,#ffe3a0,#e9ba51);color:#17233c;font-weight:900;font-size:12px;cursor:pointer;white-space:nowrap}.editor-upload-hero{padding:12px 19px}
.privacy-banner,.server-panel{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:10px 14px;border:1px solid #dce5f5;background:#edf3ff;border-radius:10px;margin:8px 0 12px}.privacy-banner b{white-space:nowrap;color:#2448b8;font-size:11px}.privacy-banner span,.server-panel p{font-size:11px;color:#64738b;line-height:1.5;margin:0}
.editor-shell{background:#fff;border:1px solid #dce2ec;border-radius:13px;overflow:hidden;box-shadow:0 10px 34px #17233c12}.editor-toolbar{min-height:49px;display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:8px 11px;border-bottom:1px solid var(--ed-line);background:#fff}.editor-toolbar button,.document-tools button,.page-management button{border:1px solid #dfe5ef;background:#fff;color:#34435c;border-radius:7px;padding:8px 10px;font:600 11px "DM Sans";cursor:pointer}.editor-toolbar button:disabled,.document-tools button:disabled,.page-management button:disabled{opacity:.4;cursor:not-allowed}.editor-toolbar input[type=file],.page-management input[type=file]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.editor-toolbar input[type=number]{width:48px;padding:7px;border:1px solid #dfe5ef;border-radius:6px}.page-total{font-size:11px;color:#718097}.toolbar-divider{height:23px;border-left:1px solid #e4e8ef;margin:0 4px}.toolbar-spacer{flex:1}.editor-toolbar .download-top{background:#0b2450;color:#fff;border-color:#0b2450}
.editor-workspace{display:grid;grid-template-columns:150px minmax(0,1fr) 245px;min-height:650px}.page-rail{background:#f9fafd;border-right:1px solid var(--ed-line);padding:12px 9px;min-width:0}.rail-heading{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#34435c;padding:0 5px 10px}.rail-heading span{background:#e9edf5;border-radius:15px;padding:3px 7px;font-size:10px}.page-thumbnails{display:flex;flex-direction:column;gap:9px;max-height:590px;overflow:auto}.rail-empty{font-size:10px;color:#98a2b3;text-align:center;padding:26px 5px;line-height:1.5}
.document-area{min-width:0;display:flex;flex-direction:column;background:#edf0f6}.document-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px 10px;background:#fff;border-bottom:1px solid var(--ed-line)}.document-tools button.active{background:#edf2ff;color:#2448c4;border-color:#cbd8ff}.tool-separator{height:22px;border-left:1px solid #e0e5ee;margin:0 4px}.page-stage{min-width:0;min-height:540px;padding:20px 12px;background:#edf0f6;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:auto}.empty-editor{min-height:410px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:#8290a6;text-align:center}.empty-editor>span{font-size:50px;color:#9eadd0}.empty-editor b{color:#465671;font-size:15px}.empty-editor small{font-size:11px;max-width:270px;line-height:1.5}.empty-editor .editor-file-btn{margin-top:8px}.canvas-wrap{position:relative;max-width:100%;box-shadow:0 4px 22px #17233c25;background:#fff;line-height:0}.canvas-wrap canvas{display:block;max-width:100%;height:auto}.editor-overlay{position:absolute;inset:0;cursor:crosshair}.editor-status{font-size:10px;color:#738198;line-height:1.5;margin:12px 0 0;min-height:16px}.page-management{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px 10px;background:#fff;border-top:1px solid var(--ed-line)}.page-management label{font-size:10px;color:#315fe9;font-weight:700;cursor:pointer;padding:7px}
.pdf-inspector{background:#fff;border-left:1px solid var(--ed-line);padding:13px 12px;min-width:0}.inspector-head{display:flex;flex-direction:column;gap:4px;padding:1px 0 12px;border-bottom:1px solid var(--ed-line)}.inspector-head span{font-size:8px;letter-spacing:1.7px;font-weight:900;color:#9a762e}.inspector-head b{font:800 16px Manrope;color:#152849}.inspector-section{display:flex;flex-direction:column;gap:8px;padding-top:12px}.inspector-empty{display:flex;flex-direction:column;align-items:center;text-align:center;padding:12px 5px 15px;border:1px dashed #dce3ef;border-radius:9px;margin-bottom:7px}.inspector-empty span{font-size:20px;color:#bd8e32}.inspector-empty b{font-size:11px;color:#4b5b73}.inspector-empty p{font-size:9px;line-height:1.5;color:#8994a6;margin:5px 0 0}.inspector-section>label,.inspector-grid label{font-size:10px;font-weight:700;color:#65738a}.inspector-section textarea,.inspector-section input,.inspector-section select{width:100%;box-sizing:border-box;border:1px solid #dfe5ef;border-radius:6px;padding:8px;font:11px "DM Sans";background:#fafbfe;color:#34435c}.inspector-section input[type=color]{height:34px;padding:3px}.inspector-section :disabled{opacity:.5}.inspector-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.inspector-grid label{display:flex;flex-direction:column;gap:5px}.inspector-note{font-size:9px;line-height:1.55;color:#8a6a2e;background:#fff8e9;border:1px solid #f2e4c5;border-radius:7px;padding:8px;margin:7px 0 0}
.editor-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;border-top:1px solid var(--ed-line)}.editor-bottom div{display:flex;gap:9px;align-items:center;font-size:10px}.editor-bottom div span{color:#6c7a91}.editor-bottom button{border:0;background:#0b2450;color:#fff;border-radius:7px;padding:10px 14px;font-weight:800;font-size:11px;cursor:pointer}.editor-bottom button:disabled{opacity:.4}.server-panel{background:#fff;border-color:var(--ed-line)}.server-panel p{margin-top:4px}.capability-pill{font-size:9px;font-weight:800;color:#527047;background:#edf6e9;border-radius:20px;padding:6px 9px;white-space:nowrap}.editor-footnote{font-size:10px;color:#7a879b;line-height:1.7}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:1000px){.editor-workspace{grid-template-columns:112px minmax(0,1fr)}.pdf-inspector{grid-column:1/-1;border-left:0;border-top:1px solid var(--ed-line)}.inspector-section{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end}.inspector-empty,.inspector-note{grid-column:1/-1}.inspector-head{flex-direction:row;align-items:center;justify-content:space-between}.page-thumbnails{max-height:520px}}
@media(max-width:650px){.editor-wrap{padding:10px 7px 24px}.editor-top{height:56px}.editor-intro{align-items:flex-start}.editor-intro p{font-size:10px}.editor-upload-hero{padding:9px 11px;font-size:10px}.privacy-banner,.server-panel{align-items:flex-start;flex-direction:column}.editor-workspace{grid-template-columns:1fr;min-height:0}.page-rail{border-right:0;border-bottom:1px solid var(--ed-line);padding:8px}.rail-heading{padding-bottom:6px}.page-thumbnails{flex-direction:row;max-height:130px;overflow-x:auto;overflow-y:hidden}.page-stage{padding:10px 5px;min-height:350px}.document-tools{gap:4px;padding:7px}.document-tools button{padding:7px 8px;font-size:10px}.page-management button{font-size:9px;padding:7px}.pdf-inspector{grid-column:auto;border-top:1px solid var(--ed-line)}.inspector-section{display:flex}.inspector-empty{grid-column:auto}.editor-toolbar{gap:5px}.editor-toolbar button{padding:7px}.editor-bottom{align-items:flex-start;flex-direction:column}.editor-bottom button{width:100%}.toolbar-spacer{display:none}.editor-toolbar .download-top{margin-left:auto}}

.page-thumb{display:flex;flex-direction:column;align-items:center;gap:5px;width:100%;padding:7px 5px;border:1px solid transparent;border-radius:8px;background:transparent;color:#78859a;font:600 9px "DM Sans";cursor:pointer}.page-thumb canvas{display:block;width:min(100%,94px);height:auto;background:#fff;border:1px solid #dfe4ed;box-shadow:0 2px 7px #17233c12}.page-thumb.active{background:#edf2ff;border-color:#b9caff;color:#2448c4}.page-thumb.active canvas{border-color:#6f91ef;box-shadow:0 0 0 2px #d9e4ff}.page-thumb:focus-visible{outline:2px solid #315fe9;outline-offset:2px}

.scanner-panel,.ocr-panel{margin:12px 10px;padding:12px;border:1px solid #dfe5ef;border-radius:10px;background:#fff}
.scanner-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.scanner-heading b{font-size:12px;color:#1a2c4b}.scanner-heading span{font-size:10px;color:#7d899d}
.scanner-actions,.ocr-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.scanner-actions button,.ocr-actions button{border:1px solid #dfe5ef;border-radius:7px;padding:8px 10px;background:#f8faff;color:#34435c;font-size:10px;font-weight:700}.scanner-actions button:disabled,.ocr-actions button:disabled{opacity:.4}
#cameraPreview{display:block;width:100%;max-height:360px;object-fit:contain;background:#101827;border-radius:8px;margin-top:10px}#cameraPreview[hidden]{display:none}
#scannerStatus{font-size:10px;color:#718097;margin:8px 0 0;line-height:1.5}
.ocr-actions label{font-size:10px;font-weight:700;color:#65738a}.ocr-actions select{max-width:100%;padding:8px;border:1px solid #dfe5ef;border-radius:7px;font-size:10px;background:#fafbfe}.ocr-actions input[type=file]{position:absolute;width:1px;height:1px;opacity:0}
#ocrResults{margin-top:10px;min-height:54px;max-height:220px;overflow:auto;white-space:pre-wrap;unicode-bidi:plaintext;border:1px solid #e5eaf2;border-radius:7px;background:#fafbfe;padding:10px;font-size:12px;line-height:1.7;color:#253653}
@media(max-width:650px){.scanner-heading{align-items:flex-start;flex-direction:column}.ocr-actions{align-items:stretch}.ocr-actions select{width:100%;max-width:none}}

.page-tools-extra{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 10px;padding:12px;border:1px solid #dfe5ef;border-radius:10px;background:#fff}
.page-tools-extra>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.page-tools-extra b{width:100%;font-size:12px;color:#1a2c4b}.page-tools-extra input[type=file]{position:absolute;width:1px;height:1px;opacity:0}.page-tools-extra input[type=number]{width:58px;padding:7px;border:1px solid #dfe5ef;border-radius:6px;font-size:11px}.page-tools-extra button{border:1px solid #dfe5ef;border-radius:7px;padding:8px 10px;background:#f8faff;color:#34435c;font-size:10px;font-weight:700}.page-tools-extra button:disabled{opacity:.45}
@media(max-width:650px){.page-tools-extra{grid-template-columns:1fr}.page-tools-extra>div{align-items:center}}

.ocr-panel #ocrResults{display:block;width:100%;min-height:190px;resize:vertical;padding:14px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;color:#10234a;font:14px/1.6 system-ui;white-space:pre-wrap}.ocr-edit-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}.ocr-edit-actions button{border:0;border-radius:9px;padding:10px 14px;background:#092b63;color:#fff;font-weight:700}.ocr-edit-actions button:disabled{opacity:.45}.ocr-panel #ocrEditStatus{font-size:12px;color:#52627c;margin-top:8px}

.pdf-text-layer{position:absolute;inset:0;overflow:hidden;pointer-events:none;user-select:text}.pdf-text-span{position:absolute;display:block;overflow:hidden;white-space:pre;transform-origin:0 0;color:transparent;-webkit-text-fill-color:transparent;pointer-events:auto;cursor:text;outline:1px solid transparent}.pdf-text-span:hover{outline:1px dashed #3974ed;background:#3974ed12}.pdf-text-span.selected{outline:2px solid #3974ed;background:#3974ed22}.pdf-text-span.edited{background:#fff;color:#10234a;-webkit-text-fill-color:#10234a;outline:1px solid #8aa8f2}.inspector-bold{display:flex;align-items:center;gap:8px;font-size:11px;color:#65738a}.inspector-section #applyTextEdit{border:0;border-radius:8px;padding:10px;background:#0b2450;color:#fff;font-weight:800}.inspector-section #applyTextEdit:disabled{opacity:.4}

.image-selection-layer{position:absolute;inset:0;pointer-events:none;z-index:4}.placed-image-handle{position:absolute;display:block;padding:0;border:1px dashed transparent;background:transparent;pointer-events:auto;cursor:pointer;min-width:8px;min-height:8px}.placed-image-handle:hover,.placed-image-handle.selected{border:2px solid #3974ed;background:#3974ed12;box-shadow:0 0 0 2px #fff8}.placed-image-handle.selected:after{content:'Selected image';position:absolute;left:0;top:-22px;padding:3px 6px;border-radius:4px;background:#1749a2;color:#fff;font:700 9px/1.2 system-ui;white-space:nowrap}
