/* v38 · one control rhythm across the editor. */
body.zaoba-editor{
  --zg-control-height:48px;
  --zg-control-icon:26px;
  --zg-control-gap:8px;
  --zg-control-row-gap:8px;
  --zg-control-pad:14px;
  --zg-control-radius:10px;
}
.zaoba-brand-logo{
  display:block;width:66px;height:66px;flex:0 0 66px;
  object-fit:contain;mix-blend-mode:multiply;
}
.zaoba-brand{gap:12px}
.workbench-toolbar{gap:16px}
.size-dropdown,.template-dropdown{gap:var(--zg-control-gap)}
.size-dropdown>.tool-art-icon,.template-dropdown>.tool-art-icon{width:var(--zg-control-icon);height:var(--zg-control-icon)}
.size-dropdown select,.template-dropdown select{height:var(--zg-control-height);min-height:var(--zg-control-height)}
.creation-tools{
  display:grid;grid-template-columns:repeat(3,122px);align-items:center;
  gap:var(--zg-control-row-gap);
}
.creation-tools.has-image-motif-upload{grid-template-columns:repeat(4,112px)}
.color-control{width:100%}
.creation-tools>button,.color-control>button{
  width:100%;height:var(--zg-control-height);min-height:var(--zg-control-height);
  gap:var(--zg-control-gap);padding:0 var(--zg-control-pad);
  border-radius:var(--zg-control-radius);
}
.tool-art-icon,.creation-tools .tool-art-icon,.back-zaoba .tool-art-icon,
.work-menu .tool-art-icon,.preview-model-button .tool-art-icon,
.save-secondary .tool-art-icon,.finish-button .tool-art-icon{
  width:var(--zg-control-icon);height:var(--zg-control-icon);
}
.back-zaoba,.work-menu button,.save-secondary,.preview-model-button,
.zaoba-editor .finish-button{
  min-height:var(--zg-control-height);height:var(--zg-control-height);
  display:inline-flex;align-items:center;justify-content:center;
  gap:var(--zg-control-gap);padding:0 var(--zg-control-pad);
  border-radius:var(--zg-control-radius);
}
.zaoba-editor .work-menu #openWorks{
  display:inline-flex;align-items:center;justify-content:center;
  gap:var(--zg-control-gap);line-height:1;
}
.work-menu{gap:var(--zg-control-row-gap)}
.work-menu button{font-size:13px}
.save-secondary{flex:0 0 122px;width:122px}
.workbench-bottom{gap:var(--zg-control-row-gap);padding-block:12px}
.history-tools{height:var(--zg-control-height);padding:1px 3px;gap:0}
.history-tools button{
  width:44px;height:44px;min-width:44px;min-height:44px;padding:0;
  display:grid;place-items:center;
}
.history-tools .tool-art-icon{width:24px;height:24px}
.history-tools>span{margin:0 2px}
.preview-model-button,.zaoba-editor .finish-button{
  flex:0 0 210px;width:210px;max-width:none;min-width:0;
  font-size:14px;box-shadow:2px 3px 0 #173f7313;
}
.zaoba-editor .finish-button{justify-content:center;gap:var(--zg-control-gap);padding-inline:var(--zg-control-pad)}
.zaoba-editor :is(.dialog-actions,.model-actions,.work-preview-actions,.works-toolbar){gap:var(--zg-control-row-gap)}
.zaoba-editor :is(.dialog-actions,.model-actions,.work-preview-actions,.works-toolbar) button:not(.icon-button){
  min-height:44px;padding:8px 16px;border-radius:var(--zg-control-radius);
}
.zaoba-editor .icon-button,.popover-heading button{
  width:44px;height:44px;min-width:44px;min-height:44px;padding:0;
  display:grid;place-items:center;line-height:1;
}
.zaoba-editor .image-motif-close{
  width:44px;height:44px;min-width:44px;min-height:44px;padding:0;
  line-height:1;display:grid;place-items:center;
}
.zaoba-editor :is(.dialog-actions,.model-actions,.work-preview-actions,.works-toolbar,.work-actions,.image-motif-actions){gap:var(--zg-control-row-gap)}
.zaoba-editor :is(.dialog-actions,.model-actions,.work-preview-actions,.works-toolbar,.work-actions,.image-motif-actions) button,
.zaoba-editor .works-undo button{
  min-height:44px;padding:8px var(--zg-control-pad);line-height:1.35;
}
.zaoba-editor #canvasQuickbar{gap:4px;padding:4px 6px}
.zaoba-editor #flipControls{display:flex;gap:4px;padding:0}
.zaoba-editor #canvasQuickbar button{min-height:44px;min-width:44px;padding:4px 10px}
.zaoba-editor #canvasQuickbar #quickDone{width:44px;padding:0}
.zaoba-editor .icon-categories button{min-height:44px}
.zaoba-editor button:active,.zaoba-editor .back-zaoba:active{transform:scale(.98)}
.back-zaoba [data-ui-icon="back"],.work-menu [data-ui-icon="save"]{margin-inline-end:-4px}
.preview-model-button [data-ui-icon="preview"],.creation-tools [data-ui-icon="add-text"]{margin-inline-end:-2px}

