.teacher-app {
  width: min(1320px, calc(100% - 36px));
}

.teacher-app [hidden] {
  display: none !important;
}

.teacher-app .teacher-hero {
  margin-bottom: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 0 20px;
  background: transparent;
  box-shadow: none;
}

.teacher-hero h1 {
  font-size: 30px;
}

.teacher-app .teacher-hero p:not(.micro) {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
}

.teacher-hero .actions {
  margin: 0;
}

.teacher-primary-nav {
  position: sticky;
  z-index: 72;
  top: 72px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 24px;
  border-bottom: 1px solid #cbd5e1;
  padding: 10px 0 0;
  background: #f7f8fb;
  scrollbar-width: thin;
}

.teacher-primary-nav button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 8px 18px;
  color: #475569;
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.teacher-primary-nav button:hover,
.teacher-primary-nav button:focus-visible {
  color: #153c64;
  background: #edf4fa;
}

.teacher-primary-nav button.is-active {
  border-color: #13786c;
  color: #14564f;
}

.teacher-app .teacher-class-filter {
  position: static;
  margin: 0 0 26px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.teacher-class-filter > .panel-head {
  align-items: end;
  margin-bottom: 16px;
}

.teacher-class-filter h2 {
  font-size: 22px;
}

.teacher-class-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 0.4fr);
  gap: 28px;
  align-items: start;
}

.teacher-class-groups {
  min-width: 0;
}

.teacher-all-classes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  margin-bottom: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  color: #1e293b;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  font-weight: 750;
}

.teacher-all-classes span {
  color: #64748b;
  font-size: 13px;
}

.teacher-all-classes.is-selected {
  border-color: #13786c;
  color: #14564f;
  background: #edf8f5;
}

.teacher-class-group {
  margin-bottom: 24px;
}

.teacher-class-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #243447;
  font-size: 15px;
  font-weight: 800;
}

.teacher-class-group h3 span {
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.teacher-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(174px, 1fr));
  gap: 10px;
}

.teacher-class-tile {
  display: grid;
  align-content: space-between;
  gap: 7px;
  min-width: 0;
  min-height: 106px;
  border: 1px solid #d7e0e6;
  border-radius: 6px;
  padding: 12px;
  color: #17212d;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
}

.teacher-class-tile:hover,
.teacher-class-tile:focus-visible {
  border-color: #13786c;
  outline: 2px solid rgba(19, 120, 108, 0.14);
}

.teacher-class-tile.is-selected {
  border-color: #13786c;
  background: #f0faf6;
  box-shadow: inset 3px 0 #13786c;
}

.teacher-tile-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.teacher-tile-top strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.teacher-class-code {
  color: #14564f;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.teacher-tile-count,
.teacher-tile-bottom {
  color: #536275;
  font-size: 12px;
  line-height: 1.35;
}

.teacher-tile-bottom {
  min-height: 17px;
}

.teacher-help-count {
  color: #a33c13;
  font-weight: 800;
}

.teacher-class-focus {
  position: sticky;
  top: 147px;
  scroll-margin-top: 134px;
  min-width: 0;
  border-top: 3px solid #13786c;
  border-bottom: 1px solid #cbd5e1;
  padding: 18px 0 20px;
  background: #f7f8fb;
}

.teacher-focus-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.teacher-focus-heading h3 {
  margin: 4px 0 0;
  font-size: 23px;
  line-height: 1.15;
}

.teacher-focus-heading > span {
  color: #64748b;
  font-size: 11px;
  text-align: right;
}

.teacher-focus-heading .teacher-ready {
  color: #14634b;
}

.teacher-focus-heading .teacher-not-ready {
  color: #9a3412;
}

.teacher-focus-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 10px;
  margin: 20px 0;
}

.teacher-focus-metrics div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.teacher-focus-metrics strong {
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.teacher-focus-metrics span {
  color: #526173;
  font-size: 12px;
  line-height: 1.3;
}

.teacher-focus-metrics .needs-attention strong {
  color: #a33c13;
}

.teacher-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.teacher-focus-actions .button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.teacher-focus-pin {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-bottom: 4px;
  border-top: 1px solid #cbd5e1;
  padding-top: 14px;
}

.teacher-focus-pin span {
  color: #526173;
  font-size: 12px;
}

.teacher-focus-pin strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.teacher-focus-pin button {
  margin-left: auto;
  border: 1px solid #b8c7d1;
  border-radius: 6px;
  padding: 6px 9px;
  color: #14564f;
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.teacher-focus-note {
  margin-top: 14px;
  color: #526173;
  font-size: 12px;
  line-height: 1.45;
}

.teacher-app .teacher-live-section .panel,
.teacher-app #teacherStudents {
  box-shadow: none;
}

.teacher-app .teacher-import-panel {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.teacher-select-notice {
  align-self: start;
  color: #526173;
  font-size: 13px;
}

.teacher-metrics-drawer {
  margin: 18px 0;
  border-top: 1px solid #cbd5e1;
  padding-top: 10px;
}

.teacher-metrics-drawer > summary {
  width: max-content;
  color: #14564f;
  cursor: pointer;
  font-weight: 750;
}

.teacher-metrics-drawer .teacher-grid {
  margin-top: 16px;
}

.teacher-app #teacherCcf {
  grid-template-columns: 1fr;
}

.teacher-app .teacher-import-class {
  display: block;
  padding: 0;
  box-shadow: none;
}

.teacher-import-class summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
}

