.allotment-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}
.allotment-eyebrow {
  margin: 0 0 7px;
  color: var(--blue-mid);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.allotment-intro-copy { max-width: 72ch; color: var(--text-muted); }
.allotment-dataset-summary { margin: 10px 0 0; color: var(--blue-dark); font-weight: 700; }
.allotment-notice { margin: 0; }
.allotment-notice h2 { font-size: 0.95rem; }
.course-browser-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  padding: 7px 10px;
  color: var(--blue-dark);
  background: var(--white);
  border: 1px solid var(--blue-mid);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.course-browser-link:hover { color: var(--white); background: var(--blue-mid); }
.allotment-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.75fr) minmax(0, 2.25fr);
  gap: 16px;
  align-items: start;
}
.allotment-layout[hidden] { display: none; }
.allotment-picker { min-width: 0; }
.allotment-picker .section-body { padding: 12px; }
.allotment-picker input,
.allotment-picker select { margin-bottom: 7px; }
.allotment-picker select { width: 100%; }
.allotment-picker-hint { margin: 0 0 8px; color: var(--text-muted); font-size: 0.8rem; }
.allotment-picker-note { margin: -2px 0 10px; color: var(--text-muted); font-size: 0.72rem; line-height: 1.35; }
.college-list {
  display: grid;
  gap: 5px;
  max-height: 650px;
  overflow: auto;
  padding-right: 2px;
}
.college-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  padding: 9px 8px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
}
.college-option:hover:not(:disabled) { color: var(--blue-dark); background: var(--blue-light); }
.college-option[aria-selected="true"] {
  color: var(--blue-dark);
  background: var(--blue-light);
  border-color: var(--blue-mid);
  font-weight: 700;
}
.college-option-name { min-width: 0; }
.college-metrics {
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  min-width: 52px;
  text-align: right;
}
.college-count,
.college-score-total {
  padding: 2px 5px;
  color: var(--blue-dark);
  background: var(--white);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  white-space: nowrap;
}
.college-score-total {
  color: var(--red-alert);
  font-size: 0.68rem;
}
.allotment-main { min-width: 0; }
.allotment-selected-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 12px;
  border-bottom: 3px solid var(--blue-dark);
}
.allotment-selected-heading h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(1.2rem, 2.3vw, 1.8rem);
  line-height: 1.2;
}
.allotment-selected-heading p { margin: 5px 0 0; color: var(--text-muted); font-size: 0.85rem; }
.allotment-total { flex: 0 0 auto; color: var(--text-muted); text-align: right; }
.allotment-total strong { display: block; color: var(--red-alert); font-size: 1.45rem; line-height: 1.05; }
.allotment-total span { font-size: 0.72rem; text-transform: uppercase; }
.allotment-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.allotment-stat {
  display: grid;
  gap: 3px;
  min-height: 70px;
  padding: 11px 12px;
  background: var(--white);
  border: 1px solid var(--border);
}
.allotment-stat span { color: var(--text-muted); font-size: 0.73rem; text-transform: uppercase; }
.allotment-stat strong { color: var(--blue-dark); font-size: 1.1rem; }
.allotment-filters {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) minmax(90px, 0.6fr) minmax(90px, 0.6fr) minmax(170px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--gray-bg);
  border: 1px solid var(--border);
}
.allotment-filters > div { min-width: 0; }
.allotment-filters label { font-size: 0.77rem; }
.allotment-filters input,
.allotment-filters select { min-width: 0; }
.allotment-reset {
  width: auto;
  min-width: 110px;
  background: var(--white);
  color: var(--blue-dark);
  border-color: var(--blue-mid);
  font-size: 0.82rem;
}
.allotment-reset:hover:not(:disabled) { color: var(--white); }
.allotment-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
}
.allotment-results-toolbar p { margin: 0; font-size: 0.82rem; }
.allotment-page-size {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  white-space: nowrap;
}
.allotment-page-size select { width: auto; min-height: 34px; padding: 5px 8px; }
.allotment-results { overflow: hidden; }
.allotment-results .table-wrap { max-width: 100%; }
.allotment-table { min-width: 1020px; font-size: 0.78rem; }
.allotment-table th { position: sticky; top: 0; z-index: 1; }
.allotment-table td { vertical-align: middle; }
.allotment-table tbody tr:nth-child(odd) { background: #fffaf6; }
.allotment-table tbody tr:nth-child(even) { background: #f6f8fb; }
.serial-cell { color: var(--blue-dark); font-weight: 700; white-space: nowrap; }
.candidate-name { display: block; color: var(--blue-dark); font-weight: 700; }
.candidate-sub { display: block; margin-top: 3px; color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; }
.candidate-score { color: var(--red-alert); font-weight: 700; }
.category-tag { display: inline-block; padding: 2px 6px; color: var(--blue-dark); background: var(--blue-light); border: 1px solid #b9cce5; font-size: 0.7rem; white-space: nowrap; }
.remark-cell { color: var(--text-muted); white-space: nowrap; }
.mobile-records { display: none; }
.record-card { padding: 13px; border-bottom: 1px solid var(--border); background: var(--white); }
.record-card:nth-child(even) { background: #f6f8fb; }
.record-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.record-score { flex: 0 0 auto; color: var(--red-alert); font-weight: 700; white-space: nowrap; }
.record-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  margin: 12px 0 0;
}
.record-meta div { min-width: 0; }
.record-meta dt { color: var(--text-muted); font-size: 0.7rem; }
.record-meta dd { margin: 2px 0 0; font-size: 0.82rem; overflow-wrap: anywhere; }
.record-meta .category-tag { max-width: 100%; white-space: normal; }
.allotment-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.allotment-pagination > div { display: flex; gap: 8px; }
.allotment-page-button {
  width: auto;
  min-width: 84px;
  min-height: 36px;
  padding: 6px 10px;
}
.allotment-page-button:disabled { color: var(--text-muted); background: var(--gray-bg); }
.empty-state { padding: 28px 16px; color: var(--text-muted); text-align: center; }
.empty-state strong { display: block; color: var(--blue-dark); }
.empty-state p { margin: 5px 0 0; }
#load-message { margin-bottom: 14px; }
@media (max-width: 900px) {
  .allotment-layout { grid-template-columns: minmax(210px, 0.8fr) minmax(0, 2fr); }
  .allotment-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .allotment-reset { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 768px) {
  .allotment-intro, .allotment-layout { grid-template-columns: 1fr; }
  .allotment-picker { order: 0; }
  .allotment-picker .section-body { padding: 10px; }
  .college-list { max-height: 230px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .allotment-main { order: 1; }
  .allotment-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .allotment-filter-search { grid-column: 1 / -1; }
  .allotment-reset { grid-column: 1 / -1; }
  .desktop-records { display: none; }
  .mobile-records { display: block; }
  .allotment-results-toolbar { align-items: flex-start; padding: 8px 0; }
  .allotment-pagination { flex-wrap: wrap; }
}
@media (max-width: 460px) {
  .allotment-selected-heading { gap: 8px; }
  .allotment-total strong { font-size: 1.2rem; }
  .allotment-stat-grid { gap: 6px; }
  .allotment-stat { min-height: 64px; padding: 8px; }
  .allotment-stat span { font-size: 0.64rem; }
  .allotment-stat strong { font-size: 0.96rem; }
  .college-list { grid-template-columns: 1fr; }
  .allotment-results-toolbar { flex-direction: column; justify-content: flex-start; gap: 5px; }
  .record-meta { gap: 8px; }
}