/* Classroom workspace UI
   Teacher / TA / HT / student / parent sidebar screens.
   Loaded last. Schedule timetable pages do not receive the workspace-ui body class. */

body.app-body.workspace-ui {
  --ws-radius: var(--radius-lg);
  --ws-pad: 12px;
  --ws-gap: 8px;
}

body.app-body.workspace-ui .page-title {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

body.app-body.workspace-ui .page-subtitle,
body.app-body.workspace-ui .section-copy,
body.app-body.workspace-ui .section-note {
  margin-bottom: 10px;
  font-size: var(--text-md);
  line-height: 1.45;
}

body.app-body.workspace-ui .card,
body.app-body.workspace-ui .drive-shell .card,
body.app-body.workspace-ui .family-card,
body.app-body.workspace-ui .wf-live-panel,
body.app-body.workspace-ui .student-v0-list-shell,
body.app-body.workspace-ui .family-v0-feed-shell {
  margin-bottom: 12px;
  padding: var(--ws-pad);
  overflow: hidden;
  border-radius: var(--ws-radius);
  box-shadow: none;
}

body.app-body.workspace-ui .card h3,
body.app-body.workspace-ui .card h4,
body.app-body.workspace-ui .wf-panel-head h3 {
  margin: 0 0 8px;
  font-size: var(--text-lg);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

body.app-body.workspace-ui .hero-panel,
body.app-body.workspace-ui .drive-hero,
body.app-body.workspace-ui .wf-hero,
body.app-body.workspace-ui .family-reading-hero,
body.app-body.workspace-ui .parent-home-head,
body.app-body.workspace-ui .resource-desk-hero,
body.app-body.workspace-ui .teacher-homework-hero {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--ws-radius);
  box-shadow: none;
}

body.app-body.workspace-ui .hero-title,
body.app-body.workspace-ui .drive-hero h2,
body.app-body.workspace-ui .wf-hero h2,
body.app-body.workspace-ui .parent-home-head h2,
body.app-body.workspace-ui .family-reading-hero h2 {
  margin: 0 0 4px;
  font-size: var(--text-xl);
  line-height: 1.2;
}

body.app-body.workspace-ui .hero-copy,
body.app-body.workspace-ui .drive-hero p,
body.app-body.workspace-ui .wf-hero p,
body.app-body.workspace-ui .parent-home-head p {
  margin: 0;
  max-width: 52rem;
  font-size: var(--text-md);
  line-height: 1.45;
}

body.app-body.workspace-ui.menu-students .hero-panel,
body.app-body.workspace-ui.menu-counseling .hero-panel,
body.app-body.workspace-ui.menu-exams .drive-hero:first-child p {
  display: none;
}

body.app-body.workspace-ui .hero-chip-row {
  display: none;
}

body.app-body.workspace-ui .stat-grid,
body.app-body.workspace-ui .ops-stats-grid,
body.app-body.workspace-ui .stats-grid,
body.app-body.workspace-ui .resource-kpi-grid,
body.app-body.workspace-ui .wf-stat-grid,
body.app-body.workspace-ui .wf-teacher-action-grid,
body.app-body.workspace-ui .student-v0-meter-grid,
body.app-body.workspace-ui .family-stat-row,
body.app-body.workspace-ui .drive-quick-grid,
/* ---------------------------------------------------------------------------
   Metric strip baseline, for every role.
   The chip styling below was scoped to .workspace-ui, which only owner and
   manager pages never receive, so on those pages the strip fell back to raw
   inline <strong>/<em> and rendered as one italic run-on sentence
   ("32学生列表 26正常 3休学 321.0剩余课时") that cannot be parsed at a glance.
   --------------------------------------------------------------------------- */
.workspace-metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.workspace-metric-strip > * {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--edu-border);
  border-radius: var(--radius-xs);
  background: var(--edu-surface);
}

