/* Shared touch layout for teacher workflows; desktop tables keep their layout. */
@media(max-width:700px){
  body:has(.mobile-workbench-page) .topbar .bar{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:12px}
  body:has(.mobile-workbench-page) .topbar .site-nav{display:flex;flex-wrap:nowrap;overflow-x:auto;max-width:100%;min-width:0;padding-bottom:4px}
  body:has(.mobile-workbench-page) .topbar .site-nav>a,body:has(.mobile-workbench-page) .topbar .site-nav>form{flex:none;white-space:nowrap}
  main.wrap.mobile-workbench-page{width:100%;min-width:0;padding:16px 12px 32px;box-sizing:border-box}
  .mobile-workbench-page :is(input,select,textarea,button,.button){max-width:100%;box-sizing:border-box;font-size:16px}
  .mobile-workbench-page :is(button,.button,select,summary){min-height:44px}
  .mobile-workbench-page :is(h1,h2,h3,p,a,td){overflow-wrap:anywhere}
  .mobile-workbench-page h1{font-size:24px;margin:12px 0 20px}
  .mobile-workbench-page .layout{display:flex;flex-direction:column;gap:16px}
  .mobile-workbench-page .layout>.panel{width:100%;min-width:0;box-sizing:border-box}
  .mobile-workbench-page .workbench-actions{gap:10px;align-items:stretch;flex-wrap:wrap}
  .mobile-workbench-page .workbench-actions>form{width:100%;min-width:0}
  .mobile-workbench-page .workbench-scroll{overflow:visible}
  .mobile-workbench-page .class-students-table,.mobile-workbench-page .resource-table{display:block;width:100%;min-width:0}
  .mobile-workbench-page :is(.class-students-table,.resource-table)>thead{display:none}
  .mobile-workbench-page .class-students-table:has([data-select-students])>thead,.mobile-workbench-page .resource-table>thead{display:block;width:100%;min-width:0;max-width:100%;margin-bottom:10px}
  .mobile-workbench-page .class-students-table:has([data-select-students])>thead>tr,.mobile-workbench-page .resource-table>thead>tr{display:flex;max-width:100%;min-width:0;overflow-x:auto}
  .mobile-workbench-page .class-students-table:has([data-select-students])>thead th:not(:has(input)){display:none}
  .mobile-workbench-page :is(.class-students-table,.resource-table)>thead th{flex:0 0 auto;padding:4px 10px;background:transparent}
  .mobile-workbench-page .mobile-select-all{display:flex;align-items:center;gap:8px;min-height:44px;white-space:nowrap;margin:0;font-weight:400;font-size:13px}
  .mobile-workbench-page .mobile-select-all:after{content:attr(data-label)}
  .mobile-workbench-page .resource-table>thead a{display:flex;align-items:center;min-height:44px}
  .mobile-workbench-page :is(.class-students-table,.resource-table)>tbody{display:grid;gap:14px}
  .mobile-workbench-page :is(.class-students-table,.resource-table)>tbody>tr{display:block;min-width:0;padding:14px;border:1px solid #e2e8ef;border-radius:12px;background:white}
  .mobile-workbench-page :is(.class-students-table,.resource-table) td{display:flex;align-items:flex-start;gap:12px;padding:6px 0;border:0;white-space:normal;min-width:0}
  .mobile-workbench-page td[data-mobile-label]:before{content:attr(data-mobile-label);flex:0 0 5.7em;color:#84919d;font-size:13px;padding-top:2px}
  .mobile-workbench-page .class-students-table td:first-child:not(:has(input)){font-size:18px;font-weight:600}
  .mobile-workbench-page .class-students-table td:has(.student-row-actions){border-top:1px solid #edf0f4;padding-top:12px;margin-top:8px}
  .mobile-workbench-page .student-row-actions{justify-content:flex-end;width:100%;gap:20px}
  .mobile-workbench-page .student-row-actions>a,.mobile-workbench-page .student-row-actions>button{display:flex;align-items:center;min-height:44px;padding:0 8px}
  .mobile-workbench-page .class-management-sidebar{padding:12px}
  .mobile-workbench-page .class-management-sidebar>form{display:flex;gap:8px;padding:0 0 8px}
  .mobile-workbench-page .class-management-sidebar>form input{flex:1;min-width:0;margin:0}
  .mobile-workbench-page .class-management-sidebar nav{display:flex;overflow-x:auto;max-height:none;gap:8px}
  .mobile-workbench-page .class-management-sidebar nav a{flex:0 0 auto;max-width:220px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding:12px;border-radius:8px}
  .mobile-workbench-page .class-management-side-title{padding:0 0 12px}
  .mobile-workbench-page .class-management-main>header{padding:16px}
  .mobile-workbench-page .class-management-toolbar>.workbench-actions{width:100%}
  .mobile-workbench-page .class-management-toolbar form{flex-wrap:nowrap;width:100%}
  .mobile-workbench-page .class-management-toolbar form input{flex:1;width:0;max-width:none}
  .mobile-workbench-page .student-roster-filters>form{width:100%}
  .mobile-workbench-page .student-roster-filters label{flex:1;min-width:0}
  .mobile-workbench-page .student-roster-filters select{min-width:0;width:100%}
  .mobile-workbench-page form:has([data-select-students])>.workbench-actions{position:sticky;top:8px;z-index:5;padding:12px;background:white;border:1px solid #e2e8ef;border-radius:12px;box-shadow:0 4px 14px #1c304b10}
  .mobile-workbench-page .class-management-body{padding:12px}
  main.mobile-workbench-page.course-workspace-page{grid-template-columns:minmax(0,1fr)}
  .mobile-workbench-page .course-shell{display:block;min-width:0;max-width:100%}
  .mobile-workbench-page .course-shell-main{min-width:0;max-width:100%}
  .mobile-workbench-page .course-side-nav{min-width:0;max-width:100%}
  .mobile-workbench-page .course-shell .course-side-nav{position:static;display:flex;flex-direction:row;flex-wrap:nowrap;overflow-x:auto;gap:8px;margin-bottom:16px;padding:4px}
  .mobile-workbench-page .course-side-nav .course-nav-title{display:none}
  .mobile-workbench-page .course-side-nav a{flex:0 0 auto;white-space:nowrap;border-radius:8px;padding:12px}
  .mobile-workbench-page .course-workspace-header{display:block}
  .mobile-workbench-page .course-workspace-header .workbench-actions{margin-top:12px}
  .mobile-workbench-page .course-module-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .mobile-workbench-page .course-module-card{padding:14px;min-width:0}
  .mobile-workbench-page .resource-browser{padding:12px;min-height:0}
  .mobile-workbench-page .resource-toolbar>div,.mobile-workbench-page .resource-toolbar-end,.mobile-workbench-page .resource-search{width:100%}
  .mobile-workbench-page .resource-search input:not([type=hidden]){flex:1;width:0;min-width:0}
  .mobile-workbench-page .resource-table-scroll{overflow:visible}
  .mobile-workbench-page .resource-file-cell{min-width:0;width:100%;display:grid;gap:8px}
  .mobile-workbench-page .resource-file-cell .resource-name{min-width:0;max-width:100%}
  .mobile-workbench-page .resource-row-actions{visibility:visible;flex-wrap:wrap;gap:16px}
  .mobile-workbench-page .resource-row-actions a,.mobile-workbench-page .resource-row-actions button{min-height:44px;display:flex;align-items:center}
  .mobile-workbench-page .resource-table td:empty{display:none}
  .mobile-workbench-page .resource-table td:first-child{float:right}
  .mobile-workbench-page .course-setup-panel{margin:0;width:100%}
  .mobile-workbench-page .course-setup-fields{padding:16px;gap:20px}
  .mobile-workbench-page .course-setup-row>div,.mobile-workbench-page .course-cover-picker{min-width:0;max-width:100%}
  .mobile-workbench-page .course-cover-picker img{width:100%;max-width:320px}
  .mobile-workbench-page .course-setup-panel footer{gap:12px}
  .mobile-workbench-page .course-setup-panel footer .button{min-width:0;flex:1}
  .mobile-workbench-page dialog{box-sizing:border-box;max-width:calc(100% - 16px);max-height:calc(100dvh - 24px);padding:16px;overflow:auto}
  .mobile-workbench-page dialog .workbench-actions,.mobile-workbench-page .resource-dialog-footer{flex-wrap:wrap}
  .mobile-workbench-page .resource-dialog-footer button{flex:1;min-width:0}
  .mobile-workbench-page .cover-crop-dialog{padding:0}
  .mobile-workbench-page .cover-crop-zoom{width:100%;justify-content:space-between}
  .mobile-workbench-page .cover-crop-zoom input{flex:1;min-width:40px;width:0}
  .mobile-workbench-page .local-upload-heading{padding:12px}
  .mobile-workbench-page .local-upload-body{padding:12px}
  .mobile-workbench-page .local-upload-dropzone{padding:20px 12px;min-height:180px}
}
