:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:#1d2938;background:#f4f7fa;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #83b8f1;outline-offset:2px}.shell{min-height:100vh;display:grid;grid-template-columns:236px 1fr}.sidebar{position:sticky;top:0;height:100vh;background:#fff;border-right:1px solid #e0e7ed;padding:25px 16px;display:flex;flex-direction:column;gap:28px}.brand{display:flex;gap:11px;align-items:center;padding:0 8px}.mark{width:39px;height:39px;display:grid;place-items:center;background:#1475d2;color:white;font-weight:750;border-radius:10px}.brand strong{display:block;font-size:16px}.brand small{color:#718197}.sidebar nav{display:grid;gap:5px}.nav-button{border:0;background:transparent;text-align:left;padding:11px 12px;border-radius:8px;color:#4c5e71}.nav-button.active{background:#e9f3ff;color:#1265b6;font-weight:650}.sidebar-foot{margin-top:auto;padding:12px;color:#748395;font-size:12px}.main{min-width:0}.topbar{height:70px;background:#fff;border-bottom:1px solid #e0e7ed;display:flex;align-items:center;justify-content:space-between;padding:0 36px;gap:20px}.topbar strong{font-size:14px}.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#e8f2ff;color:#1767b3;font-weight:700}.content{max-width:1350px;margin:auto;padding:38px 36px 70px}.demo{padding:10px 13px;margin-bottom:24px;border:1px solid #d7e7f8;background:#eef6ff;color:#315d82;border-radius:8px;font-size:13px}.heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:26px}.heading h1{font-size:27px;letter-spacing:-.025em;margin:0 0 7px}.heading p{color:#718197;margin:0;font-size:14px}.button{border:1px solid #d7e0e8;background:#fff;color:#283b4f;padding:10px 14px;border-radius:7px;white-space:nowrap}.primary{color:white;border-color:#176dcc;background:#176dcc;font-weight:600}.primary:hover{background:#0e5db3}.summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:24px}.metric,.panel{background:#fff;border:1px solid #e0e7ed;border-radius:9px}.metric{padding:17px 19px}.metric span{color:#718197;font-size:13px}.metric strong{display:block;margin-top:7px;color:#23364b;font-size:25px}.panel-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:20px;border-bottom:1px solid #edf1f5}.panel-header h2{font-size:16px;margin:0}.panel-header span{color:#7a8a9a;font-size:13px}.rows{display:grid}.item{padding:16px 20px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;border-bottom:1px solid #edf1f5}.item:last-child{border-bottom:0}.item strong{font-size:14px}.item p{margin:5px 0 0;color:#758396;font-size:13px}.tag{font-size:12px;padding:5px 9px;color:#1662aa;background:#e9f3ff;border-radius:20px}.empty{padding:46px 20px;text-align:center;color:#6d7f91;font-size:14px}.empty strong{display:block;margin-bottom:5px;color:#263b4d}.loading{padding:50px;color:#6e8294}dialog{border:1px solid #dce4ec;border-radius:10px;padding:0;width:min(500px,calc(100vw - 32px));box-shadow:0 14px 50px #1e3a5536}dialog::backdrop{background:#1c30485c}.dialog-content{padding:24px}.dialog-head{display:flex;justify-content:space-between;align-items:center}.dialog-head h2{margin:0;font-size:19px}.close{background:transparent;border:0;font-size:24px;color:#7b8998}form label,fieldset legend{display:block;color:#314356;font-size:13px;font-weight:600;margin-top:16px}input[type=text],input[type=date],select{width:100%;padding:10px 11px;margin-top:6px;background:#f9fbfc;border:1px solid #dbe3eb;border-radius:6px;color:#1d2938}fieldset{border:0;padding:0;margin:0}fieldset label{display:flex;gap:8px;align-items:center;font-weight:400;margin:10px 0}.actions{display:flex;justify-content:flex-end;gap:8px;margin-top:23px}.error{color:#b53636;font-size:13px;min-height:18px;margin:12px 0 0}#notice{position:fixed;bottom:18px;right:18px;background:#253d54;color:white;padding:11px 16px;border-radius:7px;display:none;font-size:13px}@media(max-width:700px){.shell{display:block}.sidebar{position:static;height:auto;padding:14px 16px;gap:14px;border-right:0;border-bottom:1px solid #e0e7ed}.sidebar nav{display:flex;overflow:auto}.sidebar-foot{display:none}.nav-button{white-space:nowrap}.topbar{height:54px;padding:0 18px}.content{padding:25px 16px}.heading{align-items:stretch;flex-direction:column}.heading .button{align-self:flex-start}.summary{gap:8px}.metric{padding:13px 10px}.metric span{font-size:11px}.metric strong{font-size:21px}}
.shell{display:block}.sidebar{position:static;height:auto;min-height:64px;flex-direction:row;align-items:center;padding:10px 36px;gap:24px;border-right:0;border-bottom:1px solid #e0e7ed}.sidebar nav{display:flex;margin-left:auto;gap:6px}.nav-button.active{background:#1672d2;color:white}.sidebar-foot{display:none}.topbar{height:48px;background:#f4f7fa;border-bottom:0}.content{padding-top:18px}.metric,.panel{box-shadow:0 1px 3px #1d29380c}@media(max-width:700px){.sidebar{padding:12px 16px;align-items:flex-start;flex-wrap:wrap}.sidebar nav{margin-left:0;flex-basis:100%}.topbar{padding:0 16px}.content{padding:18px 16px 50px}}
.auth-screen{min-height:100vh;display:grid;place-items:center;padding:20px}.auth-card{width:min(448px,100%);padding:24px;background:white;border:1px solid #dce4ec;border-radius:9px;box-shadow:0 2px 6px #1d29380b}.auth-card .brand{padding:0}.auth-card h1{font-size:19px;margin:25px 0 5px}.auth-hint{font-size:13px;color:#718197;margin:0}.auth-card input[type=email],.auth-card input[type=password]{width:100%;padding:10px 11px;margin-top:6px;background:#f9fbfc;border:1px solid #dbe3eb;border-radius:6px;color:#1d2938}.auth-card button[type=submit]{width:100%}
.top-actions{display:flex;align-items:center;gap:10px}.top-actions .button{padding:6px 10px;font-size:12px}
.dialog-content textarea{width:100%;min-height:80px;resize:vertical;margin-top:6px;padding:10px;border:1px solid #dbe3eb;border-radius:6px;font:inherit}.dialog-content [data-transition]{margin-top:14px}.timeline{border-top:1px solid #e8eef4;padding-top:15px;margin-top:20px;color:#6b7d90;font-size:12px}.timeline strong{color:#314356}.timeline p{margin:8px 0}
.editor-status{font-size:13px;color:#56708a}.editor-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:14px}.editor-pages,.editor-main{background:white;border:1px solid #e0e7ed;border-radius:9px;padding:12px}.editor-pages{max-height:72vh;overflow:auto}.editor-page{display:flex;align-items:center;gap:6px;border-radius:6px;padding:6px}.editor-page.current{background:#eaf4ff}.editor-page button{background:none;border:0;text-align:left;overflow-wrap:anywhere;color:#314356}.editor-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.editor-tools label{font-size:13px;display:flex;align-items:center;gap:6px}.editor-canvas-wrap{position:relative;width:fit-content;max-width:100%;margin:14px auto;background:#edf1f5;line-height:0}.editor-canvas{display:block;max-width:100%;max-height:65vh;width:auto;height:auto}.editor-overlay{position:absolute;inset:0;width:100%;height:100%;touch-action:none}.editor-create{display:flex;gap:8px;margin-top:12px}.editor-create input{margin:0}.editor-ready{margin-top:20px}@media(max-width:700px){.editor-layout{display:flex;flex-direction:column}.editor-pages{max-height:180px}.editor-tools .button{white-space:normal}.editor-create{flex-wrap:wrap}}
.editor-page button{display:flex;align-items:center;gap:8px;min-width:0}.editor-page img{width:52px;height:65px;object-fit:contain;background:#f1f5f9;border:1px solid #e0e7ed;flex-shrink:0}.editor-page span{font-size:12px}

.rotation-handle{position:absolute;z-index:3;top:8px;left:50%;transform:translateX(-50%);border:2px solid #1672d2;border-radius:50%;width:34px;height:34px;background:white;color:#1672d2;touch-action:none;cursor:grab;line-height:1;font-size:22px}.rotation-handle:active{cursor:grabbing}

/* Compact, guided page workflow */
.editor-page button[data-page]{flex:1;min-width:0}.editor-page button[data-page] span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.editor-page .page-order{flex:none}.editor-workflow{display:flex;gap:8px;flex-wrap:wrap;font-size:13px;color:#466078;margin-bottom:10px}.editor-tools{gap:6px}.editor-tools .button{font-size:13px;padding:8px 10px}.editor-tools select{max-width:210px}.editor-more{width:100%;font-size:13px;color:#386589}.editor-more summary{cursor:pointer;padding:6px 0}.editor-readiness{margin:10px 0;padding:8px 10px;border-radius:6px;background:#edf8f3;color:#245d49;font-size:13px}.editor-readiness.pending{background:#fff4dc;color:#754b00}.editor-tools .needs-apply{background:#fff1cd;border-color:#dba638;color:#714900}.editor-tools [data-erase][aria-pressed=true]{background:#e6f3ff;border-color:#2484d8}.editor-quality{font-size:13px;color:#8a5a00}.editor-quality:not(:empty){padding:8px;background:#fff7e4;border-radius:6px}@media(max-width:700px){.editor-workflow{display:block}.editor-tools select{max-width:160px}.editor-create input{min-width:0;width:100%}}

.upload-progress{padding:12px;margin:10px 0;border-radius:8px;background:#eef6ff;color:#23466a;overflow-wrap:anywhere}.upload-progress[hidden]{display:none}

.editor-file-group{border-bottom:1px solid #e5edf3;padding:4px 0 8px}.editor-file-head{display:flex;align-items:center;gap:4px;font-size:12px;color:#48647b}.editor-file-head span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.editor-file-head button{font-size:11px;white-space:nowrap;color:#176bb7}.editor-file-group .auth-hint{font-size:12px}.editor-save-progress{font-size:13px;color:#176bb7}.editor-layout{grid-template-columns:200px minmax(0,1fr)}.editor-pages,.editor-main{padding:8px}.editor-workflow{margin-bottom:5px}.editor-readiness{margin:6px 0;padding:5px 8px}.editor-canvas-wrap{margin:8px auto}.editor-canvas{max-height:72vh}.editor-create{margin-top:6px}.editor-page img{width:42px;height:54px}@media(max-width:700px){.editor-layout{display:flex}.editor-pages{max-height:145px}.editor-canvas{max-height:60vh}}

.editor-classification{display:flex;gap:8px;align-items:end;margin-top:6px}.editor-classification label{flex:1;min-width:0;font-size:12px}.editor-classification input,.editor-classification select{width:100%}@media(max-width:700px){.editor-classification{flex-wrap:wrap}.editor-classification label{min-width:150px}}

.project-picker{display:flex;align-items:center;gap:8px;min-width:0;font-size:13px;color:#59718a}.project-picker select{max-width:min(35vw,360px);min-width:130px;padding:8px;border:1px solid #d6e2ed;border-radius:8px;background:#fff;color:#1a3550}.upload-drop{padding:10px;margin:10px 0;border:1px dashed #a7c5dd;border-radius:8px;color:#59718a;text-align:center;font-size:13px}@media(max-width:700px){.project-picker span{display:none}.project-picker select{max-width:52vw;min-width:90px}.upload-drop{display:none}.heading .actions{flex-wrap:wrap}.heading .actions .button{flex:1;text-align:center}}

/* Keep user-supplied names and action groups inside the available width. */
.heading>div,.item>div,.editor-create>*{min-width:0}
.heading{flex-wrap:wrap}
.heading>div:first-child{flex:1 1 240px}
.heading .actions{flex-wrap:wrap;margin-top:0}
/* Ready-document actions must wrap as a group, not squeeze the title to zero. */
.editor-ready .item{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.editor-ready .item>div+div{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;align-items:center}
.editor-ready .item .button{white-space:normal;text-align:center;overflow-wrap:anywhere}
.dialog-content,.editor-status,.editor-save-progress,#basket-editor>.auth-hint{overflow-wrap:anywhere}
.dialog-head{gap:8px}
.dialog-head h2{min-width:0}
.dialog-head .close{flex:none}
.dialog-content .actions{flex-wrap:wrap}
.dialog-content .button{max-width:100%;white-space:normal}
.dialog-content input:not([type=checkbox]):not([type=radio]){max-width:100%}
#notice{max-width:calc(100vw - 36px);overflow-wrap:anywhere}
.heading h1,.heading p,.item strong,.item p,.editor-ready .item>span{overflow-wrap:anywhere}
.topbar,.project-picker,.top-actions{min-width:0}
.topbar{flex-wrap:wrap}
.project-picker{flex:1 1 180px}
.project-picker select{width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis}
.top-actions{flex-wrap:wrap;justify-content:flex-end}
.top-actions .avatar{flex:0 0 34px}
.feedback-global{position:fixed;right:18px;bottom:18px;z-index:20;border:1px solid #176fbd;border-radius:20px;background:#fff;color:#1765a6;padding:9px 13px;box-shadow:0 3px 12px #1d29382b;cursor:pointer;font-size:12px}
.feedback-global:hover{background:#eef6ff}
.dialog-content form{display:grid;gap:10px}
.dialog-content form label{display:flex;flex-direction:column;gap:5px;font-size:13px}
.dialog-content form input,.dialog-content form select,.dialog-content form textarea{width:100%;max-width:100%;padding:9px;border:1px solid #dbe3eb;border-radius:6px;background:#f9fbfc;color:#1d2938}
.dialog-content form textarea{min-height:72px}
.editor-main,.editor-pages,.editor-file-group,.editor-classification label{min-width:0}
.editor-tools>*{min-width:0;max-width:100%}
.editor-tools .button,.editor-create .button{white-space:normal;overflow-wrap:anywhere}
.editor-create{flex-wrap:wrap;align-items:center}
.editor-create label{min-width:0;max-width:100%}
.editor-create input[type=text]{flex:1 1 150px;width:auto}
.editor-create .button{flex:0 1 auto}
.editor-create label select{max-width:100%}
/* Document editor: persistent tools, visible page edges and eraser cursor. */
.editor-layout{grid-template-columns:200px minmax(0,1fr);align-items:start}
.editor-main{min-width:0}
.editor-stage{min-width:0;background:#e8edf2;border:1px solid #c9d4de;border-radius:8px;padding:12px}
.editor-canvas-wrap{background:#cfd8e1;border:10px solid #cfd8e1;box-shadow:0 0 0 1px #8293a3,0 5px 18px #1d29382b}
.editor-canvas{background:#fff;box-shadow:0 0 0 1px #8798a8}
.editor-tools-panel{position:sticky;top:12px;z-index:4;display:flex;flex-direction:column;gap:8px;background:#fff;border:1px solid #d5e0e8;border-radius:8px;padding:10px;margin-top:10px}
.editor-tools-panel>.editor-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.editor-tools-panel .editor-tools{display:flex;flex-wrap:wrap}
.editor-tools-panel .button,.editor-tools-panel label{min-width:0;white-space:normal;overflow-wrap:anywhere}
.editor-tools-panel label{font-size:13px;display:flex;align-items:center;gap:6px}
.editor-tools-panel select{min-width:0;max-width:100%}
.eraser-cursor{position:absolute;z-index:5;transform:translate(-50%,-50%);border:2px solid #d13b32;border-radius:50%;background:#d13b3224;pointer-events:none;box-shadow:0 0 0 1px #fff;display:block}
.eraser-cursor[hidden]{display:none}
.filename-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:8px;font-size:12px;color:#48647b}
.filename-options summary{grid-column:1/-1;cursor:pointer;font-size:13px}
.filename-options label{display:flex;flex-direction:column;align-items:stretch;gap:3px}
.filename-options input{width:100%;min-width:0}
.editor-classification{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:8px;align-items:end}
.editor-classification label{min-width:0}
@media(min-width:1000px){.editor-main{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:12px}.editor-main>.editor-workflow,.editor-main>.editor-stage{grid-column:1}.editor-main>.editor-tools-panel{grid-column:2;grid-row:1 / span 3;margin-top:0}.editor-main>.editor-readiness,.editor-main>.editor-quality,.editor-main>.editor-classification,.editor-main>.filename-options,.editor-main>.editor-create,.editor-main>.editor-save-progress,.editor-main>.error{grid-column:1}}
@media(max-width:999px){.editor-tools-panel{position:sticky;top:0}.editor-stage{order:0}.editor-tools-panel{order:1}}
@media(max-width:700px){.editor-tools-panel>.editor-tools{grid-template-columns:repeat(2,minmax(0,1fr))}.editor-classification,.filename-options{grid-template-columns:minmax(0,1fr)}.filename-options summary{grid-column:auto}.editor-canvas-wrap{border-width:7px}}
