/* Учебка BY — scoped, source-audited mobile guards outside Master.
   Followup to 2026-10-24 independent admin/student/teacher/instructor review.
   Keep wide data tables scrollable; never hide live actions. */
@media (max-width: 767.98px) {
  /* iOS Safari zooms document when a form control is focused below 16 CSS px. */
  :is([data-admin-shell], [data-role-shell]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  :is([data-admin-shell], [data-role-shell]) select,
  :is([data-admin-shell], [data-role-shell]) textarea {
    font-size: 16px;
  }
  /* Calendar/slots in student Booking previously had minimum width 300px,
     inside 272px available space on a 320px iPhone. */
  [data-role-shell="student"] [class~="min-w-[300px]"],
  [data-role-shell="student"] [class~="min-w-[280px]"] {
    min-width: 0 !important;
    max-width: 100%;
  }
  [data-role-shell="student"] [class~="min-w-[300px]"] {
    padding: 12px;
    box-sizing: border-box;
  }
  /* Active instructor lesson timer: 72px monospace doesn't fit at 320px. */
  [data-role-shell="instructor"] [class~="text-7xl"].font-mono,
  [data-role-shell="multi"] [class~="text-7xl"].font-mono {
    font-size: clamp(30px, 8.5vw, 52px);
    white-space: nowrap;
    letter-spacing: -0.025em;
  }
  /* Vehicle log and unwrapped admin direction, file/certificate tables:
     let only the table region scroll without shifting the full page. */
  [data-role-shell="instructor"] .ui-grid.overflow-hidden:has(> table),
  [data-role-shell="multi"] .ui-grid.overflow-hidden:has(> table),
  [data-admin-shell] [class~="overflow-hidden"]:has(> table),
  [data-admin-shell] [class~="overflow-y-auto"]:has(> table),
  [data-admin-shell] [class~="p-3"]:has(> table.ui-grid) {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  [data-role-shell="instructor"] .ui-grid.overflow-hidden:has(> table) > table,
  [data-role-shell="multi"] .ui-grid.overflow-hidden:has(> table) > table {
    min-width: 620px;
  }
  [data-admin-shell] [class~="p-3"]:has(> table.ui-grid) > table {
    min-width: 500px;
  }
  /* Header action rows should scroll in their own area, rather than push
     the content beyond the viewport. Preserve all auth/menu controls. */
  [data-admin-shell] > header > div:last-child {
    min-width: 0;
    max-width: calc(100vw - 126px);
    flex: 0 1 auto;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  [data-role-shell] > main > header > div:last-child {
    min-width: 0;
    max-width: calc(100vw - 78px);
    flex: 0 1 auto;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  [data-admin-shell] > header > div:last-child::-webkit-scrollbar,
  [data-role-shell] > main > header > div:last-child::-webkit-scrollbar { display: none; }
}