.teacher-import-class summary::-webkit-details-marker {
  display: none;
}

.teacher-import-class summary span {
  color: #526173;
  font-size: 12px;
  text-align: right;
}

.teacher-import-class[open] summary {
  border-bottom: 1px solid #d7e0e6;
  color: #14564f;
}

.teacher-import-class-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.teacher-print-form {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto;
  gap: 10px 18px;
  align-items: end;
  max-width: 760px;
}

.teacher-print-form label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.teacher-print-form select {
  min-height: 42px;
  border: 1px solid #b8c7d1;
  border-radius: 6px;
  padding: 7px 10px;
  background: #ffffff;
}

.teacher-print-form p {
  grid-column: 1 / -1;
  grid-row: 2;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.45;
}

.teacher-print-form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.teacher-saved-access {
  border-bottom: 1px solid #d7e0e6;
  padding: 18px 0 22px;
}

.teacher-saved-access h3 {
  margin: 0;
  font-size: 17px;
}

.teacher-saved-access-note {
  margin: 4px 0 0;
  color: #526173;
  font-size: 13px;
  line-height: 1.5;
}

.teacher-access-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.teacher-access-heading > strong {
  flex: 0 0 auto;
  border: 1px solid #f1c27d;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff8eb;
  color: #9a4b0b;
  font-size: 12px;
}

.teacher-access-heading > strong.is-complete {
  border-color: #9dd3c8;
  background: #effaf7;
  color: #14564f;
}

.teacher-saved-access-controls {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(200px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
}

.teacher-saved-access-controls label {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.teacher-saved-access-controls :is(input, select) {
  width: 100%;
  min-height: 42px;
  border: 1px solid #b8c7d1;
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
  color: #152235;
  font: inherit;
}

.teacher-saved-access-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.teacher-saved-access-actions span {
  flex: 1 1 320px;
  color: #526173;
  font-size: 13px;
  line-height: 1.45;
}

.teacher-saved-access button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.student-access-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.student-profile-link {
  display: grid;
  gap: 2px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #152235;
  text-align: left;
  cursor: pointer;
}

.student-profile-link strong {
  color: #14564f;
  text-decoration: underline;
  text-decoration-color: #9dd3c8;
  text-underline-offset: 3px;
}

.student-profile-link span {
  color: #64748b;
  font-size: 11px;
}

.student-profile-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: #152235;
  box-shadow: 0 24px 70px rgb(15 23 42 / 28%);
}

.student-profile-dialog::backdrop {
  background: rgb(15 23 42 / 58%);
}

.student-profile-dialog-body {
  padding: 22px;
}

.student-profile-header,
.student-profile-section-title,
.student-profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.student-profile-header {
  padding-bottom: 18px;
  border-bottom: 1px solid #d7e0e6;
}

.student-profile-header h2,
.student-profile-section h3,
.student-profile-current h3 {
  margin: 2px 0;
  letter-spacing: 0;
}

.student-profile-header > div > span,
.student-profile-current p,
.student-profile-footer,
.student-profile-empty {
  color: #64748b;
}

.student-profile-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-profile-live {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 750;
}

.student-profile-live.is-active,
.student-profile-live.is-help {
  border-color: #9dd3c8;
  background: #effaf7;
  color: #14564f;
}

.student-profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
  border-block: 1px solid #d7e0e6;
}

.student-profile-metrics > div {
  display: grid;
  gap: 3px;
  padding: 14px;
  border-right: 1px solid #d7e0e6;
}

.student-profile-metrics > div:last-child {
  border-right: 0;
}

.student-profile-metrics strong {
  font-size: 22px;
}

.student-profile-metrics span,
.student-profile-current dt,
.student-profile-lesson span,
.student-profile-competency small,
.student-profile-attempt small {
  color: #64748b;
  font-size: 12px;
}

.student-profile-current {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 24px;
  padding: 16px;
  background: #f5f8fa;
  border-left: 4px solid #2f7d73;
}

.student-profile-current dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 0;
}

.student-profile-current dd {
  margin: 2px 0 0;
  font-weight: 750;
}

.student-profile-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid #efc676;
  background: #fff9ec;
}

.student-profile-alerts span {
  border-left: 1px solid #e2b757;
  padding-left: 8px;
}

.student-profile-section {
  padding: 20px 0;
  border-bottom: 1px solid #d7e0e6;
}

.student-profile-section-title {
  margin-bottom: 12px;
}

.student-profile-section-title > strong {
  color: #526173;
  font-size: 13px;
}

.student-profile-lesson {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(120px, .45fr) 48px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}

.student-profile-lesson > div:first-child {
  display: grid;
  gap: 3px;
}

.student-profile-progress {
  height: 7px;
  overflow: hidden;
  background: #e2e8f0;
}

