.study-page {
  min-width: 320px;
  color: #172034;
  background: #f5f7fb;
}

.study-header {
  position: relative;
  color: #fff;
  background: #031326;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.study-header .header-inner {
  min-height: 82px;
}

.study-header .main-nav a.current,
.study-header .nav-group.current > .nav-parent {
  color: var(--red);
}

.study-search-hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-5) 0 var(--space-5);
  color: #fff;
  background:
    radial-gradient(circle at 90% 15%, rgba(15, 99, 177, 0.35), transparent 32%),
    radial-gradient(circle at 8% 100%, rgba(223, 12, 55, 0.24), transparent 30%),
    linear-gradient(120deg, #031326, #082442);
}

.study-search-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -150px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(75, 159, 231, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 55px rgba(75, 159, 231, 0.05),
    0 0 0 110px rgba(75, 159, 231, 0.03);
}

.study-search-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.study-search-hero .eyebrow {
  margin: 0 0 var(--space-2);
  color: #ff6177;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.study-search-hero h1 {
  max-width: 820px;
  margin: 0 0 var(--space-2);
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.08;
  letter-spacing: -2px;
}

.study-search-hero > .study-search-hero-inner > p:not(.eyebrow) {
  margin: 0;
  color: #cbd6e2;
  font-size: 18px;
}

.primary-search {
  display: grid;
  grid-template-columns: minmax(300px, 1.55fr) minmax(240px, 0.9fr) 230px;
  gap: 0;
  width: 100%;
  margin-top: var(--space-4);
  padding: var(--space-2);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 54px rgba(0, 6, 17, 0.36);
}

.primary-search-field {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: 22px 32px;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-right: 1px solid #dfe3e9;
}

.primary-search-field svg {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #31405a;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-search-field label {
  color: #26324a;
  font-size: 13px;
  font-weight: 800;
}

.primary-search-field input,
.primary-search-field select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #172034;
  background: #fff;
  font-size: 17px;
}

.primary-search-field input::placeholder {
  color: #778195;
  opacity: 1;
}

.primary-search > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-search > button:hover,
.primary-search > button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 9px 22px rgba(215, 13, 45, 0.28);
}

.study-results-section {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding: var(--section-space-y) var(--container-padding);
}

.results-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: var(--grid-gap);
  align-items: start;
}

.filter-panel {
  border: 1px solid #e1e5ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(19, 35, 61, 0.06);
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border-bottom: 1px solid #e7eaf0;
}

.filter-heading span {
  display: block;
  margin-bottom: var(--space-1);
  color: #778195;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.filter-heading strong {
  display: block;
  font-size: 22px;
}

.filter-close-button {
  display: none;
  border: 0;
  color: #27334a;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.filter-group {
  margin: 0;
  border: 0;
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid #e7eaf0;
}

.filter-group legend,
.filter-group > label:not(.switch-row) {
  display: block;
  width: 100%;
  margin: 0 0 var(--space-2);
  padding: 0;
  color: #172034;
  font-size: 15px;
  font-weight: 800;
}

.filter-group select {
  width: 100%;
  height: 44px;
  border: 1px solid #ccd3df;
  border-radius: 8px;
  padding: 0 var(--space-4) 0 var(--space-2);
  color: #26324a;
  background: #fff;
  font-size: 14px;
}

.check-list {
  display: grid;
  gap: var(--space-2);
}

.check-list label {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  color: #3e495d;
  font-size: 14px;
  cursor: pointer;
}

.check-list input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--red);
}

.check-list small {
  color: #929bab;
  font-size: 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  cursor: pointer;
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  margin-bottom: var(--space-1);
  font-size: 14px;
}

.switch-row small {
  color: #7d8798;
  font-size: 12px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 43px;
  height: 24px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: #c7ced9;
  transition: background 160ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--red);
}

.switch input:checked + span::after {
  transform: translateX(19px);
}

.switch input:focus-visible + span {
  outline: 3px solid rgba(237, 24, 54, 0.2);
  outline-offset: 2px;
}

.reset-filter-button,
.apply-filter-button {
  width: calc(100% - 48px);
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin: var(--space-3) var(--space-3) var(--space-3);
  border: 0;
  border-radius: 8px;
  color: #536075;
  background: #f0f3f7;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.apply-filter-button {
  display: none;
}

