.history-preview {
  position: relative;
  overflow: hidden;
  margin-top: 28px;
  padding: 38px;
  border: 1px solid #d8dff1;
  border-radius: 30px;
  background:
    linear-gradient(135deg, #ffffff 0%, #f8f9ff 62%, #eef3ff 100%);
  box-shadow: 0 20px 50px #0b1c3d0b;
}

.result-mode-switch {
  display: flex;
  width: fit-content;
  margin: 28px auto 0;
  padding: 5px;
  border: 1px solid #d8dff1;
  border-radius: 14px;
  background: #e9edf7;
}

.result-mode-switch[hidden] {
  display: none;
}

.result-mode-switch button {
  min-width: 150px;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #718096;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.result-mode-switch button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 3px 10px #0b1c3d12;
}

.result-mode-switch button:focus-visible {
  outline: 3px solid #9db8ff;
  outline-offset: 2px;
}

.school-type-filter {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px auto 0;
}

.school-type-filter[hidden] {
  display: none;
}

.school-type-filter button {
  padding: 7px 15px;
  border: 1px solid #d8dff1;
  border-radius: 999px;
  background: #fff;
  color: #718096;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.school-type-filter button.active {
  border-color: #1557e8;
  background: #1557e8;
  color: #fff;
}

.school-type-filter button:focus-visible {
  outline: 3px solid #9db8ff;
  outline-offset: 2px;
}

.result-sort {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 12px auto 0;
  color: #52627a;
  font-size: 13px;
  font-weight: 800;
}

.result-sort[hidden] {
  display: none;
}

.result-sort select {
  padding: 8px 32px 8px 11px;
  border: 1px solid #d8dff1;
  border-radius: 10px;
  background: #fff;
  color: #0b1c3d;
  font: inherit;
  font-weight: 800;
}

.result-sort small {
  color: #7b879b;
  font-weight: 650;
}

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

.history-eyebrow {
  margin: 0 0 9px;
  color: #6557c8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
}

.history-heading h2 {
  margin: 0;
  font-size: 28px;
}

.history-heading p:not(.history-eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
}

.history-notice {
  display: flex;
  gap: 14px;
  margin: 24px 0 18px;
  padding: 13px 16px;
  border-left: 4px solid #7768d7;
  border-radius: 10px;
  background: #f0effc;
  color: #565f73;
  font-size: 13px;
}

.history-notice b {
  flex: none;
  color: #4f43a7;
}

.history-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.history-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 20px;
  border: 1px solid #dce2ef;
  border-radius: 18px;
  background: #fff;
}

.year-mark {
  position: absolute;
  right: -7px;
  bottom: -22px;
  color: #eef1f8;
  font-size: 68px;
  font-weight: 950;
  letter-spacing: -.06em;
  pointer-events: none;
}

.history-card-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-card small {
  color: #8490a5;
  font-weight: 700;
}

.history-card h3 {
  margin: 6px 0 0;
  font-size: 18px;
}

.history-status {
  flex: none;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.history-status.match {
  background: #eaf8f2;
  color: var(--green);
}

.history-status.open {
  background: #edf3ff;
  color: var(--blue);
}

.history-status.confirm {
  background: #fff1e8;
  color: #bd570f;
}

.history-direction {
  position: relative;
  margin: 20px 0 14px;
  color: #46546b;
  font-size: 14px;
  font-weight: 750;
}

.history-tags {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-tags span {
  padding: 6px 8px;
  border-radius: 8px;
  background: #f3f6fa;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.history-sources {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.history-source {
  color: #7768d7;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.history-source.university {
  color: var(--blue);
}

.history-source:hover {
  text-decoration: underline;
}

.history-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border: 1px dashed #cfd8ea;
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.history-more {
  margin-top: 18px;
}

.history-guide {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.history-guide a {
  color: #6557c8;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 1000px) {
  .history-cards {
    grid-template-columns: 1fr;
  }

  .history-card {
    min-height: 190px;
  }
}

@media (max-width: 700px) {
  .history-preview {
    padding: 22px;
    border-radius: 22px;
  }

  .history-heading {
    flex-direction: column;
  }

  .result-mode-switch {
    width: 100%;
  }

  .result-mode-switch button {
    flex: 1;
    min-width: 0;
    text-align: center;
  }

  .history-notice {
    flex-direction: column;
    gap: 5px;
  }

  .history-guide {
    flex-direction: column;
    gap: 6px;
  }

  .result-sort {
    flex-wrap: wrap;
  }

  .result-sort small {
    flex-basis: 100%;
    text-align: center;
  }
}
