/* Teaching identities (#800): keep the canonical name and existing controls.
   Scoped outside drawers/login/Practice. Important declarations only supersede
   the legacy important name typography; role colours and focus remain Aurora. */
#content :is(.student-link, .student-name-two-line, .journal-person-name, .session-person-name, .person-two-line):not(.practice-student-name):has(> .student-surname) {
  display: grid;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: start;
  line-height: 1.35 !important;
}

#content :is(.student-link, .student-name-two-line, .journal-person-name, .session-person-name, .person-two-line):not(.practice-student-name) > .student-surname {
  display: block !important;
  font-size: .9375rem !important;
  font-weight: 750 !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--linea-text-primary) !important;
}

#content :is(.student-link, .student-name-two-line, .journal-person-name, .session-person-name, .person-two-line):not(.practice-student-name) > .student-given {
  display: block !important;
  margin-top: 0 !important;
  font-size: .8125rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  color: var(--linea-text-secondary) !important;
}

/* A badge is metadata for this name, never an inline continuation of it. */
#content :is(.student-link, .student-name-two-line, .journal-person-name, .session-person-name, .person-two-line):not(.practice-student-name):has(> .student-surname) + .role-pill,
#content td > .numbered-student-cell + .role-pill {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 6px 0 0;
  white-space: normal;
  line-height: 1.3;
}

/* Both roster cards and existing numbered table cells use the same columns. */
#content .numbered-student-cell,
#content .numbered-roster .roster-person {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 6px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

#content :is(.numbered-student-cell, .numbered-roster .roster-person) > .row-number {
  grid-column: 1;
  grid-row: 1;
}

#content :is(.numbered-student-cell, .numbered-roster .roster-person) > :is(.student-link, .student-name-two-line) {
  grid-column: 2;
  grid-row: 1;
}

#content :is(.numbered-student-cell, .numbered-roster .roster-person) > .role-pill {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  max-width: 100%;
  margin: 0;
  white-space: normal;
  line-height: 1.3;
}

/* Legacy auto-numbering leaves role-pill outside the wrapper. Align it without
   moving nodes, rebinding handlers or changing that shared JS contract. */
#content td > .numbered-student-cell + .role-pill {
  margin-inline-start: 36px;
  max-width: calc(100% - 36px);
}

/* Auto-layout analytics tables otherwise shrink wrapped names to a few letters.
   Keep a readable name column; wide teaching data still scrolls in table-wrap. */
#content td > :is(.student-link, .numbered-student-cell):not(.practice-student-name):has(.student-surname) {
  min-width: 13.75rem;
  max-width: 18rem;
}

/* Static teaching-context spacing, formerly blocked inline style attributes. */
#content .teaching-section-spacing { margin-top: 12px; }

/* A grid track must not expand the page to the table minimum-content width. */
#content #groupWorkspacePane .analytics-page { grid-template-columns: minmax(0, 1fr); }
#content #groupAnalyticsBody { min-width: 0; }

#content .roster-export-actions {display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}
