/* REVOLISH v0.13.7 — mobile usability improvements only.
   Desktop layout, live data/auth logic, and report export scripts are unchanged. */

@media (max-width: 850px) {
  .topbar .mobile-menu {
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
  }
  .topbar-left { display: flex; align-items: center; min-width: 0; }
  #crumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar .nav { min-height: 46px; }
  .page-title { gap: 13px; }
  .page-title .actions { width: 100%; }
  .page-title .actions > .btn { min-height: 44px; }
  .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .mid-roster-table, .mid-history, .roster-import-table {
    max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  #content .btn, #modal-root .btn { min-height: 44px; }
  .student-toolbar select, .preview-controls select { min-height: 42px; }
  .mid-week-picks span { width: 44px; height: 44px; }
}

@media (max-width: 600px) {
  .main-content { padding: 16px 12px 52px; }
  .page-title h1 { font-size: 23px; line-height: 1.3; }
  .page-title .actions { gap: 8px; }
  .page-title .actions > .btn { flex: 1 1 140px; }
  .topbar { gap: 6px; }
  .topbar-left { flex: 1 1 auto; }
  .topbar-right { min-width: 0; flex-shrink: 1; }
  .topbar-right #save-label { max-width: 110px; overflow-wrap: anywhere; }
  #content .form-field input,
  #content .form-field select,
  #content .form-field textarea,
  #modal-root input,
  #modal-root select,
  #modal-root textarea { font-size: 16px; }
  .mid-topics { flex-direction: column; }
  .mid-topics > .form-field { width: 100%; }
  .mid-session-header,
  .mid-session-header > div:first-child { flex-wrap: wrap; }
  .mid-bulk-actions { gap: 9px; }
  .mid-bulk-actions .btn { min-height: 44px; }
  .mid-test-switches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mid-switch { min-height: 46px; white-space: normal; text-align: center; line-height: 1.35; }
  .mid-report-wrapper { max-width: 100%; padding: 8px; }
  .mid-report-paper { max-width: 100%; }
  .mid-report-header { flex-wrap: wrap; }
  .mid-report-header > span { white-space: normal; }
  .mid-export-buttons { flex-wrap: wrap; }
  .mid-export-buttons .btn { flex: 1 1 42%; }
  .student-roster-actions { width: 100%; }
  .student-roster-actions > .btn { flex: 1 1 120px; }
  .focus-stepper { flex-wrap: wrap; gap: 7px; }
  .focus-step { flex: 1 1 100%; min-width: 0; padding: 9px 11px; font-size: 12px; white-space: normal; }
  .step-chevron { display: none; }
  .focus-top { flex-wrap: wrap; }
  .focus-top .actions { width: 100%; }
  .focus-question-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .focus-question { min-height: 44px; height: 44px; font-size: 13px; }
  .focus-question b { top: 2px; right: 4px; }
  .question-actions { flex-wrap: wrap; }
  .question-actions .btn { min-height: 44px; }
  .student-toolbar .field-wrap.grow { flex: 1 1 100%; }
  .student-toolbar .field-wrap { min-width: 0; flex: 1 1 135px; }
  .student-toolbar select { min-height: 44px; }
  .analysis-tabs { max-width: 100%; }
  .analysis-tabs button { min-height: 40px; }
  .preview-shell { max-width: 100%; overflow-x: auto; }
  .exam-records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .main-content { padding-inline: 9px; }
  .mid-card-pad { padding-inline: 9px; }
  .focus-question-grid { gap: 6px; }
  .mid-report-summary { gap: 5px; }
  .mid-report-summary > div { padding: 10px 6px; }
  .mid-report-summary b { font-size: 19px; }
  .mid-week-picks { flex-wrap: wrap; }
  .topbar-right #save-label { max-width: 90px; }
}
