/* SAMAMI Studio v70: responsive engineer facts, localized numeric editing.
   Scoped to the optional engineering panel, without changing palette or ERP.
*/
#root [data-qa="studio-advanced-engineering"] {
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
#root [data-qa="studio-advanced-engineering"] .cw-engineering-truth,
#root [data-qa="studio-advanced-engineering"] .cw-section-title,
#root [data-qa="studio-advanced-engineering"] .cw-field,
#root [data-qa="studio-advanced-engineering"] .cw-field-row {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
#root [data-qa="studio-advanced-engineering"] .cw-section-title {
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 8px;
  align-items: flex-start;
}
#root [data-qa="studio-advanced-engineering"] .cw-section-title :is(h2,span) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}
html body #root#root [data-qa="studio-advanced-engineering"] .cw-field-row input[data-localized-number] {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  text-align: center !important;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
#root [data-qa="studio-advanced-engineering"] .cw-field-row small {
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 720px) {
  #root [data-qa="studio-advanced-engineering"] .cw-engineering-truth {
    padding: clamp(10px,3.5vw,18px);
  }
  #root [data-qa="studio-advanced-engineering"] .cw-fields {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 14px;
  }
  #root [data-qa="studio-advanced-engineering"] .cw-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  #root [data-qa="studio-advanced-engineering"] .cw-field > span {
    display: block;
    line-height: 1.75;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}


/* SAMAMI Studio v71 — remove the 620px empty spacer and keep the usable
   3D area together with door action and commercial/technical disclosure.
   Only affects the guided studio preview, not the other ERP canvases. */
#root [data-qa="studio-guided-preview"] {
  min-width: 0;
}
#root [data-qa="studio-guided-preview"] .cw-elevator-garage,
#root [data-qa="studio-guided-preview"] .cw-elevator-garage-layout,
#root [data-qa="studio-guided-preview"] .cw-elevator-preview,
#root [data-qa="studio-guided-preview"] .cw-elevator-canvas-shell {
  min-height: 0 !important;
  height: auto !important;
  max-width: 100%;
  box-sizing: border-box;
}
#root [data-qa="studio-guided-preview"] .cw-elevator-preview {
  position: relative !important;
  inset: auto !important;
}
#root [data-qa="studio-guided-preview"] .sx-webgl-stage {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-height: 0 !important;
  height: auto !important;
  gap: 0 !important;
  padding: 0 !important;
  position: relative;
  overflow: hidden;
}
#root [data-qa="studio-guided-preview"] .sx-webgl-canvas {
  display: block;
  flex: none;
  width: 100% !important;
  max-width: 100% !important;
  height: clamp(330px,43vw,525px) !important;
  max-height: none !important;
  min-height: 0 !important;
  touch-action: pan-y;
}
/* The English telemetry pills made a fake three-column grid under the
   rendered canvas. Detailed pricing/technical status stays in the native
   accessible expandable section immediately below the preview. */
#root [data-qa="studio-guided-preview"] :is(.sx-scene-hint,.sx-stage-badge,.sx-render-status) {
  display: none !important;
}
#root [data-qa="studio-guided-preview"] .cw-elevator-preview-meta {
  min-height: 0 !important;
  height: auto !important;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-block: 9px !important;
  text-align: start;
}
#root [data-qa="studio-guided-preview"] .cw-elevator-garage-head {
  min-width: 0;
  height: auto !important;
  min-height: 0 !important;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-block: 14px !important;
}
#root [data-qa="studio-guided-preview"] .cw-elevator-garage-head > div,
#root [data-qa="studio-guided-preview"] .cw-elevator-garage-head :is(h2,p) {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
#root [data-qa="studio-guided-preview"] .cw-elevator-preview-toolbar {
  height: auto !important;
  min-height: 42px !important;
  gap: 9px;
  flex-wrap: wrap;
  padding: 8px 12px;
}
#root [data-qa="studio-guided-preview"] .cw-door-preview-action {
  box-sizing: border-box;
  min-width: 0;
  height: auto !important;
  min-height: 0 !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 9px 14px;
  margin: 0 !important;
  padding: 12px !important;
}
#root [data-qa="studio-guided-preview"] .cw-door-preview-action > button {
  flex: 0 1 auto;
  min-height: 42px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
#root [data-qa="studio-guided-preview"] .cw-door-preview-action > span {
  min-width: 0;
  flex: 1 1 180px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
#root [data-qa="studio-guided-preview"] .cw-expert-details,
#root [data-qa="studio-guided-preview"] .cw-impact {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
#root [data-qa="studio-guided-preview"] .cw-expert-details summary {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
@media (max-width: 720px) {
  #root [data-qa="studio-guided-preview"] .cw-stage-head {
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    row-gap: 8px;
  }
  #root [data-qa="studio-guided-preview"] .cw-stage-head :is(span,strong) {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #root [data-qa="studio-guided-preview"] .sx-webgl-canvas {
    height: clamp(305px,100vw,420px) !important;
  }
  #root [data-qa="studio-guided-preview"] .cw-door-preview-action {
    flex-direction: column;
    align-items: stretch;
  }
  #root [data-qa="studio-guided-preview"] .cw-door-preview-action > :is(button,span) {
    width: 100%;
    flex: 0 0 auto;
    min-width: 0;
  }
  #root [data-qa="studio-guided-preview"] .cw-elevator-preview-meta {
    align-items: flex-start;
    gap: 7px;
  }
}


/* Override the older high-specificity public-refine-v6 shell that forced a
   three-column WebGL telemetry grid, even after scoped v71 styles loaded. */
html[data-samami-theme] body.sam-configurator-document #root [data-qa="studio-guided-preview"] .sx-webgl-stage {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  gap: 0 !important;
  padding: 0 !important;
}
html[data-samami-theme] body.sam-configurator-document #root [data-qa="studio-guided-preview"] .sx-webgl-stage :is(.sx-scene-hint,.sx-stage-badge,.sx-render-status) {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
html[data-samami-theme] body.sam-configurator-document #root [data-qa="studio-guided-preview"] .sx-webgl-canvas {
  display: block !important;
  height: clamp(330px,43vw,525px) !important;
  max-height: none !important;
  width: 100% !important;
}
@media (max-width:720px) {
  html[data-samami-theme] body.sam-configurator-document #root [data-qa="studio-guided-preview"] .sx-webgl-canvas {
    height: clamp(305px,100vw,420px) !important;
  }
}


/* Prevent the older canvas shell max-height from clipping the scaled
   mobile WebGL output or leaving a hidden gutter beneath the model. */
html[data-samami-theme] body.sam-configurator-document #root [data-qa="studio-guided-preview"] .cw-elevator-canvas-shell {
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
}
