:root{
  --pe-blue:#087ee0; --pe-border:#168af1; --pe-hover:#eef7ff; --pe-bg:#e7e7e7;
  --pe-green:#08bd8e; --pe-text:#25313c; --pe-muted:#667788;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;color:var(--pe-text)}
body.pdf-pro-body{background:var(--pe-bg);overflow:hidden}
button,input,select,textarea{font:inherit}
button{user-select:none}
[hidden]{display:none!important}

/* First upload screen */
.pe-upload-screen{position:fixed;inset:0;z-index:100;background:linear-gradient(#f8fafc,#eef2f6);display:grid;place-items:center;padding:24px}
.pe-upload-card{width:min(660px,100%);background:#fff;border:1px solid #d8e2ec;border-radius:16px;box-shadow:0 20px 60px rgba(22,44,69,.12);padding:38px;text-align:center}
.pe-upload-card h1{margin:0 0 8px;font-size:30px}.pe-upload-card p{margin:0 0 26px;color:#637487}
.pe-drop{border:2px dashed #9bc8ee;border-radius:14px;padding:46px 20px;background:#f8fcff;transition:.2s;cursor:pointer}
.pe-drop.drag{border-color:#087ee0;background:#eef8ff}.pe-drop strong{display:block;font-size:21px;color:#0676d8;margin-bottom:5px}.pe-drop span{font-size:14px;color:#76889a}
.pe-open-primary{margin-top:18px;border:0;border-radius:8px;background:#087ee0;color:white;font-weight:700;padding:12px 21px;cursor:pointer}

/* Overall editor: intentionally mirrors the supplied reference HTML */
.pe-app{height:100vh;background:#e7e7e7;display:grid;grid-template-rows:116px 78px minmax(0,1fr);overflow:hidden}
.pe-top{position:relative;display:flex;justify-content:center;align-items:center;background:#efefef;z-index:60;padding:0 90px}
.pe-toolbar{height:48px;display:flex;align-items:stretch;background:#fff;border:1px solid var(--pe-border);border-radius:7px;box-shadow:0 1px 2px rgba(20,49,75,.05);color:#0574d8;white-space:nowrap;position:relative}
.pe-tool,.pe-split-main,.pe-split-caret{border:0;border-right:1px solid var(--pe-border);background:#fff;color:#0574d8;height:46px;padding:0 18px;font-size:17px;display:flex;align-items:center;gap:8px;cursor:pointer;transition:.14s}
.pe-tool:hover,.pe-tool.active,.pe-split-main:hover,.pe-split-main.active,.pe-split-caret:hover{background:var(--pe-hover)}
.pe-toolbar>.pe-tool:last-child{border-right:0;border-radius:0 6px 6px 0}
.pe-split{position:relative;display:flex}.pe-split-main{padding-right:10px}.pe-split-caret{width:34px;padding:0;justify-content:center}
.pe-icon{font-size:21px;line-height:1}.pe-small{font-size:11px;color:#7b9ab7;margin-left:1px}
.pe-dropdown{position:relative}
.pe-menu{position:absolute;top:52px;left:0;min-width:210px;background:#fff;border:1px solid #c5d8e9;border-radius:7px;box-shadow:0 14px 30px rgba(23,58,86,.16);padding:7px;z-index:90}
.pe-menu button{width:100%;border:0;background:#fff;text-align:left;padding:10px 11px;border-radius:5px;color:#33475b;cursor:pointer}.pe-menu button:hover{background:#edf7ff;color:#0875dc}
.pe-menu hr{border:0;border-top:1px solid #e7eef5;margin:5px}
.pe-menu .pe-inline-row{display:flex;gap:8px;padding:8px;align-items:center}.pe-menu input[type=number]{width:70px;padding:7px;border:1px solid #cbd8e5;border-radius:5px}.pe-menu input[type=color]{width:42px;height:32px;border:1px solid #cbd8e5;border-radius:5px;background:white;padding:2px}
.pe-format-btn{width:34px!important;text-align:center!important;border:1px solid #cbd8e5!important;padding:7px!important}.pe-format-btn.on{background:#e8f4ff!important;border-color:#158af2!important;color:#0875dc!important}
.pe-side-quick{position:absolute;right:50px;top:34px;width:61px;border:1px solid var(--pe-border);border-radius:7px;overflow:hidden;background:#fff;box-shadow:0 1px 2px rgba(20,49,75,.05)}
.pe-side-quick button{display:block;width:100%;height:44px;border:0;border-bottom:1px solid var(--pe-border);background:#fff;color:#0875dc;font-size:21px;cursor:pointer}.pe-side-quick button:last-child{border-bottom:0}.pe-side-quick button:hover{background:#eef7ff}

.pe-pagebar{position:relative;display:flex;justify-content:center;align-items:center;background:#e7e7e7;z-index:55}
.pe-page-controls{display:flex;align-items:center;gap:0;height:42px}
.pe-page-no{font-size:28px;font-weight:400;color:#5ba9ec;margin-right:34px;min-width:30px;text-align:right}
.pe-page-btn{height:42px;min-width:52px;border:1px solid var(--pe-border);border-right:0;background:#fff;color:#0875dc;font-size:20px;cursor:pointer}.pe-page-btn:first-of-type{border-radius:6px 0 0 6px}.pe-page-btn:nth-last-of-type(1){border-right:1px solid var(--pe-border);border-radius:0 6px 6px 0}.pe-page-btn:hover{background:#eef7ff}
.pe-insert{height:42px;margin-left:28px;border:1px solid var(--pe-border);border-radius:7px;background:#fff;color:#0875dc;font-size:17px;padding:0 18px;cursor:pointer}.pe-insert:hover{background:#eef7ff}
.pe-prevnext{position:absolute;left:24px;display:flex;gap:6px}.pe-prevnext button{width:38px;height:38px;border:1px solid #c7d4e1;border-radius:6px;background:white;color:#51708e;cursor:pointer}
.pe-doc-name{position:absolute;right:132px;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#718397}

.pe-main{min-height:0;position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;background:#e7e7e7;overflow:hidden}
.pe-stage{min-width:0;overflow:auto;padding:7px 84px 120px;display:flex;justify-content:center;align-items:flex-start}
.pe-page-shell{position:relative;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.2);transform-origin:top center;flex:0 0 auto}
.pe-page-shell::before{content:"";position:absolute;z-index:18;left:0;right:0;top:0;height:8px;background:#000;pointer-events:none}
.pe-canvas{display:block;background:white}
.pe-layer{position:absolute;inset:0;z-index:20;overflow:hidden}
.pe-text-hit{position:absolute;border:1px solid transparent;cursor:text;z-index:21}.pe-text-hit:hover{border-color:#1b8ef2;background:rgba(27,142,242,.06)}
.pe-text-hit.hidden-source{background:white;border-color:transparent}
.pe-ann{position:absolute;z-index:24;transform-origin:top left}.pe-ann.selected{outline:2px solid #188af0;outline-offset:2px}.pe-ann .pe-resize{display:none;position:absolute;width:12px;height:12px;background:#fff;border:2px solid #168af1;border-radius:2px;right:-7px;bottom:-7px;cursor:nwse-resize}.pe-ann.selected .pe-resize{display:block}
.pe-ann-text{display:flex;align-items:flex-start;white-space:pre-wrap;overflow:visible;line-height:1.15}.pe-ann-img img{width:100%;height:100%;object-fit:contain;display:block;pointer-events:none}.pe-ann-whiteout{background:#fff}.pe-ann-highlight{background:rgba(255,230,62,.42)}.pe-ann-rectangle{border:2px solid #e03a3a}.pe-ann-ellipse{border:2px solid #e03a3a;border-radius:50%}.pe-ann-link{border:2px dashed #087ee0;background:rgba(8,126,224,.08)}.pe-ann-form{border:1px solid #6daee4;background:#fff;display:flex;align-items:center;padding:2px 5px;color:#8798aa}.pe-ann-check{border:1px solid #6daee4;background:white}.pe-ann-line svg,.pe-ann-arrow svg,.pe-ann-draw svg,.pe-ann-underline svg{width:100%;height:100%;overflow:visible;display:block}
.pe-draft{position:absolute;z-index:40;min-width:4px;min-height:22px;outline:0;white-space:pre-wrap;line-height:1.1;cursor:text;background:transparent;border-left:1px solid #111;padding:0 2px}
.pe-draw-canvas{position:absolute;inset:0;z-index:35;touch-action:none}

/* Thumbnail drawer */
.pe-thumbs{width:158px;height:100%;overflow:auto;background:#f4f4f4;border-left:1px solid #cbd3da;padding:10px;z-index:45}.pe-thumbs[hidden]{display:none}.pe-thumb{background:#fff;border:2px solid transparent;border-radius:4px;padding:5px;margin-bottom:10px;cursor:pointer;box-shadow:0 1px 3px #0002}.pe-thumb.active{border-color:#188af0}.pe-thumb canvas{display:block;width:100%;height:auto}.pe-thumb span{display:block;text-align:center;font-size:11px;color:#6d7b89;margin-top:4px}

/* Floating text editing bar, inspired by supplied code's “Type your text” and Apply button */
.pe-float-editor{position:fixed;z-index:120;left:50%;bottom:78px;transform:translateX(-50%);width:min(520px,calc(100vw - 34px));background:rgba(255,248,223,.96);border-radius:14px;padding:10px 12px;box-shadow:0 9px 28px rgba(43,56,69,.15);display:flex;align-items:center;gap:10px}
.pe-float-editor textarea{flex:1;min-height:48px;max-height:120px;resize:vertical;border:0;border-bottom:1px solid #21a981;background:transparent;outline:0;font-size:19px;padding:9px 4px;color:#222}.pe-float-editor button{height:48px;border:0;border-radius:6px;background:#08bd8e;color:#fff;font-weight:800;font-size:18px;padding:0 18px;cursor:pointer}.pe-float-editor button:hover{background:#06aa80}.pe-float-cancel{background:#fff!important;color:#6d7c8c!important;border:1px solid #d6dee6!important;width:40px!important;padding:0!important}
.pe-apply-wrap{position:fixed;left:0;right:0;bottom:0;display:flex;justify-content:center;padding:13px 0 18px;z-index:110;pointer-events:none}.pe-apply-glow{padding:8px;background:#fff0bf;border-radius:13px;box-shadow:0 0 26px rgba(251,191,36,.32);pointer-events:auto}.pe-apply{height:54px;border:0;border-radius:6px;background:#08bd8e;color:white;font-weight:800;font-size:20px;padding:0 25px;cursor:pointer}.pe-apply:hover{background:#06aa80}.pe-apply[disabled]{opacity:.55;cursor:not-allowed}

/* Draw/select hint and toasts */
.pe-hint{position:fixed;z-index:70;left:18px;bottom:18px;max-width:360px;background:#263544;color:#fff;border-radius:8px;padding:10px 13px;font-size:12px;box-shadow:0 8px 24px #0002;opacity:.94}
.pe-toast{position:fixed;z-index:200;right:18px;bottom:18px;background:#1f2d3a;color:#fff;padding:11px 14px;border-radius:8px;box-shadow:0 10px 30px #0003;font-size:13px}.pe-toast.ok{background:#087c5f}.pe-toast.err{background:#b42318}
.pe-busy{position:fixed;inset:0;z-index:250;background:rgba(237,241,245,.82);backdrop-filter:blur(3px);display:grid;place-items:center}.pe-busy-card{background:white;border-radius:12px;padding:22px 28px;box-shadow:0 20px 55px #0002;text-align:center}.pe-spinner{width:34px;height:34px;border:4px solid #dce8f4;border-top-color:#087ee0;border-radius:50%;margin:0 auto 10px;animation:peSpin .8s linear infinite}@keyframes peSpin{to{transform:rotate(360deg)}}

/* signature modal */
.pe-modal{position:fixed;inset:0;z-index:180;background:rgba(25,36,49,.55);display:grid;place-items:center;padding:20px}.pe-card{width:min(760px,100%);background:#fff;border-radius:13px;padding:16px;box-shadow:0 30px 90px #0005}.pe-card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.pe-card-head h3{margin:0}.pe-card-head button{width:34px;height:34px;border:0;border-radius:50%;background:#f0f3f6;cursor:pointer}.pe-sign-canvas{width:100%;height:240px;border:1px dashed #9bb0c4;border-radius:8px;touch-action:none;display:block}.pe-card-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}.pe-card-actions button{padding:10px 15px;border:1px solid #c7d3df;border-radius:7px;background:#fff;cursor:pointer}.pe-card-actions .primary{background:#087ee0;color:white;border-color:#087ee0}

@media(max-width:1050px){.pe-top{justify-content:flex-start;padding:0 68px 0 8px}.pe-toolbar{overflow-x:auto;max-width:100%}.pe-tool,.pe-split-main{padding:0 12px;font-size:14px}.pe-icon{font-size:18px}.pe-side-quick{right:9px;top:35px;width:48px}.pe-stage{padding-left:18px;padding-right:18px}.pe-doc-name{display:none}}
@media(max-width:700px){body.pdf-pro-body{overflow:hidden}.pe-app{grid-template-rows:67px 60px minmax(0,1fr)}.pe-top{height:67px}.pe-toolbar{height:44px;border-radius:0}.pe-tool,.pe-split-main,.pe-split-caret{height:42px}.pe-side-quick{position:fixed;top:auto;right:8px;bottom:12px;width:auto;display:flex;z-index:130}.pe-side-quick button{width:43px;height:42px;border-bottom:0;border-right:1px solid var(--pe-border)}.pe-page-no{font-size:22px;margin-right:10px}.pe-page-btn{height:36px;min-width:42px;font-size:16px}.pe-insert{height:36px;margin-left:10px;padding:0 10px;font-size:13px}.pe-prevnext{display:none}.pe-pagebar{justify-content:flex-start;padding-left:8px;overflow-x:auto}.pe-stage{padding:7px 8px 88px;justify-content:flex-start}.pe-thumbs{position:absolute;right:0;top:0;bottom:0;width:116px;z-index:80}.pe-float-editor{bottom:68px}.pe-apply-wrap{padding-bottom:9px}.pe-apply{height:48px;font-size:17px}.pe-hint{display:none}}