.workspace-metric-strip strong {
  color: var(--edu-text);
  font-size: var(--text-md);
  font-weight: 800;
  line-height: 1.2;
}

.workspace-metric-strip em {
  color: var(--edu-text-muted);
  font-size: var(--text-sm);
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Students search, unified.
   The old card asked the operator to pick a field before typing, then offered a
   second dropdown beside the results and mixed export/navigation links into the
   filter row. One box now searches every field; filters sit below it; secondary
   actions moved to the list header where they read as actions, not as more
   search choices.
   --------------------------------------------------------------------------- */
.students-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.students-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--control-h-lg);
  padding: 0 var(--space-5);
  border: 1px solid var(--edu-border);
  border-radius: var(--radius-sm);
  background: var(--edu-surface);
  color: var(--edu-text);
  font-size: var(--text-md);
  box-sizing: border-box;
}

.students-search-submit {
  flex: 0 0 auto;
  height: var(--control-h-lg);
  padding: 0 var(--space-6);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--edu-primary);
  color: #fff;
  font-size: var(--text-md);
  font-weight: 700;
  white-space: nowrap;
}

.students-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.students-filter-select {
  flex: 1 1 140px;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--edu-border);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--edu-text-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.students-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.students-list-header h3 {
  margin: 0;
}

.students-list-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.students-list-actions-bar .btn {
  height: 32px;
  padding: 0 10px;
  font-size: var(--text-sm);
  line-height: 30px;
  border-radius: var(--radius-lg);
}

.students-list-note {
  margin: 6px 0 10px;
}

@media (max-width: 768px) {
  .students-list-note {
    display: none !important;
  }

  /* Export and master-data navigation are desktop-office actions; on a phone
     they only pushed the first student row further below the fold. */
  body.app-body .students-desktop-action {
    display: none !important;
  }

  body.app-body .students-list-actions-bar .btn {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 12px !important;
    font-size: 12.5px !important;
    line-height: 30px !important;
  }
}

body.app-body.workspace-ui .workspace-metric-strip {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px !important;
  align-items: stretch;
  margin: 0 0 12px !important;
}

