body {
  background: #fff;
  color: #222;
  font-family: Arial, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  margin: 0;
}

.skip-link {
  background: #000;
  color: #fff;
  left: 8px;
  padding: 6px 10px;
  position: absolute;
  text-decoration: none;
  top: -100px;
  z-index: 10;
}

.skip-link:focus {
  top: 8px;
}

.page {
  background: #fff;
  border: 1px solid #d6d6d6;
  margin: 18px auto;
  max-width: 1100px;
  padding: 12px 16px 20px;
}

.site-footer {
  color: #5b574f;
  font-size: 12px;
  margin: 0 auto 18px;
  max-width: 1100px;
  padding: 0 16px;
  text-align: center;
}

.site-footer nav {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 6px;
}

.site-footer a {
  color: #5b574f;
  font-weight: bold;
}

.site-footer p {
  margin: 0;
}

h1 {
  color: #000;
  font-size: 24px;
  margin: 0 0 4px;
}

header p {
  margin: 0 0 16px;
}

.page-heading {
  align-items: baseline;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.info-link {
  color: #5b574f;
  font-weight: bold;
}

.info-page {
  max-width: 800px;
}

.info-page h2 {
  border-bottom: 3px solid #ffcd00;
  color: #5b574f;
  font-size: 18px;
  margin: 22px 0 8px;
  padding-bottom: 3px;
}

.info-page li {
  margin: 6px 0;
}

.info-list {
  margin: 0;
}

.info-list > div {
  border-bottom: 1px solid #ddd;
  padding: 8px 0;
}

.info-list dt {
  font-weight: bold;
}

.info-list dd {
  margin: 2px 0 0;
}

.back-navigation {
  margin: 0 0 14px;
}

.back-navigation a {
  align-items: center;
  color: #5b574f;
  display: inline-flex;
  font-size: 14px;
  font-weight: bold;
  gap: 6px;
  text-decoration: none;
}

.back-navigation a:hover {
  text-decoration: underline;
}

.back-navigation a:focus-visible {
  outline: 2px solid #ffcd00;
  outline-offset: 3px;
}

.filters {
  background: #eee;
  border: 1px solid #d0d0d0;
  border-top: 4px solid #ffcd00;
  display: grid;
  gap: 10px 14px;
  grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr) minmax(260px, 1.4fr);
  margin-bottom: 14px;
  padding: 12px;
}

.filters label {
  font-weight: bold;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.filter-field-course input {
  width: 100%;
}

.filter-field-course {
  grid-column: 1 / -1;
}

.display-options {
  align-items: center;
  border: 0;
  display: grid;
  gap: 8px 12px;
  grid-column: 3 / -1;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  margin: 0;
  min-width: 0;
  padding: 0;
}

.checkbox-label {
  align-items: center;
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.display-options legend {
  color: #5b574f;
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  padding: 0;
}

.grouped-instructor {
  width: 360px;
  max-width: 360px;
  overflow: hidden;
  white-space: nowrap;
}

input,
select {
  border: 1px solid #999;
  border-radius: 0;
  box-sizing: border-box;
  font: inherit;
  min-height: 28px;
  padding: 3px 5px;
}

input {
  width: 100%;
}

input[type="checkbox"] {
  flex: 0 0 auto;
  height: 16px;
  margin: 0;
  width: 16px;
}

select {
  min-width: 150px;
}

#status {
  font-weight: bold;
  margin: 0 0 6px;
}

.mobile-sort {
  display: none;
}

.column-settings {
  margin: 0 0 14px;
}

.settings-toggle {
  background: #eee;
  border-color: #999;
  color: #222;
}

.settings-toggle[aria-expanded="true"] {
  background: #5b574f;
  color: #fff;
}

.column-settings-panel {
  align-items: end;
  background: #eee;
  border: 1px solid #d0d0d0;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-top: 4px;
  padding: 10px 12px;
}

.column-settings-panel[hidden] {
  display: none;
}

.column-settings-panel fieldset {
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
}

.column-settings-panel legend {
  color: #5b574f;
  font-weight: bold;
  margin-bottom: 6px;
  padding: 0;
  width: 100%;
}

.secondary-button {
  background: transparent;
  color: #5b574f;
  white-space: nowrap;
}

.column-hidden {
  display: none !important;
}

.status-message {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 24px;
}

.loading-indicator {
  animation: loading-spin 800ms linear infinite;
  border: 2px solid #bbb;
  border-right-color: #ffcd00;
  border-radius: 50%;
  display: inline-block;
  height: 14px;
  width: 14px;
}

.status-message.is-error,
.error-message {
  color: #8a1c1c;
}

.comparison-panel {
  border: 1px solid #d0d0d0;
  border-top: 4px solid #ffcd00;
  margin: 0 0 14px;
  padding: 10px 12px 12px;
}

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

.comparison-heading h2 {
  color: #5b574f;
  font-size: 18px;
  margin: 0;
}

.comparison-status {
  margin: 3px 0 8px;
}

.comparison-table {
  min-width: 800px;
}

.comparison-table td:not(:first-child) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.comparison-selection {
  text-align: center;
  width: 54px;
}

.selection-heading {
  white-space: nowrap;
}

.error-message {
  align-items: center;
  background: #fbeaea;
  border: 1px solid #d99;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 12px 0;
  padding: 10px;
}

.error-message[hidden] {
  display: none;
}

.error-message p {
  margin: 0;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 10px;
}

button {
  background: #5b574f;
  border: 1px solid #4a4741;
  color: #fff;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  padding: 4px 9px;
}

button:disabled {
  cursor: default;
  color: #c9c7c2;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #ffcd00;
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .loading-indicator {
    animation: none;
  }
}

.table-wrapper {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 650px;
  width: 100%;
}

th,
td {
  border: 1px solid #aaa;
  padding: 5px 7px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #5b574f;
  color: #fff;
}

.sort-button {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: bold;
  padding: 0;
  text-align: left;
}

.sort-button:hover {
  text-decoration: underline;
}

.sort-indicator {
  display: inline-block;
  height: 12px;
  margin-left: 4px;
  position: relative;
  vertical-align: -1px;
  width: 10px;
}

.sort-indicator::before,
.sort-indicator::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  content: "";
  left: 1px;
  position: absolute;
}