.reset-filter-button {
  display: inline-flex;
}

.results-content {
  min-width: 0;
}

.results-header {
  min-height: 74px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid #dfe3e9;
}

.results-kicker {
  margin: 0 0 var(--space-1);
  color: #758096;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.results-header h2 {
  margin: 0;
  color: #172034;
  font-size: clamp(23px, 2.2vw, 30px);
  letter-spacing: -0.7px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: #69758a;
  font-size: 13px;
  white-space: nowrap;
}

.sort-control select,
.mobile-sort select {
  height: 40px;
  border: 1px solid #ccd3df;
  border-radius: 8px;
  padding: 0 var(--space-4) 0 var(--space-2);
  color: #26324a;
  background: #fff;
  font-weight: 600;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  min-height: 25px;
  margin: var(--space-2) 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 29px;
  border: 1px solid #d7dce5;
  border-radius: 18px;
  padding: var(--space-1) var(--space-2);
  color: #39455a;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.filter-chip span {
  color: var(--red);
  font-size: 18px;
  line-height: 12px;
}

.status-message {
  min-height: 0;
  color: #6b768a;
  font-size: 14px;
}

.status-message.error {
  margin: var(--space-3) 0;
  border: 1px solid #ffc5ce;
  border-radius: 10px;
  padding: var(--space-2);
  color: #97152a;
  background: #fff2f4;
}

.result-list {
  display: grid;
  gap: var(--space-2);
}

.uni-logo-box {
  --uni-logo-size: 48px;
  width: var(--uni-logo-size);
  height: var(--uni-logo-size);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle, #dfe4eb);
  border-radius: 8px;
  padding: var(--space-1);
  color: #8a95a7;
  background: #fff;
  box-sizing: content-box;
}

.uni-logo-box--56 { --uni-logo-size: 56px;
 }
.uni-logo-box--64 { --uni-logo-size: 64px;
 }
.uni-logo-box--80 { --uni-logo-size: 80px;
 }
.uni-logo-box--96 { --uni-logo-size: 96px;
 }

.uni-logo-box img,
.uni-logo-box svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.uni-logo-box svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.study-card-main {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.study-card-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  overflow: hidden;
  border: 1px solid #e0e4eb;
  border-radius: 13px;
  padding: var(--space-3);
  background: #fff;
  box-shadow: 0 6px 20px rgba(19, 35, 61, 0.04);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--red);
  transform: scaleY(0);
  transition: transform 160ms ease;
}

.result-card:hover {
  border-color: #cbd2de;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(19, 35, 61, 0.09);
}

.result-card:hover::before {
  transform: scaleY(1);
}

.result-card h3 {
  margin: 0 0 var(--space-1);
  color: #101a2d;
  font-size: 21px;
  line-height: 1.25;
}

.result-card .stretched-link::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
}

.result-card h3 a:hover,
.result-card h3 a:focus-visible {
  color: var(--red);
}

.result-card .university {
  margin: 0 0 var(--space-2);
  color: #566176;
  font-size: 15px;
  font-weight: 600;
}

.card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  color: #697489;
  font-size: 13px;
}

.card-facts span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.card-facts svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.card-badge {
  border-radius: 5px;
  padding: var(--space-1);
  color: #324057;
  background: #eaf0f7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.card-badge.free {
  color: #167047;
  background: #e3f6ed;
}

.card-badge.restricted {
  color: #93520a;
  background: #fff2dc;
}

.card-badge.language {
  color: #3e4c8a;
  background: #e9ebfb;
}

