.schools-db {
  --schools-ink: var(--ink, #071b38);
  --schools-paper: var(--paper, #fbfaf6);
  --schools-cream: var(--cream, #f2f0e8);
  --schools-mint: var(--lime, #3ce0b5);
  --schools-coral: var(--coral, #d94870);
  --schools-line: var(--line, rgba(7, 27, 56, .2));
  background: var(--schools-paper);
  border-block: 1px solid var(--schools-line);
  color: var(--schools-ink);
  padding: clamp(54px, 7vw, 96px) 4vw;
}

/* Filtering and comparison are client-side conveniences. Keep controls that
   cannot do anything out of the no-JavaScript and invalid-payload experience;
   the complete server-rendered school directory remains visible. */
.schools-db:not(.is-enhanced) :is(
  .schools-filters,
  .school-card__compare,
  .school-compare-tray,
  .school-compare-dialog
) {
  display: none;
}

.schools-db__inner,
.school-profile__inner {
  margin-inline: auto;
  max-width: 1480px;
}

.schools-db__intro {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  margin-bottom: clamp(28px, 4vw, 52px);
}

.schools-db__eyebrow,
.school-profile__eyebrow {
  color: var(--schools-coral);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .16em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.schools-db h2,
.school-profile h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 5vw, 5.2rem);
  letter-spacing: -.045em;
  line-height: .96;
  margin: 0;
}

.schools-db__lede {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.12rem, 1.6vw, 1.5rem);
  line-height: 1.5;
  margin: 20px 0 0;
  max-width: 760px;
}

.schools-db__method {
  align-self: end;
  background: var(--schools-ink);
  color: var(--schools-cream);
  padding: 22px;
}

.schools-db__method strong {
  color: var(--schools-mint);
  display: block;
  font-size: .72rem;
  letter-spacing: .14em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.schools-db__method p {
  font-size: .92rem;
  line-height: 1.55;
  margin: 0;
}

.schools-quick {
  border-block: 1px solid var(--schools-line);
  margin: 0 0 clamp(28px, 4vw, 48px);
  padding: clamp(24px, 3vw, 38px) 0;
}

.schools-quick__head {
  align-items: end;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  margin-bottom: 20px;
}

.schools-db .schools-quick__head h2 {
  font-size: clamp(1.85rem, 3vw, 3.25rem);
  line-height: 1.02;
}

.schools-quick__head > p,
.schools-quick__note {
  line-height: 1.55;
  margin: 0;
}

.intent-table-wrap {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.intent-table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

.intent-table caption {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.intent-table th,
.intent-table td {
  border-bottom: 1px solid var(--schools-line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

.intent-table thead th {
  background: var(--schools-ink);
  color: var(--schools-cream);
  font-size: .68rem;
  letter-spacing: .08em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
}

.intent-table tbody th {
  min-width: 190px;
}

.intent-table tbody th a {
  border-bottom: 1px solid currentColor;
  color: var(--schools-ink);
  font-weight: 900;
}

.intent-table tbody th span {
  display: block;
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.35;
  margin-top: 4px;
}

.schools-quick__note {
  font-size: .82rem;
  margin-top: 12px;
}

.schools-filters {
  background: var(--schools-cream);
  border: 1px solid var(--schools-line);
  margin-bottom: 24px;
  padding: clamp(18px, 2.4vw, 30px);
}

.schools-filters__grid {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(150px, 1fr)) auto;
}

.schools-filter {
  display: grid;
  gap: 7px;
}

.schools-filter label {
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.schools-filter input,
.schools-filter select {
  appearance: none;
  background: var(--schools-paper);
  border: 1px solid var(--schools-ink);
  border-radius: 0;
  color: var(--schools-ink);
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

.schools-filter select {
  background-image: linear-gradient(45deg, transparent 50%, var(--schools-ink) 50%), linear-gradient(135deg, var(--schools-ink) 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 32px;
}

.schools-filter input:focus-visible,
.schools-filter select:focus-visible,
.school-card button:focus-visible,
.school-card a:focus-visible,
.school-compare-tray button:focus-visible,
.school-compare-dialog button:focus-visible,
.school-compare-dialog a:focus-visible {
  outline: 3px solid var(--schools-coral);
  outline-offset: 3px;
}

.schools-filter-reset {
  background: transparent;
  border: 1px solid var(--schools-ink);
  cursor: pointer;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .1em;
  min-height: 46px;
  padding: 10px 16px;
  text-transform: uppercase;
}

.schools-filter-reset:hover {
  background: var(--schools-ink);
  color: var(--schools-cream);
}

.schools-results-bar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 16px;
}

.schools-results-bar p {
  font-size: .84rem;
  font-weight: 800;
  margin: 0;
}

.schools-results-bar a {
  border-bottom: 1px solid currentColor;
  color: var(--schools-coral);
  font-size: .8rem;
  font-weight: 800;
}

.schools-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.school-card {
  background: var(--schools-cream);
  border: 1px solid var(--schools-line);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  position: relative;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.school-card:hover {
  border-color: var(--schools-ink);
  transform: translateY(-2px);
}

.school-card[data-selected="true"] {
  border-color: var(--schools-coral);
  box-shadow: inset 0 0 0 2px var(--schools-coral);
}

.school-card__head {
  align-items: start;
  border-bottom: 1px solid var(--schools-line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 22px 22px 18px;
}

.school-card__number {
  color: var(--schools-coral);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.school-card__location {
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-align: right;
  text-transform: uppercase;
}

.school-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px;
}

.school-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 2.2vw, 2.55rem);
  letter-spacing: -.035em;
  line-height: 1;
  margin: 0;
}

.school-card__name {
  color: rgba(7, 27, 56, .7);
  font-size: .82rem;
  line-height: 1.35;
  margin: 9px 0 16px;
}

.school-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
}

.school-card__tag {
  border: 1px solid var(--schools-line);
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .07em;
  padding: 6px 8px;
  text-transform: uppercase;
}

.school-card__facts {
  border-block: 1px solid var(--schools-line);
  display: grid;
  gap: 0;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 18px;
}

.school-card__facts div {
  min-width: 0;
  padding: 12px 0;
}

.school-card__facts div + div {
  border-left: 1px solid var(--schools-line);
  padding-left: 14px;
}

.school-card__facts dt {
  color: rgba(7, 27, 56, .65);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .09em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.school-card__facts dd {
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}

.school-card__fee-note {
  color: rgba(7, 27, 56, .72);
  font-size: .76rem;
  line-height: 1.45;
  margin: -6px 0 16px;
}

.school-card__summary {
  font-size: .88rem;
  line-height: 1.55;
  margin: 0 0 18px;
}

.school-card__best {
  border-left: 3px solid var(--schools-mint);
  font-size: .82rem;
  line-height: 1.5;
  margin: auto 0 20px;
  padding-left: 12px;
}

.school-card__best strong {
  display: block;
  font-size: .65rem;
  letter-spacing: .1em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.school-card__actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.school-card__profile,
.school-card__compare {
  align-items: center;
  border: 1px solid var(--schools-ink);
  cursor: pointer;
  display: inline-flex;
  font-size: .69rem;
  font-weight: 900;
  justify-content: center;
  letter-spacing: .09em;
  min-height: 44px;
  padding: 10px 12px;
  text-align: center;
  text-transform: uppercase;
}

.school-card__profile {
  background: var(--schools-ink);
  color: var(--schools-cream);
}

.school-card__profile:hover {
  background: var(--schools-coral);
  border-color: var(--schools-coral);
}

.school-card__compare {
  background: transparent;
}

.school-card__compare:hover,
.school-card__compare[aria-pressed="true"] {
  background: var(--schools-mint);
}

.school-card__compare:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.schools-empty {
  border: 1px dashed var(--schools-ink);
  grid-column: 1 / -1;
  padding: 34px;
  text-align: center;
}

.schools-empty h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  margin: 0 0 8px;
}

.schools-empty p {
  margin: 0;
}

.schools-db__caveat {
  border-top: 1px solid var(--schools-line);
  font-size: .78rem;
  line-height: 1.55;
  margin: 26px 0 0;
  padding-top: 18px;
}

.school-compare-tray {
  align-items: center;
  background: var(--schools-ink);
  bottom: 12px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .24);
  color: var(--schools-cream);
  display: grid;
  gap: 16px;
  grid-template-columns: auto 1fr auto;
  margin: 24px auto 0;
  max-width: 1480px;
  padding: 14px 16px;
  position: sticky;
  z-index: 14;
}

.school-compare-tray[hidden] {
  display: none !important;
}

.school-compare-tray__count {
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .08em;
  margin: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.school-compare-tray__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.school-compare-chip {
  align-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .25);
  cursor: pointer;
  display: inline-flex;
  font-size: .68rem;
  font-weight: 800;
  gap: 8px;
  min-height: 34px;
  padding: 6px 9px;
}

.school-compare-chip span {
  color: var(--schools-mint);
  font-size: 1rem;
  line-height: 1;
}

.school-compare-tray__actions {
  display: flex;
  gap: 8px;
}

.school-compare-tray__actions button {
  border: 1px solid rgba(255, 255, 255, .45);
  cursor: pointer;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  min-height: 40px;
  padding: 8px 12px;
  text-transform: uppercase;
}

.school-compare-tray__open {
  background: var(--schools-mint);
  border-color: var(--schools-mint) !important;
  color: var(--schools-ink);
}

.school-compare-tray__open:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: .55;
}

.school-compare-dialog {
  background: var(--schools-paper);
  border: 1px solid var(--schools-ink);
  color: var(--schools-ink);
  margin: auto;
  max-height: min(88vh, 920px);
  max-width: min(1200px, calc(100vw - 32px));
  padding: 0;
  width: 100%;
}

.school-compare-dialog::backdrop {
  background: rgba(2, 14, 31, .78);
}

.school-compare-dialog.is-open {
  display: block;
  inset: 5vh 16px auto;
  position: fixed;
  z-index: 100;
}

.school-compare-dialog__head {
  align-items: start;
  background: var(--schools-ink);
  color: var(--schools-cream);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 20px 22px;
}

.school-compare-dialog__head p {
  color: var(--schools-mint);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .12em;
  margin: 0 0 5px;
  text-transform: uppercase;
}

.school-compare-dialog__head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 3rem);
  letter-spacing: -.03em;
  line-height: 1;
  margin: 0;
}

.school-compare-dialog__close {
  border: 1px solid rgba(255, 255, 255, .55);
  color: var(--schools-cream);
  cursor: pointer;
  flex: none;
  font-size: 1.3rem;
  height: 42px;
  width: 42px;
}

.school-compare-dialog__scroll {
  max-height: calc(88vh - 90px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 0 16px;
}

.school-compare-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.school-compare-table caption {
  font-size: .76rem;
  padding: 14px 18px;
  text-align: left;
}

.school-compare-table th,
.school-compare-table td {
  border: 1px solid var(--schools-line);
  line-height: 1.45;
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

.school-compare-table thead th {
  background: var(--schools-cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.school-compare-table tbody th {
  background: var(--schools-cream);
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .09em;
  min-width: 150px;
  text-transform: uppercase;
}

.school-compare-table td {
  font-size: .84rem;
  min-width: 205px;
}

.school-compare-table a {
  border-bottom: 1px solid currentColor;
  color: var(--schools-coral);
  font-weight: 800;
}

.school-profile {
  background: var(--schools-paper);
  padding: clamp(48px, 7vw, 92px) 4vw;
}

.school-profile__top {
  display: grid;
  gap: 30px;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  margin-bottom: 28px;
}

.school-profile__lede {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  line-height: 1.5;
  margin: 18px 0 0;
}

.school-profile__snapshot {
  align-self: end;
  background: var(--schools-ink);
  color: var(--schools-cream);
  padding: 22px;
}

.school-profile__snapshot strong {
  color: var(--schools-mint);
  display: block;
  font-size: .68rem;
  letter-spacing: .11em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.school-profile__snapshot p {
  line-height: 1.5;
  margin: 0;
}

.school-profile__layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
}

.school-profile__panel {
  border: 1px solid var(--schools-line);
  padding: clamp(20px, 3vw, 34px);
}

.school-profile__panel h2 {
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  margin-bottom: 16px;
}

.school-profile__panel p,
.school-profile__panel li {
  line-height: 1.65;
}

.school-profile__panel ul {
  display: grid;
  gap: 8px;
  list-style: square;
  margin: 0;
  padding-left: 20px;
}

.school-profile__facts {
  display: grid;
  margin: 0;
}

.school-profile__facts div {
  border-bottom: 1px solid var(--schools-line);
  display: grid;
  gap: 8px;
  grid-template-columns: 120px 1fr;
  padding: 12px 0;
}

.school-profile__facts dt {
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.school-profile__facts dd {
  line-height: 1.45;
  margin: 0;
}

.school-profile__fees {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.school-profile__fee-row {
  align-items: baseline;
  border-bottom: 1px solid var(--schools-line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 9px 0;
}

.school-profile__fee-row strong {
  white-space: nowrap;
}

.school-profile__sources {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.school-profile__sources li {
  list-style: none;
}

.school-profile__sources a {
  border-bottom: 1px solid currentColor;
  color: var(--schools-coral);
  font-weight: 800;
}

.school-profile__back {
  align-items: center;
  background: var(--schools-mint);
  border: 1px solid var(--schools-ink);
  display: inline-flex;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .1em;
  margin-top: 26px;
  min-height: 46px;
  padding: 10px 16px;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .schools-filters__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 780px) {
  .schools-db__intro,
  .schools-quick__head,
  .school-profile__top,
  .school-profile__layout {
    grid-template-columns: 1fr;
  }

  .schools-filters__grid {
    grid-template-columns: 1fr 1fr;
  }

  .schools-filter--search,
  .schools-filter-reset {
    grid-column: 1 / -1;
  }

  .school-compare-tray {
    bottom: 0;
    grid-template-columns: 1fr;
    margin-inline: -2vw;
  }

  .school-compare-tray__actions button {
    flex: 1;
  }

  .school-profile__facts div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .schools-db,
  .school-profile {
    padding-inline: 18px;
  }

  .schools-grid,
  .schools-filters__grid {
    grid-template-columns: 1fr;
  }

  .schools-filter--search,
  .schools-filter-reset {
    grid-column: auto;
  }

  .schools-results-bar {
    align-items: start;
    flex-direction: column;
  }

  .school-card__actions {
    grid-template-columns: 1fr;
  }

  .school-card__facts {
    grid-template-columns: 1fr;
  }

  .school-card__facts div + div {
    border-left: 0;
    border-top: 1px solid var(--schools-line);
    padding-left: 0;
  }

  .school-compare-tray {
    margin-inline: -18px;
  }

  .school-compare-tray__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .school-compare-dialog {
    max-width: calc(100vw - 12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .school-card {
    transition: none;
  }
}
