/* Rectangle-first preview, preserving pixels and showing Wearing/Mods without
 * consuming an entire desktop viewport. The actual canvas bitmap is resized
 * by v4-preview-rectangle.js so character/title proportions never stretch. */
@media (min-width:761px) and (min-height:601px){
 html:not(.v4-arcade-mode) #v4-character .canvaswrap{
   box-sizing:border-box!important;display:flex!important;position:relative!important;
   width:calc(100% - 16px)!important;max-width:100%!important;
   height:clamp(240px,38dvh,455px)!important;
   min-height:240px!important;max-height:455px!important;
   aspect-ratio:auto!important;flex:0 0 auto!important;
   align-self:center!important;align-items:center!important;justify-content:center!important;
   margin:7px 8px 5px!important;overflow:hidden!important;
 }
 html:not(.v4-arcade-mode) #v4-character .canvaswrap>canvas#canvas{
   display:block!important;width:100%!important;height:100%!important;
   max-width:100%!important;max-height:100%!important;
   aspect-ratio:auto!important;object-fit:fill!important;transform:none!important;
   image-rendering:pixelated!important;
 }
 html:not(.v4-arcade-mode) #v4-character .v4-wearing-group{margin-top:4px!important}
 html:not(.v4-arcade-mode) #v4-character .v4-equipped-mods{margin-top:7px!important}
}
/* Undo/redo icons use the World Planner's compact connected tool controls. */
#v4-character #v4-v2-action-row .v4-undo-redo{
 display:inline-flex!important;align-items:center;flex:0 0 auto!important;
 gap:3px;padding:3px;margin:0;min-width:0;
 background:linear-gradient(145deg,rgba(44,84,124,.38),rgba(9,25,48,.55));
 border:1px solid rgba(142,199,237,.34);border-radius:11px;
}
#v4-character #v4-v2-action-row .v4-undo-redo .v4-history-button{
 display:grid!important;place-items:center!important;flex:0 0 auto!important;
 width:35px!important;min-width:35px!important;max-width:35px!important;
 height:35px!important;min-height:35px!important;max-height:35px!important;
 margin:0!important;padding:0!important;border-radius:8px!important;
 color:#deeffc!important;background:rgba(60,118,164,.13)!important;
 border:1px solid transparent!important;
 font:800 25px/1 system-ui,sans-serif!important;
 cursor:pointer;
}
#v4-character #v4-v2-action-row .v4-undo-redo .v4-history-button:hover:not(:disabled){
 background:rgba(79,166,223,.31)!important;border-color:rgba(156,226,255,.65)!important;
}
#v4-character #v4-v2-action-row .v4-undo-redo .v4-history-button:disabled{
 opacity:.35!important;cursor:not-allowed!important;
}
#v4-character #v4-v2-action-row .v4-undo-redo .v4-history-button:focus-visible{
 outline:2px solid #b3edff!important;outline-offset:2px!important;
}
@media(max-width:760px){
 #v4-character #v4-v2-action-row .v4-undo-redo{flex:0 0 auto!important}
 #v4-character #v4-v2-action-row .v4-undo-redo .v4-history-button{
   width:33px!important;min-width:33px!important;height:33px!important;min-height:33px!important;
 }
}
