/* Shared editor surfaces. Control dimensions belong to property-rows.css. */
:root{
 --bg:#11151b;--panel:#1b2129;--surface:#252d38;--field:#131920;
 --line:#343e4b;--text:#e0e6ef;--muted:#98a6b8;--accent:#72cebd;
 --hover:#303c4a;--soft-accent:#243e40;--orange:#ddb47e;
 --theme-raised:#222a35;--theme-subtle:#171d25;--theme-border-soft:#29323e;
 --theme-selected:#284441;--theme-selected-text:#c5f4e9;
 --theme-shadow:0 20px 70px #0007,0 1px 0 #ffffff05 inset;
 --checker:repeating-conic-gradient(#242c36 0% 25%,#202731 0% 50%) 50%/16px 16px;
 --editor-header-height:30px;
}
body{background:var(--bg);color:var(--text);letter-spacing:0;-webkit-font-smoothing:antialiased}
body button{background:var(--surface);border-color:var(--line);color:#c7d3e1;box-shadow:none;font-weight:400;transition:background .12s,border-color .12s,color .12s}
body button:hover:not(:disabled){background:var(--hover);border-color:#566575;color:#f1f5fa}
body button:active:not(:disabled){background:#354450}
body button:disabled{opacity:.4}
body button.primary,body .header #executeBtn{background:#34665f;border-color:#4a8a7d;color:#e0fff5;box-shadow:none}
body button.primary:hover:not(:disabled),body .header #executeBtn:hover:not(:disabled){background:#3e7d70;border-color:#71bba7}
body button.danger,body .resource-danger{color:#e5aaa9;background:#34272d;border-color:#60404a}
body button.danger:hover:not(:disabled){background:#52323c;border-color:#98606c}
body button.quiet{background:transparent}
body button:focus-visible{outline:1px solid #81948f;outline-offset:1px}
body :is(input,select,textarea){color:var(--text);background:var(--field);border-color:var(--line)}
body .property-row :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select,textarea){
 background:var(--field)!important;border:1px solid var(--line)!important;color:var(--text);
}
body .property-row :is(input,select,textarea):disabled{background:#191f27!important;color:#68778a;border-color:#2b3440!important}
body :is(input,textarea)::placeholder{color:#66778a;opacity:1}
body .property-label{color:#a5b3c4}
body :is(.property-label,.property-value,input[type=number],output){font-variant-numeric:tabular-nums}
body select{color-scheme:dark}
body select option,body select optgroup{background:#202935;color:#dfe9f5}
body :is(.tip,.resource-hint,.design-muted,.account-muted,.region-inline-hint){color:#8999ac;line-height:1.6}
body a{color:#9cdbce;text-underline-offset:3px}
body hr{border:0;border-top:1px solid var(--theme-border-soft)}
body *{scrollbar-color:#455363 transparent;scrollbar-width:thin}
body ::-webkit-scrollbar-thumb{background-color:#455363}

/* Application header and docking chrome. */
body .header{box-sizing:border-box;display:flex;align-items:center;flex-wrap:nowrap;height:var(--editor-header-height);min-height:30px;max-height:30px;padding:0 16px;gap:14px;background:#1b222c;border-bottom:1px solid #36414e;box-shadow:none}
body .header .brand{min-width:170px;gap:9px}
body .brand strong{font-size:17px;letter-spacing:2px}
body .header .brand-icon{width:25px;height:25px}
body .header .brand-icon svg{width:25px;height:25px}
body .header #projectBar{height:20px;min-height:20px;align-items:center;gap:6px;background:transparent;border-color:var(--line);border-top:0;min-width:0}
body .header #accountButton{--button-height:28px;background:transparent;border-color:transparent;max-width:250px;overflow:hidden;text-overflow:ellipsis}
body .header #accountButton .account-avatar{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex:0 0 24px;width:24px;min-width:24px;height:24px;min-height:24px;max-height:24px;aspect-ratio:1;border-radius:50%;overflow:hidden;font-size:12px!important;line-height:24px!important}
body .header #accountButton:hover{background:#27323e;border-color:var(--line)}
body .header #projectBar .project-name-tag{box-sizing:border-box;height:20px;min-height:20px;max-height:20px;line-height:18px!important;background:#242f3a;border-color:#3c4d59;border-radius:3px;padding:0 8px;color:#d0dce8}
body .header #projectSaveState{color:#94b4a8}
body .header-actions{gap:5px}
body #workspaceLayoutMenu>summary{display:flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;height:20px;min-height:20px;max-height:20px;padding:0 6px;line-height:18px;border-radius:3px}
body .workspace.dock-workspace{padding:6px;background:var(--bg)}
body .dock-divider{flex-basis:5px}
body .dock-stack{border-color:#35404c;border-radius:4px;background:var(--panel)}
body .dock-tabs{flex-basis:28px;min-height:28px;align-items:center;padding:0 4px;gap:2px;background:var(--theme-subtle);border-color:var(--line)}
body .dock-tabs .dock-tab{background:transparent;border:0;border-radius:2px;color:#8597aa;cursor:grab;min-width:48px}
body .dock-tabs .dock-tab[aria-selected=true]{background:var(--theme-selected);color:var(--theme-selected-text);box-shadow:inset 0 -1px #68bba9}
body .dock-tabs .dock-action{min-width:20px;flex-basis:20px;background:transparent;color:#7f92a7}
body .dock-workspace .dock-view>:is(.left-panel,.right-panel,.canvas-panel){background:var(--panel)}
body .dock-floating{border-color:#526475;border-radius:5px;box-shadow:var(--theme-shadow)}

/* Layer tools, search, and the hierarchy. */
body .left-panel .panel-title{padding:10px 10px 8px;gap:5px;grid-template-columns:repeat(2,minmax(0,1fr));border-bottom:1px solid var(--theme-border-soft)}
body .panel-title #uploadBtn{grid-column:auto;width:100%}
body .panel-title #kitLibraryBtn{grid-column:1/-1}
body .panel-title .layout-builder-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
body .panel-title .layout-builder-actions button{width:100%}
body .panel-title :is(#uploadBtn,#generateDesignBtn,#reanalyzeBtn){background:var(--surface);border-color:var(--line);color:#c7d3e1;margin:0}
body .panel-title #uploadBtn{border-color:#42675f;color:#bce7d8;background:#273e3c}
body .panel-title button::before{width:12px;height:12px;margin-right:4px;vertical-align:-2px}
body .left-panel .search-wrap{margin:8px 10px 6px;padding:0;min-height:20px}
body .filters{padding:4px 10px 8px;gap:4px;flex-wrap:wrap;overflow:visible;border-bottom:1px solid var(--theme-border-soft)}
body .filters button{background:transparent;border-color:transparent;color:#91a3b7}
body .filters button.active{background:var(--theme-selected);border-color:#3a625b;color:var(--theme-selected-text)}
body .filters>button[data-filter]{--button-height:26px}
body .layer-toolbar-actions{display:flex;align-items:center;gap:2px;margin-left:auto;padding-left:6px;border-left:1px solid var(--theme-border-soft)}
body .filters .layer-icon-btn{--button-height:16px;width:16px;min-width:16px;flex:none;padding:0!important;border:0;border-radius:3px!important}
body .filters .layer-icon-btn svg{width:16px;height:16px;flex:none}
body .filters #createEmptyNodeBtn{color:var(--accent)}
body .filters #createEmptyNodeBtn:hover{background:var(--soft-accent);border-color:#42675f;color:#d4fff2}
body .filters .layer-icon-danger:hover:not(:disabled){background:#442e37;border-color:#704651;color:#ffc0bc}
body .filters .layer-follow-option{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:16px;height:16px;padding:0;margin:0!important;margin-left:auto!important;border:0;border-radius:3px;color:#91a3b7;cursor:pointer}
body .filters .layer-follow-option::before{content:'';width:16px;height:16px;flex:none;background:currentColor;mask:var(--ui-focus) center/contain no-repeat;-webkit-mask:var(--ui-focus) center/contain no-repeat;pointer-events:none}
body .filters #followCanvasSelection{position:absolute;inset:0;width:100%!important;height:100%!important;max-height:none!important;opacity:0;cursor:pointer}
body .filters .layer-follow-option:has(input:checked){color:var(--theme-selected-text);background:var(--theme-selected);box-shadow:inset 0 0 0 1px #3a625b}
body .filters .layer-follow-option:hover{color:var(--text);background:var(--hover);box-shadow:inset 0 0 0 1px #566575}
body .filters .layer-follow-option:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:1px}
body .tree-hint{color:#6e8398;padding:4px 10px}
body #elementList{padding:6px 0}
body #elementList .layer{height:20px;min-height:20px;gap:4px;padding-block:0;border-radius:3px;border:1px solid transparent;background:transparent;margin:0 4px;color:#bac9da}
body #elementList .layer{width:calc(100% - 8px)}
body #elementList :is(.layer-eye,.layer-lock){--button-height:20px;width:22px;min-width:22px;flex:none;padding:0!important;border-radius:3px!important;color:#a8b8cb}
body #elementList :is(.layer-eye,.layer-lock) svg{width:16px;height:16px;flex:none;stroke-width:1.9}
body #elementList :is(.tree-caret,.layer-more){--button-height:20px;width:18px;padding:0!important}
body #elementList :is(.tree-caret,.layer-more) svg{width:18px;height:18px;flex:none}
body #elementList .layer-eye:hover:not(:disabled){background:#72cebd1c;color:#b3f5e3}
body #elementList .layer-lock:hover:not(:disabled),body #elementList .layer-lock.active{background:#ddb47e15;color:#efc385}
body #elementList .layer-lock.inherited{color:#8f9cad}
body #elementList .layer-hidden .layer-eye{color:#77889c}
body #elementList .layer-eye:disabled{opacity:.5}
body #elementList :is(.layer-eye,.layer-lock):focus-visible{outline:2px solid var(--accent);outline-offset:-1px}
body #elementList .symbol{width:18px;height:18px}
body #elementList .symbol svg{width:18px;height:18px}
body .layer-root-drop{display:flex;align-items:center;justify-content:center;box-sizing:border-box;height:20px;min-height:20px;padding:0;margin:8px 10px;border-color:#384953;color:#7f9a9f;border-radius:3px;line-height:18px}
body #elementList .layer:hover{background:#252f3b}
body #elementList .layer.selected{background:var(--theme-selected);border-color:#3d6c61;box-shadow:inset 2px 0 var(--accent)}
body #elementList .layer .layer-copy strong{font-size:12px;line-height:18px;font-weight:400;color:inherit}
body #elementList .layer-parent .layer-copy strong{font-weight:600;color:#d5e2ef}
body .left-bottom{border-top:1px solid var(--theme-border-soft);background:var(--theme-subtle);color:#7e91a6;padding:6px 10px}
body :is(.empty-inspector,.list-empty){color:#7d91a6}

/* Canvas chrome stays quiet around artwork. */
body .layer-arrange-menu>summary{color:var(--text);background:var(--surface);border-color:var(--line)}
body .layer-arrange-menu>summary:hover,body .layer-arrange-menu[open]>summary{background:var(--hover);border-color:#566575}
body .layer-arrange-menu>summary:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
body .layer-arrange-menu>div{background:var(--theme-raised);border-color:var(--line);box-shadow:var(--theme-shadow)}
body .layer-arrange-menu p{color:var(--muted)}
body .layer-arrange-menu button{background:transparent;border-color:transparent;color:var(--text)}
body .layer-arrange-menu button:hover:not(:disabled){background:var(--hover);border-color:#566575;color:#f1f5fa}
body .layer-arrange-menu button:disabled{color:#8794a6;opacity:1}
body .canvas-panel>#previewControls{box-sizing:border-box;height:30px;min-height:30px;max-height:30px;background:#1e2631;border-color:var(--line);padding:0 9px;align-items:center;flex-wrap:nowrap;gap:4px;column-gap:4px!important;row-gap:4px!important}
body #previewControls>.canvas-toolstrip{box-sizing:border-box;height:28px;min-height:0;margin-top:0;padding-block:0;align-items:center;flex-wrap:nowrap}
body .preview-controls>button{background:#27313e;border-color:#3c4858;color:#afbed0}
body .preview-controls :is(.preview-views,.preview-modes){display:flex;align-items:center;flex:none;background:transparent;border:0;border-radius:3px;padding:0;gap:4px}
body .preview-views button,body .preview-modes button{background:transparent;border-color:transparent}
body .preview-views button.active,body .preview-modes button.active,body #interactionPreviewBtn.active{background:#344c4b;color:#d0f4e9;border-color:#4a7066}
body :is(#floatingChatLauncher,#headerChatLauncher,#layerView,#allView,#compositionView){--button-height:16px;display:inline-flex;align-items:center;justify-content:center;width:16px;min-width:16px;flex:none;padding:0!important;font-size:0!important;line-height:0!important;border:0;border-radius:3px!important}
body :is(#floatingChatLauncher,#headerChatLauncher){--button-icon:var(--ui-sparkles)}
body #layerView{--button-icon:var(--ui-focus)}
body #allView{--button-icon:var(--ui-grid-2x2)}
body #compositionView{--button-icon:var(--ui-layers)}
body :is(#floatingChatLauncher,#headerChatLauncher,#layerView,#allView,#compositionView)::before{content:'';display:block!important;width:16px;height:16px;margin:0;flex:none;background:currentColor;mask:var(--button-icon) center/contain no-repeat;-webkit-mask:var(--button-icon) center/contain no-repeat}
body :is(#floatingChatLauncher,#headerChatLauncher,#layerView,#allView,#compositionView)::after{content:none!important}
body #previewControls #interactionPreviewBtn{--button-height:16px;display:inline-flex;align-items:center;justify-content:center;width:16px;min-width:16px;flex:none;margin:0;padding:0!important;font-size:0!important;line-height:0!important;border:0;border-radius:3px!important}
body #previewControls #interactionPreviewBtn::before{content:'';display:block;width:16px;height:16px;margin:0;flex:none;background:currentColor;mask:var(--ui-play) center/contain no-repeat;-webkit-mask:var(--ui-play) center/contain no-repeat}
body :is(#screenPreviewBtn,#adjustRectanglesBtn,#previewMore>summary){--button-height:16px;display:inline-flex;align-items:center;justify-content:center;width:16px;min-width:16px;height:16px;min-height:16px;max-height:16px;box-sizing:border-box;flex:none;padding:0!important;font-size:0!important;line-height:0!important;border:0;border-radius:3px!important}
body #screenPreviewBtn{--button-icon:var(--ui-expand)}
body #adjustRectanglesBtn{--button-icon:var(--ui-move)}
body #previewMore>summary{--button-icon:var(--ui-settings-2)}
body #previewControls :is(#screenPreviewBtn,#adjustRectanglesBtn,#previewMore>summary)::before{content:'';display:block;width:16px;height:16px;margin:0;flex:none;background:currentColor;mask:var(--button-icon) center/contain no-repeat;-webkit-mask:var(--button-icon) center/contain no-repeat}
body #previewMore>summary::after{content:none}
body #previewMore>summary:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
body .canvas-toolstrip{min-height:28px;padding:4px 0;gap:5px;border-top:1px solid var(--theme-border-soft);margin-top:3px}
body .toolbar .tools{gap:2px;align-items:center}
body .toolbar .tools button{background:transparent;border-color:transparent;color:#95a8bb}
body .toolbar .tools button.active{background:#2c4844;border-color:#4b7468;color:#b5eddb}
body .toolbar .divider{background:#394553;margin:0 5px;height:14px}
body :is(.canvas-info,.canvas-footer){background:var(--theme-subtle);color:#7f93aa;border-color:var(--theme-border-soft)}
body .viewport{background-color:#151c25}
body .canvas-selection-toolbar{background:#232d3a;border-color:#4b5b6e;border-radius:5px;box-shadow:0 6px 22px #0004}
body :is(.preview-extra,.workspace-layout-menu,.layer-menu,.ai-tools-menu,.region-context-menu){background:#222c38;border-color:#46596b;border-radius:5px;box-shadow:0 12px 35px #0006}
body :is(.preview-extra,.layer-menu,.ai-tools-menu) button{background:transparent}

/* Inspector: one header per group, consistent content gutters. */
body .right-panel #inspector{padding:10px 12px}
body .right-panel .element-preview{background:var(--checker);border-color:#354250;border-radius:3px;overflow:hidden}
body .right-panel .inspector-identity{margin:8px 0;gap:2px}
body .right-panel .inspector-section{border-color:var(--theme-border-soft);margin-top:8px;background:transparent}
body .right-panel .inspector-section>summary{background:var(--theme-raised);color:#cad9e7;padding:4px 12px;min-height:26px;border-block:1px solid #ffffff03}
body .right-panel .inspector-section>summary:hover{background:#2a3542}
body .right-panel .inspector-section>summary::before{width:12px;height:12px;color:#94b3bb}
body .right-panel .inspector-section>.inspector-section-body{padding:8px 12px}
body .right-panel .property-row .property-label{color:#a1b0c1}
body .right-panel .property-row:hover .property-label{color:#d2dce8}
/* Reserve the compact value width for digits; keyboard arrows still step numbers. */
body :is(.coords,.slice-grid,.color-rgba) input[type=number]{appearance:textfield;padding-inline:2px!important}
body :is(.coords,.slice-grid,.color-rgba) input[type=number]::-webkit-inner-spin-button,
body :is(.coords,.slice-grid,.color-rgba) input[type=number]::-webkit-outer-spin-button{appearance:none;margin:0}
body .right-panel :is(.layer-project-controls,.add-component){padding-top:6px;margin-top:6px}
body .right-panel .layer-order-buttons{gap:2px}
body .right-panel :is(.resource-properties,.fill-preview-options){border-color:var(--theme-border-soft);background:transparent}
body .right-panel :is(.resource-suggestion,#nineSliceDetails)>summary{color:#94acbe;padding:7px 0}
body .right-panel :is(.tip,.resource-hint){color:#8395aa}

/* Shared dialog frame, covering account/admin, project and creation panels. */
body dialog.panel-base{background:var(--panel);color:var(--text);border:1px solid #4b5b6e;border-radius:6px;box-shadow:var(--theme-shadow);max-width:calc(100vw - 32px)}
body #resourceDeleteDialog{width:calc(20vw - 6.4px)}
@media(max-width:640px){body #resourceDeleteDialog{width:calc(100vw - 32px)}}
body dialog::backdrop{background:#080d16b8;backdrop-filter:blur(3px)}
body .panel-base>.panel-header{background:var(--theme-raised);border-color:#3a4858;padding:12px 48px 12px 18px;margin:0}
body .panel-base>.panel-header h2{font-size:14px;line-height:22px;font-weight:600;letter-spacing:0;color:#e1eaf4}
body .panel-base>.panel-header :is(p,small){color:#8ea4b9;letter-spacing:0}
body .dialog-framed>.dialog-body{padding:16px 18px 18px;background:var(--panel)}
body button.dialog-close{min-width:20px;width:20px;top:12px;right:12px;background:transparent;border-color:transparent;border-radius:3px!important;box-shadow:none}
body button.dialog-close{padding:0!important}
body button.dialog-close svg{width:14px;height:14px;flex-shrink:0}
body button.dialog-close:hover{background:#3e3038;border-color:#76505b;color:#edbbbc}
body .dialog-actions{gap:6px;align-items:center;flex-wrap:wrap;margin-top:16px;padding-top:12px;border-top:1px solid var(--theme-border-soft)}
body .dialog-actions>.tip{margin:0;margin-right:auto}
body dialog :is(h3,h4){color:#bdd0e1;font-size:12px;font-weight:600}
body .account-panel .account-balance{background:#202e34;border-color:#3c575d;border-radius:4px;padding:14px;margin:0 0 14px}
body .account-panel .account-balance strong{font-size:26px;color:#acddce}
body .account-panel .account-section{background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;margin:0}
body .account-panel .account-section>summary{background:var(--theme-raised);padding:8px 10px;color:#c3d2e3}
body .account-panel .account-section-body{padding:12px 10px 16px}
body .account-panel :is(.account-form-grid,.account-price-grid){column-gap:14px!important}
body :is(.admin-user-row,.account-ledger-row,.membership-order){padding:10px 0;border-color:var(--theme-border-soft)}
body .admin-user-row>div:last-child{display:flex;gap:4px;flex-wrap:wrap}
body .account-tabs{gap:2px;border-bottom:1px solid var(--line);padding-bottom:8px}
body .account-tabs button.active{background:var(--theme-selected);border-color:#4d766b;color:#c8efdf}

/* Generation forms and selection tools: flatter groups, aligned controls. */
body .design-columns{gap:20px}
body .design-dimensions{margin:4px 0}
body .design-style-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:16px!important}
body .design-style-filters .property-row{grid-template-columns:105px minmax(0,1fr)!important}
body .design-generation :is(#designSubmit,#designAdopt){background:#34665f;border-color:#4a8a7d;color:#e0fff5}
body .design-generation footer{margin-top:16px;padding-top:12px;border-top:1px solid var(--theme-border-soft)}
body .design-result{background:var(--theme-subtle);border-color:var(--line);border-radius:4px;padding:14px}
body :is(.design-style-filters,.layout-generator-settings){gap:8px}
body .recognition-regions-dialog .region-tools{background:var(--theme-subtle);border-color:var(--line);border-radius:4px;padding:10px;gap:8px}
body .recognition-regions-dialog .region-auto-settings{display:grid;grid-template-columns:minmax(140px,1fr) 100px auto minmax(160px,1fr) auto;gap:6px!important;background:transparent;border:0;padding:4px 0}
body .region-auto-settings>.property-row{grid-template-columns:max-content minmax(0,1fr)!important;margin:0!important;align-self:center}
body .region-auto-settings>.region-inline-hint{grid-column:1/-1}
body .recognition-regions-dialog .region-mode-switch{background:var(--panel);border-color:var(--line);border-radius:3px}
body .region-mode-switch button.active{background:var(--theme-selected);color:var(--theme-selected-text)}
body :is(.target-choice,.storage-choice){border-color:var(--line);background:var(--theme-subtle);border-radius:4px}

/* Resource galleries, sprite editors, project browser, and chat. */
body .dock-workspace #resourceBrowser{background:var(--panel);padding:10px}
body #resourceBrowser .resource-tools{--property-height:20px;--button-height:20px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 6px;padding:0 0 8px;border-bottom:1px solid var(--theme-border-soft)}
body #resourceBrowser .resource-toolbar-search{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;min-width:0}
body #resourceBrowser .resource-filter-field{display:grid;grid-template-columns:26px minmax(0,1fr);align-items:center;gap:4px;min-width:0;margin:0;color:var(--muted)}
body #resourceBrowser .resource-filter-field>span{white-space:nowrap}
body #resourceBrowser .resource-tools :is(#resourceSearch,#resourceFilter,#resourceOwner,#resourceType,#resourceTagFilter){grid-column:auto;grid-row:auto;width:100%;min-width:0;margin:0;text-overflow:ellipsis}
body #resourceBrowser #importResourceBtn{--button-height:20px;grid-column:auto;grid-row:auto;margin:0;color:#bce7d8;background:#273e3c;border-color:#42675f}
body .resource-grid{gap:6px}
body .resource-card{background:#202a35;border:1px solid #344454;border-radius:4px;padding:6px}
body .resource-card:hover{background:#2a3744;border-color:#617489}
body .resource-card.selected{background:#263d3e;border-color:#6fae9c;box-shadow:inset 0 0 0 1px #6fae9c33}
body .resource-card img{border-radius:2px;background:var(--checker)}
body :is(.resource-atlas-tree,.kit-sheets,.atlas-item,.kit-sheet-card){background:#202a35;border-color:#374758;border-radius:4px}
body :is(.resource-dialog-heading,.screen-preview-heading,.sprite-zoom-heading){background:var(--theme-raised);border-color:var(--line)}
body .right-panel #resourceDialog{box-sizing:border-box;width:100%;max-width:100%;min-width:0;padding:10px 12px}
body #resourceDialog .resource-dialog-heading{margin:0 -12px 12px;padding:8px 12px;border-bottom:1px solid var(--line);gap:8px}
body #resourceDialog .resource-dialog-heading h2{font-size:13px;font-weight:600}
body #resourceDialog .dialog-actions{gap:4px}
body #resourceDialog :is(#resourceMeta,#resourceDialogInfo){overflow-wrap:anywhere;color:var(--muted);font-size:11px;line-height:1.7}
body #resourceDialog #resourceUseList{min-width:0;max-width:100%}
body #resourceDialog #resourceUseList button{max-width:100%;overflow:hidden;text-overflow:ellipsis}
body :is(.material-toolbar,.sprite-dialog-tools,.sprite-properties-strip){background:var(--theme-subtle);border-color:var(--line);border-radius:3px}
body :is(.board-crop-settings,.board-crop-group,.material-properties){border-color:var(--theme-border-soft)}
body #resourceSpriteDialog.material-studio .board-crop-fields:not(:has(>button,>select)){
 display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:2px!important;
}
body #resourceSpriteDialog.material-studio .board-crop-fields>.property-row{min-width:0!important;flex-basis:0;width:auto!important}
body #resourceSpriteDialog.material-studio .board-nine-slice-controls .board-crop-fields:not(:has(>button,>select)){grid-template-columns:repeat(2,minmax(0,1fr))!important}
body #resourceSpriteDialog.material-studio .board-crop-fields:has(>button){display:flex!important;gap:4px!important;flex-wrap:wrap!important}
body #resourceSpriteDialog.material-studio .board-crop-fields:has(>button)>.property-row{flex:1 0 100%;min-width:0!important}
body #resourceSpriteDialog.material-studio :is(.board-crop-group,.material-card){padding:10px;background:var(--theme-raised);border-color:var(--line);border-radius:4px;box-shadow:none}
body #resourceSpriteDialog .board-crop-settings .board-crop-group+.board-crop-group{padding-left:10px;border-left:1px solid var(--line)}
body #resourceSpriteDialog .sprite-dialog-tools{padding:8px 14px;gap:8px;flex-wrap:wrap}
body #resourceSpriteDialog .sprite-dialog-tools>.property-row{width:auto;flex:0 1 230px;min-width:180px!important}
body #resourceSpriteDialog .sprite-dialog-tools>.property-row:last-child{margin-left:auto!important}
body #resourceSpriteDialog.material-studio .board-slice-sync{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;min-width:0}
body #resourceSpriteDialog.material-studio .board-slice-sync>.property-row{grid-column:1/-1;min-width:0!important}
body #resourceSpriteDialog.material-studio .board-slice-sync button{min-width:0;width:100%}
body #resourceSpriteDialog.material-studio .board-crop-fields input[type=number]{appearance:textfield;padding-inline:2px!important}
body #resourceSpriteDialog.material-studio .board-crop-fields input[type=number]::-webkit-inner-spin-button{appearance:none;margin:0}
body .material-studio .material-properties{background:var(--panel)}
body :is(.atlas-sprite-description,.atlas-settings-pane){background:var(--panel);border-color:var(--line);border-radius:4px}
body .screen-preview-settings{background:var(--panel);border-color:var(--line);padding:14px}
body.project-management-active #projectManagementMain{display:grid;grid-template-columns:minmax(0,1fr);place-items:center;box-sizing:border-box;width:100%;max-width:none;min-height:calc(100dvh - var(--editor-header-height));padding:24px 16px;margin:0}
body.project-management-active :is(.workspace,.review-log-console){display:none}
body.project-management-active #projectManagementMain #projectsPanelDialog[open]{display:flex;width:720px;min-width:0;max-width:100%;max-height:calc(100dvh - var(--editor-header-height) - 48px);margin:0;background:var(--panel);border:1px solid #3d4b5a;border-radius:8px;box-shadow:var(--theme-shadow);--button-height:20px}
body #projectsPanelDialog>.dialog-top{padding:16px 48px 14px 20px;background:var(--theme-raised)}
body #projectsPanelDialog>.dialog-top h2{font-size:16px;line-height:24px}
body #projectsPanelDialog>.dialog-top p{margin-top:4px;color:var(--muted);font-size:12px}
body #projectsPanelDialog>.dialog-body{display:flex;flex-direction:column;gap:12px;padding:16px 20px;overflow:auto}
body #projectsPanelDialog .projects-panel-toolbar{flex:none;gap:8px;margin:0}
body #projectsPanelDialog .projects-panel-help{flex:none;margin:0;color:var(--muted);font-size:11px;line-height:1.7}
body #projectsPanelDialog .projects-panel-help summary{width:fit-content;cursor:pointer;color:#9caec0}
body #projectsPanelDialog .projects-panel-help summary:hover{color:var(--text)}
body #projectsPanelDialog .projects-panel-help p{margin:6px 0 0;padding-left:12px;border-left:2px solid var(--line)}
body #projectsPanelDialog .projects-panel-list{display:flex;flex-direction:column;flex:0 1 auto;min-height:0;max-height:none;gap:8px;padding:1px;overflow:auto}
body #projectsPanelDialog .projects-panel-item{display:grid;grid-template-columns:80px minmax(0,1fr) auto;gap:14px;background:#202a34;border:1px solid #354351;border-radius:5px;padding:12px;align-items:center}
body #projectsPanelDialog .projects-panel-item:hover{border-color:#516171;background:#242f3a}
body #projectsPanelDialog .projects-panel-item.current{background:#233735;border-color:#537c6f}
body #projectsPanelDialog .projects-panel-item>img{width:80px;height:64px;object-fit:contain;border-radius:4px;background:var(--theme-subtle);padding:4px}
body #projectsPanelDialog .projects-panel-item:has(>img[hidden])>.projects-panel-info{grid-column:1/3}
body .projects-panel-info{overflow-wrap:anywhere}
body .projects-panel-title strong{font-size:14px;font-weight:500;color:#dde8f3}
body #projectsPanelDialog .projects-panel-info>small{display:block;color:#91a4b6;font-size:11px;line-height:1.7;margin-top:4px}
body #projectsPanelDialog .projects-panel-actions{grid-column:auto;display:flex;justify-content:flex-end;flex-wrap:wrap;max-width:230px;gap:6px;padding:0;border:0}
body #projectsPanelDialog .dialog-actions{flex:none;gap:8px;margin:0;padding-top:12px;border-top:1px solid var(--theme-border-soft)}
body #projectsPanelDialog :is(#projectsPanelNote,#projectsPanelError){flex:none;margin:0}
body #projectsPanelDialog #projectsPanelError:empty{display:none}
@media(max-width:560px){
 body #projectsPanelDialog>.dialog-body{padding:14px}
 body #projectsPanelDialog .projects-panel-item{grid-template-columns:64px minmax(0,1fr);gap:10px}
 body #projectsPanelDialog .projects-panel-item>img{width:64px;height:56px}
 body #projectsPanelDialog .projects-panel-actions{grid-column:1/-1;max-width:none;padding-top:8px;border-top:1px solid var(--theme-border-soft)}
}
body .floating-element-chat{background:var(--panel);border-color:#46596d;border-radius:6px;box-shadow:var(--theme-shadow)}
body .floating-element-chat .chat-composer{background:var(--theme-subtle);border-color:var(--line);border-radius:4px;box-shadow:none}
body .floating-element-chat .chat-composer:focus-within{border-color:var(--line);box-shadow:none}
body #elementChatDialog .dialog-top{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px}
body #elementChatDialog .dialog-top h2{margin:0;line-height:24px}
body #elementChatDialog .chat-dialog-actions{position:static;display:flex;align-items:center;gap:4px;margin-left:auto}
body #elementChatDialog :is(.chat-dialog-actions button,#closeElementChat){--button-height:24px;position:static;display:inline-flex;align-items:center;justify-content:center;width:24px;min-width:24px;flex:none;margin:0;padding:0!important;line-height:0!important;border-radius:3px!important}
body #elementChatDialog .chat-dialog-actions svg{display:block;width:18px;height:18px;flex:none}
body #elementChatDialog .chat-prompt-label{display:block;margin:0 0 6px;color:var(--text);font-size:13px!important;line-height:20px!important}
body #elementChatDialog #elementChatMessage{display:block;width:100%;height:60px;min-height:60px!important;max-height:200px!important;padding:2px 8px!important;font-size:13px!important;line-height:18px!important;resize:vertical!important;background:var(--field);border:1px solid var(--line)!important;border-radius:4px!important}
body #elementChatDialog .chat-composer-footer{display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding-top:8px}
body #elementChatDialog .chat-context-actions{display:flex;align-items:center;flex:none;gap:2px;margin:0}
body #elementChatDialog .chat-context-actions>button.chat-icon-button{--button-height:20px;display:inline-flex;align-items:center;justify-content:center;width:20px;min-width:20px;flex:none;padding:0!important;line-height:0!important;border-radius:3px!important}
body #elementChatDialog .chat-context-actions svg{display:block;width:18px;height:18px;flex:none}
body #elementChatDialog .chat-composer-footer #elementChatModel{flex:1 1 140px;width:auto;min-width:100px;max-width:none;height:24px!important;min-height:24px!important;max-height:24px!important;margin:0}
body #elementChatDialog .chat-composer-footer>button{--button-height:24px}
body :is(.chat-task-card,.chat-sent){border-color:#3d4f61;background:#202d3b;border-radius:4px}
body #elementChatDialog :is(.chat-task-card,.chat-message){margin-block:2px}
body .chat-message.user{background:#263e3c;border-color:#3c645a}
body .review-status-row{background:var(--theme-subtle);border-color:var(--line)}
body .studio-grid-controls{border-color:var(--line);color:#92a5b9;gap:8px}
body #reviewLogPanel{background:#171f29;border-color:#4a5d72}
body .toast{background:#28443f;border-color:#527c6d;border-radius:4px;color:#d5f1e5;box-shadow:0 8px 24px #0005}

@media(max-width:1100px){
 body .header{padding-inline:10px;gap:0 8px}
 body .header #saveProjectBtn{width:auto;min-width:0}
 body .header .brand{min-width:140px}
 body .header #accountButton{max-width:190px}
 body .left-panel .panel-title{padding:8px;gap:4px}
 body .recognition-regions-dialog .region-auto-settings{grid-template-columns:repeat(2,minmax(0,1fr))}
 body .region-auto-settings>.region-inline-hint{grid-column:1/-1}
}
@media(max-width:760px){
 body .header .brand{min-width:100px}
 body .header .brand strong{font-size:14px;letter-spacing:1px}
 body .header #accountButton{max-width:145px}
 body .dialog-framed>.dialog-body{padding:12px}
 body #projectsPanelDialog .projects-panel-list{grid-template-columns:minmax(0,1fr)}
 body .design-columns{grid-template-columns:minmax(0,1fr)}
 body .region-auto-settings>.property-row{min-width:0}
}
/* Generation forms use full-width fields instead of the inspector's mini rows. */
body dialog.generation-form-panel{width:min(1040px,96vw)!important;max-width:1040px!important;max-height:90vh;border:1px solid var(--line);border-radius:10px;background:var(--panel);box-shadow:var(--theme-shadow);--button-height:30px}
body dialog.generation-form-panel.design-generation-compact{width:min(760px,96vw)!important;--generation-label-width:132px}
body dialog.generation-form-panel.layout-builder-dialog:not(.layout-material-mode){width:min(840px,96vw)!important;height:min(680px,90dvh)}
body .generation-form-panel>.panel-header{padding:16px 52px 16px 22px;background:var(--theme-raised)}
body .generation-form-panel>.panel-header h2{font-size:16px;line-height:24px}
body .generation-form-panel .generation-subtitle{margin:5px 0 0;font-size:12px;line-height:1.6;color:var(--muted)}
body .generation-form-panel>.dialog-body{padding:20px 22px;background:var(--panel);scroll-padding-block:16px;overscroll-behavior:contain}
body .generation-form-panel :is(form,section,.kit-gen-style,.kit-gen-settings){min-width:0}
body .generation-form-panel label{display:flex;flex-direction:column;align-items:stretch;gap:4px;margin:0 0 12px;color:#becbd9;font-weight:500;font-size:12px!important;line-height:20px!important}
body .generation-form-panel :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){width:100%;box-sizing:border-box;height:var(--generation-input-height,20px);min-height:var(--generation-input-min-height,20px);max-height:var(--generation-input-max-height,20px);padding:0 6px;border:1px solid var(--line);border-radius:3px;background:var(--field);color:var(--text);font-size:12px;line-height:18px;transition:border-color .15s,background .15s}
body .generation-form-panel textarea{--generation-input-height:60px;--generation-input-min-height:60px;--generation-input-max-height:none;padding:8px 10px;font-size:13px;line-height:1.6;resize:vertical!important;overflow:auto}
body dialog.generation-form-panel[data-property-layout="custom"] :is(input,select,textarea):is(:focus,:focus-visible){border-color:#72cebd!important;outline:2px solid #72cebd24!important;outline-offset:1px;background:#18232c}
body .generation-form-panel button:not(.dialog-close):not(:has(img,canvas)){border-radius:5px!important;padding-inline:12px!important}
body .generation-form-panel .dialog-close{--button-height:26px;top:15px;right:16px;min-width:26px;width:26px;padding:0!important}
body .generation-form-panel .design-muted{margin:0 0 14px;font-size:12px;line-height:1.7;color:var(--muted);overflow-wrap:anywhere}
body .generation-form-panel :is(#designStatus,#layoutBuilderStatus,#kitLibraryStatus):empty{display:none}
body .generation-form-panel :is(#designStatus,#layoutBuilderStatus,#kitLibraryStatus):not(:empty){margin:14px 0 0;padding:10px 12px;border-left:2px solid var(--accent);border-radius:3px;background:var(--theme-subtle);line-height:1.7;overflow-wrap:anywhere}
body .generation-form-panel .generation-section-title{margin:0 0 16px;font-size:13px;line-height:20px;font-weight:600;color:var(--text)}
body .generation-form-panel details{margin:8px 0 0;border-top:1px solid var(--theme-border-soft);padding-top:12px}
body .generation-form-panel summary{color:var(--muted);font-size:12px;line-height:22px;cursor:pointer}
body .generation-form-panel details[open]>summary{margin-bottom:12px;color:var(--text)}
body .generation-form-panel .design-columns{display:grid;grid-template-columns:minmax(0,1fr);gap:20px}
body .generation-form-panel .design-settings{padding:20px 0 0;border-top:1px solid var(--theme-border-soft);border-left:0}
body .generation-form-panel .design-settings label:has(> :is(input,select)){display:grid;grid-template-columns:var(--generation-label-width,132px) minmax(0,1fr);align-items:center;gap:8px;min-width:0;white-space:nowrap;margin-bottom:8px}
body .generation-form-panel .design-settings label> :is(input,select){width:100%;min-width:0;max-width:100%;margin:0}
body .generation-form-panel .design-settings input[type=number]{appearance:textfield}
body .generation-form-panel .design-settings input[type=number]::-webkit-inner-spin-button{appearance:none;margin:0}
body .generation-form-panel .design-settings .design-dimensions{grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%;margin-bottom:12px}
body .generation-form-panel .design-settings .design-dimensions>label{grid-template-columns:var(--generation-label-width,132px) minmax(100px,1fr);margin-bottom:0}
body .generation-form-panel .design-settings .design-dimensions input{min-width:100px;width:100%;justify-self:stretch}
body .generation-form-panel .design-dimensions{column-gap:12px!important;row-gap:0!important;margin:0}
body .generation-form-panel .design-style-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 10px!important;margin-top:18px;padding-top:16px;border-top:1px solid var(--theme-border-soft)}
body .generation-form-panel .design-style-filters>p{grid-column:1/-1;margin:-4px 0 12px;font-size:11px}
body .generation-form-panel .generation-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin:20px 0 0;padding:16px 0 0;border-top:1px solid var(--line);background:var(--panel)}
body .generation-form-panel .generation-actions> :is(span,p){flex:1 1 280px;margin:0;color:var(--muted);font-size:12px;line-height:1.7}
body .generation-form-panel .generation-actions>button{flex:0 0 auto}
body .generation-form-panel :is(#designSubmit,#newLayoutForm [type=submit],#generateLayoutForm [type=submit],#kitGenerateBtn){--button-height:34px;min-width:130px;background:#34665f;border-color:#4a8a7d;color:#e0fff5;font-weight:500}
body .generation-form-panel :is(#designSubmit,#newLayoutForm [type=submit],#generateLayoutForm [type=submit],#kitGenerateBtn):hover:not(:disabled){background:#3e7d70;border-color:#71bba7}
body .generation-form-panel #layoutIntroNote{margin:0 0 18px;padding-bottom:16px;border-bottom:1px solid var(--theme-border-soft);color:var(--muted);font-size:12px;line-height:1.8}
body .generation-form-panel .layout-create-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:0 20px}
body .generation-form-panel .layout-create-fields>*{grid-column:1/-1;min-width:0}
body .generation-form-panel .layout-create-fields>.layout-name-field{grid-column:1}
body .generation-form-panel .layout-create-fields>.design-dimensions{grid-column:2}
body .generation-form-panel #layoutLibrary{--button-height:20px;--toggle-size:18px;margin:0 0 18px;padding:14px;border:1px solid var(--line);border-radius:6px;background:var(--theme-subtle)}
body .generation-form-panel #layoutLibrary legend{padding:0 6px;color:var(--muted);font-size:12px}
body .generation-form-panel #layoutLibrary .layout-library-item{box-sizing:border-box;flex-direction:row;align-items:center;gap:8px;height:20px;min-height:20px;max-height:20px;margin:0;padding:0 4px;border-radius:4px;background:var(--panel)}
body .generation-form-panel #layoutLibrary .layout-library-item>input[type=checkbox]{box-sizing:border-box;flex:0 0 18px;width:18px!important;min-width:18px!important;max-width:18px!important;height:18px!important;min-height:18px!important;max-height:18px!important;margin:0!important;align-self:center}
body dialog.generation-form-panel #layoutLibrary input[type=checkbox]:is(:focus,:focus-visible){outline-offset:-2px!important}
body .generation-form-panel .gen-block{margin:0 0 20px;padding:0 0 20px;border:0;border-bottom:1px solid var(--theme-border-soft);border-radius:0;background:transparent}
body .generation-form-panel .gen-block h4{margin:0 0 16px;color:var(--text);font-size:13px;line-height:20px}
body .generation-form-panel .gen-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 16px}
body .generation-form-panel .gen-actions{position:static;bottom:auto;border-radius:0}
body .generation-form-panel .kit-usage{margin:0 0 20px;padding:0 0 14px;border:0;border-bottom:1px solid var(--theme-border-soft)}
body .generation-form-panel .kit-usage p{margin:0;max-width:84ch}
body .generation-form-panel .kit-gen{padding:0;margin:0 0 20px;border:0;border-radius:0;background:transparent}
body .generation-form-panel .kit-gen-grid{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:24px}
body .generation-form-panel .kit-gen-style{gap:0}
body .generation-form-panel .kit-gen-settings{padding-left:24px;border-left:1px solid var(--theme-border-soft)}
body .generation-form-panel .kit-gen-sheet{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;align-items:start;margin:0}
body .generation-form-panel .kit-gen-sheet label{align-items:stretch;gap:4px}
body .generation-form-panel .kit-gen-sheet>:is(span,p){grid-column:1/-1;min-width:0}
body .generation-form-panel .kit-output{justify-self:start;margin:0 0 10px;border-color:#42675f;border-radius:4px;background:var(--soft-accent);color:#bce7d8;padding:4px 8px;font-size:11px;white-space:normal}
body .generation-form-panel .kit-pack-row{display:flex;align-items:flex-end;gap:10px;padding-top:16px;border-top:1px solid var(--theme-border-soft)}
body .generation-form-panel .kit-pack-row label{flex:1;max-width:400px;margin:0}
body .generation-form-panel .kit-pack-row button{--button-height:20px;flex:none}
body .generation-form-panel .kit-selection{padding-top:18px;border-top:1px solid var(--line)}
body .generation-form-panel .kit-selection-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:14px}
body .generation-form-panel .kit-selection-heading h3{margin:0}
body .generation-form-panel .kit-pick-actions{display:flex;flex-wrap:wrap;gap:6px}
body .generation-form-panel .kit-pick-actions button{--button-height:26px;background:transparent;color:var(--muted)}
body .generation-form-panel .kit-chips{gap:7px;max-height:260px;overflow:auto;padding:0 0 4px;border:0}
body .generation-form-panel .kit-chips>.kit-chip{--button-height:28px;border-color:var(--line);background:var(--theme-subtle);color:var(--muted)}
body .generation-form-panel .kit-chips>.kit-chip.checked{background:var(--soft-accent);border-color:#466a63;color:var(--theme-selected-text)}
body .generation-form-panel .kit-chips>.kit-chip:hover{border-color:var(--accent);color:var(--text)}
body .generation-form-panel .kit-sheets{padding:14px;margin-bottom:20px}
body .generation-form-panel .kit-sheets header{margin:0}
/* Compact caption/value rows; prompt fields keep their multiline layout. */
body :is(.layout-builder-dialog,.kit-library-dialog).generation-form-panel label:has(> :is(input:not([type=checkbox]):not([type=radio]),select)){
 display:grid;grid-template-columns:var(--generation-inline-label-width,90px) minmax(0,1fr);align-items:center;gap:8px;min-width:0
}
body :is(.layout-builder-dialog,.kit-library-dialog).generation-form-panel label>span:first-child{white-space:nowrap}
body :is(.layout-builder-dialog,.kit-library-dialog).generation-form-panel label> :is(input,select){min-width:0;width:100%;margin:0}
body :is(.layout-builder-dialog,.kit-library-dialog).generation-form-panel label>.design-muted{grid-column:2;margin:0}
body .generation-form-panel.layout-builder-dialog .design-dimensions{grid-template-columns:repeat(2,minmax(0,1fr))!important;--generation-inline-label-width:64px}
body .generation-form-panel .kit-gen-sheet{--generation-inline-label-width:64px}
body .generation-form-panel .kit-pack-row{align-items:center}
body .generation-form-panel .kit-pack-row label{max-width:600px}
/* Keep action bars outside the independently scrolling form content. */
body dialog.generation-form-panel:is(.layout-material-mode,.kit-library-dialog){height:min(840px,90dvh)}
body .generation-form-panel:is(.layout-builder-dialog,.kit-library-dialog)>.dialog-body{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:0}
body .generation-form-panel :is(#newLayoutForm,#generateLayoutForm){display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;order:1}
body .generation-form-panel .generation-scroll{flex:1;min-height:0;overflow:auto;padding:20px 22px;scroll-padding-block:16px;overscroll-behavior:contain}
body .generation-form-panel :is(#newLayoutForm>.generation-actions,#generateLayoutForm>.gen-actions,.dialog-body>.kit-gen-actions){position:static;flex:none;gap:10px;width:100%;margin:0;padding:12px 22px;border-top:1px solid var(--line);background:var(--panel)}
body .generation-form-panel.layout-builder-dialog #layoutBuilderStatus:not(:empty){flex:none;margin:0;padding:8px 22px}
body .generation-form-panel.layout-builder-dialog #layoutPlanningProgress{flex:none;padding:8px 22px}
body .search-wrap>.property-row>.property-label{display:none!important}
body .search-wrap>.property-row{grid-template-columns:minmax(0,1fr)!important}
@media(max-width:760px){
 body .generation-form-panel>.panel-header{padding:12px 48px 12px 16px}
 body .generation-form-panel>.dialog-body{padding:16px}
 body .generation-form-panel .dialog-close{top:12px;right:12px}
 body .generation-form-panel :is(.design-columns,.kit-gen-grid,.layout-create-fields,.gen-grid){grid-template-columns:minmax(0,1fr);gap:0}
 body .generation-form-panel .layout-create-fields>:is(.layout-name-field,.design-dimensions){grid-column:1/-1}
 body .generation-form-panel :is(.design-settings,.kit-gen-settings){padding:20px 0 0;margin-top:6px;border-left:0;border-top:1px solid var(--theme-border-soft)}
 body .generation-form-panel .gen-grid{gap:12px}
 body .generation-form-panel .generation-actions> :is(span,p){flex-basis:100%}
 body .generation-form-panel #kitGenerateBtn{min-width:0;white-space:normal;height:auto!important;min-height:34px!important;max-height:none!important}
}
@media(max-width:520px){
 body .generation-form-panel .design-settings :is(.design-dimensions,.design-style-filters){grid-template-columns:minmax(0,1fr)!important}
 body .generation-form-panel .design-settings .design-dimensions{row-gap:8px!important}
}
/* Sprite editors manage their own compact rows instead of automatic property grids. */
body .sprite-edit-dialog:not(.material-studio){gap:2px;overflow:hidden;padding:0}
body .sprite-edit-dialog:not(.material-studio):not(.single){width:min(1120px,67.9vw);max-width:1120px}
body .sprite-edit-dialog:not(.material-studio)>header{flex:none;gap:10px;min-width:0}
body .sprite-edit-dialog:not(.material-studio)>header>h2{flex:1;min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:22px}
body .sprite-edit-dialog:not(.material-studio)>header>.sprite-edit-close{position:absolute;top:12px;right:12px}
body .sprite-edit-dialog:not(.material-studio) .sprite-edit-meta{flex:none}
body .sprite-edit-dialog:not(.material-studio) .sprite-dialog-tools{flex:none;display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px;padding:6px 8px;margin:0 12px 2px}
body .sprite-edit-dialog:not(.material-studio) .sprite-grid-toggle{display:flex;flex:none;align-items:center;gap:4px;white-space:nowrap;margin:0}
body .sprite-edit-dialog:not(.material-studio) .sprite-edit-mode{flex:1 1 220px;min-width:0;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .sprite-edit-dialog:not(.material-studio) .sprite-edit-extra{display:flex;flex-wrap:wrap;gap:2px 4px}
body .sprite-edit-dialog:not(.material-studio) .sprite-edit-body{flex:1;min-height:0;overflow:hidden;margin:0 12px}
body .sprite-edit-dialog:not(.material-studio) .sprite-edit-body>.board-crop-editor{flex:1;min-height:0;gap:2px}
body .sprite-edit-dialog:not(.material-studio) .sprite-entry-picker{display:flex;flex:0 0 auto;align-items:center;gap:8px;margin:0;padding:2px 0;min-width:0}
body .sprite-edit-dialog:not(.material-studio) .sprite-entry-picker>span{flex:none;color:var(--muted)}
body .sprite-edit-dialog:not(.material-studio) .sprite-entry-picker>select{flex:0 1 360px;min-width:0;width:100%;max-width:100%}
body .sprite-edit-dialog.single:not(.material-studio) .sprite-entry-picker{display:none}
body .sprite-edit-dialog:not(.material-studio) .sprite-edit-body .board-crop-viewport{flex:1 1 0;min-height:0;max-height:none;margin:0;padding:4px;border-radius:4px}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip{display:flex;flex:none;flex-wrap:wrap;align-items:center;gap:2px 8px;max-height:38%;overflow:auto;padding:4px 0 0}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip>.board-crop-settings{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);flex:1 0 100%;align-items:start;gap:12px;padding:6px 8px;border-radius:4px;min-width:0}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip .board-crop-group{display:flex;flex-direction:column;align-items:stretch;gap:2px;min-width:0}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip .board-crop-group+.board-crop-group{padding-left:12px}
body .sprite-edit-dialog.hide-slice:not(.material-studio) .sprite-properties-strip>.board-crop-settings{grid-template-columns:minmax(0,1fr)}
body .sprite-edit-dialog.hide-slice:not(.material-studio) .sprite-properties-strip .board-crop-group:last-child{display:none}
body .sprite-edit-dialog:not(.material-studio) .board-crop-group-title{margin:0;color:var(--muted);font-size:11px;line-height:20px;letter-spacing:0}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip .board-crop-fields{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px 8px!important;width:100%;max-width:none;min-width:0;margin:0}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip .board-crop-fields label{display:flex;flex-direction:row;align-items:center;gap:4px;width:auto;min-width:0;white-space:nowrap;margin:0}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip .board-crop-fields input{width:100%;min-width:0;flex:1}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip>.board-crop-fields:has(>button){grid-template-columns:minmax(120px,1fr) minmax(130px,1fr) minmax(220px,1.4fr) repeat(3,max-content);flex:1 0 100%;align-items:center;overflow-x:auto}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip>.board-crop-fields:has(>button)>label{height:20px;align-items:center}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip>.board-crop-fields:has(>button) label>select{flex:1;min-width:0;width:100%;max-width:none;align-self:center;margin:0;appearance:none;line-height:18px!important;padding:0 22px 0 6px!important;background:var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%238fa3b8' d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 6px center/8px 5px}
body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip .board-nine-slice-controls{display:grid!important;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:2px 10px;margin:0;padding:0;border:0;white-space:normal}
body .sprite-edit-dialog:not(.material-studio) .board-nine-slice-controls>label{display:flex;align-items:center;gap:4px;white-space:nowrap;margin:0}
body .sprite-edit-dialog:not(.material-studio) .board-nine-slice-controls>span{min-width:0;text-align:right;font-size:11px;color:var(--muted)}
body .sprite-edit-dialog:not(.material-studio) .board-nine-slice-controls>:is(.board-crop-fields,.board-slice-sync){grid-column:1/-1}
body .sprite-edit-dialog:not(.material-studio) .board-slice-sync{display:flex;flex-wrap:nowrap!important;align-items:center;gap:2px 4px;margin:0;white-space:nowrap}
body .sprite-edit-dialog:not(.material-studio) .board-slice-sync label{display:flex;flex-direction:row;flex:0 1 180px;align-items:center;gap:4px;min-width:0;margin:0}
body .sprite-edit-dialog:not(.material-studio) .board-slice-sync input{flex:1;min-width:0;width:100%}
body .sprite-edit-dialog:not(.material-studio) .board-slice-sync>button{flex:0 0 auto}
body .sprite-edit-dialog:not(.material-studio) .sprite-edit-note{flex:none;margin:2px 12px;line-height:16px}
body .sprite-edit-dialog:not(.material-studio)>footer{flex:none;gap:8px;margin:2px 0 0;padding:6px 12px 10px;border-top:1px solid var(--line)}
body .sprite-edit-dialog:not(.material-studio)>footer .sprite-edit-status{flex:1;min-width:0}
/* Material repair: 20px controls, visible 16px icons, and 2px between rows. */
body #resourceSpriteDialog.material-studio .material-workspace{grid-template-columns:100px minmax(0,1fr) clamp(280px,24vw,340px)}
body #resourceSpriteDialog.material-studio .material-tools{min-width:0;padding:10px 4px;gap:2px}
body #resourceSpriteDialog.material-studio .material-section-label{margin:0 0 4px;line-height:20px;letter-spacing:0}
body #resourceSpriteDialog.material-studio :is(.material-tools,.material-selection-modes) button{display:flex;flex-direction:row;align-items:center;justify-content:center;min-width:0;gap:4px;overflow:hidden}
body #resourceSpriteDialog.material-studio :is(.material-tools,.material-selection-modes) button svg{display:block;flex:0 0 16px;width:16px;height:16px}
body #resourceSpriteDialog.material-studio .material-tools button.active{background:var(--soft-accent);border-color:var(--accent);box-shadow:none}
body #resourceSpriteDialog.material-studio .material-properties{min-width:0;padding:10px;gap:8px}
body #resourceSpriteDialog.material-studio .material-card{gap:2px;padding:10px;min-width:0}
body #resourceSpriteDialog.material-studio.repair-mode .material-card{gap:2px;padding:10px}
body #resourceSpriteDialog.material-studio .material-card h3{margin:0 0 4px;line-height:20px}
body #resourceSpriteDialog.material-studio .material-card p{line-height:16px;overflow-wrap:anywhere}
body #resourceSpriteDialog.material-studio .material-selection{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:2px 4px}
body #resourceSpriteDialog.material-studio.repair-mode .material-selection{gap:2px 4px}
body #resourceSpriteDialog.material-studio .material-selection>*{grid-column:1/-1;min-width:0}
body #resourceSpriteDialog.material-studio .material-selection>label{grid-column:auto}
body #resourceSpriteDialog.material-studio .material-card .property-row{--property-label-width:76px;margin-bottom:0!important}
body #resourceSpriteDialog.material-studio .material-properties .property-fields{row-gap:2px!important}
body #resourceSpriteDialog.material-studio .material-selection>label.property-row{--property-label-width:52px}
body #resourceSpriteDialog.material-studio :is(.material-selection-options,.material-history,.material-selection-modes,.material-fill,.material-feather){gap:2px}
body #resourceSpriteDialog.material-studio .material-feather{display:grid;grid-template-columns:minmax(0,1fr)}
body #resourceSpriteDialog.material-studio .material-feather .property-row{--property-label-width:90px}
body #resourceSpriteDialog.material-studio .material-feather>button{width:100%}
body #resourceSpriteDialog.material-studio .material-ai label:has(#directEditInstruction){display:flex!important;flex-direction:column;align-items:stretch!important;gap:2px!important}
body #resourceSpriteDialog.material-studio #directEditInstruction{width:100%!important;min-height:60px!important;height:60px!important;max-height:240px!important;padding:4px 6px!important;resize:vertical!important;line-height:18px!important}
body #resourceSpriteDialog.material-studio .material-ai #confirmDirectEdit{margin-top:2px}
@media(max-width:900px){
 body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip>.board-crop-settings{grid-template-columns:minmax(0,1fr);gap:4px}
 body .sprite-edit-dialog:not(.material-studio) .sprite-properties-strip .board-crop-group+.board-crop-group{padding-left:0;border-left:0}
 body .sprite-edit-dialog:not(.material-studio) .sprite-edit-meta{display:none}
 body #resourceSpriteDialog.material-studio .material-workspace{grid-template-columns:100px minmax(0,1fr) 280px}
}
@media(prefers-reduced-motion:reduce){body button{transition:none}}
