.student-insights-shell {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.student-insights-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.student-domain-switch,
.student-insights-view-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--slate-300);
  border-radius: 10px;
  background: var(--slate-100);
}

.student-domain-switch button,
.student-insights-view-switch button {
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--navy-900);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.student-domain-switch button.active,
.student-insights-view-switch button.active {
  background: var(--navy-900);
  color: #fff;
  box-shadow: 0 1px 3px rgb(19 35 58 / 18%);
}

.student-domain-switch button:focus-visible,
.student-insights-view-switch button:focus-visible,
.student-mastery-sort:focus-visible {
  outline: 3px solid rgb(31 111 178 / 30%);
  outline-offset: 2px;
}

.student-insights-content {
  min-width: 0;
}

.student-insights-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #fff;
}

.student-insights-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.student-insights-heading h2,
.student-insights-heading p {
  margin: 0;
}

.student-insights-heading > p {
  max-width: 34rem;
  color: var(--slate-500);
  text-align: right;
}

.student-engagement-table-wrap,
.student-mastery-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.student-engagement-table,
.student-mastery-table {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.student-engagement-table th,
.student-engagement-table td,
.student-mastery-table th,
.student-mastery-table td {
  padding: 10px 8px;
  border-right: 1px solid var(--slate-200);
  border-bottom: 1px solid var(--slate-200);
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.student-engagement-table th:first-child,
.student-engagement-table td:first-child,
.student-mastery-table th:first-child,
.student-mastery-table td:first-child {
  border-left: 1px solid var(--slate-200);
}

.student-engagement-table thead th,
.student-mastery-table thead th {
  border-top: 1px solid var(--slate-200);
  background: var(--slate-100);
  color: var(--navy-950);
  font-weight: 800;
  text-align: center;
}

.student-engagement-table thead th:first-child,
.student-mastery-table thead tr:first-child th:first-child {
  border-top-left-radius: 8px;
}

.student-engagement-table thead th:last-child,
.student-mastery-table thead tr:first-child th:last-child {
  border-top-right-radius: 8px;
}

.student-engagement-table tbody th,
.student-mastery-table tbody th {
  color: var(--navy-950);
  text-align: left;
}

.student-engagement-table td,
.student-mastery-table td {
  color: var(--slate-700);
  text-align: center;
}

.student-not-started {
  display: inline-block;
  line-height: 1.15;
  text-align: center;
}

.student-engagement-table tbody tr:last-child th,
.student-engagement-table tbody tr:last-child td,
.student-mastery-table tbody tr:last-child th,
.student-mastery-table tbody tr:last-child td {
  border-bottom-color: var(--slate-300);
}

.student-mastery-heading {
  align-items: center;
}

.student-mastery-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  color: var(--slate-700);
  font-size: 0.78rem;
}

.student-mastery-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.student-mastery-square {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid var(--slate-500);
  border-radius: 3px;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 82%);
}

.student-mastery-square.is-excellent {
  border-color: #0d5f35;
  background: #147a45;
}

.student-mastery-square.is-strong {
  border-color: #269760;
  background: #d9f1e4;
}

.student-mastery-square.is-good {
  border-color: #729524;
  background: #e9f0cf;
}

.student-mastery-square.is-average {
  border-color: #bd7810;
  background: #fae8c5;
}

.student-mastery-square.is-weak {
  border-color: #bd343e;
  background: #f8dadd;
}

.student-mastery-square.is-notAvailable {
  border-color: var(--slate-500);
  background: var(--slate-100);
}

.student-curriculum-item-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  width: 100%;
}

.student-mastery-practice {
  align-self: start;
  justify-self: end;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--blue-500);
  border-radius: 5px;
  background: #fff;
  color: var(--blue-700);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.student-mastery-practice:hover {
  background: var(--blue-50);
}

.student-mastery-practice:focus-visible {
  outline: 3px solid rgb(31 111 178 / 30%);
  outline-offset: 2px;
}

.student-mastery-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.student-mastery-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--navy-950);
  font-size: 0.82rem;
  font-weight: 800;
}

.student-mastery-filters select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 7px 30px 7px 9px;
  border: 1px solid var(--slate-300);
  border-radius: 7px;
  background: #fff;
  color: var(--navy-950);
  font: inherit;
  font-weight: 500;
}

.student-mastery-table-wrap {
  --student-mastery-visible-row-height: 3.25rem;
  max-height: calc(
    (var(--student-mastery-visible-row-height) * 20) + 6.5rem
  );
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-bottom: 1px solid var(--slate-200);
}

.student-mastery-table-wrap::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.student-mastery-table {
  font-size: 0.74rem;
}

.student-mastery-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.student-mastery-table thead th {
  padding: 8px 4px;
}

.student-mastery-table tbody tr {
  min-height: var(--student-mastery-visible-row-height);
}

.student-mastery-table tbody th,
.student-mastery-table tbody td {
  min-width: 0;
  padding: 9px 5px;
}

.student-mastery-item-col {
  width: 36%;
}

.student-mastery-count-col,
.student-mastery-score-col,
.student-mastery-level-col {
  width: 6.4%;
}

.student-mastery-sort {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 3px 1px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.student-curriculum-paths {
  display: grid;
  gap: 4px;
  line-height: 1.35;
}

.student-curriculum-path {
  display: grid;
  gap: 2px;
}

.student-curriculum-context,
.student-curriculum-skill {
  display: block;
}

.student-curriculum-context {
  color: var(--blue-700);
}

.student-curriculum-skill {
  color: var(--navy-950);
}

.student-curriculum-path + .student-curriculum-path {
  padding-top: 4px;
  border-top: 1px dashed var(--slate-200);
}

.student-insights-empty,
.student-insights-loading,
.student-insights-error {
  margin: 0;
  padding: 28px;
  border: 1px dashed var(--slate-300);
  border-radius: 9px;
  background: var(--blue-50);
  color: var(--slate-700);
  text-align: center;
}

.student-insights-error {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.student-insights-error p {
  margin: 0;
}

@media (max-width: 1050px) {
  .student-insights-toolbar,
  .student-insights-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .student-insights-heading > p {
    text-align: left;
  }

  .student-mastery-legend {
    justify-content: flex-start;
  }

  .student-mastery-table {
    font-size: 0.67rem;
  }

  .student-mastery-table th,
  .student-mastery-table td {
    padding-right: 3px;
    padding-left: 3px;
  }
}

@media (max-width: 700px) {
  .student-domain-switch,
  .student-insights-view-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .student-mastery-filters {
    grid-template-columns: 1fr;
  }

  .student-mastery-table {
    font-size: 0.6rem;
  }

  .student-mastery-square {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }
}
