/* V89 — resizable Loaf Studio side panels */
.editor-main{
  --editor-left-w:340px;
  --editor-right-w:300px;
  position:relative;
}
@media(min-width:1081px){
  .editor-main{
    grid-template-columns:var(--editor-left-w) 7px minmax(520px,1fr) 7px var(--editor-right-w)!important;
  }
  .editor-sidebar{grid-column:1!important;grid-row:1!important;min-width:0!important}
  .editor-resizer-left{grid-column:2!important}
  .workspace{grid-column:3!important;grid-row:1!important;min-width:0!important}
  .editor-resizer-right{grid-column:4!important}
  .editor-inspector{grid-column:5!important;grid-row:1!important;min-width:0!important}
  .editor-resizer{
    position:relative;
    z-index:35;
    width:7px;
    min-width:7px;
    cursor:col-resize;
    touch-action:none;
    background:linear-gradient(90deg,transparent,rgba(255,255,255,.035),transparent);
    transition:background .18s ease,box-shadow .18s ease;
  }
  .editor-resizer::before{
    content:"";
    position:absolute;
    left:2px;
    top:50%;
    width:3px;
    height:62px;
    transform:translateY(-50%);
    border-radius:99px;
    background:linear-gradient(180deg,transparent,rgba(146,92,255,.65),rgba(95,225,255,.62),transparent);
    opacity:.34;
    transition:.18s ease;
  }
  .editor-resizer:hover,.editor-resizer.dragging{
    background:rgba(135,84,255,.08);
    box-shadow:0 0 24px rgba(123,75,255,.13);
  }
  .editor-resizer:hover::before,.editor-resizer.dragging::before{opacity:1;height:90px}
  body.editor-resizing,body.editor-resizing *{cursor:col-resize!important;user-select:none!important}
}

/* Keep ThumbLab controls inside whatever width the user chooses. */
.editor-sidebar>.tool-panel{min-width:0!important;box-sizing:border-box!important;overflow-x:hidden!important}
.thumb-panel,.thumb-panel *{box-sizing:border-box}
.thumb-panel .panel-title,.thumb-panel .thumb-hero,.thumblab-nav-v86,.thumb-section,.v86-studio-card,.v86-export-card{max-width:100%;min-width:0}
.v86-card-head>div{min-width:0}.v86-card-head span{overflow-wrap:anywhere}
.v86-drop{grid-template-columns:24px minmax(0,1fr)!important}
.v86-pose-grid,.v86-grade-grid,.v86-scale-row{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.v86-pose-grid button,.v86-grade-grid button,.v86-scale-row button{min-width:0;padding-inline:5px}
.v86-skin-options label,.v86-color-controls label{grid-template-columns:minmax(54px,72px) minmax(0,1fr)!important}
.v86-skin-options input[type=range],.v86-color-controls input[type=range]{min-width:0;width:100%}
.v86-search{min-width:0!important;width:100%!important}
.v86-mc-assets{grid-template-columns:repeat(auto-fit,minmax(58px,1fr))!important;min-width:0}
.v86-mc-assets button{width:100%;min-width:0}
.v86-inline{grid-template-columns:minmax(58px,72px) minmax(0,1fr) minmax(62px,78px)!important;min-width:0}
.v86-inline>*{min-width:0!important;max-width:100%}
.v86-gradient-custom{grid-template-columns:30px 30px minmax(70px,1fr) 52px 46px!important;min-width:0}
.v86-gradient-custom>*{min-width:0!important}
.v86-export-card{grid-template-columns:minmax(0,1fr) 68px 68px!important}
.thumblab-nav-v86{padding-right:2px!important}
.thumblab-nav-v86 button{max-width:100%}

/* Small left panel: stack complex rows instead of clipping them. */
@media(min-width:1081px){
  .editor-main[data-left-compact="1"] .v86-inline{grid-template-columns:1fr!important}
  .editor-main[data-left-compact="1"] .v86-inline button{min-height:32px}
  .editor-main[data-left-compact="1"] .v86-gradient-custom{grid-template-columns:36px 36px 1fr!important}
  .editor-main[data-left-compact="1"] .v86-gradient-custom button{min-height:31px}
  .editor-main[data-left-compact="1"] .v86-export-card{grid-template-columns:1fr 1fr!important}
  .editor-main[data-left-compact="1"] .v86-export-card>div{grid-column:1/-1}
}

/* Existing responsive layouts stay in control on tablet/mobile. */
@media(max-width:1080px){.editor-resizer{display:none!important}}
