*{box-sizing:border-box}body{margin:0;background:#f4f4f4;color:#303030;font-family:"Pretendard","Noto Sans KR",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:13px}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid #e0e0e0;border-radius:7px;background:#fff;color:#3e3e3e;padding:9px 13px;font-weight:600;transition:background .15s}button:hover{background:#f3f3f3}button:disabled{opacity:.4;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #4e4e4e;outline-offset:3px}.primary{background:#494949;border-color:#494949;color:#fff}.primary:hover{background:#3b3b3b}.topbar{height:76px;background:#fff;display:flex;align-items:center;gap:24px;padding:0 26px;border-bottom:1px solid #e6e6e6}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:inherit;min-width:232px}.brand strong{font-size:19px;letter-spacing:-.6px}.brand strong span{font-weight:500}.brand-mark{width:36px;height:36px;background:#2b2b2b;border-radius:10px;color:white;font-size:26px;font-weight:800;text-align:center;position:relative;line-height:36px}.brand-mark span{font-size:15px;color:#c3c3c3;position:absolute;top:-9px;right:2px}.document-title{font-weight:600;color:#616161;flex:1}.badge{font-size:10px;border:1px solid #e1e1e1;border-radius:4px;margin-left:9px;padding:3px 6px;color:#838383}.top-actions{display:flex;align-items:center;gap:9px}.member-name{margin-right:13px;color:#828282;font-size:12px}.toolbar{height:58px;background:#fff;border-bottom:1px solid #e2e2e2;display:flex;align-items:center;justify-content:space-between;padding:0 27px}.toolbar-group{display:flex;align-items:center;gap:15px}.toolbar-group button{padding:6px 10px}.toolbar-group>button:first-child,.toolbar-group>button:nth-child(2){font-size:19px;border-color:transparent}.divider{height:20px;width:1px;background:#e2e2e2;margin-right:6px}.muted,small{color:#8b8b8b;font-weight:400}.toolbar b{font-size:12px;font-weight:500}.toolbar select{border:1px solid #e0e0e0;border-radius:5px;padding:7px 12px;background:#fff}.workspace{height:calc(100vh - 134px);min-height:660px;display:grid;grid-template-columns:254px minmax(350px,1fr) 282px}.assets-panel,.properties-panel{min-height:0;background:#fff;padding:25px 22px;overflow:auto}.assets-panel{border-right:1px solid #e2e2e2;display:flex;flex-direction:column}.properties-panel{border-left:1px solid #e2e2e2}.panel-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}.panel-heading h2{font-size:14px;margin:0;letter-spacing:-.3px}.panel-heading>span:not(.status-dot){color:#909090;font-size:11px;background:#f2f2f2;padding:3px 7px;border-radius:5px}.assets-panel>.muted{font-size:11px;margin:0 0 22px}.upload-zone{position:relative;display:flex;align-items:center;flex-direction:column;text-align:center;gap:11px;border:1px dashed #b8b8b8;border-radius:10px;background:#f8f8f8;padding:24px 8px;cursor:pointer;flex-shrink:0}.upload-zone.dragging{background:#eaeaea}.upload-icon{color:#505050;font-size:25px;font-weight:300;line-height:22px}.upload-zone strong{font-size:13px;color:#444444}.upload-zone>span:not(.upload-icon){font-size:10px;color:#838383}.upload-zone small{font-size:10px}.upload-zone input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.asset-list{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.asset{padding:0;overflow:hidden;text-align:left;border-radius:7px}.asset img{width:100%;height:84px;object-fit:contain;padding:7px;background-color:#f8f8f8;background-image:linear-gradient(45deg,#ebebeb 25%,transparent 25%),linear-gradient(-45deg,#ebebeb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ebebeb 75%),linear-gradient(-45deg,transparent 75%,#ebebeb 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.asset span{display:block;padding:8px;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.asset-tip{margin-top:auto;padding-top:35px;font-size:11px;line-height:1.8;color:#929292}.asset-tip>span{color:#555555;font-weight:600}.asset-tip p{margin:9px 0}#upload-status{font-size:11px;line-height:1.6;color:#a04830;margin:8px 0 0}.stage-panel{min-height:0;display:flex;flex-direction:column;min-width:0;background:#efefef;background-image:radial-gradient(#d9d9d9 .7px,transparent .7px);background-size:12px 12px}.stage-caption{height:58px;display:flex;justify-content:space-between;align-items:center;padding:0 28px;font-size:11px;color:#858585;flex-shrink:0}.stage-caption b{font-size:10px;margin-left:6px;background:#e0e0e0;padding:3px 6px;border-radius:4px;color:#7a7a7a}.stage-caption>span:last-child{font-size:10px}#stage-scroll{overflow:auto;flex:1;min-height:0;display:flex;padding:8px 30px 35px}.paper-wrap{margin:auto;flex:none;position:relative}.paper-label{text-align:center;font-size:10px;color:#929292;padding-bottom:11px}.paper-bottom-label{text-align:center;font-size:10px;color:#929292;margin-top:14px}#paper{position:relative;background:#fff;box-shadow:0 5px 22px #3b3b3b17;overflow:hidden}.canvas-container{position:relative}#empty-state{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;pointer-events:none}#empty-state[hidden]{display:none}.empty-symbol{display:flex;width:65px;height:65px;border:1px solid #e2e2e2;border-radius:17px;background:#f7f7f7;align-items:center;justify-content:center;font-size:32px;color:#929292;margin-bottom:8px}#empty-state h1{font-size:20px;letter-spacing:-1px;font-weight:600;color:#666666;margin:15px 0 9px}#empty-state p{font-size:12px;line-height:1.9;color:#a2a2a2;margin:0}.empty-pill{font-size:10px;letter-spacing:.5px;color:#9a9a9a;background:#f4f4f4;border-radius:20px;margin-top:25px;padding:7px 13px}.stage-footer{height:38px;display:flex;justify-content:space-between;align-items:center;padding:0 23px;background:#f9f9f9c9;border-top:1px solid #e4e4e4;color:#939393;font-size:10px;flex-shrink:0}.stage-footer i{padding:0 6px}.status-dot{width:6px;height:6px;border-radius:50%;background:#909090}.selection-hint{font-size:11px;color:#909090;line-height:1.8;margin:15px 0 20px}fieldset{border:0;padding:0;margin:0;min-width:0}legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.section-title{display:flex;justify-content:space-between;font-size:11px;font-weight:600;margin:19px 0 10px}.section-title small{font-size:10px}.field-grid,.button-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.field-grid label{display:flex;align-items:center;border:1px solid #e2e2e2;border-radius:6px;color:#a0a0a0;font-size:11px;padding-left:11px;height:35px;background:#fcfcfc}input[type=number]{width:100%;min-width:0;padding:8px 4px 8px 8px;border:0;background:transparent;color:#505050;font-size:12px}.check-label{display:flex;align-items:center;gap:5px;font-size:10px;color:#888888;margin-top:11px}input[type=checkbox]{accent-color:#494949}.rotation-field{display:flex;align-items:center;border:1px solid #e2e2e2;border-radius:6px;padding-left:10px;color:#989898}.quality{background:#f2f2f2;border-radius:7px;padding:12px;margin-top:17px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;color:#5f5f5f;font-size:10px}.quality b{font-size:12px}.quality p{width:100%;font-size:10px;margin:7px 0 0;line-height:1.6;color:#888888}.quality.warning{background:#fff5e8;color:#ac6822}.quality.warning p{color:#a37c4e}.button-grid button,.align-grid button{font-size:10px;padding:8px 3px;font-weight:500}.align-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:9px}.fill-card{margin-top:24px;border-top:1px solid #e8e8e8;padding-top:5px}.fill-card p{font-size:10px;line-height:1.7;color:#939393}.fill-card label{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#7c7c7c;margin:16px 0}.fill-card select{padding:6px 20px 6px 10px;border:1px solid #e0e0e0;border-radius:5px;background:#fff;font-size:11px}.fill-card .primary{width:100%;font-size:12px;padding:12px}.prototype-note{font-size:10px;color:#a0a0a0;line-height:1.8;border-top:1px solid #eeeeee;padding-top:15px;margin-top:20px}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#333333;color:white;padding:12px 22px;border-radius:9px;box-shadow:0 5px 20px #0002;z-index:20;max-width:80%;pointer-events:none;opacity:0;transition:opacity .15s}#toast.visible{opacity:1}dialog{border:0;border-radius:14px;width:560px;max-width:90vw;max-height:90vh;box-shadow:0 20px 80px #0003;padding:24px}dialog::backdrop{background:#1e1e1e88}.preview-heading{display:flex;align-items:center;justify-content:space-between}.preview-heading h2{font-size:17px}.preview-heading button{border:0}dialog p{font-size:11px;color:#8c8c8c}#preview-image{display:block;max-width:100%;max-height:65vh;margin:20px auto;background:repeating-conic-gradient(#eeeeee 0% 25%,white 0% 50%) 50%/16px 16px;border:1px solid #e8e8e8}#dtf-app.is-busy .workspace{pointer-events:none;opacity:.75}@media(max-width:1100px){.workspace{grid-template-columns:218px minmax(300px,1fr) 244px}.assets-panel,.properties-panel{padding:20px 16px}.brand{min-width:192px}.member-name{display:none}.stage-footer>span:last-child{display:none}.document-title{font-size:11px}.topbar{padding:0 20px}}@media(max-width:800px){body{min-width:760px}.workspace{grid-template-columns:190px minmax(320px,1fr) 240px}.document-title{display:none}.topbar{justify-content:space-between}.toolbar{padding:0 15px}.toolbar-group{gap:8px}}
.properties-panel{display:flex;flex-direction:column;overflow:hidden}
.sidebar-tabs{display:flex;gap:6px;flex-shrink:0;border-bottom:1px solid #e4e4e4;margin:-5px 0 18px;padding-bottom:10px}
.sidebar-tabs button{flex:1;padding:9px 5px;border:0;font-size:11px;white-space:nowrap;background:#f6f6f6;color:#848484}
.sidebar-tabs button[aria-selected=true]{background:#eaeaea;color:#434343}
#history-count{display:inline-block;margin-left:3px;min-width:17px;font-size:10px}
#properties-content{overflow:auto;min-height:0;padding-right:3px}
#properties-content[hidden],.history-panel[hidden]{display:none}
.history-panel{display:flex;flex-direction:column;min-height:0;flex:1}
.history-heading{display:flex;align-items:center;justify-content:space-between;gap:5px}
.history-heading h2{font-size:13px;margin:0}
.history-heading>span{color:#919191;font-size:9px}
.history-help,.history-note{font-size:10px;line-height:1.8;color:#8a8a8a}
.history-list{list-style:none;margin:8px 0;padding:0;overflow:auto;min-height:70px;flex:1;position:relative;border:1px solid #e5e5e5;border-radius:8px;background:#fbfbfb}
.history-row{display:flex;align-items:stretch;border-bottom:1px solid #ededed}
.history-row:last-child{border-bottom:0}
.history-jump{display:flex;align-items:center;gap:7px;min-width:0;flex:1;text-align:left;border:0;border-radius:0;background:transparent;padding:12px 8px;font-size:11px;font-weight:500}
.history-number{font-size:9px;color:#a3a3a3;font-variant-numeric:tabular-nums}
.history-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.history-state{font-size:9px;color:#8c8c8c;flex-shrink:0}
.history-remove{border:0;border-radius:0;background:transparent;padding:0 9px;font-size:19px;color:#9a9a9a}
.history-remove:hover{background:#fcece7;color:#b65b46}
.history-row.current{background:#ebebeb;box-shadow:inset 3px 0 #505050}
.history-row.current .history-jump,.history-row.current .history-state{color:#424242;font-weight:600}
.history-row.future{opacity:.5}
#history-delete{flex-shrink:0;margin-top:5px;font-size:10px;color:#a35342;border-color:#edd9d2;background:#fffaf8;padding:11px 6px}
.history-note{font-size:9px;margin-bottom:0}
#safe-guide{position:absolute;pointer-events:none;border:1.5px dashed #d5a300;box-shadow:0 0 0 10000px #ffd44718;z-index:4}
#safe-margin-note{color:#94730a}
.asset-card{position:relative;min-width:0}
.asset-card .asset{width:100%;height:100%}
.asset-card .asset[draggable=true]{cursor:grab}
.asset-delete{position:absolute;top:4px;right:4px;width:24px;height:24px;padding:0;border:1px solid #dedede;border-radius:50%;background:#fffffff2;color:#8a665b;line-height:20px;font-size:18px;box-shadow:0 1px 4px #0001}
.asset-delete:hover{background:#ffebe4;color:#a33e24}
#stage-scroll.drop-ready{outline:3px dashed #4e4e4e;outline-offset:-6px;background-color:#e9e9e9}
.document-title{min-width:0}
#design-title{display:inline-block;max-width:220px;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#save-state{display:block;margin-top:5px;font-size:10px;color:#838383}
#save-state.unsaved{color:#ae7b26}
.top-actions{flex-shrink:0}
.top-actions button{white-space:nowrap}
.design-name-label{display:block;margin:25px 0 8px;color:#585858;font-size:12px}
#design-name{width:100%;padding:12px;border:1px solid #d2d2d2;border-radius:7px;font:inherit;color:#373737}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}
.dialog-error{color:#a3442c!important;min-height:18px}
.saved-design{display:flex;align-items:center;gap:8px;padding:15px 0;border-bottom:1px solid #e9e9e9}
.saved-design>div{flex:1;min-width:0}
.saved-design strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.saved-design small{display:block;margin-top:7px;font-size:10px}
.saved-design button{font-size:11px;padding:8px 11px}
.saved-design .delete-design{color:#a96755;border-color:#eedfd6}
#design-list{max-height:55vh;overflow:auto}
.toolbar-group #export-json{font-size:11px;padding:7px 10px;border-color:#e0e0e0}
@media(max-width:1100px){.topbar{gap:10px}.brand{min-width:170px}.top-actions{gap:5px}.top-actions button{font-size:11px;padding:9px}.document-title #design-title{max-width:125px}}

.creation-tools{padding:16px 0;border-bottom:1px solid #e4e4e4;margin-bottom:16px}.creation-tools h2{font-size:13px;margin:0 0 10px}.tool-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.tool-grid button{display:flex;flex-direction:column;align-items:center;gap:5px;padding:9px 2px;font-size:11px}.tool-grid b{font-size:22px;font-weight:500;line-height:24px}.creation-tools small,.extra-properties small{display:block;color:#7d7d7d;font-size:11px;line-height:1.5;margin-top:8px}.extra-properties{border-bottom:1px solid #e4e4e4;padding-bottom:12px;margin-bottom:14px}.extra-properties>label{display:block;margin-bottom:9px;font-size:12px}.extra-properties textarea,.extra-properties select{display:block;width:100%;margin-top:5px;border:1px solid #e0e0e0;border-radius:6px;padding:7px;font:inherit;box-sizing:border-box}.extra-properties textarea{resize:vertical}.extra-properties input[type=color]{display:block;width:100%;height:32px;padding:2px;border:1px solid #e0e0e0;border-radius:6px}.extra-properties[hidden]{display:none}
.extra-properties .field-grid label{display:block;padding:0;border:0;background:none;line-height:1.6}.extra-properties .field-grid input{display:block;box-sizing:border-box;width:100%;min-width:0;border:1px solid #e0e0e0;border-radius:6px;padding:7px;margin-top:5px}.extra-properties .field-grid select{min-width:0}

/* Quiet, rounded scrollbars across the editor and its dialogs. */
#dtf-app *{scrollbar-width:thin;scrollbar-color:#bcbcbc transparent}
@supports selector(::-webkit-scrollbar){
 #dtf-app *{scrollbar-width:auto;scrollbar-color:auto}
 #dtf-app *::-webkit-scrollbar{width:10px;height:10px}
 #dtf-app *::-webkit-scrollbar-track{background:transparent}
 #dtf-app *::-webkit-scrollbar-thumb{background:#c2c2c2;border:3px solid transparent;background-clip:padding-box;border-radius:20px;min-height:36px}
 #dtf-app *::-webkit-scrollbar-thumb:hover{background-color:#9c9c9c;border-width:2px}
 #dtf-app *::-webkit-scrollbar-thumb:active{background-color:#7c7c7c}
 #dtf-app *::-webkit-scrollbar-button{display:none;width:0;height:0}
 #dtf-app *::-webkit-scrollbar-corner{background:transparent}
}
@media(forced-colors:active){#dtf-app *{scrollbar-color:auto;scrollbar-width:auto}}

#studio-confirm{width:400px;padding:28px;border:1px solid #e8e8e8;border-radius:16px;box-shadow:0 24px 80px #1e1e1e30}#studio-confirm::backdrop{background:#23232359;backdrop-filter:blur(3px)}.confirm-symbol{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#eeeeee;color:#4a4a4a;font-size:21px;font-weight:700}#confirm-title{font-size:17px;margin:18px 0 10px}#confirm-message{white-space:pre-line;font-size:12px;line-height:1.9;color:#787878;margin:0}#studio-confirm .dialog-actions{margin-top:26px}#studio-confirm button{min-width:90px;padding:10px 16px}
#studio-context{position:fixed;z-index:40;width:230px;max-height:calc(100vh - 16px);overflow:auto;padding:7px;border:1px solid #e4e4e4;border-radius:12px;background:#fffffff5;backdrop-filter:blur(16px);box-shadow:0 10px 40px #2727272e,0 2px 8px #27272710}#studio-context[hidden]{display:none}#context-title{padding:8px 9px;font-size:10px;font-weight:600;color:#989898}#studio-context button{display:flex;width:100%;justify-content:space-between;align-items:center;padding:9px 10px;border:0;background:transparent;font-size:12px;font-weight:500;border-radius:6px;text-align:left}#studio-context button[hidden]{display:none}#studio-context button:hover,#studio-context button:focus-visible{background:#ededed;color:#404040;outline:0}#studio-context button small{font-size:10px;color:#a0a0a0}.context-separator{height:1px;background:#ececec;margin:5px 3px}#studio-context .context-danger{color:#b45649}#studio-context .context-danger:hover{background:#fcf0ec;color:#a74030}#context-opacity{padding:10px;border-top:1px solid #efefef;border-bottom:1px solid #efefef;margin:4px 0}#context-opacity label{display:flex;justify-content:space-between;font-size:11px}#context-opacity output{font-variant-numeric:tabular-nums;color:#646464}#context-opacity input{width:100%;accent-color:#525252;margin:12px 0 4px}#context-opacity small{font-size:9px;color:#9e9e9e}

#designs-dialog{width:650px}.saved-design{gap:14px;padding:14px 0}.saved-design .design-thumbnail{display:flex;align-items:center;justify-content:center;flex:0 0 76px;width:76px;height:102px;padding:7px;border:1px solid #e5e5e5;border-radius:9px;background:#f3f3f3;color:#959595;font-size:9px;line-height:1.6;overflow:hidden}.saved-design .design-thumbnail:hover{border-color:#919191;background:#ededed}.design-thumbnail img{display:block;max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 1px 5px #28282817;background:#fff}.saved-design strong{line-height:1.5}.saved-design small{line-height:1.6}@media(max-width:600px){.saved-design{gap:8px}.saved-design .design-thumbnail{flex-basis:58px;width:58px;height:80px}.saved-design button{padding:7px}}

/* Photoshop-style rail and adjacent tool settings. History stays on the right. */
.workspace{grid-template-columns:52px 254px minmax(300px,1fr) 248px}
.tool-rail{display:flex;flex-direction:column;align-items:center;gap:7px;padding:16px 6px;background:#f8f8f8;border-right:1px solid #e2e2e2;min-height:0}.tool-rail button{display:grid;place-items:center;width:38px;height:38px;padding:9px;border:1px solid transparent;background:transparent;border-radius:8px;color:#767676}.tool-rail svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.tool-rail button:hover{background:#eeeeee;color:#484848}.tool-rail button[aria-pressed=true]{background:#e5e5e5;border-color:#d2d2d2;color:#3e3e3e}.tool-rail button:nth-child(2){margin-bottom:12px}
.left-editor-panel{display:flex;flex-direction:column;background:#fff;min-height:0;min-width:0;border-right:1px solid #e2e2e2;padding:22px 17px 0}.left-editor-panel>.sidebar-tabs{margin:0 0 18px}.left-editor-panel>.assets-panel{border:0;padding:0 2px 22px;flex:1;min-height:0}.left-editor-panel>#properties-content{flex:1;padding:0 2px 22px}.left-editor-panel>[hidden]{display:none!important}.history-sidebar{padding:22px 16px;display:flex;flex-direction:column}.history-sidebar #tab-history{border:0;background:#f4f4f4;color:#565656;font-size:12px;padding:10px;margin:0 0 16px;text-align:left}.history-sidebar .history-heading{display:none}.history-sidebar .history-help{margin-top:0}.extra-properties .field-grid label{height:auto}
@media(max-width:1100px){.workspace{grid-template-columns:48px 224px minmax(290px,1fr) 218px}.tool-rail{padding-left:4px;padding-right:4px}.left-editor-panel{padding:20px 13px 0}.history-sidebar{padding:20px 12px}}
@media(max-width:800px){.workspace{grid-template-columns:44px 206px minmax(280px,1fr) 210px}.tool-rail button{width:34px;height:36px}body{min-width:760px}}

#draft-state{display:block;margin-top:3px;font-size:9px;color:#929292}

/* Contextual panels open beside the clicked rail icon, without permanent tabs. */
.workspace{position:relative;grid-template-columns:52px minmax(300px,1fr) 248px}
.left-editor-panel{position:absolute;z-index:8;left:60px;top:10px;bottom:12px;display:flex;flex-direction:row;align-items:stretch;gap:0;padding:0;border:1px solid #e3e3e3;border-radius:12px;background:#fff;box-shadow:0 12px 38px #2b2b2b26;overflow:hidden;max-width:calc(100% - 76px)}
.left-editor-panel[hidden]{display:none}.left-editor-panel>.assets-panel{width:232px;flex:0 0 232px;padding:19px 16px;overflow:auto}.left-editor-panel>#properties-content{width:252px;flex:0 0 252px;padding:19px 16px;overflow:auto}.left-editor-panel>.assets-panel:not([hidden])+#properties-content:not([hidden]){border-left:1px solid #e5e5e5}.left-editor-panel .panel-heading{position:sticky;top:-19px;background:#fff;z-index:2;padding:10px 0;margin-top:-10px}.left-editor-panel .panel-heading h2{display:flex;align-items:center;gap:8px}.left-editor-panel #asset-count{font-size:10px;font-weight:400;color:#939393}.flyout-close{border:0;background:transparent;font-size:21px;font-weight:400;color:#919191;padding:0 4px;line-height:25px}.flyout-close:hover{background:#f0f0f0;color:#464646}
@media(max-width:1100px){.workspace{grid-template-columns:48px minmax(290px,1fr) 218px}.left-editor-panel{left:56px}}
@media(max-width:800px){.workspace{grid-template-columns:44px minmax(280px,1fr) 210px}.left-editor-panel{left:50px;max-width:calc(100% - 60px)}.left-editor-panel>.assets-panel{width:212px;flex-basis:212px}.left-editor-panel>#properties-content{width:236px;flex-basis:236px}}

.context-style-field{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border-top:1px solid #efefef}.context-style-field[hidden]{display:none}.context-style-field label{font-size:11px;white-space:nowrap}.context-style-field input[type=color]{width:68px;height:28px;border:1px solid #e0e0e0;border-radius:5px;padding:2px;background:#fff;cursor:pointer}.context-style-field input[type=number]{width:76px;border:1px solid #e0e0e0;border-radius:5px;padding:6px;background:#fff}

.studio-color-picker{position:fixed;z-index:60;width:252px;padding:15px;border:1px solid #e0e0e0;border-radius:12px;background:#fff;box-shadow:0 12px 40px #28282833}.studio-color-picker[hidden]{display:none}.color-picker-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;font-size:12px}.color-picker-heading button{border:0;padding:0 5px;font-size:20px;color:#929292}.color-presets{display:grid;grid-template-columns:repeat(6,1fr);gap:7px}.color-presets button{height:25px;padding:0;border:1px solid #0002;border-radius:5px}.color-preview{height:28px;border:1px solid #0001;border-radius:5px;margin:12px 0}.studio-color-picker>label{display:flex;align-items:center;gap:12px;font-size:11px}.color-hex{width:100%;padding:7px;border:1px solid #e0e0e0;border-radius:5px;font:inherit}.color-sliders{margin-top:12px}.color-sliders label{display:flex;align-items:center;gap:9px;font-size:10px;margin:7px 0}.color-sliders input{flex:1;min-width:0;accent-color:#525252}.color-sliders output{width:24px;text-align:right;font-variant-numeric:tabular-nums}.color-error{font-size:10px;color:#b24f3d;margin:6px 0}.color-picker-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:12px}.color-picker-actions button{font-size:11px;padding:7px 13px}

#draw-settings p{font-size:10px;line-height:1.8;color:#8c8c8c}#draw-thickness{display:block;border:1px solid #e0e0e0;border-radius:6px;margin-top:7px}#draw-settings label[hidden]{display:none}

.measurement-unit{display:flex;align-items:center;justify-content:space-between;margin-top:16px;font-size:11px}.measurement-unit select{border:1px solid #e0e0e0;border-radius:6px;background:#fff;padding:6px 12px}.measurement-note{font-size:9px;color:#8e8e8e;line-height:1.6;margin:7px 0}

#image-properties-dialog{width:520px}.image-info-heading{display:flex;align-items:center;gap:16px;margin:14px 0 22px}.image-info-heading img{width:78px;height:78px;object-fit:contain;border:1px solid #e4e4e4;border-radius:8px;background:repeating-conic-gradient(#eeeeee 0% 25%,white 0% 50%) 50%/12px 12px}.image-info-heading strong{min-width:0;overflow-wrap:anywhere;font-size:13px;line-height:1.6}#image-info-values{margin:0}#image-info-values>div{padding:12px 0;border-top:1px solid #eaeaea;display:flex;align-items:baseline;justify-content:space-between;gap:15px}#image-info-values dt{font-size:11px;color:#858585}#image-info-values dd{margin:0;font-size:12px;text-align:right;color:#464646;font-variant-numeric:tabular-nums}#image-properties-dialog>p{line-height:1.8;margin-top:20px}

#stage-scroll.is-panning,#stage-scroll.is-panning *{cursor:grabbing!important;user-select:none}

#font-search{width:100%;box-sizing:border-box}#font-results,#font-info{display:block;margin:6px 0;font-size:10px;line-height:1.5;color:#7a7a7a}#font-info a{color:#585858}#add-font{width:100%;margin:8px 0;padding:9px;border:1px solid #dfdfdf;border-radius:7px;background:#f6f6f6;color:#464646;cursor:pointer}#add-font:disabled{opacity:.5;cursor:wait}
.font-picker-field>label{display:block;margin-bottom:7px;font-size:11px;color:#7a7a7a}#font-trigger{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:10px 12px;text-align:left;font-size:12px;font-weight:500;background:#fff;border:1px solid #e0e0e0;border-radius:8px}#font-trigger[aria-expanded=true]{border-color:#555555;box-shadow:0 0 0 3px #55555512}#font-current{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#font-trigger svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;flex-shrink:0}.font-popup{position:fixed;z-index:45;display:flex;flex-direction:column;padding:8px;background:#fff;border:1px solid #e3e3e3;border-radius:12px;box-shadow:0 12px 36px #2f2f2f2b;overflow:hidden}.font-popup[hidden]{display:none}.font-search-wrap{display:flex;align-items:center;gap:8px;flex-shrink:0;padding:0 9px;background:#f4f4f4;border:1px solid #e8e8e8;border-radius:7px}.font-search-wrap svg{width:16px;height:16px;fill:none;stroke:#8a8a8a;stroke-width:1.6;flex-shrink:0}.font-search-wrap #font-search{min-width:0;height:36px;padding:0;border:0;background:transparent;font-size:12px;color:#383838;outline:none}.font-search-wrap:focus-within{border-color:#a3a3a3}#font-options{overflow:auto;min-height:0;flex:1;padding-top:5px;scrollbar-width:thin;scrollbar-color:#d2d2d2 transparent}.font-group-label{padding:11px 9px 6px;color:#929292;font-size:10px;font-weight:600}.font-option{display:flex;align-items:center;justify-content:space-between;width:100%;gap:10px;border:0;border-radius:6px;padding:9px 10px;text-align:left;background:transparent;font-size:12px;font-weight:400}.font-option span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.font-option.is-active,.font-option:hover{background:#f3f3f3}.font-option[aria-selected=true]{color:#484848;font-weight:600}.font-popup #font-results{flex-shrink:0;padding:9px 8px 2px;margin:5px 0 0;border-top:1px solid #efefef;font-size:10px;color:#939393}

/* Keep editor chrome non-selectable while preserving editable text fields. */
body{-webkit-user-select:none;user-select:none}
input,textarea,[contenteditable=true],[contenteditable=true] *{-webkit-user-select:text;user-select:text}
a,img{-webkit-user-drag:none}

.group-status{display:flex;align-items:center;gap:10px;padding:12px;margin:14px 0 18px;background:#f2f2f2;border:1px solid #dbdbdb;border-radius:9px;color:#4c4c4c}.group-status[hidden]{display:none}.group-status>svg{width:25px;height:25px;flex-shrink:0;fill:#f2f2f2;stroke:currentColor;stroke-width:1.6}.group-status strong{display:block;font-size:12px;font-weight:600}.group-status small{display:block;margin-top:5px;font-size:9px;line-height:1.6;color:#808080}

/* Native font controls only store values; the searchable picker is the visible UI. */
#font-family[hidden],#font-upload[hidden]{display:none!important}
#local-font-dialog{width:490px}#local-font-dialog p{line-height:1.8}.local-font-system-label{display:flex;align-items:center;justify-content:space-between;margin:18px 0;font-size:12px}.local-font-system-label select{padding:8px 12px;border:1px solid #dedede;border-radius:7px;background:#fff}#local-font-paths{display:grid;gap:8px}#local-font-paths input{width:100%;padding:11px;border:1px solid #e2e2e2;border-radius:7px;background:#f6f6f6;color:#4a4a4a;font:12px Consolas,monospace;cursor:text}
.studio-color-picker{width:282px;max-height:calc(100vh - 16px);overflow:auto}.color-mode{margin-left:7px;padding:3px 6px;border-radius:4px;background:#f1f1f1;color:#565656;font-size:10px;font-weight:500}.color-palette{position:relative;height:148px;border-radius:7px;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,transparent);cursor:crosshair;touch-action:none;overflow:hidden}.color-palette-point{position:absolute;width:12px;height:12px;transform:translate(-50%,-50%);border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #0008;pointer-events:none}.studio-color-picker .color-hue{display:block;width:100%;height:12px;margin:12px 0 0;padding:0;border:0;border-radius:8px;appearance:none;background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red);cursor:pointer}.color-hue::-webkit-slider-thumb{appearance:none;width:15px;height:17px;background:#fff;border:1px solid #0003;border-radius:4px;box-shadow:0 1px 3px #0003}.color-hue::-moz-range-thumb{width:12px;height:16px;background:#fff;border:1px solid #0003;border-radius:4px}.color-sliders label{font-size:12px;font-weight:600}.color-sliders input[type=range]{flex:1}.color-sliders input.color-rgb-value{flex:0 0 54px;width:54px;padding:5px 3px;border:1px solid #e0e0e0;border-radius:5px;background:#fff;color:#444444;font-size:12px;text-align:center}.studio-color-picker .color-hex-label{margin-top:12px;font-size:10px;color:#939393}.color-presets{margin-top:12px}.color-presets button{height:20px}.color-preview{height:23px;margin-bottom:4px}

/* Keep the current frame visible while history assets are prepared. */
#dtf-app.is-busy.is-restoring .workspace{opacity:1}
.right-sidebar-tabs{display:flex;gap:5px;margin-bottom:14px;flex-shrink:0}
.history-sidebar .right-sidebar-tabs :is(#tab-history,#tab-layers){flex:1;margin:0;padding:10px 4px;border:0;background:#f4f4f4;color:#727272;font-size:11px;text-align:center}
.history-sidebar .right-sidebar-tabs :is(#tab-history,#tab-layers)[aria-selected=true]{background:#e5e5e5;color:#414141;box-shadow:inset 0 -2px #525252}
#layers-panel{display:flex;flex-direction:column;flex:1;min-height:0}#layers-panel[hidden]{display:none}
#layer-list{flex:1;overflow:auto;min-height:80px;border:1px solid #e3e3e3;border-radius:8px;padding:3px}
.layer-row{display:flex;align-items:center;gap:8px;width:100%;border:1px solid transparent;border-radius:5px;padding:9px 6px;margin:2px 0;text-align:left;font-weight:400;background:transparent;cursor:grab}
.layer-row[aria-pressed=true]{background:#ebebeb;border-color:#b8b8b8}.layer-row.is-clipped{padding-left:18px}
.layer-thumbnail{display:grid;place-items:center;flex:0 0 30px;width:30px;height:34px;border:1px solid #e1e1e1;border-radius:4px;background:#f6f6f6;color:#5d5d5d;font-size:20px}
.layer-thumbnail img{width:100%;height:100%;object-fit:contain}
.layer-caption{min-width:0;flex:1}.layer-caption strong,.layer-caption small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layer-caption strong{font-size:11px;font-weight:500}.layer-caption small{font-size:9px;margin-top:5px}
.layer-row.drop-before{border-top:3px solid #525252}.layer-row.drop-after{border-bottom:3px solid #525252}
.layer-order-actions{display:flex;gap:5px;margin-top:10px}.layer-order-actions button{flex:1;padding:6px;font-size:16px}.layer-actions{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.layer-actions button{flex:1;padding:8px 4px;font-size:10px;white-space:nowrap}
:root[data-theme=dark] .history-sidebar .right-sidebar-tabs :is(#tab-history,#tab-layers){background:var(--raised);color:var(--muted)}
:root[data-theme=dark] .history-sidebar .right-sidebar-tabs :is(#tab-history,#tab-layers)[aria-selected=true]{background:#323232;color:var(--accent)}
:root[data-theme=dark] #layer-list{border-color:var(--border)}
:root[data-theme=dark] .layer-row{background:transparent;border-color:transparent}
:root[data-theme=dark] .layer-row[aria-pressed=true]{background:#323232;border-color:#636363}
:root[data-theme=dark] .layer-thumbnail{background:var(--raised);border-color:var(--border);color:var(--accent)}
:root[data-theme=dark] .layer-row.drop-before{border-top-color:var(--accent)}
:root[data-theme=dark] .layer-row.drop-after{border-bottom-color:var(--accent)}
/* Separate property sections while keeping related controls together. */
#text-tools{padding-bottom:0}
.text-settings-section{padding:18px 0;border-top:1px solid #e3e3e3}
.text-settings-section:first-child{padding-top:2px;border-top:0}
.text-settings-section>label{display:block;font-size:11px;font-weight:500}
.text-settings-section h3{margin:0 0 13px;font-size:12px;font-weight:600;color:#484848}
#text-tools .field-grid{gap:12px}
#text-tools .field-grid label{font-size:11px;line-height:1.7}
#text-tools .field-grid :is(input,select){height:36px;margin-top:7px;padding:8px;font-size:12px}
#text-tools small{font-size:10px;line-height:1.7;margin-top:10px}
#text-content{min-height:76px;line-height:1.6;padding:10px}
#properties-content .extra-properties{margin-bottom:20px;padding-bottom:18px}
#properties-content #text-tools{padding-bottom:0}
#properties-content .section-title{margin-top:24px;margin-bottom:12px}
#properties-content .measurement-unit{padding-top:4px}
#properties-content .rotation-field{margin-bottom:20px}
#studio-context .context-style-field{padding:12px 10px;gap:14px}
#studio-context .context-style-field input[type=number]{height:34px;width:82px;padding:7px 9px;font-weight:500}
/* Position and size fields act as one rounded control, including their label. */
#properties>.field-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
#properties>.field-grid>label{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:center;min-width:0;height:36px;padding:0 8px;border-radius:7px;overflow:hidden;background:#f9f9f9;color:#7c7c7c}
#properties>.field-grid>label>input{width:100%;min-width:0;height:34px;padding:0 3px;border:0;border-radius:0;background:transparent;color:#393939;font-size:12px;font-variant-numeric:tabular-nums}
#properties>.rotation-field{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:center;min-width:0;height:36px;padding:0 8px;border-radius:7px;overflow:hidden;background:#f9f9f9}
#properties>.rotation-field>input{height:34px;min-width:0;padding:0 3px;border:0;border-radius:0;background:transparent;font-variant-numeric:tabular-nums}
#properties>.field-grid>label:focus-within,#properties>.rotation-field:focus-within{border-color:#525252;box-shadow:0 0 0 2px #52525226}
#properties>:is(.field-grid,.rotation-field) input:focus-visible{outline:none;box-shadow:none}
/* Numeric spinners steal space and shift short fields when hovered or focused. */
#properties input[type=number],#studio-context input[type=number]{appearance:textfield;-moz-appearance:textfield}
#properties input[type=number]::-webkit-inner-spin-button,#properties input[type=number]::-webkit-outer-spin-button,
#studio-context input[type=number]::-webkit-inner-spin-button,#studio-context input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
#properties-content :is(input,textarea,select,button):focus-visible,#studio-context :is(input,button):focus-visible{outline:none;border-color:#525252;box-shadow:0 0 0 2px #52525240}
#properties-content #properties>:is(.field-grid,.rotation-field) input:focus-visible{outline:none;box-shadow:none}
.layer-entry{display:flex;align-items:center;gap:3px;min-width:0}
.layer-entry>.layer-row{flex:1;min-width:0;width:auto}
.layer-entry>.layer-eye{flex:0 0 24px;width:24px;height:30px;padding:3px;border:0;background:transparent;color:#787878;border-radius:5px}
.layer-eye svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.layer-entry.is-hidden .layer-thumbnail,.layer-entry.is-hidden .layer-caption{opacity:.5}
.layer-entry>.layer-eye:hover{background:#ebebeb;color:#414141}
:root[data-theme=dark] .layer-entry>.layer-eye{background:transparent;color:#b9b9b9}
:root[data-theme=dark] .layer-entry>.layer-eye:hover{background:#323232;color:#acacac}
#context-line-style-input{min-width:0;width:112px;padding:8px;border:1px solid #e0e0e0;border-radius:7px;background:#fff;color:#3e3e3e;font:inherit;font-size:12px}
#line-tools select,#draw-line-style{margin-top:8px;height:36px}
.layer-entry{position:relative}
.layer-entry>.layer-expand{flex:0 0 16px;width:16px;height:28px;border:0;padding:0;background:transparent;color:#787878;font-size:17px}
.layer-entry>.layer-expand:disabled{opacity:0;pointer-events:none}
.layer-entry.layer-child{margin-left:13px;border-left:1px solid #dedede;padding-left:3px}
.layer-child .layer-thumbnail{flex-basis:24px;width:24px;height:28px;font-size:16px}
.layer-child .layer-row{padding:6px 3px;gap:5px}
.layer-rename{position:absolute;left:45px;right:3px;top:7px;width:calc(100% - 48px);height:36px;padding:8px;border:1px solid #525252;border-radius:6px;background:#fff;color:#303030;font:inherit;font-size:12px;z-index:2}
:root[data-theme=dark] .layer-entry>.layer-expand{background:transparent;color:#c8c8c8}
:root[data-theme=dark] .layer-entry.layer-child{border-left-color:#505050}
:root[data-theme=dark] .layer-rename{background:#383838;color:#f5f5f5;border-color:#acacac}
/* Startup overlay stays in place until the saved canvas has finished restoring. */
.studio-loading{position:fixed;inset:0;z-index:100000;display:grid;place-items:center;background:#f0f0f0;color:var(--text,#303030);opacity:1;transition:opacity .22s ease;cursor:progress}
.studio-loading-card{display:flex;flex-direction:column;align-items:center;text-align:center;padding:40px 32px;max-width:calc(100vw - 32px)}
.studio-loading-mark{display:grid;place-items:center;position:relative;width:64px;height:64px;border-radius:20px;background:#545454;color:white;font-size:38px;font-weight:750;box-shadow:0 12px 32px #54545424;margin-bottom:18px}
.studio-loading-mark>span{position:absolute;right:9px;top:6px;font-size:23px}
.studio-loading-card>strong{font-size:18px;letter-spacing:-.5px}
.studio-loading-spinner{width:26px;height:26px;border:3px solid #54545425;border-top-color:#545454;border-radius:50%;margin-top:30px;animation:studio-loading-spin .85s linear infinite}
.studio-loading-card p{margin:16px 0 8px;font-size:14px;font-weight:600}
.studio-loading-card small{color:var(--muted,#707070);font-size:12px;line-height:1.6}
#studio-loading-retry{margin-top:20px;padding:9px 18px;border:1px solid var(--border,#d2d2d2);border-radius:10px;background:var(--surface,#fff);color:inherit;cursor:pointer}
.studio-loading.is-complete{opacity:0;pointer-events:none}
.studio-loading.has-error .studio-loading-spinner{animation:none;border-color:#c88d52}
:root[data-theme=dark] .studio-loading{background:#202020}
:root[data-theme=dark] .studio-loading-spinner{border-color:#acacac25;border-top-color:#acacac}
@keyframes studio-loading-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.studio-loading{transition:none}.studio-loading-spinner{animation:none}}

/* Shared, persistent width for the layer/history sidebar. */
.workspace{grid-template-columns:52px minmax(300px,1fr) var(--right-panel-width,248px)}
.history-sidebar{min-width:0}
#right-panel-resize{position:absolute;z-index:9;right:calc(var(--right-panel-width,248px) - 4px);top:0;bottom:0;width:9px;padding:0;border:0;border-radius:0;background:transparent;cursor:col-resize;touch-action:none;outline:none}
#right-panel-resize::after{content:'';position:absolute;top:0;bottom:0;left:3px;width:3px;border-radius:3px;background:transparent;transition:background .15s}
#right-panel-resize:hover::after,#right-panel-resize:focus-visible::after,.is-resizing-sidebar #right-panel-resize::after{background:var(--accent,#525252)}
body.is-resizing-sidebar,body.is-resizing-sidebar *{cursor:col-resize!important;user-select:none!important}
@media(max-width:1100px){.workspace{grid-template-columns:48px minmax(300px,1fr) var(--right-panel-width,218px)}}
@media(max-width:800px){.workspace{grid-template-columns:44px minmax(300px,1fr) var(--right-panel-width,210px)}}

#text-background-tools .field-grid{gap:10px;margin:10px 0}
#text-background-tools .field-grid label{display:block;height:auto;padding:0;border:0;background:transparent;font-size:11px;color:inherit}
#text-background-tools .field-grid .check-label{display:flex;align-items:center;gap:5px}
#text-background-tools input[type=number]{display:block;width:100%;margin-top:6px;padding:8px;border:1px solid var(--border,#e0e0e0);border-radius:6px;background:var(--raised,#fff);color:var(--text,#303030)}
#text-background-tools input[type=color]{width:100%;height:30px;margin-top:6px;padding:2px;border:1px solid var(--border,#e0e0e0);border-radius:6px}
.layer-order-actions,.layer-actions{gap:6px;justify-content:flex-start}
.layer-order-actions button,.layer-actions button{flex:0 0 28px;width:28px;height:28px;padding:5px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px}
.layer-order-actions svg,.layer-actions svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.layer-row.drop-inside{outline:2px solid var(--accent,#525252);outline-offset:-2px;background:#ebebeb}
:root[data-theme=dark] .layer-row.drop-inside{background:#323232}
#cutout-dialog{width:940px;max-height:94vh}
#cutout-dialog h3{font-size:12px;margin:16px 0 10px}
#cutout-dialog h3 small{font-size:11px;margin-left:10px}
.cutout-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 0;border-block:1px solid var(--border,#e0e0e0)}
.cutout-toolbar button{font-size:11px;padding:7px 10px}.cutout-toolbar label{display:flex;align-items:center;gap:8px;font-size:11px}
.cutout-toolbar button[aria-pressed=true]{background:#464646;color:white;border-color:#464646}
.cutout-original,#cutout-samples img{background:repeating-conic-gradient(#e2e2e2 0% 25%,#fff 0% 50%) 50%/16px 16px}
.cutout-original{display:flex;justify-content:center;align-items:center;min-height:80px;padding:8px;border-radius:8px;overflow:hidden}
#cutout-source{display:block;max-width:100%;max-height:300px;width:auto;height:auto;touch-action:none;cursor:crosshair}
#cutout-samples{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}
#cutout-samples button{padding:6px;overflow:hidden;font-size:11px;text-align:center}
#cutout-samples button[aria-pressed=true]{border-color:#525252;box-shadow:0 0 0 2px #525252}
#cutout-samples img{display:block;width:100%;height:145px;object-fit:contain;border-radius:4px;margin-bottom:8px}
#cutout-status{min-height:18px}
#text-background-tools .check-label{white-space:nowrap;justify-content:flex-start;margin:0}
#text-background-tools input[type=checkbox]{width:14px;height:14px;flex:0 0 14px;margin:0}
#text-background-tools h3{color:var(--text,#3f3f3f)}
.cutout-comparison{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}
.cutout-comparison section{min-width:0}
.cutout-comparison .cutout-original,.cutout-selected{height:310px;display:flex;justify-content:center;align-items:center;padding:8px;border-radius:8px;overflow:hidden;background:repeating-conic-gradient(#e2e2e2 0% 25%,#fff 0% 50%) 50%/16px 16px}
.cutout-comparison #cutout-source{max-height:294px}
#cutout-selected-image{max-width:100%;max-height:294px;width:auto;height:auto;object-fit:contain}
#cutout-selected-image[hidden],#cutout-selected-note[hidden]{display:none}
#cutout-selected-note{color:#4f4f4f;background:#ffffffed;border-radius:8px;padding:12px;font-size:12px;text-align:center}
/* Keep the original stationary while previews regenerate during a brush stroke. */
#cutout-samples{min-height:184px;grid-auto-rows:184px}
.text-format-bar{display:flex;align-items:center;gap:5px;margin-top:8px}
.text-format-bar[hidden]{display:none}
.text-format-bar button{width:30px;height:29px;padding:3px;font-size:14px;border-radius:6px}
.text-format-bar [data-format=fontWeight]{font-weight:800}.text-format-bar [data-format=fontStyle]{font-style:italic}
.text-format-bar [data-format=underline]{text-decoration:underline}.text-format-bar [data-format=linethrough]{text-decoration:line-through}
.text-format-bar button[aria-pressed=true]{background:#e5e5e5;color:#414141;border-color:#525252}
#text-tools .text-format-scope,.text-format-scope{margin:0 0 0 4px;font-size:10px;white-space:nowrap}
#canvas-text-format{position:fixed;z-index:14;margin:0;padding:7px;border:1px solid var(--border,#e0e0e0);border-radius:10px;background:var(--surface,#fff);box-shadow:0 5px 20px #0002}
:root[data-theme=dark] .text-format-bar button[aria-pressed=true]{background:#323232;color:var(--accent);border-color:#6e6e6e}

.text-format-bar input.text-format-color{flex:0 0 30px;width:30px;min-width:30px;height:29px;padding:3px;border-radius:6px;cursor:pointer}

.color-eyedropper{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;margin-top:10px;padding:7px;border-radius:7px;font-size:12px}
.color-eyedropper svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.studio-color-picker.is-sampling{visibility:hidden}
.color-eyedropper-overlay{position:fixed;inset:0;z-index:10000;visibility:visible;cursor:crosshair;touch-action:none}
.color-eyedropper-hint{position:fixed;left:calc(50% - 120px);top:20px;padding:8px 10px;border:2px solid #a6a6a6;border-radius:8px;background:#2b2b2beb;color:#fff;font-size:11px;pointer-events:none;box-shadow:0 3px 14px #0003;white-space:nowrap}

#load-system-fonts{width:100%;margin:10px 0 5px;font-size:12px}#system-font-status{display:block;line-height:1.5;margin-bottom:8px;overflow-wrap:anywhere}

.text-format-bar button.text-format-font{width:auto;min-width:58px;font-size:11px;padding:3px 8px}.layer-entry.layer-child{margin-left:calc(var(--layer-depth,1)*14px)}

.layer-help{flex:none;margin:0 0 10px;color:var(--muted,#707070);font-size:11px}
.layer-help>summary{display:flex;align-items:center;gap:6px;width:fit-content;margin-left:auto;padding:5px 8px;border-radius:6px;cursor:pointer;list-style:none}
.layer-help>summary::-webkit-details-marker{display:none}
.layer-help>summary>span{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:1px solid currentColor;border-radius:50%;font-size:10px}
.layer-help>summary:hover,.layer-help[open]>summary{background:var(--raised,#f1f1f1);color:var(--text,#303030)}
.layer-help>summary:focus-visible{outline:2px solid var(--accent,#545454);outline-offset:2px}
.layer-help-content{margin-top:6px;padding:10px 12px;border:1px solid var(--border,#e0e0e0);border-radius:8px;max-height:240px;overflow:auto}
.layer-help-content .history-help{margin-bottom:0;color:inherit}
.layer-help-content .history-note{padding-top:8px;border-top:1px solid var(--border,#e0e0e0);color:inherit}

/* Readable panel typography at normal browser zoom. */
.left-editor-panel .selection-hint{font-size:13px;line-height:1.7;margin:14px 0 22px;overflow-wrap:anywhere}
.left-editor-panel .measurement-note{font-size:12px;line-height:1.65;margin:9px 0 16px;overflow-wrap:anywhere}
.left-editor-panel :is(.measurement-unit,.section-title,.field-grid label,.rotation-field,.check-label){font-size:13px}
.left-editor-panel input[type=number]{font-size:14px}
.left-editor-panel :is(.extra-properties label,.fill-card label){font-size:13px;line-height:1.5}
#properties-content :is(small,.extra-properties p,.quality p),#font-info,#font-results{font-size:12px;line-height:1.65}
.left-editor-panel .quality{font-size:12px}
.layer-caption strong{font-size:13px;line-height:1.45;font-weight:500}
.layer-caption small{font-size:12px;line-height:1.5;margin-top:4px;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
.layer-row{padding-top:10px;padding-bottom:10px}
.layer-child .layer-row{padding-top:8px;padding-bottom:8px}
.history-sidebar :is(.history-help,.history-note,.history-state,.history-number,.layer-help){font-size:12px;line-height:1.65}
.history-sidebar .history-jump{font-size:13px;line-height:1.5}

/* Fixed working units and inline text size. */
.global-unit-control{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:13px;font-weight:700;border:1px solid var(--border,#697279);border-radius:8px;padding:3px 8px}
.global-unit-control select{min-width:62px;font-weight:700}
#canvas-text-format .text-format-size{display:flex;align-items:center;gap:5px;margin:0;white-space:nowrap;font-size:12px}
#canvas-text-format .text-format-size input{width:76px;min-width:0;height:30px;margin:0;padding:4px 6px;font-size:13px;color:inherit;background:transparent;border:1px solid currentColor;border-radius:5px}
#canvas-text-format{max-width:calc(100vw - 16px);flex-wrap:wrap}

#document-tabs{display:flex;align-items:stretch;gap:3px;flex:none;min-height:39px;overflow-x:auto;padding:5px 8px 0;background:#e5e5e5;border-bottom:1px solid #ccc}
.document-tab{display:flex;flex:none;max-width:220px;border:1px solid #ccc;border-bottom:0;border-radius:7px 7px 0 0;background:#eee}
.document-tab:has([aria-selected=true]){background:#fff;border-top:2px solid #222}
.document-tab button{background:transparent;border:0;border-radius:0;font-size:12px;padding:7px 10px;color:#555}
.document-tab [role=tab]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:75px;text-align:left}
.document-tab [aria-selected=true]{color:#111;font-weight:700}
.document-tab .close-document-tab{padding:4px 8px;font-size:17px;flex:none}
#document-tabs .new-document-tab{flex:none;border:0;background:transparent;font-size:19px;padding:3px 10px}
:root[data-theme=dark] #document-tabs{background:#191919;border-color:#444}
:root[data-theme=dark] .document-tab{background:#272727;border-color:#444}
:root[data-theme=dark] .document-tab:has([aria-selected=true]){background:#363636;border-top-color:#eee}
:root[data-theme=dark] .document-tab button{color:#ccc}
:root[data-theme=dark] .document-tab [aria-selected=true]{color:#fff}

#document-tabs button:focus:not(:focus-visible){outline:none;box-shadow:none}
#document-tabs button:focus-visible{outline:2px solid currentColor;outline-offset:-3px;border-radius:5px}

#object-export-dialog{width:490px}#object-export-form>label{display:grid;grid-template-columns:80px 1fr;align-items:center;gap:12px;margin:16px 0;font-size:13px}
#object-export-form input,#object-export-form select{width:100%;padding:10px;border:1px solid #aaa;border-radius:7px;background:transparent;color:inherit;font:inherit}
.export-preview-wrap{height:190px;display:flex;justify-content:center;align-items:center;background:repeating-conic-gradient(#ddd 0% 25%,#fff 0% 50%) 50%/16px 16px;border-radius:8px;overflow:hidden}
#export-preview{max-width:100%;max-height:100%;object-fit:contain}
.export-folder{border-top:1px solid #8885;padding-top:15px;font-size:13px}.export-folder small{display:block;margin-top:10px;line-height:1.6;font-size:12px}
#object-export-dialog p{font-size:12px;line-height:1.6}#export-folder-name{overflow-wrap:anywhere}
.export-status-row{display:flex;align-items:center;gap:10px;min-height:36px}.save-spinner{display:inline-block;width:26px;height:26px;border:3px solid #8886;border-top-color:currentColor;border-radius:50%;animation:ab-save-spin .8s linear infinite;flex:none}.save-spinner[hidden]{display:none}
@keyframes ab-save-spin{to{transform:rotate(360deg)}}
#save-progress{width:380px;text-align:center;padding:32px;color:#222;background:#fff}#save-progress h2{font-size:18px;margin:16px 0 10px}#save-progress p,#save-progress small{font-size:13px;line-height:1.6;color:inherit}#save-progress::backdrop{background:#0007}
:root[data-theme=dark] #save-progress{background:#252525;color:#eee}
#object-export-dialog .dialog-error:empty,.export-status-row:has(#export-status:empty){display:none}
.export-folder>div{display:flex;flex-wrap:wrap;gap:7px}
@media(max-height:800px){.export-preview-wrap{height:120px}#object-export-dialog p{margin:8px 0}#object-export-form>label{margin:12px 0}}

.left-editor-panel{top:calc(var(--document-tabs-height,39px) + 8px)}
.stage-panel{position:relative}.studio-ruler,.ruler-corner{position:absolute;z-index:4;pointer-events:none}.studio-ruler[hidden],.ruler-corner[hidden]{display:none}.ruler-corner{width:22px;height:22px;background:#eee;color:#444;font-size:10px;display:grid;place-items:center;border-right:1px solid #8885;border-bottom:1px solid #8885}
.has-rulers #stage-scroll{padding-top:32px;padding-left:52px}
#toggle-rulers[aria-pressed=true]{background:#333;color:#fff;border-color:#333}
:root[data-theme=dark] .ruler-corner{background:#292929;color:#eee}
:root[data-theme=dark] #toggle-rulers[aria-pressed=true]{background:#eee;color:#222}

#server-save-state{display:block;font-size:11px;line-height:1.5;color:#555;max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#server-save-state[data-state=saving]::before{content:'';display:inline-block;width:8px;height:8px;border:2px solid #8885;border-top-color:currentColor;border-radius:50%;animation:ab-save-spin .8s linear infinite;margin-right:5px}
#server-save-state[data-state=error]{color:#ad4933}:root[data-theme=dark] #server-save-state{color:#ddd}:root[data-theme=dark] #server-save-state[data-state=error]{color:#ffb29c}

.document-tab{position:relative}.document-tab [role=tab]{cursor:grab}.document-tab.tab-dragging{opacity:.45}.document-tab.tab-dragging [role=tab]{cursor:grabbing}
.document-tab.tab-drop-before::before,.document-tab.tab-drop-after::after{content:'';position:absolute;top:3px;bottom:3px;width:3px;border-radius:2px;background:#222;pointer-events:none;z-index:2}
.document-tab.tab-drop-before::before{left:-3px}.document-tab.tab-drop-after::after{right:-3px}
:root[data-theme=dark] .document-tab.tab-drop-before::before,:root[data-theme=dark] .document-tab.tab-drop-after::after{background:#eee}

/* Keep document status together beside the object count. */
.stage-footer{gap:16px;padding:0 16px}
.footer-save-status{display:flex;align-items:center;gap:10px;min-width:0;flex:1;overflow-x:auto;white-space:nowrap;scrollbar-width:thin}
.footer-save-status #object-count{flex:none;font-size:11px}
.footer-save-status :is(#save-state,#server-save-state,#draft-state){display:inline-block;flex:none;margin:0;font-size:11px;line-height:18px;border-left:1px solid #8885;padding-left:10px}
.footer-save-status #server-save-state{max-width:360px}
.stage-footer .stage-shortcuts{flex:none;white-space:nowrap}
@media(max-width:1300px){.stage-footer .stage-shortcuts{display:none}}

/* The noninteractive progress dialog needs no browser focus frame. */
#save-progress,#save-progress:focus,#save-progress:focus-visible{border:0;outline:none;border-radius:18px;box-shadow:0 16px 56px #00000024;padding:30px 32px}
#save-progress .save-spinner{width:28px;height:28px;border-width:2px;border-color:#8883;border-top-color:#444}
#save-progress h2{font-size:16px;font-weight:600;margin:18px 0 8px;letter-spacing:-.3px}
#save-progress p{margin:0 0 9px;color:#555}
#save-progress small{display:block;font-size:12px;color:#888;line-height:1.7}
#save-progress::backdrop{background:#0004}
:root[data-theme=dark] #save-progress{background:#282828;box-shadow:0 16px 56px #0006}
:root[data-theme=dark] #save-progress .save-spinner{border-color:#ffffff20;border-top-color:#eee}
:root[data-theme=dark] #save-progress p{color:#ddd}
:root[data-theme=dark] #save-progress small{color:#aaa}
/* Compact custom canvas controls and artboard overlays. */
#custom-tools{display:flex;align-items:center;gap:4px}#custom-tools[hidden]{display:none}#custom-tools button,#custom-tools summary{padding:5px 9px;font-size:17px;cursor:pointer;list-style:none}
.export-sections-menu{position:relative}.export-sections-menu>div{position:absolute;top:34px;left:0;z-index:50;display:grid;min-width:150px;padding:7px;background:var(--surface,#fff);border:1px solid var(--border,#ddd);border-radius:9px;box-shadow:0 8px 24px #0002}.export-sections-menu>div button{white-space:nowrap;font-size:12px!important;text-align:left;border:0}
#paper.custom-paper{background:transparent!important;box-shadow:none!important;overflow:visible}.custom-paper #empty-state{display:none!important}
#section-controls{position:absolute;inset:0;pointer-events:none;z-index:6}.section-frame{position:absolute;border:1px solid #7777;pointer-events:none}.section-frame.is-active{border-color:#999}.section-toolbar{position:absolute;bottom:100%;left:0;display:flex;align-items:center;height:25px;gap:3px;pointer-events:auto;white-space:nowrap}.section-toolbar button{border:0;background:var(--surface,#fff);color:var(--text,#333);padding:3px 7px;font-size:11px;border-radius:4px}.section-toolbar button:first-child{font-weight:500}.add-section{position:absolute;pointer-events:auto;font-size:12px;background:var(--surface,#fff);color:var(--text,#333)}
.section-resize{position:absolute;pointer-events:auto;z-index:2}.resize-n,.resize-s{height:6px;left:8px;right:8px;cursor:ns-resize}.resize-n{top:-3px}.resize-s{bottom:-3px}.resize-e,.resize-w{width:6px;top:8px;bottom:8px;cursor:ew-resize}.resize-e{right:-3px}.resize-w{left:-3px}.resize-nw,.resize-ne,.resize-sw,.resize-se{width:9px;height:9px;background:#fff;border:1px solid #777;border-radius:2px}.resize-nw{left:-5px;top:-5px;cursor:nwse-resize}.resize-ne{right:-5px;top:-5px;cursor:nesw-resize}.resize-sw{left:-5px;bottom:-5px;cursor:nesw-resize}.resize-se{right:-5px;bottom:-5px;cursor:nwse-resize}
.section-crop-overlay{position:absolute;inset:0;pointer-events:auto;cursor:crosshair;background:#0001;z-index:3;overflow:hidden}.section-crop-mark{position:absolute;pointer-events:none;border:1px dashed #fff;outline:1px solid #222;box-shadow:0 0 0 10000px #0005}
.custom-size-fields{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}.custom-size-fields label{display:grid;gap:7px;font-size:12px}.custom-size-fields input,.custom-size-fields select{width:100%;border:1px solid var(--border,#ccc);border-radius:6px;background:var(--raised,#eee);color:inherit;padding:9px;font-size:14px}#custom-size-dialog h2{font-size:17px}#custom-size-dialog small{display:block;margin-top:14px;line-height:1.6}#custom-size-error{color:#c65b42}
.tool-help{font-size:12px;margin:8px 0;color:var(--muted,#777)}.tool-help summary{cursor:pointer;list-style:none;font-size:13px}.tool-help[open]{padding:8px;background:var(--raised,#f3f3f3);border-radius:6px}.tool-help p,.tool-help small{line-height:1.6}
.toolbar-group{gap:9px}.topbar{gap:16px}.brand{min-width:180px}.top-actions{gap:6px}.prototype-note{display:none}.stage-footer .stage-shortcuts{display:none}
#pixel-tools-dialog{width:min(1120px,95vw);max-width:95vw;padding:20px} .pixel-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.pixel-heading h2{font-size:16px;margin:0}.pixel-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:20px;height:min(65vh,660px)}.pixel-settings{overflow:auto;display:flex;flex-direction:column;gap:14px}.pixel-settings label{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pixel-settings small{font-size:12px;line-height:1.7;opacity:.7}.pixel-settings input[type=number]{width:64px}.pixel-settings input[type=range]{width:120px}.pixel-actions,.pixel-tool-buttons{display:flex;gap:6px;flex-wrap:wrap}.pixel-stop{display:flex;align-items:center;gap:8px;margin:6px 0}.pixel-stop input[type=color]{width:44px;height:32px;padding:2px}.pixel-view{overflow:auto;display:grid;place-items:center;background:repeating-conic-gradient(#bbb 0% 25%,#ddd 0% 50%) 0/18px 18px;border-radius:10px}.pixel-surface{position:relative;max-width:100%;flex-shrink:0}.pixel-surface canvas{position:absolute;width:100%;height:100%;inset:0}#pixel-selection{cursor:crosshair;touch-action:none}#pixel-status{min-height:20px;font-size:12px}.pixel-tool-buttons [aria-pressed=true]{background:#777;color:white}
.paper-wrap:has(.custom-paper)>.paper-label,.paper-wrap:has(.custom-paper)>.paper-bottom-label{display:none}.member-name{display:none}.brand{min-width:160px}#selection-hint{font-size:12px}.layer-kind{font-size:11px}.tool-help>summary:hover{color:var(--text,#222)}.export-sections-menu[open]>summary{background:#8882}:root[data-theme=dark] .export-sections-menu>div,:root[data-theme=dark] .section-toolbar button,:root[data-theme=dark] .add-section{background:#292929;color:#eee}:root[data-theme=dark] .custom-size-fields input,:root[data-theme=dark] .custom-size-fields select{background:#333;color:#eee}
.pixel-rgb{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:8px;background:#8881;border-radius:6px}.pixel-rgb[hidden]{display:none}.pixel-rgb label{font-size:10px;display:grid;gap:3px}.pixel-rgb input[type=number]{width:100%;padding:5px}.pixel-rgb .pixel-hex{grid-column:1/-1;width:100%;padding:6px}.pixel-stop{gap:4px}.pixel-stop .pixel-swatch{width:30px;min-width:30px;height:26px;border:1px solid #8888}.pixel-stop input.pixel-offset{width:43px;padding:4px}.pixel-stop button{padding:4px 6px}.pixel-stop span{font-size:10px}
.pixel-settings [hidden]{display:none!important}#pixel-tools-dialog button{background:#f3f3f3;color:#333;border:1px solid #ddd;border-radius:6px}#pixel-tools-dialog button:hover{background:#e7e7e7}#pixel-tools-dialog button:disabled{opacity:.4;cursor:default}#pixel-tools-dialog input:not([type=range]):not([type=checkbox]),#pixel-tools-dialog select{border:1px solid #ccc;border-radius:5px;background:#fff;color:#222;padding:5px}#pixel-tools-dialog :focus-visible{outline:2px solid #659bd0;outline-offset:1px}#pixel-tools-dialog .primary{background:#222;color:#fff;border-color:#222}#pixel-tools-dialog [aria-pressed=true]{background:#333;color:white}:root[data-theme=dark] #pixel-tools-dialog button{background:#353535;border-color:#505050;color:#eee}:root[data-theme=dark] #pixel-tools-dialog button:hover{background:#444}:root[data-theme=dark] #pixel-tools-dialog input:not([type=range]):not([type=checkbox]),:root[data-theme=dark] #pixel-tools-dialog select{background:#303030;border-color:#555;color:#eee}:root[data-theme=dark] #pixel-tools-dialog .primary{background:#eee;color:#222}:root[data-theme=dark] #pixel-tools-dialog [aria-pressed=true]{background:#555;color:#fff}:root[data-theme=dark] .pixel-view{background:repeating-conic-gradient(#555 0% 25%,#666 0% 50%) 0/18px 18px}.pixel-settings input[type=checkbox],.pixel-settings input[type=range]{accent-color:#888}