.sort-indicator::before {
  border-bottom: 5px solid #888;
  top: 0;
}

.sort-indicator::after {
  border-top: 5px solid #888;
  bottom: 0;
}

.sort-indicator.sort-ascending::before {
  border-bottom-color: #ffcd00;
}

.sort-indicator.sort-ascending::after,
.sort-indicator.sort-descending::before {
  border-top-color: transparent;
  border-bottom-color: transparent;
}

.sort-indicator.sort-descending::after {
  border-top-color: #ffcd00;
}

.course-link {
  color: #0645ad;
  text-decoration: underline;
}

.detail-controls {
  align-items: center;
  background: #eee;
  border: 1px solid #d0d0d0;
  border-top: 4px solid #ffcd00;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
  padding: 8px;
}

.detail-controls select {
  min-width: 220px;
}

.detail-controls .checkbox-label {
  margin-left: 8px;
}

.summary-section {
  margin: 16px 0 8px;
}

.summary-section h3 {
  margin-bottom: 8px;
}

.summary-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.summary-grid > div {
  background: #eee;
  border: 1px solid #d0d0d0;
  border-top: 3px solid #ffcd00;
  padding: 8px;
}

.summary-grid dt {
  font-size: 12px;
  font-weight: bold;
}

.summary-grid dd {
  font-size: 20px;
  font-weight: bold;
  margin: 4px 0 0;
}

.histogram {
  align-items: flex-start;
  display: flex;
  height: 290px;
  margin: 0 auto;
  max-width: 592px;
  padding: 8px 0 0;
  user-select: none;
}

.histogram-plot {
  align-items: end;
  border: 1px solid #555;
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  gap: 3px;
  height: 250px;
  min-width: 0;
  padding: 18px 3px 3px;
  position: relative;
}

.histogram-column {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: end;
  height: 100%;
  position: relative;
  z-index: 1;
}

.histogram-count {
  font-size: 12px;
  height: 16px;
  line-height: 16px;
}

.histogram-bar {
  background: #ffcd00;
  border: 1px solid #c7a600;
  box-sizing: border-box;
  min-height: 0;
  width: 100%;
}

.histogram-label {
  background: #fff;
  font-weight: bold;
  margin-top: 5px;
  min-height: 18px;
  white-space: nowrap;
}

.histogram-axis-title {
  font-size: 12px;
}

