/* Native Texture workspace. No legacy floating window styling. */
#inuroTreatmentSidebar [data-treatment-panel="textures"] .inuro-treatment-panel-body{padding:0!important;overflow:hidden!important}
.inuro-native-textures{display:flex;flex-direction:column;height:100%;min-height:0}
.inuro-native-texture-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:start;gap:8px;overflow-y:auto;min-height:0;flex:1;padding:10px;overscroll-behavior:contain}
.inuro-native-texture-card{position:relative;min-width:0;border:1px solid #254357;border-radius:7px;background:#102635;overflow:hidden}
.inuro-native-texture-card.selected{border-color:#2adfff;background:#14394b}
.inuro-native-texture-select{display:flex;flex-direction:column;gap:5px;width:100%;padding:5px;background:transparent;border:0;color:#dcecf4;text-align:left;cursor:pointer;font:inherit}
.inuro-native-texture-select:disabled{opacity:.45;cursor:not-allowed}
.inuro-native-texture-select img{width:100%;aspect-ratio:1;object-fit:cover;display:block;border-radius:4px;background:#081824}
.inuro-native-texture-select span{font-size:10px;line-height:1.25;min-height:25px;overflow-wrap:anywhere}
.inuro-native-mask-color{
  /* Pass 15e.7: native texture swatch is a button, not the legacy span. */
  position:absolute;
  right:7px;
  bottom:7px;
  display:block;
  box-sizing:border-box;
  width:24px !important;
  height:24px !important;
  min-width:24px !important;
  min-height:24px !important;
  max-width:24px !important;
  max-height:24px !important;
  padding:0 !important;
  margin:0;
  flex:none;
  aspect-ratio:1 / 1;
  border:2px solid #d7f4ff;
  border-radius:50% !important;
  box-shadow:0 1px 5px #0008;
  appearance:none;
  line-height:0;
  cursor:pointer;
}
.inuro-native-texture-footer{flex:0 0 auto;display:flex;gap:9px;align-items:center;padding:10px;border-top:1px solid #254357;background:#0c1c29}
.inuro-native-texture-scale{flex:1;min-width:0;font-size:11px;color:#dcecf4}
.inuro-native-texture-scale span{float:right;color:#8ad7ed}
.inuro-native-texture-scale input{display:block;width:100%;margin-top:7px;accent-color:#2adfff}
.inuro-native-texture-remove{flex:0 0 45%;min-height:35px;border:1px solid #28546a;background:#123149;color:#dcecf4;border-radius:6px;font-size:11px;cursor:pointer}
.inuro-native-texture-remove:disabled{opacity:.4;cursor:not-allowed}

/* Pass 05: fixed-height texture browser, independent scroll, fixed card proportions. */
/* Pass 06: texture section participates in the same shared flex-height allocation as all other treatments. */
body:not(.studio-home) #inuroTreatmentSidebar [data-treatment-panel="textures"] .inuro-treatment-panel-body{flex:1 1 auto;min-height:0}
#inuroTreatmentSidebar .inuro-native-textures{height:100%;min-height:0}
#inuroTreatmentSidebar .inuro-native-texture-grid{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;grid-auto-rows:max-content;align-content:start;scrollbar-gutter:stable}
#inuroTreatmentSidebar .inuro-native-texture-card{height:96px;min-height:96px;max-height:96px;align-self:start}
#inuroTreatmentSidebar .inuro-native-texture-select{height:100%;padding:5px;gap:0}
#inuroTreatmentSidebar .inuro-native-texture-select img{height:100%;min-height:0;aspect-ratio:auto;object-fit:cover}
#inuroTreatmentSidebar .inuro-native-texture-select span{display:none}
#inuroTreatmentSidebar .inuro-native-texture-footer{flex-shrink:0}
/* Inurofication v2 Standard Button: text-only at rest, cyan treatment on hover. */
#inuroTreatmentSidebar .inuro-native-texture-remove{background:transparent;border:1px solid transparent;color:#fff;border-radius:6px;font:600 12px inherit;transition:background .15s,border-color .15s,box-shadow .15s}
#inuroTreatmentSidebar .inuro-native-texture-remove:not(:disabled):hover,
#inuroTreatmentSidebar .inuro-native-texture-remove:not(:disabled):focus-visible{background:linear-gradient(120deg,#123c50,#1c687a);border-color:#53dff3;box-shadow:inset 0 0 0 1px #1b8295}
#inuroTreatmentSidebar .inuro-native-texture-remove:disabled{opacity:.4;background:transparent;border-color:transparent}

/* Pass 06: Adaptive Panel Heights. Four sections share available vertical room.
   Minimum is the entire open section, including its 40px header. When the
   viewport cannot fit all minima, the stack itself scrolls rather than crushing
   cards or stealing the pinned texture controls. */
body:not(.studio-home) #inuroTreatmentSidebar .inuro-treatment-sidebar-stack{
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
body:not(.studio-home) #inuroTreatmentSidebar .inuro-treatment-panel{
  flex:0 0 40px!important;
  min-height:40px!important;
  max-height:none;
}
body:not(.studio-home) #inuroTreatmentSidebar .inuro-treatment-panel.is-expanded{
  flex:1 1 160px!important;
  height:auto!important;
  min-height:160px!important;
  max-height:560px!important;
}
body:not(.studio-home) #inuroTreatmentSidebar .inuro-treatment-panel.is-expanded .inuro-treatment-panel-body{
  min-height:0!important;
  flex:1 1 auto!important;
}
/* Fixed preview size and an independently scrolling grid; footer stays pinned. */
body:not(.studio-home) #inuroTreatmentSidebar .inuro-native-texture-grid{
  min-height:0!important;
  overflow-y:auto!important;
  grid-auto-rows:96px!important;
  align-content:start!important;
}
body:not(.studio-home) #inuroTreatmentSidebar .inuro-native-texture-card{
  height:96px!important;
  min-height:96px!important;
  max-height:96px!important;
}

/* Inurofication v2 Pass 15e.3: Glow texture swatches.
   Keep the swatch square before rounding; avoid global span/input sizing rules. */
body:not(.studio-home) #inuroTreatmentSidebar #textureWindow .texture-library-card .texture-card-glow-color {
  position: absolute;
  right: 10px;
  bottom: 34px;
  display: block;
  box-sizing: border-box;
  width: 23px;
  height: 23px;
  min-width: 23px;
  min-height: 23px;
  max-width: 23px;
  max-height: 23px;
  aspect-ratio: 1 / 1;
  padding: 0;
  margin: 0;
  border: 2px solid #d5f5ff;
  border-radius: 50%;
  box-shadow: 0 1px 5px #0008;
  flex: none;
  z-index: 2;
  cursor: pointer;
}

/* Pass 15e.5: SVG-based circular glow-color marker.
   The marker is drawn as an actual circle, rather than a CSS ellipse-prone box. */
body:not(.studio-home) #inuroTreatmentSidebar #textureWindow .texture-library-card .texture-card-glow-color {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
body:not(.studio-home) #inuroTreatmentSidebar #textureWindow .texture-library-card .texture-card-glow-color svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.55));
}

/* Pass 15e.6: isolate the texture-preview color control from inherited span sizing.
   Use an explicitly square viewport and explicitly square SVG, regardless of card flex layout. */
body:not(.studio-home) #inuroTreatmentSidebar #textureWindow .texture-library-card > span.texture-card-glow-color {
  position:absolute !important;
  right:8px !important;
  bottom:8px !important;
  top:auto !important;
  left:auto !important;
  display:block !important;
  width:28px !important;
  height:28px !important;
  min-width:28px !important;
  min-height:28px !important;
  max-width:28px !important;
  max-height:28px !important;
  aspect-ratio:1 / 1 !important;
  flex:0 0 28px !important;
  align-self:auto !important;
  box-sizing:border-box !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  border-radius:50% !important;
  background:transparent !important;
  overflow:visible !important;
  line-height:normal !important;
  z-index:5 !important;
}
body:not(.studio-home) #inuroTreatmentSidebar #textureWindow .texture-library-card > span.texture-card-glow-color > svg {
  display:block !important;
  width:28px !important;
  height:28px !important;
  min-width:28px !important;
  min-height:28px !important;
  max-width:28px !important;
  max-height:28px !important;
  aspect-ratio:1 / 1 !important;
  box-sizing:border-box !important;
  flex:none !important;
  margin:0 !important;
  padding:0 !important;
  transform:none !important;
}