body.app-body.workspace-ui .stat-card,
body.app-body.workspace-ui .ops-stat,
body.app-body.workspace-ui .resource-kpi,
body.app-body.workspace-ui .wf-stat-card,
body.app-body.workspace-ui .wf-teacher-action-card,
body.app-body.workspace-ui .student-v0-meter,
body.app-body.workspace-ui .family-stat,
body.app-body.workspace-ui .workspace-metric-strip > * {
  display: inline-flex !important;
  flex: 1 1 88px;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0 !important;
  max-width: 100%;
  min-height: 0 !important;
  height: auto !important;
  margin: 0;
  padding: 7px 10px !important;
  border: 1px solid var(--edu-border) !important;
  border-radius: var(--radius-lg) !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.app-body.workspace-ui .stat-label,
body.app-body.workspace-ui .ops-stat-label,
body.app-body.workspace-ui .resource-kpi-label,
body.app-body.workspace-ui .wf-stat-label,
body.app-body.workspace-ui .wf-teacher-action-title,
body.app-body.workspace-ui .student-v0-meter span,
body.app-body.workspace-ui .family-stat-label,
body.app-body.workspace-ui .workspace-metric-strip em {
  margin: 0 !important;
  color: var(--edu-text-muted) !important;
  font-size: var(--text-xs) !important;
  font-style: normal;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: none !important;
  word-break: keep-all;
}

body.app-body.workspace-ui .stat-value,
body.app-body.workspace-ui .ops-stat-value,
body.app-body.workspace-ui .resource-kpi-value,
body.app-body.workspace-ui .wf-stat-value,
body.app-body.workspace-ui .wf-teacher-action-value,
body.app-body.workspace-ui .student-v0-meter strong,
body.app-body.workspace-ui .family-stat-value,
body.app-body.workspace-ui .workspace-metric-strip strong {
  margin: 0 !important;
  color: var(--edu-text) !important;
  font-size: var(--text-xl) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

body.app-body.workspace-ui .stat-note,
body.app-body.workspace-ui .ops-stat-copy,
body.app-body.workspace-ui .wf-stat-copy,
body.app-body.workspace-ui .wf-teacher-action-copy,
body.app-body.workspace-ui .wf-teacher-action-link,
body.app-body.workspace-ui .family-stat-copy {
  display: none !important;
}

body.app-body.workspace-ui .workspace-search-card,
body.app-body.workspace-ui .students-search-card,
body.app-body.workspace-ui .picker-shell,
body.app-body.workspace-ui .reading-student-tools {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--edu-border);
  border-radius: var(--ws-radius);
  background: #fff;
}

body.app-body.workspace-ui .workspace-search-card > .mobile-card-summary,
body.app-body.workspace-ui .students-search-card > .mobile-card-summary,
body.app-body.workspace-ui .reading-student-tools > .mobile-card-summary,
body.app-body.workspace-ui details[data-search-always] > summary {
  display: none !important;
}

body.app-body.workspace-ui .workspace-search-card > .card-header-row,
body.app-body.workspace-ui .students-search-card > .card-header-row {
  display: none;
}

body.app-body.workspace-ui .workspace-search-form,
body.app-body.workspace-ui .workspace-search-card .query-form,
body.app-body.workspace-ui .students-search-card .query-form {
  display: grid;
  gap: 8px;
}

body.app-body.workspace-ui .workspace-search-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

body.app-body.workspace-ui .workspace-search-card .filter-grid,
body.app-body.workspace-ui .students-search-card .filter-grid,
body.app-body.workspace-ui.menu-counseling .query-form .filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

body.app-body.workspace-ui .workspace-search-card input,
body.app-body.workspace-ui .workspace-search-card select,
body.app-body.workspace-ui .students-search-card input,
body.app-body.workspace-ui .students-search-card select,
body.app-body.workspace-ui .picker-shell input,
body.app-body.workspace-ui .reading-student-picker input,
body.app-body.workspace-ui .reading-student-picker select {
  min-width: 0 !important;
  min-height: var(--control-h-lg);
  max-width: 100%;
}

body.app-body.workspace-ui .workspace-search-card .btn-row,
body.app-body.workspace-ui .students-search-card .btn-row {
  gap: 6px;
}

body.app-body.workspace-ui button,
body.app-body.workspace-ui .btn,
body.app-body.workspace-ui .nav-link-label,
body.app-body.workspace-ui .page-title,
body.app-body.workspace-ui .card h3,
body.app-body.workspace-ui .card h4 {
  overflow-wrap: normal;
  word-break: keep-all;
}

body.app-body.workspace-ui .filter-grid,
body.app-body.workspace-ui .form-grid,
body.app-body.workspace-ui .quick-action-grid,
body.app-body.workspace-ui form.query-form .filter-grid,
body.app-body.workspace-ui form.mobile-stack .filter-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

body.app-body.workspace-ui .filter-grid > label,
body.app-body.workspace-ui .form-grid > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

body.app-body.workspace-ui .table-wrap,
body.app-body.workspace-ui .card > table,
body.app-body.workspace-ui .card > .admin-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

body.app-body.workspace-ui .ops-mobile-cards td,
body.app-body.workspace-ui .student-list-actions,
body.app-body.workspace-ui .btn-row {
  overflow-wrap: normal;
  word-break: keep-all;
}

body.app-body.workspace-ui .student-v0-app-grid,
body.app-body.workspace-ui .family-v0-app-grid {
  gap: 8px;
}

body.app-body.workspace-ui .student-v0-app-card,
body.app-body.workspace-ui .family-v0-app-card {
  min-height: 0;
  padding: 10px;
  border-radius: var(--radius-sm);
}

body.app-body.workspace-ui .parent-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

body.app-body.workspace-ui .parent-summary-strip a,
body.app-body.workspace-ui .parent-summary-strip > span {
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-lg);
}

