#canvasBackgroundBtn{flex:none}
#canvasBackgroundBtn svg{width:24px;height:24px;pointer-events:none}
.canvas-background-dialog{width:min(360px,calc(100vw - 32px));max-height:calc(100dvh - 32px);box-sizing:border-box;padding:26px;border:1px solid #dce3f5;border-radius:24px;color:#172851;background:#fff;overflow:auto;overflow-wrap:anywhere}
.canvas-background-dialog h2{font-size:19px;line-height:1.25;margin:4px 34px 24px 0;hyphens:auto}
.canvas-background-dialog .property-section{padding:0;border:0}
.canvas-background-dialog .property-section h3{display:none}
.canvas-background-dialog .field{display:flex;justify-content:space-between;align-items:center;gap:16px}
.canvas-background-dialog input[type=color]{flex:none;width:64px;height:44px;padding:3px;border:1px solid #bdc9e3;border-radius:10px;background:transparent;cursor:pointer}
.canvas-background-dialog .help{font-size:13px;line-height:1.5;color:#64718d;margin:18px 0}
.canvas-background-dialog .backgrounds{display:flex;gap:8px;margin-bottom:22px}
.canvas-background-dialog .backgrounds button{flex:1;min-height:44px}
.canvas-background-dialog .canvas-background-done{width:100%;min-height:44px}
html[data-theme=dark] .canvas-background-dialog .help{color:#b6b6b6}
@media(max-width:700px){.canvas-background-dialog{padding:24px}}
@media(max-width:420px){
 .canvas-background-dialog h2{font-size:17px}
 .canvas-background-dialog .backgrounds{flex-wrap:wrap}
 .canvas-background-dialog .backgrounds button{flex:1 0 82px}
}
/* A short landscape viewport cannot fit both fixed tool rows and selection actions.
   Keep usable canvas space and let the page scroll rather than stack the rows. */
@media(max-width:700px) and (max-height:450px){
 body{overflow-y:auto}
 .workspace{min-height:540px}
 .editor-expanded .workspace{min-height:440px}
}
