/* IrfanEdu PDF Editor */
#pdfed{--bg:#f3f4f6;--panel:#fff;--ink:#111827;--mute:#6b7280;--line:#e5e7eb;--accent:#2563eb;--accent-ink:#fff;--sel:#2563eb}
#pdfed *{box-sizing:border-box}
#pdfed{height:100%;margin:0}
#pdfed{background:var(--bg);color:var(--ink);font:14px/1.4 system-ui,Segoe UI,Roboto,sans-serif;display:flex;flex-direction:column}
#pdfed .pe-head{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:8px 12px;background:var(--panel);border-bottom:1px solid var(--line)}
#pdfed .pe-head .sp{flex:1}
#pdfed button,#pdfed .btn{font:inherit;color:var(--ink);background:var(--panel);border:1px solid var(--line);border-radius:6px;padding:6px 10px;cursor:pointer}
#pdfed button:hover,#pdfed .btn:hover{border-color:var(--accent)}
#pdfed button.on{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
#pdfed button.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
#pdfed button.danger{color:#dc2626}
#pdfed button:disabled{opacity:.4;cursor:default}
#pdfed input[type=text],#pdfed input[type=number],#pdfed select,#pdfed textarea{font:inherit;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:5px 7px;width:100%}
#pdfed input[type=color]{width:36px;height:28px;padding:0;border:1px solid var(--line);border-radius:6px;background:none}
#pdfed label{display:flex;align-items:center;gap:6px;color:var(--ink)}
#pdfed .pe-main{flex:1;display:flex;min-height:0}
#pdfed #stage{flex:1;overflow:auto;padding:16px;text-align:center}
#pdfed #pages{display:inline-flex;flex-direction:column;gap:14px;align-items:center}
#pdfed .pe-side{width:290px;background:var(--panel);border-left:1px solid var(--line);overflow:auto;padding:12px;display:flex;flex-direction:column;gap:14px}
#pdfed .pe-side h3{margin:0 0 6px;font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:var(--mute)}
#pdfed .pe-side section{border-bottom:1px solid var(--line);padding-bottom:14px}
#pdfed .pe-side section:last-child{border-bottom:0}
#pdfed .row{display:flex;gap:8px;align-items:center;margin-bottom:6px}
#pdfed .row>*{flex:1}
#pdfed .row>input[type=color],#pdfed .row>.fix{flex:none}
#pdfed .hint{color:var(--mute);font-size:12px}
#pdfed #drop{margin:auto;max-width:460px;text-align:center;padding:48px 24px;border:2px dashed var(--line);border-radius:14px;background:var(--panel)}
#pdfed #drop.over{border-color:var(--accent)}
#pdfed #drop .dtitle{font-size:22px;font-weight:700;margin:0 0 8px}
#pdfed .page{position:relative;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.25);text-align:left}
#pdfed .page canvas{display:block}
#pdfed .layer{position:absolute;inset:0;overflow:hidden}
#pdfed .wm{pointer-events:none;z-index:1}
#pdfed .ov{z-index:2}
#pdfed .th-layer{z-index:3;display:none;pointer-events:none}
#pdfed .th{position:absolute;pointer-events:auto;cursor:text;border-radius:2px}
#pdfed .th:hover{background:rgba(37,99,235,.18);outline:1px solid var(--sel)}
#pdfed .th.used{display:none}
#pdfed[data-tool=edittext] .th-layer{display:block}
#pdfed[data-tool=edittext] .ov{pointer-events:none}
#pdfed[data-tool=addtext] .ov,#pdfed[data-tool=whiteout] .ov{cursor:crosshair}
#pdfed:not([data-tool=select]) .obj{pointer-events:none}
#pdfed .obj{position:absolute;cursor:move;user-select:none}
#pdfed .obj.sel{outline:2px solid var(--sel)}
#pdfed .obj.glob:not(.sel){outline:1px dashed #f59e0b}
#pdfed .obj.text{white-space:pre;line-height:1.15;color:#000;padding:0;min-width:6px;min-height:1em}
#pdfed .obj.text[contenteditable]:not([contenteditable=false]){cursor:text;user-select:text;outline:2px solid #f59e0b;background:rgba(255,255,255,.7)}
#pdfed .obj img{width:100%;height:100%;display:block;pointer-events:none}
#pdfed .handle{position:absolute;right:-6px;bottom:-6px;width:12px;height:12px;background:var(--sel);border:2px solid #fff;border-radius:3px;cursor:nwse-resize;display:none}
#pdfed .obj.sel .handle{display:block}
#pdfed .ghost{position:absolute;background:rgba(37,99,235,.25);border:1px solid var(--sel)}
#pdfed .wmcell{position:absolute;white-space:nowrap;transform-origin:center}
#pdfed #toast{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);background:#111827;color:#fff;padding:8px 14px;border-radius:8px;opacity:0;transition:opacity .2s;pointer-events:none;max-width:90vw;z-index:50}
#pdfed #toast.show{opacity:.95}
#pdfed .hide{display:none!important}
#pdfed .obj{touch-action:none}
#pdfed .handle{touch-action:none}
#pdfed[data-tool=addtext] .ov,#pdfed[data-tool=whiteout] .ov{touch-action:none}
@media (max-width:760px){#pdfed .pe-main{flex-direction:column}
#pdfed .pe-side{width:100%;max-height:42vh;border-left:0;border-top:1px solid var(--line)}
#pdfed #stage{padding:8px}
#pdfed .handle{width:24px;height:24px;right:-12px;bottom:-12px}
#pdfed button,#pdfed .btn{padding:8px 12px}
#pdfed input[type=text],#pdfed input[type=number],#pdfed select{font-size:16px}
}

#pdfed{position:relative;height:88vh;min-height:640px;max-width:100%;border:1px solid var(--line);border-radius:8px;overflow:hidden;margin:0}
#pdfed .pe-head,#pdfed .pe-main,#pdfed .pe-side{margin:0}
#pdfed button,#pdfed .btn{line-height:1.2;text-transform:none;letter-spacing:0;width:auto;margin:0;box-shadow:none;font-weight:400}
#pdfed button.primary,#pdfed button.on{background:var(--accent);color:var(--accent-ink)}
#pdfed input[type=text],#pdfed input[type=number],#pdfed select{height:auto;margin:0;box-shadow:none}
#pdfed input[type=checkbox]{width:auto;margin:0}
#pdfed label{margin:0;font-weight:400}
#pdfed h1,#pdfed h3{line-height:1.3}
#pdfed .page canvas{max-width:none}
#pdfed img{max-width:none}
#pdfed .obj img{max-width:100%}
@media (max-width:760px){#pdfed{height:auto;min-height:0;overflow:visible}#pdfed .pe-main{display:block}#pdfed #stage{height:72vh}#pdfed:not(.has-pdf) #stage{height:auto}#pdfed .pe-side{max-height:none;overflow:visible}}
#pdfed:not(.has-pdf){height:auto;min-height:0}
#pdfed:not(.has-pdf) #stage{padding:24px 16px}
