/* LEAL3D_V63_REV8_CORRECOES_PRECISAS */

/* A rolagem geral da página jamais é bloqueada na troca de etapas. */
html:has(body.l3d-session-switching),
body.l3d-session-switching {
  overflow-y: auto !important;
}

/* Somente duas abas reais. */
@media (max-width: 1279.98px) {
  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ============================================================
   PREVIEW VETORIZADO
   ============================================================ */

#vectorStage,
#modelStage {
  position: relative !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#vectorPreview {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  display: block !important;
  overflow: hidden !important;
  transform: none !important;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#vectorPreview.l3d-vector-dragging {
  cursor: grabbing;
}

#vectorPreview > svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  transform-origin: initial !important;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
  image-rendering: auto;
  pointer-events: none;
}

#vectorPreview > svg > .l3d-selection-mask {
  pointer-events: none;
  image-rendering: auto;
}

/* Recentralizar reutiliza exatamente o grupo nativo de posições do 3D. */
#vectorStage .l3d-vector-presets {
  z-index: 9;
  margin: 0;
}

/* Selecionar e Remover usam a mesma identidade de grupo do preview. */
#vectorStage .l3d-selection-modes {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 9;
  margin: 0;
}

#vectorStage .l3d-selection-modes.hidden,
#vectorStage .l3d-selection-reprocess.hidden,
#modelStage .l3d-selection-review.hidden,
#vectorStage .l3d-vector-presets.hidden {
  display: none !important;
}

#vectorStage .l3d-selection-modes button.is-active {
  animation: l3d-rev8-selection-pulse 1.15s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(var(--secondary-rgb), .18);
}

@keyframes l3d-rev8-selection-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--secondary-rgb), 0);
  }
  50% {
    transform: scale(1.045);
    box-shadow: 0 0 0 7px rgba(var(--secondary-rgb), .14);
  }
}

/* Botões inferiores recuperam o visual de botão primário do sistema. */
#vectorStage .l3d-selection-reprocess,
#modelStage .l3d-selection-review {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 9;
  width: auto !important;
  min-width: 0 !important;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

#vectorStage .l3d-selection-reprocess:disabled {
  opacity: .42 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(.28) saturate(.55);
}

#vectorStage .l3d-selection-reprocess.is-busy {
  opacity: .74 !important;
  cursor: progress !important;
}

/* ============================================================
   COLUNA ESQUERDA E SCROLLBAR
   ============================================================ */

@media (min-width: 1280px) {
  .workflow,
  .kc-workflow {
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  .workflow > .workflow-section-title,
  .kc-workflow > .workflow-section-title {
    flex: 0 0 auto;
    min-height: 59px;
    margin: 0 !important;
    padding: 20px 20px 12px;
  }

  .l3d-workflow-scroll-body {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 0 20px 0 20px;
  }

  .l3d-workflow-scroll-body > .session:last-child,
  .l3d-workflow-scroll-body > .kc-session:last-child {
    margin-bottom: 0 !important;
  }
}

@media (max-width: 1279.98px) {
  .l3d-workflow-scroll-body {
    overflow: visible !important;
    padding: 0 !important;
  }
}

/* Scrollbars controladas exclusivamente pelo editor visual na REV9. */

@media (max-width: 760px) {
  #vectorStage .l3d-selection-modes {
    left: 10px;
    bottom: 10px;
  }

  #vectorStage .l3d-selection-reprocess,
  #modelStage .l3d-selection-review {
    right: 10px;
    bottom: 10px;
    min-height: 42px;
    padding: 10px 13px;
    font-size: .68rem;
  }
}
