.data-source-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 16px 20px;
  border: 1px solid rgba(155, 16, 43, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.data-source-bar > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.data-source-bar strong {
  color: var(--primary);
}

.data-source-bar span:not(.source-dot) {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.data-source-bar a {
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.source-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.14);
}

.study-data-loading,
.study-data-error {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  text-align: left;
}

.study-data-loading strong,
.study-data-loading span,
.study-data-error strong,
.study-data-error span {
  display: block;
}

.study-data-loading strong,
.study-data-error strong {
  color: var(--primary);
  font-size: 20px;
}

.study-data-loading span,
.study-data-error span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.study-data-error {
  flex-direction: column;
  text-align: center;
}

.loading-spinner {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 4px solid rgba(155, 16, 43, 0.16);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: study-spin 0.8s linear infinite;
}

@keyframes study-spin {
  to { transform: rotate(360deg); }
}

.study-filter-panel {
  padding: 30px;
}

.filter-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.filter-kicker {
  display: block;
  margin-bottom: 5px;
  color: #fda4af;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.reset-filter {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}

.reset-filter:hover {
  color: var(--primary);
  background: #fff;
}

.primary-filter-grid {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(180px, 0.55fr) minmax(260px, 1.2fr);
  gap: 14px;
  margin-top: 24px;
}

.filter-field {
  min-width: 0;
}

.filter-field > span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 800;
}

.study-filter-panel .input,
.study-filter-panel .select {
  min-height: 54px;
  background: rgba(255, 255, 255, 0.1);
}

.study-filter-panel .input:focus,
.study-filter-panel .select:focus {
  border-color: #fda4af;
  box-shadow: 0 0 0 3px rgba(253, 164, 175, 0.14);
}

.advanced-filters {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.advanced-filters summary {
  width: fit-content;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

.advanced-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.finder-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.finder-metrics article {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 19px 20px;
  border: 1px solid rgba(155, 16, 43, 0.11);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.finder-metrics span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.finder-metrics strong {
  color: var(--primary);
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.finder-metrics .metric-warning strong {
  color: #b45309;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 34px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.1);
}

.result-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: #f3f4f6;
}

.result-tab {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: #4b5563;
  background: transparent;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
}

.result-tab.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 20px rgba(155, 16, 43, 0.22);
}

.result-actions,
.result-actions label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-actions label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.result-actions select {
  min-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #252525;
  background: #fff;
  font-family: inherit;
  font-weight: 800;
}

.result-actions > a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.result-summary {
  min-height: 27px;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 800;
}

.program-results,
.path-results {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.program-card,
.qualification-path-card {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.program-card::before,
.qualification-path-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--primary);
}

.program-card-head,
.path-card-head,
.program-card-footer,
.path-card-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.program-heading {
  min-width: 0;
}

.program-heading h3 {
  margin-top: 8px;
  color: #1f2937;
  font-size: 20px;
  line-height: 1.55;
  font-weight: 900;
}

.program-faculty {
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
}

.program-code {
  min-width: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 12px;
  color: #fff;
  background: #111114;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.program-card .tags {
  margin: 13px 0 15px;
}

.program-card-footer,
.path-card-footer {
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.program-card-footer > span,
.path-card-footer > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.text-button {
  border: 0;
  color: var(--primary);
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.eligible-paths {
  margin-top: 15px;
  padding: 14px;
  border-radius: 16px;
  background: #f8fafc;
}

.eligible-paths ul {
  display: grid;
  gap: 9px;
  list-style: none;
}

.eligible-paths li {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.65;
  font-weight: 700;
}

.eligible-paths li strong {
  color: #1f2937;
}

.path-card-head h3 {
  color: var(--primary);
  font-size: 21px;
  font-weight: 900;
}

.path-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.path-badge,
.program-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 900;
}

.path-result-count {
  min-width: 82px;
  text-align: right;
}

.path-result-count strong,
.path-result-count span {
  display: block;
}

.path-result-count strong {
  color: var(--primary);
  font-size: 28px;
  line-height: 1;
}

.path-result-count span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.qualification-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
  list-style: none;
}

.qualification-flow li {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
}

.qualification-flow span,
.qualification-flow strong {
  display: block;
}

.qualification-flow span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.qualification-flow strong {
  color: #27313f;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.qualification-path-card.needs-review::before {
  background: #f59e0b;
}

.review-label {
  color: #b45309;
  font-weight: 900;
}

.study-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}

.study-pagination button,
.study-pagination span {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: #4b5563;
  background: #fff;
  font-family: inherit;
  font-weight: 900;
}

.study-pagination button {
  cursor: pointer;
}

.study-pagination button:hover,
.study-pagination button.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.study-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.study-empty {
  margin-top: 22px;
  padding: 38px 24px;
  border: 1px dashed rgba(155, 16, 43, 0.28);
  border-radius: 22px;
  background: #fff;
  text-align: center;
}

.study-empty strong,
.study-empty span {
  display: block;
}

.study-empty strong {
  color: var(--primary);
  font-size: 20px;
}

.study-empty span {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.study-caveat {
  margin-top: 28px;
}

.study-caveat strong {
  display: block;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .primary-filter-grid,
  .advanced-filter-grid,
  .finder-metrics,
  .qualification-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions {
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .data-source-bar,
  .filter-panel-head,
  .program-card-head,
  .path-card-head,
  .program-card-footer,
  .path-card-footer,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-filter-grid,
  .advanced-filter-grid,
  .finder-metrics,
  .qualification-flow {
    grid-template-columns: 1fr;
  }

  .study-filter-panel,
  .program-card,
  .qualification-path-card {
    padding: 20px;
  }

  .result-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .result-tab {
    width: 100%;
  }

  .result-actions label {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions select,
  .result-actions > a {
    width: 100%;
  }

  .path-result-count {
    text-align: left;
  }

  .study-data-loading {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation-duration: 1.8s;
  }
}

