/* IVQA mobile safety overrides
 * Goal: reduce horizontal overflow and improve readability on small screens
 * without rewriting the upstream theme (style.css).
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

pre,
code {
  max-width: 100%;
}

pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Forms and inputs: avoid accidental overflow */
input,
select,
textarea,
button {
  max-width: 100%;
}

/* Common plugin wrappers that often overflow */
.dataTables_wrapper,
.select2-container,
.select2-container * {
  max-width: 100%;
}

@media (max-width: 767.98px) {
  /* Make wide tables scroll instead of forcing page horizontal scroll */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Tabs can be too wide on mobile */
  .nav-tabs {
    flex-wrap: wrap;
  }
}

@media (max-width: 575.98px) {
  /* Large fixed-width utility classes from theme (style.css) */
  .w-750,
  .w-800,
  .w-850,
  .w-900,
  .w-950,
  .w-1000 {
    width: 100% !important;
  }

  .min-w-750,
  .min-w-800,
  .min-w-850,
  .min-w-900,
  .min-w-950,
  .min-w-1000 {
    min-width: 0 !important;
  }

  .max-w-750,
  .max-w-800,
  .max-w-850,
  .max-w-900,
  .max-w-950,
  .max-w-1000 {
    max-width: 100% !important;
  }

  /* Allow long button text to wrap instead of overflow */
  .btn {
    white-space: normal;
  }

  /* Reduce side paddings where upstream theme is tight */
  .content,
  .content-wrapper,
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }
}
