/* Full-screen editing uses the existing platform tokens. */
body dialog.editor-dialog{width:calc(100vw - 24px);max-width:none;height:calc(100dvh - 24px);max-height:none;margin:12px;padding:0;overflow:hidden;background:var(--page)}
.editor-dialog>.modalbody{padding:0;height:calc(100% - var(--dialog-header-height,40px));max-height:none;overflow:hidden}.editor-dialog>.modalhead{background:var(--surface)}
.work-editor{height:100%;display:flex;flex-direction:column;gap:0;color:var(--text);font-size:var(--font-body);background:var(--page)}
.editor-dialog,.work-editor,.work-editor *{scrollbar-width:none}.editor-dialog::-webkit-scrollbar,.work-editor::-webkit-scrollbar,.work-editor *::-webkit-scrollbar{display:none;width:0;height:0}
.work-editor .editor-preview{align-items:safe center;justify-content:safe center}
.work-editor .editor-image{max-width:none;max-height:none;transform:none;overflow:visible}
.work-editor .editor-image>img{width:100%;height:100%;max-width:none;max-height:none;pointer-events:none;user-select:none}
.editor-image.editor-transforming>img{visibility:hidden}
.editor-image[data-tool=move] canvas{cursor:move}.editor-image[data-tool=region] canvas{cursor:crosshair}
.work-editor #editorCanvas:focus{outline:0}
.editor-selection{position:absolute;pointer-events:none;border:1px solid var(--accent);box-sizing:border-box}
.editor-selection[hidden]{display:none}
.work-editor .editor-selection>button{position:absolute;width:10px;height:10px;min-width:0;min-height:0;padding:0;border:1px solid var(--accent);border-radius:0;background:var(--surface);pointer-events:auto;touch-action:none;transform:translate(-50%,-50%)}
.editor-selection>[data-editor-handle=nw]{left:0;top:0;cursor:nwse-resize}.editor-selection>[data-editor-handle=ne]{left:100%;top:0;cursor:nesw-resize}.editor-selection>[data-editor-handle=se]{left:100%;top:100%;cursor:nwse-resize}.editor-selection>[data-editor-handle=sw]{left:0;top:100%;cursor:nesw-resize}
.work-editor .editor-selection>button:hover,.work-editor .editor-selection>button:focus-visible{color:var(--accent-hover);outline:0;box-shadow:none}
.work-editor .editor-add-reference{display:inline-flex;align-items:center;gap:5px;width:auto;min-height:32px;padding:5px 8px;font-size:var(--font-caption)}.editor-add-reference svg{width:15px;height:15px}
dialog.editor-reference-dialog{width:min(620px,calc(100vw - 32px));max-height:calc(100dvh - 48px);padding:0;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:var(--radius-card,12px)}.editor-reference-dialog .modalbody{max-height:calc(100dvh - 120px);overflow:auto}
.editor-reference-sources{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}.editor-reference-sources button{font-size:var(--font-body);padding:5px 9px}.editor-reference-sources [aria-pressed=true]{color:var(--accent)}.editor-reference-sources [data-reference-upload]{margin-left:auto;display:flex;align-items:center;gap:5px}.editor-reference-sources svg{width:15px;height:15px}
.editor-reference-search{display:flex;gap:8px;margin-bottom:12px}.editor-reference-search input{flex:1;min-width:0;border:0;outline:0;background:var(--field);color:var(--text)}.editor-reference-search input:focus{color:var(--accent-hover)}
.editor-reference-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.editor-reference-options button{min-width:0;display:flex;flex-direction:column;align-items:stretch;padding:7px;gap:5px;background:var(--field);font-size:var(--font-caption);text-align:left}.editor-reference-options img{width:100%;height:100px;object-fit:contain;background:repeating-conic-gradient(var(--border) 0 25%,var(--field) 0 50%) 0/12px 12px}.editor-reference-options span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-reference-options small{color:var(--muted)}
@media(max-width:480px){.editor-reference-options{grid-template-columns:repeat(2,minmax(0,1fr))}}
.editor-topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;min-height:48px;background:var(--page)}.editor-topbar>div{display:flex;align-items:center;gap:8px}.editor-topbar button,.editor-topbar a{font-size:var(--font-body)}.editor-topbar .active{color:var(--accent)}.editor-source-label{font-size:var(--font-caption);color:var(--muted);margin-left:12px}.editor-download{display:flex;align-items:center;gap:6px;color:var(--secondary);padding:6px 10px}.editor-download svg{width:16px;height:16px}
.editor-workspace{display:grid;grid-template-columns:222px 42px minmax(0,1fr) 246px;gap:12px;padding:0 12px;flex:1;min-height:0;min-width:0}.editor-assets,.editor-tools,.editor-controls,.editor-canvas-card,.editor-composer{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card,12px);min-width:0}
.editor-assets{padding:13px 12px;overflow:auto;min-height:0}.editor-panel-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.editor-panel-title>strong{font-size:var(--font-section);font-weight:600}.editor-panel-title .iconbtn{background:transparent;width:26px;height:26px;min-width:26px;padding:4px}.editor-source-tabs{display:flex;gap:5px;margin-bottom:12px}.editor-source-tabs button{background:transparent;padding:5px 8px;min-width:0;min-height:30px;font-size:var(--font-body)}.editor-source-tabs .active{color:var(--accent)}
.work-editor input:not([type=checkbox]):not([type=file]),.work-editor select,.work-editor textarea{border:0;box-shadow:none;background:var(--field);color:var(--text);font-size:var(--font-body);min-width:0}.work-editor input:focus,.work-editor select:focus,.work-editor textarea:focus{outline:0;color:var(--accent-hover)}#editorSearch{width:100%;margin-bottom:12px}
.editor-asset-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 8px}.editor-asset-card{background:var(--field);border-radius:8px;padding:5px;min-width:0}.editor-asset-card>img{display:block;width:100%;height:94px;object-fit:contain;border-radius:5px;background:repeating-conic-gradient(var(--border) 0 25%,var(--field) 0 50%) 0/12px 12px}.editor-asset-card strong{display:block;font-size:var(--font-caption);font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:5px}.editor-asset-card small{display:block;color:var(--muted);font-size:11px}.editor-asset-card>div{display:flex;border-top:1px solid var(--border);margin-top:6px;padding-top:3px}.editor-asset-card button{flex:1;background:transparent;min-width:0;min-height:24px;padding:2px 4px;font-size:var(--font-caption)}.editor-page{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-top:12px;font-size:var(--font-caption)}.editor-page button{min-width:0;font-size:var(--font-caption);padding:5px}.editor-note{font-size:var(--font-caption);color:var(--muted);margin:12px 0}
.editor-tools{display:flex;flex-direction:column;align-items:center;gap:8px;padding:10px 3px}.editor-tools .iconbtn{width:32px;height:32px;min-width:0;padding:7px;background:transparent;color:var(--secondary)}.editor-tools .active{color:var(--accent)}.editor-tools svg{width:17px;height:17px}
.editor-main{display:flex;flex-direction:column;gap:12px;min-width:0;min-height:0}.editor-canvas-card{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.editor-canvas-head{height:40px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:0 14px;border-bottom:1px solid var(--border);font-size:var(--font-caption);color:var(--secondary)}.editor-preview{display:flex;flex:1;min-height:0;gap:14px;align-items:center;justify-content:center;padding:18px;overflow:auto;background-color:var(--canvas,var(--page));background-image:radial-gradient(var(--border) .65px,transparent .65px);background-size:24px 24px}.editor-image{position:relative;flex-shrink:0;max-width:100%;max-height:100%;transform-origin:center;background:repeating-conic-gradient(var(--border) 0 25%,var(--surface) 0 50%) 0/12px 12px}.editor-image>img{display:block;max-width:100%;max-height:calc(100dvh - 392px);width:auto;height:auto;object-fit:contain}.editor-image canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none}.editor-comparing>.editor-image,.editor-comparing>figure{max-width:48%}.editor-preview figure{margin:0;min-width:0;align-self:center}.editor-preview figure img{max-width:100%;max-height:calc(100dvh - 410px);object-fit:contain}.editor-preview figcaption{font-size:var(--font-caption);color:var(--muted);margin-top:7px}
.editor-composer{padding:12px 14px;flex-shrink:0}.editor-reference-row{display:flex;align-items:center;gap:8px;min-height:40px;flex-wrap:wrap}.editor-reference-card{display:flex;align-items:center;gap:6px;padding:5px;background:var(--field);border-radius:8px;min-width:0}.editor-reference-card img{width:29px;height:36px;object-fit:contain;background:var(--surface);border-radius:4px}.editor-reference-card strong{display:block;max-width:92px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--font-caption);font-weight:400}.editor-reference-card select{background:transparent;padding:0;min-height:18px;width:68px;font-size:11px;color:var(--muted)}.editor-reference-card .iconbtn{align-self:flex-start;width:20px;height:20px;min-width:20px;padding:3px;background:transparent}.editor-reference-card .iconbtn svg{width:12px;height:12px}.editor-add-reference{width:32px;height:36px;min-width:32px;padding:7px;background:var(--field)}.editor-target{font-size:var(--font-caption);color:var(--muted);margin-left:auto}.editor-prompt-row{display:flex;align-items:center;gap:12px;margin:9px 0}.editor-prompt-row textarea{background:transparent;flex:1;resize:vertical;min-height:44px;height:44px;max-height:140px;padding:3px 0;line-height:20px}.editor-prompt-row .primary{font-size:var(--font-body);min-height:36px;flex-shrink:0}.editor-composer-settings{display:flex;align-items:center;gap:8px;border-top:1px solid var(--border);padding-top:9px;flex-wrap:wrap;font-size:var(--font-caption)}.editor-composer-settings select{width:auto;padding:4px 8px;min-height:28px;font-size:var(--font-caption)}.editor-model{color:var(--secondary);background:var(--field);padding:4px 8px;border-radius:6px}.editor-composer-settings #editorAiStatus{color:var(--muted);flex:1;min-width:0;overflow-wrap:anywhere}.editor-composer-settings .small{font-size:var(--font-caption);padding:4px 7px;min-width:0}
.editor-controls{padding:0 12px 12px;margin:0;overflow:auto;min-height:0;display:block}.editor-inspector-tabs{display:flex;gap:5px;height:44px;align-items:center;border-bottom:1px solid var(--border);margin-bottom:14px}.editor-inspector-tabs button{flex:1;background:transparent;font-size:var(--font-body);min-width:0;padding:6px}.editor-inspector-tabs .active{color:var(--accent)}.editor-board-card{display:flex;gap:10px;align-items:center;padding:10px;background:var(--field);border-radius:var(--radius-card);margin-bottom:16px}.editor-board-card>img{width:38px;height:47px;object-fit:contain}.editor-board-card strong{display:block;font-size:var(--font-caption)}.editor-board-card small{display:block;color:var(--muted);font-size:11px;margin-top:4px}.editor-layer-count{display:flex;justify-content:space-between;font-size:var(--font-caption);color:var(--muted);margin-bottom:8px}.editor-layer-row{display:flex;align-items:center;gap:5px;padding:7px 0}.editor-layer-select{display:flex;flex:1;gap:8px;align-items:center;justify-content:flex-start;min-width:0;background:transparent;padding:0;font-size:var(--font-caption)}.editor-layer-select img{width:30px;height:36px;object-fit:contain;background:var(--field);border-radius:4px;flex-shrink:0}.editor-layer-select span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-layer-row>.iconbtn{background:transparent;padding:4px;width:25px;min-width:25px;height:28px}.editor-layer-row.active .editor-layer-select{color:var(--accent)}.editor-layer-row svg{width:14px;height:14px}.editor-property-card{padding:12px;background:var(--field);border-radius:var(--radius-card);margin-bottom:12px;font-size:var(--font-caption)}.editor-property-card>strong{font-size:var(--font-body);display:block;margin-bottom:10px}.editor-property-card label{display:flex;flex-direction:column;gap:5px;min-width:0;margin:8px 0;color:var(--secondary)}.editor-property-card input,.editor-property-card select{background:var(--surface)!important;width:100%;padding:6px 8px}.editor-property-card input[type=file]{background:transparent!important;font-size:11px}.editor-property-card .small{margin-top:8px;width:100%}.editor-position{display:flex;gap:9px}.editor-position>label{flex:1;min-width:0}.editor-history-card{display:flex;gap:9px;padding:9px;margin-bottom:10px;border-radius:var(--radius-card);background:var(--field)}.editor-history-card img{width:48px;height:60px;object-fit:contain;flex-shrink:0}.editor-history-card strong{font-size:var(--font-caption);display:block}.editor-history-card small{font-size:11px;color:var(--muted);display:block;margin:4px 0}.editor-history-card button{font-size:var(--font-caption);padding:4px 7px;min-height:26px}.editor-status{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:28px;padding:4px 14px;font-size:var(--font-caption);color:var(--muted)}.editor-status .error{font-size:var(--font-caption);flex:1;min-width:0;overflow-wrap:anywhere}
.review-note-list{display:flex;flex-direction:column;gap:12px}.review-note{padding:12px;background:var(--card);border-radius:10px;font-size:var(--font-caption);line-height:1.6}.review-note strong,.review-note small{display:block}.review-note small{color:var(--muted);margin-top:6px}.review-note p{margin:7px 0}.review-note .actions{gap:5px;flex-wrap:wrap;margin-top:8px}.review-note .actions button{padding:5px 8px}
@media(max-width:1250px){.editor-workspace{grid-template-columns:190px 38px minmax(0,1fr) 220px;gap:8px;padding:0 8px}.editor-assets{padding:12px 9px}.editor-asset-card>img{height:80px}.editor-composer{padding:10px}.editor-source-label{display:none}.editor-model{font-size:11px}.editor-target{display:none}.editor-reference-card strong{max-width:70px}}
@media(max-width:1000px){.editor-workspace{grid-template-columns:165px 36px minmax(0,1fr) 190px;gap:6px}.editor-assets{padding:10px 7px}.editor-asset-grid{grid-template-columns:1fr}.editor-controls{padding:0 8px 8px}.editor-prompt-row .primary{padding:6px 9px;font-size:var(--font-caption)}.editor-composer-settings{gap:5px}.editor-topbar{gap:6px;padding-inline:8px}.editor-topbar>div{gap:4px}.editor-topbar button{padding:5px 8px;font-size:var(--font-caption)}}
@media(max-width:760px){body dialog.editor-dialog{width:calc(100vw - 12px);height:calc(100dvh - 12px);margin:6px}.editor-workspace{grid-template-columns:36px minmax(0,1fr);grid-template-rows:minmax(180px,1fr) minmax(130px,.55fr);overflow:auto}.editor-assets{grid-column:1/-1;grid-row:2;max-height:220px}.editor-asset-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.editor-tools{grid-column:1;grid-row:1}.editor-main{grid-column:2;grid-row:1}.editor-controls{grid-column:1/-1;grid-row:3;max-height:260px}.editor-inspector-tabs{margin-bottom:8px}.editor-topbar{flex-wrap:wrap}.editor-topbar>div{flex-wrap:wrap}.editor-preview{padding:8px}.editor-image>img{max-height:30vh}.editor-composer{padding:8px}.editor-reference-row{gap:5px}.editor-reference-card{padding:3px}.editor-reference-card strong{max-width:60px}.editor-reference-card img{width:24px;height:30px}.editor-reference-card select{width:55px;font-size:10px}.editor-prompt-row{gap:6px}.editor-prompt-row textarea{font-size:var(--font-caption);height:40px;min-height:40px}.editor-model{font-size:10px}.editor-status>span:last-child{display:none}.editor-history-cards{display:flex;gap:9px;overflow:auto}.editor-history-card{flex-shrink:0}.editor-asset-card>img{height:70px}}