.student-profile-progress span {
  display: block;
  height: 100%;
  background: #2f7d73;
}

.student-profile-more {
  margin-top: 8px;
  border-top: 1px solid #d7e0e6;
}

.student-profile-more summary {
  padding: 12px 0;
  color: #14564f;
  font-weight: 750;
  cursor: pointer;
}

.student-profile-competencies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px 18px;
}

.student-profile-competency {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.student-profile-competency small {
  grid-column: 1 / -1;
}

.student-profile-attempt {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.student-profile-attempt > div {
  display: grid;
  gap: 3px;
}

.student-profile-result {
  align-self: start;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}

.student-profile-attempt.is-correct .student-profile-result {
  color: #14564f;
}

.student-profile-footer {
  padding-top: 18px;
}

.student-profile-loading {
  display: grid;
  justify-items: start;
  gap: 12px;
  min-height: 180px;
  padding: 28px;
}

.teacher-access-recovery {
  margin-top: 18px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.teacher-access-recovery > summary {
  width: max-content;
  max-width: 100%;
  color: #475569;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.teacher-access-recovery > p,
#teacherSavedAccessRestoreStatus {
  color: #526173;
  font-size: 12px;
  line-height: 1.45;
}

.teacher-access-recovery-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 12px 0 8px;
}

.teacher-access-recovery-controls label {
  display: grid;
  gap: 5px;
  min-width: min(100%, 320px);
  color: #334155;
  font-size: 12px;
  font-weight: 750;
}

.teacher-access-recovery-controls input {
  min-height: 42px;
  border: 1px solid #b8c7d1;
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
}

.teacher-access-danger {
  margin-top: 18px;
  border-top: 1px solid #d7e0e6;
  padding-top: 14px;
}

.teacher-access-danger > summary {
  width: max-content;
  max-width: 100%;
  color: #9a3412;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.teacher-access-danger .teacher-print-form {
  margin-top: 16px;
}

#teacherSavedLabelsPrint {
  display: none;
}

@media print {
  @page { size: A4; margin: 10mm; }

  body.teacher-label-printing {
    width: auto;
    margin: 0;
    background: #fff;
    color: #152235;
  }

  body.teacher-label-printing > :not(#teacherSavedLabelsPrint) {
    display: none !important;
  }

  body.teacher-label-printing #teacherSavedLabelsPrint {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4mm;
    align-content: start;
    font: 14px Arial, sans-serif;
  }

  .teacher-saved-label {
    min-height: 45mm;
    border: 1px solid #9caab5;
    border-radius: 5px;
    padding: 6mm;
    break-inside: avoid;
  }

  .teacher-saved-label-top {
    display: flex;
    justify-content: space-between;
    color: #14564f;
    font-size: 12px;
  }

  .teacher-saved-label h2 {
    margin: 5mm 0;
    font-size: 17px;
    line-height: 1.15;
  }

  .teacher-saved-label dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
  }

  .teacher-saved-label dt {
    color: #526173;
    font-size: 10px;
  }

  .teacher-saved-label dd {
    margin: 2px 0;
    font-size: 18px;
    font-weight: bold;
  }

  .teacher-saved-label p {
    margin: 4mm 0 1mm;
    font-weight: bold;
  }

  .teacher-saved-label small {
    color: #526173;
  }
}

@media (max-width: 900px) {
  .teacher-saved-access-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-saved-access-controls > button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .teacher-class-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .teacher-class-focus {
    position: static;
    order: -1;
    padding: 14px 0;
  }

  .teacher-app .teacher-class-filter .panel-head > div {
    display: block;
  }

  .teacher-focus-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .teacher-access-heading {
    display: grid;
  }

  .teacher-access-heading > strong {
    justify-self: start;
  }

  .teacher-saved-access-controls {
    grid-template-columns: 1fr;
  }

  .teacher-saved-access-controls > button {
    grid-column: auto;
    width: 100%;
  }

  .teacher-app {
    width: calc(100% - 24px);
  }

  .teacher-app .teacher-hero {
    display: flex;
    align-items: start;
    padding-top: 4px;
  }

  .teacher-hero .actions {
    display: none;
  }

  .teacher-primary-nav {
    top: 72px;
    gap: 0;
    overflow-x: visible;
    margin-bottom: 16px;
  }

  .teacher-primary-nav button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding-inline: 4px;
    font-size: 12px;
    line-height: 1.2;
  }

  .teacher-class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .teacher-class-tile {
    min-height: 108px;
    padding: 10px;
  }

  .teacher-tile-top {
    display: grid;
    gap: 2px;
  }

  .teacher-focus-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-print-form {
    grid-template-columns: 1fr;
  }

  .teacher-print-form p {
    grid-row: auto;
  }

  .student-profile-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .student-profile-dialog-body {
    padding: 14px;
  }

  .student-profile-header,
  .student-profile-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .student-profile-metrics,
  .student-profile-competencies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-profile-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .student-profile-current {
    grid-template-columns: 1fr;
  }

  .student-profile-lesson {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .student-profile-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .student-profile-attempt {
    grid-template-columns: 72px 1fr;
  }
}