@media(max-width:1050px) and (min-width:761px){
  .creation-tools{grid-template-columns:repeat(3,108px)}
  .creation-tools.has-image-motif-upload{grid-template-columns:repeat(4,94px)}
  .creation-tools>button,.color-control>button{padding-inline:9px;font-size:12px}
  .save-secondary{flex-basis:108px;width:108px}
  .preview-model-button,.zaoba-editor .finish-button{flex-basis:180px;width:180px}
}
@media(max-width:760px), (pointer:coarse) and (max-width:1024px){
  body.zaoba-editor{
    --zg-control-height:44px;
    --zg-control-icon:24px;
    --zg-control-pad:10px;
  }
  .zaoba-header{height:52px;min-height:52px;padding-inline:10px}
  .zaoba-brand{gap:7px;font-size:24px}
  .zaoba-brand-logo{width:48px;height:48px;flex-basis:48px}
  .back-zaoba{display:none}
  .work-menu{top:env(safe-area-inset-top);height:52px}
  .work-menu #openWorks{height:44px;min-height:44px;gap:var(--zg-control-gap);padding-inline:8px}
  .design-start-controls{gap:var(--zg-control-row-gap);padding:4px 10px 6px}
  .design-start-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
  .design-start-controls label select{height:44px;min-height:44px}
  .design-start-controls label select{width:100%;max-width:none;min-width:0}
  .creation-tools{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:var(--zg-control-row-gap);padding:6px 10px;
  }
  .creation-tools.has-image-motif-upload{grid-template-columns:repeat(4,minmax(0,1fr))}
  .creation-tools>button,.color-control>button{
    height:44px;min-height:44px;gap:var(--zg-control-gap);
    padding-inline:8px;font-size:12px;
  }
  .workbench-bottom{gap:var(--zg-control-row-gap);padding:5px 10px max(7px,env(safe-area-inset-bottom))}
  .history-tools{height:44px;padding:0}
  .history-tools button{width:44px;height:44px;min-width:44px}
  .preview-model-button,.zaoba-editor .finish-button{
    flex:1 1 0;width:auto;height:44px;min-height:44px;
    gap:var(--zg-control-gap);padding-inline:8px;font-size:12px;
  }
  .zaoba-editor #canvasQuickbar{gap:4px;padding:3px 5px}
  .zaoba-editor #canvasQuickbar button{height:44px;min-height:44px;padding-inline:9px}
  .zaoba-editor #closeIconLibrary{height:44px;min-height:44px;padding-inline:9px}
  .canvas-view-tools button{height:44px;min-height:44px;padding-inline:10px}
}
@media(max-width:360px){
  .creation-tools>button,.color-control>button{gap:6px;padding-inline:4px;font-size:11px;white-space:nowrap}
  .creation-tools .tool-art-icon{width:22px;height:22px}
  .preview-model-button .tool-art-icon,.finish-button .tool-art-icon{display:none}
  .preview-model-button,.zaoba-editor .finish-button{gap:0;padding-inline:5px;font-size:11px}
}
@media(max-height:510px) and (pointer:coarse){
  .zaoba-header{display:none}
}
@media(min-width:600px) and (max-width:1024px) and (max-height:510px) and (pointer:coarse){
  .creation-tools,.creation-tools.has-image-motif-upload{
    grid-template-columns:1fr;align-content:start;gap:6px;padding:8px;
  }
  .creation-tools>button,.color-control>button{width:100%;font-size:12px;padding-inline:8px}
  .workbench-bottom{gap:5px;padding:4px 8px}
  .preview-model-button,.zaoba-editor .finish-button{
    flex:0 0 calc(100% - 16px);width:calc(100% - 16px);
    min-height:44px;height:44px;font-size:12px;padding-inline:7px;
  }
}