body.app-body.workspace-ui .parent-summary-strip strong {
  font-size: var(--text-xl);
}

body.app-body.workspace-ui .wf-teacher-lessons .wf-panel-copy,
body.app-body.workspace-ui .wf-hero-actions {
  display: none;
}

@media (max-width: 900px) {
  body.app-body.workspace-ui .page-title {
    font-size: var(--text-xl);
  }
}

html[data-layout-mode="mobile"] body.app-body.workspace-ui .page-title {
  font-size: var(--text-xl);
}

@media (max-width: 900px) {
  body.app-body.workspace-ui .main {
    padding: 12px 12px calc(var(--role-mobile-nav-height, 58px) + 28px + env(safe-area-inset-bottom));
  }

  body.app-body.workspace-ui .topbar {
    min-height: 48px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
  }

  body.app-body.workspace-ui .stat-card,
  body.app-body.workspace-ui .ops-stat,
  body.app-body.workspace-ui .resource-kpi,
  body.app-body.workspace-ui .wf-stat-card,
  body.app-body.workspace-ui .wf-teacher-action-card,
  body.app-body.workspace-ui .student-v0-meter,
  body.app-body.workspace-ui .family-stat,
  body.app-body.workspace-ui .workspace-metric-strip > * {
    flex: 1 1 calc(50% - 6px);
  }

  body.app-body.workspace-ui .workspace-search-primary,
  body.app-body.workspace-ui .students-search-card .filter-grid,
  body.app-body.workspace-ui .workspace-search-card .filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.app-body.workspace-ui .btn-row > .btn,
  body.app-body.workspace-ui .btn-row > button,
  body.app-body.workspace-ui .btn-row > a {
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
  }

  body.app-body.workspace-ui .parent-summary-strip,
  body.app-body.workspace-ui .student-v0-meter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.app-body.workspace-ui .parent-summary-strip {
    display: grid !important;
  }

  body.app-body.workspace-ui .ann-two-col,
  body.app-body.workspace-ui .announcements-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  body.app-body.workspace-ui .drive-file-table.ops-mobile-cards,
  body.app-body.workspace-ui .ops-mobile-cards {
    min-width: 0;
  }
}

html[data-layout-mode="mobile"] body.app-body.workspace-ui .stat-card,
html[data-layout-mode="mobile"] body.app-body.workspace-ui .ops-stat,
html[data-layout-mode="mobile"] body.app-body.workspace-ui .wf-stat-card,
html[data-layout-mode="mobile"] body.app-body.workspace-ui .wf-teacher-action-card,
html[data-layout-mode="mobile"] body.app-body.workspace-ui .student-v0-meter {
  flex: 1 1 calc(50% - 6px);
  min-height: 0 !important;
  padding: 7px 10px !important;
}

html[data-layout-mode="mobile"] body.app-body.workspace-ui .hero-panel,
html[data-layout-mode="mobile"] body.app-body.workspace-ui .drive-hero,
html[data-layout-mode="mobile"] body.app-body.workspace-ui .wf-hero {
  padding: 12px 14px;
}

html[data-layout-mode="mobile"] body.app-body.workspace-ui .table-wrap {
  overflow-x: clip;
}

html[data-layout-mode="mobile"] body.app-body.workspace-ui .workspace-search-card > .mobile-card-summary,
html[data-layout-mode="mobile"] body.app-body.workspace-ui .students-search-card > .mobile-card-summary,
html[data-layout-mode="mobile"] body.app-body.workspace-ui .reading-student-tools > .mobile-card-summary {
  display: none !important;
}

