/**
 * GMR — matrizes SurveyJS (matrix / matrixdropdown / matrixdynamic)
 * Evita clip de tabelas largas; scroll horizontal em viewports estreitos.
 */

#surveyContainer,
#themeLiveHost {
  min-width: 0;
  max-width: 100%;
}

.sd-root-modern,
.sd-root-modern .sd-body,
.sd-root-modern .sd-page {
  min-width: 0;
  max-width: 100%;
}

/* SurveyJS usa overflow-x: visible em mobile — restaura scroll na pergunta */
.sd-root-modern .sd-question--table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.sd-root-modern .sd-question--mobile.sd-question--table,
.sd-root-modern .sd-question--mobile.sd-question--scroll {
  overflow-x: auto;
}

.sd-root-modern .sd-question--table > .sd-question__content,
.sd-root-modern .sd-matrixdynamic__content,
.sd-root-modern .sd-matrixdropdown__content {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.sd-root-modern .sd-question--scroll {
  overflow-x: auto;
}

/* Telas largas: mais largura útil para matrizes (sem alterar mobile) */
@media (min-width: 768px) {
  body:has(#surveyContainer:not(:empty)) {
    max-width: min(960px, calc(100vw - 2rem));
  }
}
