.compare-content {
  background: #dde9ff;
  border-radius: 20px;
  padding: clamp(16px, 2vw, 28px);
  box-shadow: inset 0 0 0 1px #a8bee8;
}

.compare-hero h1 {
  margin: 0;
  font-size: clamp(30px, 3.2vw, 42px);
  color: #16243d;
}

.compare-hero p {
  margin: 8px 0 0;
  color: #2b3b55;
  font-size: 18px;
}

.compare-toolbar {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.toolbar-search {
  flex: 1 1 560px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f6f9ff;
  border-radius: 999px;
  border: 1px solid #b4c6ea;
  padding: 8px;
}

.toolbar-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: #182233;
  padding: 8px 14px;
}

.toolbar-search button,
.add-school-toolbar-btn {
  border: none;
  background: linear-gradient(135deg, #1d86ff, #1262d8);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 15px;
}

.add-school-toolbar-btn {
  flex: 0 0 auto;
  min-width: 140px;
}

.compare-summary {
  margin: 14px 2px 0;
  color: #233451;
  font-size: 16px;
  font-weight: 700;
}

.comparison-board {
  margin-top: 10px;
  background: #c5d7fa;
  border: 1px solid #9fb9e8;
  border-radius: 18px;
  padding: 16px;
}

.compare-columns {
  display: flex;
  gap: 14px;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 4px;
}

.compare-card {
  flex: 0 0 min(290px, calc(100vw - 110px));
  border-radius: 16px;
  border: 1px solid #abc2eb;
  background: #fdfefe;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 510px;
  box-sizing: border-box;
}

.compare-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.compare-card-header h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  color: #13233c;
}

.compare-card-header a {
  color: #13233c;
  text-decoration: none;
}

.compare-card-header a:hover {
  text-decoration: underline;
}

.remove-school-btn {
  border: 1px solid #c6d6f4;
  background: #f5f8ff;
  color: #28406a;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
}

.school-subtitle {
  margin: 10px 0 0;
  color: #3d4d69;
  font-size: 14px;
}

.school-type-badge {
  margin-top: 10px;
  display: inline-block;
  background: #e7efff;
  color: #274169;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.compare-metrics {
  margin-top: 14px;
  border: 1px solid #d5e1f7;
  border-radius: 12px;
  overflow: hidden;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-top: 1px solid #e8eefb;
  font-size: 14px;
}

.metric-row:first-child {
  border-top: none;
}

.metric-label {
  color: #40506b;
  font-weight: 700;
}

.metric-value {
  color: #1262d8;
  font-weight: 700;
  text-align: right;
}

.compare-card-footer {
  margin-top: auto;
  padding-top: 12px;
}

.compare-card-footer a {
  display: inline-flex;
  text-decoration: none;
  color: #fff;
  background: #1b73e8;
  border-radius: 9px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 14px;
}

.compare-card.add-card {
  justify-content: center;
  align-items: center;
  border-style: dashed;
  background: #f4f8ff;
}

.add-card-plus {
  font-size: 38px;
  line-height: 1;
  border: 1px solid #a8c0ea;
  background: #fff;
  color: #145dc4;
  border-radius: 999px;
  width: 66px;
  height: 66px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.add-card-text {
  margin-top: 12px;
  font-weight: 700;
  color: #243b5d;
}

.empty-state-card {
  min-height: 250px;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.error-card {
  min-height: 180px;
  color: #8d1737;
  background: #ffe7ef;
  border-color: #f2adc1;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 33, 48, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  width: min(760px, 96vw);
  max-height: 85vh;
  background: #f6f9ff;
  border: 1px solid #b3c6eb;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-header h2 {
  margin: 0;
  color: #16243d;
  font-size: 24px;
}

.modal-close-btn {
  border: 1px solid #b8caed;
  background: #fff;
  border-radius: 8px;
  padding: 5px 11px;
  font-weight: 700;
  cursor: pointer;
}

.modal-search-row {
  margin-top: 12px;
}

.modal-search-row input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #b8caed;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}

.modal-results {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  overflow-y: auto;
  max-height: 58vh;
}

.modal-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #d4e0f7;
  border-radius: 11px;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.modal-result-name {
  color: #172641;
  margin: 0;
  font-weight: 700;
  font-size: 15px;
}

.modal-result-meta {
  margin: 3px 0 0;
  color: #445572;
  font-size: 13px;
}

.modal-add-btn {
  border: none;
  background: #1a74ea;
  color: #fff;
  border-radius: 8px;
  padding: 8px 11px;
  font-weight: 700;
  min-width: 64px;
}

.modal-add-btn:disabled {
  background: #a2b8dd;
  cursor: not-allowed;
}

.modal-empty {
  margin: 16px 2px 2px;
  color: #4a5d7d;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid #d7e2f6;
  margin-top: 10px;
}

.modal-secondary-btn {
  border: 1px solid #b9cceb;
  background: #fff;
  color: #2a436d;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 840px) {
  .compare-card {
    min-height: 430px;
  }

  .compare-card-header h3 {
    font-size: 20px;
  }

  .metric-row {
    padding: 9px 10px;
  }

  .modal-card {
    max-height: 90vh;
  }
}

@media (max-width: 560px) {
  .compare-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-search {
    flex-basis: auto;
  }

  .toolbar-search button {
    padding: 9px 12px;
  }

  .add-school-toolbar-btn {
    width: 100%;
  }
}