html[data-layout-mode="mobile"] body.app-body.workspace-ui .students-search-card .filter-grid,
html[data-layout-mode="mobile"] body.app-body.workspace-ui .workspace-search-card .filter-grid {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 540px) {
  body.app-body.workspace-ui .stat-value,
  body.app-body.workspace-ui .ops-stat-value,
  body.app-body.workspace-ui .wf-stat-value,
  body.app-body.workspace-ui .wf-teacher-action-value,
  body.app-body.workspace-ui .student-v0-meter strong {
    font-size: var(--text-lg) !important;
  }

  body.app-body.workspace-ui .student-v0-app-card strong,
  body.app-body.workspace-ui .family-v0-app-card strong {
    font-size: var(--text-md);
    word-break: keep-all;
  }
}

/* ==========================================================================
   Students List Table Frame & Scroll Lock Fixes
   ========================================================================== */
body.app-body.menu-students .students-list-card .table-wrap,
body.app-body.workspace-ui .students-list-card .table-wrap,
body.app-body.workspace-ui .students-table-wrap {
  max-height: none !important;
  overflow: visible !important;
  overflow-x: clip !important;
  border-radius: var(--radius-md) !important;
  touch-action: pan-y !important;
}

body.app-body.menu-students .students-list-card table,
body.app-body.workspace-ui .students-list-card table,
body.app-body.workspace-ui .ops-students-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: auto !important;
}

/* The regular roster has nine real fields. Keep their widths attached to the
   semantic columns instead of relying on generic nth-child rules that were
   written for the old five-column compact table. */
body.app-body.menu-students .ops-students-compact {
  min-width: 1120px !important;
  table-layout: fixed !important;
}

body.app-body.menu-students .ops-students-compact .col-student-name-en { width: 14% !important; }
body.app-body.menu-students .ops-students-compact .col-student-name-ko { width: 11% !important; }
body.app-body.menu-students .ops-students-compact .col-student-no { width: 9% !important; }
body.app-body.menu-students .ops-students-compact .col-student-phone { width: 11% !important; }
body.app-body.menu-students .ops-students-compact .col-student-status { width: 8% !important; }
body.app-body.menu-students .ops-students-compact .col-student-class { width: 13% !important; }
body.app-body.menu-students .ops-students-compact .col-student-homeroom { width: 13% !important; }
body.app-body.menu-students .ops-students-compact .col-student-credits {
  width: 10% !important;
  text-align: center !important;
}
body.app-body.menu-students .ops-students-compact .col-student-actions {
  width: 11% !important;
  min-width: 0 !important;
  text-align: right !important;
}

.student-status-badge {
  margin: 0;
  padding: 2px 7px;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}

.student-status-badge.is-ended {
  border: 1px solid var(--edu-border);
  background: var(--edu-bg);
  color: var(--edu-text-muted);
}

/* Students Table Desktop Defaults */
.student-mobile-submeta {
  display: none;
}
.col-student-class.desktop-only,
.col-student-homeroom.desktop-only {
  display: table-cell;
}