.histogram-x-axis-title {
  bottom: -30px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.distribution-table {
  margin: 20px auto 0;
  max-width: 592px;
  min-width: 0;
  width: calc(100% - 8px);
}

.distribution-table th,
.distribution-table td {
  padding: 7px 10px;
}

.distribution-table th:first-child,
.distribution-table td:first-child {
  text-align: left;
}

.distribution-table th:last-child,
.distribution-table td:last-child {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.distribution-table tbody tr:nth-child(even) {
  background: #f4f4f4;
}

.distribution-table caption {
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
}

tbody tr:nth-child(even) {
  background: #f4f4f4;
}

@media (max-width: 640px) {
  .site-footer nav {
    flex-wrap: wrap;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .comparison-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .comparison-heading button {
    align-self: flex-start;
  }

  .mobile-sort {
    align-items: center;
    display: flex;
    gap: 8px;
    margin: 0 0 10px;
  }

  .column-settings-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .column-settings-panel fieldset {
    flex-direction: column;
  }

  .secondary-button {
    align-self: flex-start;
  }

  .mobile-sort label {
    font-weight: bold;
  }

  .mobile-sort select {
    flex: 1;
  }

  .page {
    border-left: 0;
    border-right: 0;
    margin: 0;
  }

  .filters {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
  }

  .filter-field,
  .filter-field-course,
  .display-options {
    width: 100%;
  }

  .display-options {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 0;
  }

  input,
  select {
    max-width: none;
    width: 100%;
  }

  .histogram {
    height: 290px;
    overflow-x: auto;
  }

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

  .histogram-plot {
    flex-basis: 500px;
  }

  .comparison-table {
    min-width: 0;
  }

  .table-wrapper {
    overflow: visible;
  }

  table {
    min-width: 0;
  }

  .table-wrapper > table:not(.comparison-table),
  .comparison-table {
    table-layout: fixed;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody,
  tbody tr,
  tbody td {
    display: block;
  }

  tbody tr {
    background: #fff;
    border: 1px solid #aaa;
    margin-bottom: 10px;
  }

  tbody tr:nth-child(even) {
    background: #fff;
  }

  tbody td {
    align-items: baseline;
    border: 0;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 24px;
    overflow-wrap: anywhere;
    padding: 6px 8px;
  }

  tbody td::before {
    color: #555;
    content: attr(data-label);
    flex: 0 0 105px;
    font-size: 12px;
    font-weight: bold;
  }

  tbody td:last-child {
    border-bottom: 0;
  }

  tbody td:first-child {
    background: #f2f2f2;
    font-size: 16px;
    font-weight: bold;
  }

  tbody td:first-child::before {
    font-size: 12px;
    font-weight: bold;
  }

  #course-results tr {
    position: relative;
  }

  #course-results td.comparison-selection {
    background: transparent;
    border-bottom: 0;
    display: flex;
    align-items: center;
    min-height: 0;
    height: 37px;
    padding: 0 8px;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
    z-index: 1;
  }

  #course-results td.comparison-selection::before {
    content: none;
  }

  #course-results td.comparison-selection input {
    height: 20px;
    width: 20px;
  }

  #course-results td:nth-child(2) {
    padding-right: 44px;
  }

  .comparison-table tbody tr {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .comparison-table tbody td {
    min-width: 0;
  }

  .comparison-table tbody td:first-child,
  .comparison-table tbody td:nth-child(2) {
    grid-column: 1 / -1;
  }

  .comparison-table tbody td:first-child {
    background: #f2f2f2;
  }

  .comparison-table tbody td:nth-child(2) {
    color: #555;
    font-size: 13px;
    font-weight: normal;
  }

  .comparison-table tbody td:nth-child(n + 3) {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    min-height: 54px;
    padding: 7px 5px;
    text-align: center;
  }

  .comparison-table tbody td:nth-child(n + 3)::before {
    flex: none;
    font-size: 11px;
    text-transform: uppercase;
  }

  .comparison-table tbody td:nth-child(n + 3):not(:last-child) {
    border-bottom: 1px solid #ddd;
  }

  .distribution-table {
    border-collapse: separate;
    border-spacing: 0;
    display: table;
    margin: 20px 0 0;
    width: 100%;
  }

  .distribution-table thead {
    display: table-header-group;
  }

  .distribution-table tbody {
    display: table-row-group;
  }

  .distribution-table tr {
    display: table-row;
    margin: 0;
  }

  .distribution-table th,
  .distribution-table td {
    display: table-cell;
    min-height: 0;
    padding: 9px 10px;
  }

  .distribution-table th {
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .distribution-table th:first-child,
  .distribution-table td:first-child {
    text-align: left;
  }

  .distribution-table th:last-child,
  .distribution-table td:last-child {
    text-align: right;
  }

  .distribution-table tbody tr:nth-child(even) {
    background: #f4f4f4;
  }

  .distribution-table tbody td {
    border-bottom: 1px solid #ddd;
  }

  .distribution-table tbody td::before {
    content: none;
  }

  .distribution-table tbody td:first-child {
    background: transparent;
    font-size: inherit;
    font-weight: normal;
  }

  .distribution-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .grouped-instructor {
    max-width: none;
    width: auto;
  }
}
