:root{font:15px Inter,system-ui,sans-serif;color:#17233a;background:#eef2f8;--blue:#1e49cf;--line:#dce4ef}
*{box-sizing:border-box}
body{margin:0}
[hidden]{display:none!important}
.pdf-editor .editor-header{min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px clamp(12px,3vw,36px);background:#fff;border-bottom:1px solid var(--line)}
.editor-brand,.actions,.toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:9px}
.editor-brand img{width:33px;height:33px;object-fit:contain}
.pdf-editor button,.pdf-editor input{font:inherit}
.pdf-editor button{border:1px solid #cbd6e6;border-radius:8px;background:#fff;color:inherit;cursor:pointer;padding:7px 11px}
.pdf-editor button:hover:not(:disabled){border-color:var(--blue);color:var(--blue)}
.pdf-editor button:disabled{opacity:.5;cursor:default}
.pdf-editor button.primary{background:var(--blue);color:#fff;border-color:var(--blue)}
.pdf-editor button.primary:hover:not(:disabled){background:#153aad;color:#fff}
.pdf-editor button.danger{color:#a32232}
.welcome{max-width:570px;margin:clamp(36px,10vh,120px) auto 24px;padding:44px 24px;text-align:center;background:#fff;border:1px solid var(--line);border-radius:18px}
.welcome h1{font-size:clamp(32px,5vw,48px);margin:0 0 12px;letter-spacing:-.035em}
.muted,#filename{color:#536680}
#workspace{display:grid;grid-template-columns:205px minmax(0,1fr);min-height:calc(100vh - 124px)}
.pdf-editor aside,.toolbar{background:#fff;border-bottom:1px solid var(--line)}
.pdf-editor aside{border-right:1px solid var(--line)}
.panel{padding:13px 16px 0}
.pdf-editor h2{font-size:16px;margin:0}
#filename{overflow-wrap:anywhere;margin:7px 0}
#pages{margin:0;padding:8px 13px;list-style:none;max-height:65vh;overflow:auto}
#pages button{width:100%;margin-bottom:5px;text-align:left}
#pages [aria-current=true]{background:#edf2ff;color:#153aad;border-color:#809af6}
.toolbar{padding:10px 15px}
.toolbar label{display:inline-flex;align-items:center;gap:5px}
.toolbar input{border:1px solid var(--line);border-radius:5px;padding:4px;max-width:44vw}
#size{width:66px}
#stage{padding:20px;display:flex;justify-content:center;overflow:auto}
#sheet{position:relative;align-self:start;background:#fff;box-shadow:0 6px 24px #17233a24}
#canvas{display:block}
#overlays{position:absolute;inset:0;overflow:hidden;pointer-events:none}
#overlays>*{position:absolute;transform-origin:0 100%;white-space:pre;line-height:1}
#sheet.placing{cursor:crosshair}
#status{min-height:1.5em;margin:12px 16px;color:#35496b}
@media(max-width:660px){#workspace{grid-template-columns:minmax(0,1fr)}#pages{display:flex;max-height:none}#pages li{flex:none;margin-right:5px}#stage{padding:12px}.pdf-editor .editor-header{align-items:flex-start}.welcome{margin-inline:12px}}
.editor-ribbon{background:#f7f9fd}
.editor-ribbon input[type=color]{width:35px;height:30px;padding:2px}
.editor-ribbon select{border:1px solid #cbd5e1;border-radius:5px;padding:5px;background:#fff}
.editor-toggle{border:1px solid #dce4ef;border-radius:7px;padding:5px 7px;background:#fff}