/* On mobile (<= 768px): Hide class & homeroom columns, show submeta under name, table 100% fixed */
@media (max-width: 768px) {
  /* =====================================================================
     Phone chrome diet.
     The bottom navigation already names the current section and the card
     heading repeats it, so the 27px page title was a third label for the same
     thing. It stays in the accessibility tree, just not on screen. The role
     label next to the operator name is org context they already know.
     ===================================================================== */
  body.app-body .page-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0);
    white-space: nowrap !important;
    border: 0 !important;
  }

  body.app-body .topbar-identity-role {
    display: none !important;
  }

  /* The filter card pushed the first student row to 474px on an 844px screen.
     Secondary actions (reset / export / master data) do not need full-size
     controls to sit above the data. */
  body.app-body.menu-students .students-search-card {
    padding: 8px 10px !important;
  }

  body.app-body.menu-students .students-search-card input,
  body.app-body.menu-students .students-search-card select,
  body.app-body.menu-students .students-search-card .btn,
  body.app-body.menu-students .students-search-card button {
    min-height: var(--control-h-lg) !important;
    height: auto !important;
    padding: 6px 10px !important;
    font-size: var(--text-md) !important;
  }

  body.app-body.menu-students .students-unified-search-form {
    gap: 6px !important;
  }

  /* =====================================================================
     Students roster: one line per student.
     Single owner for this component (loads last), replacing competing blocks
     that previously lived in edu-theme.css and responsive-density.css and
     expanded each row into a 222px label card.
     Row content, by product decision: name / head teacher / credits / report.
     ===================================================================== */
  body.app-body.menu-students table.ops-students-compact,
  body.app-body.menu-students table.ops-students-compact tbody {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.app-body.menu-students table.ops-students-compact tr:first-child {
    display: none !important;
  }

  body.app-body.menu-students table.ops-students-compact tr:not(:first-child) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 72px) auto auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 7px 10px;
    min-height: 48px;
    border: 0;
    border-bottom: 1px solid var(--edu-border);
    border-radius: 0;
    background: #fff;
  }

  /* ops-ui.css spans .ops-primary and .ops-actions across every column for the
     generic mobile card treatment. In a one-line roster that would stack the
     name, credits and action onto three rows. */
  body.app-body.menu-students table.ops-students-compact td.ops-primary,
  body.app-body.menu-students table.ops-students-compact td.ops-actions {
    grid-column: auto !important;
  }

  body.app-body.menu-students table.ops-students-compact tr:last-child {
    border-bottom: 0;
  }

  body.app-body.menu-students table.ops-students-compact td {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    font-size: var(--text-md);
  }

  /* A one-line row needs no per-cell labels; the column order carries meaning. */
  body.app-body.menu-students table.ops-students-compact td::before {
    display: none !important;
  }

  /* The sub-line under the name duplicated class + head teacher, both of which
     are either dropped or shown in their own column now. */
  body.app-body.menu-students table.ops-students-compact .student-mobile-submeta {
    display: none !important;
  }

  body.app-body.menu-students table.ops-students-compact .col-student-name {
    font-weight: 700;
  }

  body.app-body.menu-students table.ops-students-compact .col-student-name > div {
    display: block !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* The name and student number are wrapped in an inline-styled flex row that
     wrapped onto a second line and pushed the row past 44px. Scoped to the
     first child so it cannot resurrect the sub-line below it. */
  body.app-body.menu-students table.ops-students-compact .col-student-name > div > div:first-child {
    display: block !important;
    flex-wrap: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
  }

  /* One line has room for the name, not the student number too; the number is
     available on the student's own page. */
  body.app-body.menu-students table.ops-students-compact .student-no-sub {
    display: none !important;
  }

  /* Class is dropped on phones; head teacher is kept and gets its own column. */
  body.app-body.menu-students table.ops-students-compact .col-student-class {
    display: none !important;
  }

  body.app-body.menu-students table.ops-students-compact .col-student-homeroom {
    display: block !important;
    color: var(--edu-text-muted);
    font-size: var(--text-sm);
    text-align: right;
  }

  body.app-body.menu-students table.ops-students-compact .col-student-credits {
    text-align: right !important;
    font-size: var(--text-sm);
    overflow: visible;
  }

  body.app-body.menu-students table.ops-students-compact .col-student-actions {
    text-align: right !important;
    overflow: visible;
  }

  body.app-body.menu-students table.ops-students-compact .student-list-actions {
    display: inline-flex !important;
    width: auto !important;
    min-width: 0;
    justify-content: flex-end !important;
  }

  /* Icon-only action keeps the row to a single line. */
  body.app-body.menu-students table.ops-students-compact .student-list-actions .btn {
    width: auto !important;
    min-width: 36px;
    min-height: 36px !important;
    padding: 6px 8px !important;
    white-space: nowrap !important;
  }

  body.app-body.menu-students table.ops-students-compact .student-report-label {
    display: none;
  }

  .student-mobile-submeta {
    display: block !important;
  }

  body.app-body .col-student-class.desktop-only,
  .students-list-card th.desktop-only,
  .students-list-card td.desktop-only,
  .ops-students-table th.desktop-only,
  .ops-students-table td.desktop-only {
    display: none !important;
  }

  body.app-body.menu-students .students-list-card,
  body.app-body.workspace-ui .students-list-card {
    overflow-x: clip !important;
    padding: 10px 8px !important;
  }

  body.app-body.menu-students .ops-students-table,
  body.app-body.workspace-ui .ops-students-table,
  .students-list-card table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  body.app-body.menu-students .ops-students-table th,
  body.app-body.menu-students .ops-students-table td {
    padding: 8px 4px !important;
    font-size: 12.5px !important;
    vertical-align: middle !important;
  }

  /* 1st col: Name + Submeta */
  body.app-body .col-student-name,
  body.app-body.menu-students .ops-students-table th.col-student-name,
  body.app-body.menu-students .ops-students-table td.col-student-name {
    width: 56% !important;
    max-width: 56% !important;
    text-align: left !important;
  }

  /* 4th col: Credits */
  body.app-body .col-student-credits,
  body.app-body.menu-students .ops-students-table th.col-student-credits,
  body.app-body.menu-students .ops-students-table td.col-student-credits {
    width: 18% !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* 5th col: Manage / Report Button */
  body.app-body .col-student-actions,
  body.app-body.menu-students .ops-students-table th.col-student-actions,
  body.app-body.menu-students .ops-students-table td.col-student-actions {
    width: 26% !important;
    min-width: 68px !important;
    text-align: right !important;
    padding-right: 4px !important;
    white-space: nowrap !important;
  }

  body.app-body .student-report-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 8px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    border-radius: 6px !important;
  }
}