.card-action {
  position: relative;
  z-index: 2;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 42px;
  border: 1px solid #d4dae4;
  border-radius: 8px;
  padding: 0 var(--space-2);
  color: #26334b;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.card-action:hover,
.card-action:focus-visible {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.card-action span {
  margin-left: var(--space-1);
  font-size: 17px;
  transition: transform 150ms ease;
}

.card-action:hover span,
.card-action:focus-visible span {
  transform: translateX(3px);
}

.result-skeleton {
  min-height: 174px;
  border: 1px solid #e0e4eb;
  border-radius: 13px;
  padding: var(--space-4);
  background: #fff;
}

.result-skeleton span {
  display: block;
  width: 72%;
  height: 14px;
  margin-bottom: var(--space-2);
  border-radius: 5px;
  background: linear-gradient(90deg, #eef1f5 25%, #f7f8fa 50%, #eef1f5 75%);
  background-size: 200% 100%;
}

.result-skeleton span:first-child {
  width: 48%;
  height: 22px;
}

.result-skeleton span:last-child {
  width: 88%;
}

@media (prefers-reduced-motion: no-preference) {
  .result-skeleton span {
    animation: skeleton 1.3s ease-in-out infinite alternate;
  }

  @keyframes skeleton {
    to {
      opacity: 0.48;
    }
  }
}

.empty-state {
  margin-top: var(--space-3);
  border: 1px solid #e0e4eb;
  border-radius: 14px;
  padding: var(--space-5) var(--space-3);
  text-align: center;
  background: #fff;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-2);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--red);
  background: #ffe9ed;
  font-size: 27px;
  font-weight: 800;
}

.empty-state h3 {
  margin: 0 0 var(--space-2);
  font-size: 22px;
}

.empty-state p {
  max-width: 480px;
  margin: 0 auto var(--space-3);
  color: #6c778b;
  line-height: 1.55;
}

.empty-state button,
.load-more-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 var(--space-3);
  color: #fff;
  background: var(--red);
  font-weight: 800;
  cursor: pointer;
}

.load-more-wrap {
  padding-top: var(--space-3);
  text-align: center;
}

.load-more-button {
  border: 1px solid #ccd3de;
  color: #2c384d;
  background: #fff;
}

.mobile-toolbar {
  display: none;
}

@media (max-width: 1020px) {
  .study-header .header-inner {
    min-height: 72px;
  }

  .study-search-hero {
    padding: var(--space-4) var(--space-3) var(--space-5);
  }

  .primary-search {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .primary-search .location-field {
    border-right: 0;
  }

  .primary-search > button {
    grid-column: 1 / -1;
    min-height: 52px;
    margin-top: var(--space-1);
  }

  .study-results-section {
    width: 100%;
  }

  .results-layout {
    display: block;
  }

  .mobile-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }

  .filter-open-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    border: 1px solid #cad1dd;
    border-radius: 8px;
    padding: 0 var(--space-2);
    color: #28354c;
    background: #fff;
    font-weight: 800;
  }

  .filter-open-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
  }

  .filter-count {
    min-width: 21px;
    height: 21px;
    border-radius: 11px;
    padding: 0 var(--space-1);
    color: #fff;
    background: var(--red);
    font-size: 11px;
    line-height: 21px;
  }

  .filter-panel {
    position: fixed;
    z-index: 51;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(390px, calc(100% - 42px));
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .filter-panel.open {
    transform: translateX(0);
  }

  .filter-backdrop {
    position: fixed;
    z-index: 50;
    inset: 0;
    background: rgba(2, 10, 23, 0.58);
  }

  .filter-close-button {
    display: block;
  }

  .apply-filter-button {
    display: flex;
    margin-bottom: 0;
    color: #fff;
    background: var(--red);
  }

  .sort-control {
    display: none;
  }
}

@media (max-width: 767px) {
  .result-card {
    grid-template-columns: 1fr;
  }

  .study-card-main {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .study-card-main > .uni-logo-box {
    align-self: flex-start;
  }

  .result-card .card-action {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .study-search-hero {
    padding: var(--space-4) var(--space-2) var(--space-4);
  }

  .study-search-hero h1 {
    font-size: 36px;
    letter-spacing: -1.4px;
  }

  .study-search-hero > .study-search-hero-inner > p:not(.eyebrow) {
    font-size: 16px;
    line-height: 1.5;
  }

  .primary-search {
    grid-template-columns: 1fr;
    margin-top: var(--space-3);
    padding: var(--space-1);
  }

  .primary-search-field {
    min-height: 66px;
    border-right: 0;
    border-bottom: 1px solid #e1e5eb;
    padding: var(--space-1) var(--space-2);
  }

  .primary-search > button {
    grid-column: auto;
  }

  .study-results-section {
    width: 100%;
  }

  .mobile-sort select {
    max-width: 142px;
  }

  .results-header {
    min-height: 68px;
  }

  .results-header h2 {
    font-size: 22px;
  }

  .result-card {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3) var(--space-3);
  }

  .result-card h3 {
    font-size: 19px;
  }

  .card-action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-skeleton span {
    animation: none;
  }
}