/* On phones, preserve all nine formal columns as a two-column information
   card. No field is merged into the name or removed from the roster. */
@media (max-width: 768px) {
  body.app-body.menu-students table.ops-students-compact {
    min-width: 0 !important;
  }

  body.app-body.menu-students table.ops-students-compact tr:not(:first-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start !important;
    gap: 8px 12px !important;
    margin-bottom: 10px !important;
    padding: 12px !important;
    border: 1px solid var(--edu-border) !important;
    border-radius: var(--radius-lg) !important;
  }

  body.app-body.menu-students table.ops-students-compact td {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    text-align: left !important;
  }

  body.app-body.menu-students table.ops-students-compact td::before {
    content: attr(data-label) !important;
    display: block !important;
    margin-bottom: 3px !important;
    color: var(--edu-text-muted) !important;
    font-size: var(--text-xs) !important;
    font-weight: 700 !important;
  }

  body.app-body.menu-students table.ops-students-compact .col-student-name-en,
  body.app-body.menu-students table.ops-students-compact .col-student-actions,
  body.app-body.menu-students table.ops-students-compact td.empty-msg {
    grid-column: 1 / -1 !important;
  }

  body.app-body.menu-students table.ops-students-compact .col-student-class,
  body.app-body.menu-students table.ops-students-compact .col-student-homeroom {
    display: block !important;
    color: var(--edu-text) !important;
    font-size: var(--text-md) !important;
    text-align: left !important;
  }

  body.app-body.menu-students table.ops-students-compact .col-student-credits {
    text-align: left !important;
  }

  body.app-body.menu-students table.ops-students-compact .col-student-actions {
    padding-top: 4px !important;
    text-align: left !important;
  }

  body.app-body.menu-students table.ops-students-compact .student-list-actions {
    display: flex !important;
    justify-content: flex-start !important;
  }

  body.app-body.menu-students table.ops-students-compact .student-report-label {
    display: inline !important;
  }
}
