:root {
  --navy-950: #082238;
  --navy-900: #0d2d46;
  --navy-800: #123b59;
  --navy-700: #1a4c6e;
  --blue-600: #176ca1;
  --gold-500: #d9aa43;
  --gold-300: #f1d693;
  --ink: #16293b;
  --muted: #687786;
  --muted-strong: #4a5d6e;
  --line: #dce4ea;
  --line-strong: #cad6df;
  --surface: #ffffff;
  --surface-soft: #f6f9fb;
  --surface-alt: #edf3f7;
  --page: #f3f6f8;
  --success: #187b5b;
  --success-soft: #e7f6ef;
  --blue-soft: #e9f3fa;
  --gold-soft: #fbf3df;
  --danger: #b54842;
  --danger-soft: #fff0ee;
  --shadow-sm: 0 8px 24px rgba(14, 42, 64, 0.07);
  --shadow-lg: 0 24px 70px rgba(7, 31, 49, 0.14);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #ecf3f7;
  --muted: #9eafbd;
  --muted-strong: #c0ccd5;
  --line: #284357;
  --line-strong: #355368;
  --surface: #122c40;
  --surface-soft: #0e2537;
  --surface-alt: #19364a;
  --page: #091e2d;
  --success: #69d4aa;
  --success-soft: #143f37;
  --blue-soft: #143951;
  --gold-soft: #43391f;
  --danger: #ff9b94;
  --danger-soft: #482929;
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

select {
  color-scheme: light;
}

select option,
select optgroup {
  background-color: #ffffff;
  color: #16293b;
}

html[data-theme="dark"] select {
  color-scheme: dark;
}

html[data-theme="dark"] select option,
html[data-theme="dark"] select optgroup {
  background-color: #0d2d46;
  color: #f7fbff;
}

html[data-theme="dark"] select option:checked {
  background-color: #176ca1;
  color: #ffffff;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(217, 170, 67, 0.55);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  right: 50%;
  transform: translate(50%, -140%);
  border-radius: 10px;
  background: var(--gold-500);
  color: #172331;
  padding: 10px 18px;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translate(50%, 0);
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--navy-950);
  color: #fff;
}

.header-inner {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px 14px 14px 5px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent),
    var(--navy-700);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.04);
  color: var(--gold-300);
  font-size: 22px;
  font-weight: 900;
}

.brand-mark::after {
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--gold-500);
  content: "";
}

.brand > span:last-child,
.footer-brand > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-size: 15px;
  font-weight: 850;
}

.brand small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.theme-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 700;
  transition: 150ms ease;
}

.theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.theme-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--gold-300);
  font-size: 16px;
}

.theme-icon.moon,
html[data-theme="dark"] .theme-icon.sun {
  display: none;
}

html[data-theme="dark"] .theme-icon.moon {
  display: inline-grid;
}

.hero {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 20%, rgba(50, 121, 158, 0.34), transparent 27%),
    radial-gradient(circle at 80% 8%, rgba(217, 170, 67, 0.1), transparent 24%),
    linear-gradient(125deg, var(--navy-950), var(--navy-900) 56%, #153f5a);
  color: #fff;
}

.hero::before {
  position: absolute;
  top: -100px;
  left: -80px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 60px rgba(255, 255, 255, 0.025),
    0 0 0 120px rgba(255, 255, 255, 0.015);
  content: "";
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to left, #000 0, transparent 75%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 66px 0 128px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--gold-300);
  font-size: 12px;
  font-weight: 800;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 5px rgba(217, 170, 67, 0.13);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 5vw, 66px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.22;
}

.hero h1 span {
  display: block;
  color: var(--gold-300);
}

.hero p {
  max-width: 660px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.9;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 27px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.hero-stats strong {
  color: #fff;
  font-size: 17px;
  font-weight: 850;
}

.hero-stats .visit-counter {
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  padding: 4px 10px;
}

.visit-counter-icon {
  color: var(--gold-300);
  font-size: 12px;
}

.visit-counter[data-state="loading"] {
  opacity: 0.72;
}

.visit-counter[data-state="error"] {
  color: rgba(255, 255, 255, 0.55);
}

.search-wrap,
.results-section,
.source-note {
  width: min(1180px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.search-wrap {
  position: relative;
  z-index: 3;
  margin-top: -78px;
}

.public-disclaimer {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  margin: 0 0 24px;
  border: 1px solid rgba(185, 124, 28, 0.28);
  border-radius: 16px;
  background: #fff8e8;
  padding: 16px 18px;
}

.public-disclaimer-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #f1b84a;
  color: #3c2a05;
  font-size: 19px;
  font-weight: 950;
}

.public-disclaimer h3 {
  margin: 0 0 4px;
  color: #3c2a05;
  font-size: 14px;
  font-weight: 900;
}

.public-disclaimer p {
  margin: 0;
  color: #6b5325;
  font-size: 11px;
  line-height: 1.9;
}

html[data-theme="dark"] .public-disclaimer {
  border-color: rgba(241, 184, 74, 0.3);
  background: rgba(78, 57, 17, 0.48);
}

html[data-theme="dark"] .public-disclaimer h3 {
  color: #ffe4a2;
}

html[data-theme="dark"] .public-disclaimer p {
  color: #e9d8ad;
}

.search-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: clamp(22px, 3.2vw, 38px);
}

.search-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-kicker {
  margin: 0 0 5px;
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 850;
}

html[data-theme="dark"] .section-kicker {
  color: #79bfe7;
}

.search-card-head h2,
.results-toolbar h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: -0.025em;
}

.search-card-head p:last-child,
.results-toolbar > div > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.verified-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--success) 20%, transparent);
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 750;
}

.verified-badge span {
  display: inline-grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--success);
  color: var(--surface);
  font-size: 10px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  display: flex;
  min-height: 21px;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.field-label em {
  border-radius: 999px;
  background: var(--gold-soft);
  color: #8a6414;
  padding: 2px 7px;
  font-size: 9px;
  font-style: normal;
}

html[data-theme="dark"] .field-label em {
  color: var(--gold-300);
}

.field small {
  color: var(--muted);
  font-size: 10px;
}

.input-shell {
  position: relative;
  display: flex;
  min-height: 52px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  transition: 150ms ease;
}

.input-shell:focus-within {
  border-color: #3d86ae;
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(35, 112, 154, 0.11);
}

.input-shell input,
.input-shell select {
  width: 100%;
  height: 50px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 650;
}

.input-shell input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.input-shell select {
  appearance: none;
  padding-left: 36px;
}

.input-shell select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.select-shell::after {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.average-shell {
  border-color: color-mix(in srgb, var(--blue-600) 42%, var(--line-strong));
  background: var(--blue-soft);
}

.average-shell input {
  direction: ltr;
  padding-left: 48px;
  text-align: right;
  font-size: 17px;
  font-weight: 850;
}

.input-suffix {
  position: absolute;
  left: 14px;
  color: var(--blue-600);
  font-size: 14px;
  font-weight: 850;
}

.search-shell input {
  padding-right: 42px;
}

.search-symbol {
  position: absolute;
  right: 15px;
  color: var(--muted);
  font-size: 19px;
  transform: rotate(-18deg);
}

.field-error .input-shell {
  border-color: var(--danger);
  background: var(--danger-soft);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 11%, transparent);
}

.field-error small {
  color: var(--danger);
  font-weight: 700;
}

.advanced-filters {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.advanced-filters summary {
  display: flex;
  list-style: none;
  align-items: center;
  justify-content: space-between;
  padding: 17px 2px 8px;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.advanced-filters summary::-webkit-details-marker {
  display: none;
}

.advanced-filters summary > span:first-child::before {
  display: inline-block;
  width: 20px;
  color: var(--blue-600);
  content: "＋";
  font-size: 16px;
}

.advanced-filters[open] summary > span:first-child::before {
  content: "−";
}

.summary-hint {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.advanced-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  padding: 12px 0 4px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.primary-button {
  display: inline-flex;
  min-width: 160px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  box-shadow: 0 9px 22px rgba(14, 60, 89, 0.2);
  color: #fff;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 850;
  transition: 150ms ease;
}

.primary-button:hover {
  box-shadow: 0 12px 28px rgba(14, 60, 89, 0.28);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.primary-button span {
  font-size: 19px;
  transform: rotate(-18deg);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  padding: 10px 2px;
  font-size: 12px;
  font-weight: 750;
}

.form-note {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.results-section {
  margin-top: 38px;
  scroll-margin-top: 20px;
}

.initial-state,
.loading-state,
.error-state {
  display: flex;
  min-height: 250px;
  align-items: center;
  justify-content: center;
  gap: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  padding: 34px;
}

.initial-visual {
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 26px 26px 26px 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--blue-600);
  font-size: 28px;
  font-weight: 900;
}

.initial-visual i {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 25px;
  height: 25px;
  border: 5px solid var(--page);
  border-radius: 50%;
  background: var(--gold-500);
}

.initial-state h2,
.error-state h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.initial-state p,
.error-state p,
.loading-state p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

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

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.error-state > span {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 25px;
  font-weight: 900;
}

[hidden] {
  display: none !important;
}

.results-content {
  padding-top: 12px;
}

.eligibility-notice {
  margin: -6px 0 18px;
  border: 1px solid color-mix(in srgb, var(--gold-500) 38%, var(--line));
  border-radius: 13px;
  background: var(--gold-soft);
  color: var(--muted-strong);
  padding: 11px 14px;
  font-size: 11px;
  line-height: 1.8;
}

.eligibility-notice strong {
  color: var(--ink);
}

.results-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.results-toolbar h2 strong {
  color: var(--blue-600);
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.sort-control select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-bottom: 18px;
}

.summary-grid article {
  display: flex;
  min-height: 80px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 15px;
}

.summary-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  font-size: 17px;
  font-weight: 850;
}

.summary-icon.blue {
  background: var(--blue-soft);
  color: var(--blue-600);
}

.summary-icon.gold {
  background: var(--gold-soft);
  color: #99701a;
}

.summary-icon.green {
  background: var(--success-soft);
  color: var(--success);
}

.summary-grid article div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-grid small,
.cutoff-block small,
.margin-block small {
  color: var(--muted);
  font-size: 10px;
}

.summary-grid strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 13px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-strong);
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
}

.filter-chip button {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--muted);
  padding: 0;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 135px 130px;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 21px 22px;
  transition: 150ms ease;
}

.result-card::before {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 4px;
  background: var(--blue-600);
  content: "";
  opacity: 0.72;
}

.result-card:hover {
  border-color: color-mix(in srgb, var(--blue-600) 30%, var(--line));
  box-shadow: 0 15px 34px rgba(9, 45, 70, 0.1);
  transform: translateY(-1px);
}

.result-main {
  min-width: 0;
}

.result-university {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 7px;
}

.result-identity {
  min-width: 0;
  flex: 1;
}

.rank-badge {
  display: inline-grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 850;
}

.result-university h3,
.result-university-name {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.5;
}

.result-college-name {
  margin: 4px 0 0;
  color: var(--blue-700);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.result-department-name {
  margin: 3px 0 0;
  color: var(--muted-strong);
  font-size: 16px;
  font-weight: 780;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.result-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.channel-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 9px;
  font-weight: 850;
}

.channel-free {
  border: 1px solid color-mix(in srgb, var(--success) 28%, transparent);
  background: var(--success-soft);
  color: var(--success);
}

.channel-parallel {
  border: 1px solid color-mix(in srgb, var(--gold-500) 35%, transparent);
  background: var(--gold-soft);
  color: #8a6414;
}

html[data-theme="dark"] .channel-parallel {
  color: var(--gold-300);
}

.channel-evening {
  border: 1px solid color-mix(in srgb, var(--blue-600) 32%, transparent);
  background: var(--blue-soft);
  color: var(--blue-600);
}

.channel-private {
  border: 1px solid color-mix(in srgb, #7e57c2 32%, transparent);
  background: color-mix(in srgb, #7e57c2 13%, var(--surface));
  color: #6741ad;
}

.channel-competitive {
  border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

html[data-theme="dark"] .channel-private {
  color: #c8afff;
}

html[data-theme="dark"] .channel-evening {
  color: #8acced;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.result-tags span {
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
}

.result-tags .source-page {
  border: 1px solid var(--line);
  background: transparent;
}

.result-tags .parallel-rule {
  background: var(--gold-soft);
  color: #8a6414;
}

html[data-theme="dark"] .result-tags .parallel-rule {
  color: var(--gold-300);
}

.result-tags .evening-rule {
  background: var(--blue-soft);
  color: var(--blue-600);
}

.result-tags .evening-reduction,
.result-tags .evening-gender {
  background: var(--danger-soft);
  color: var(--danger);
}

html[data-theme="dark"] .result-tags .evening-rule {
  color: #8acced;
}

.cutoff-block,
.margin-block,
.fee-block {
  display: flex;
  min-height: 62px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  text-align: center;
}

.private-card {
  grid-template-columns: minmax(0, 1fr) 185px 185px;
}

.government-fee-card {
  grid-template-columns: minmax(0, 1fr) 125px 120px 180px;
  gap: 14px;
}

.fee-block {
  gap: 3px;
}

.fee-block small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.fee-block strong {
  color: var(--navy-700);
  font-size: 17px;
  font-weight: 950;
  line-height: 1.6;
}

html[data-theme="dark"] .fee-block strong {
  color: #8acced;
}

.private-cutoff {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  line-height: 1.45;
}

.private-cutoff small {
  color: var(--muted-strong);
  font-size: 9px;
  font-weight: 800;
}

.private-cutoff b {
  color: var(--success);
  font-size: 13px;
  font-weight: 950;
}

html[data-theme="dark"] .private-cutoff b {
  color: #71d8b2;
}

.fee-block em {
  display: -webkit-box;
  max-width: 170px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cutoff-block strong {
  margin-top: 3px;
  color: var(--navy-700);
  font-size: 20px;
  font-weight: 950;
}

.cutoff-block > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

html[data-theme="dark"] .cutoff-block strong {
  color: #8acced;
}

.margin-block strong {
  margin-top: 3px;
  color: var(--success);
  font-size: 15px;
  font-weight: 900;
}

.margin-block span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.load-more {
  display: flex;
  min-width: 220px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 22px auto 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 800;
}

.load-more span {
  color: var(--muted);
  font-size: 9px;
}

.empty-results {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  padding: 44px 20px;
  text-align: center;
}

.empty-results > div {
  color: var(--muted);
  font-size: 38px;
  transform: rotate(-18deg);
}

.empty-results h3 {
  margin: 12px 0 5px;
}

.empty-results p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.empty-results button {
  margin-top: 15px;
  border: 0;
  background: transparent;
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 800;
}

.source-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 38px;
  margin-bottom: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 20px 22px;
}

.source-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-600);
  font-family: Georgia, serif;
  font-weight: 900;
}

.source-note h2 {
  margin: 0 0 5px;
  font-size: 13px;
}

.source-note p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.85;
}

.source-note a {
  color: var(--blue-600);
  font-weight: 800;
  text-underline-offset: 3px;
}

html[data-theme="dark"] .source-note a {
  color: #8acced;
}

.contact-section {
  position: relative;
  display: grid;
  width: min(1180px, calc(100% - 40px));
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  align-items: center;
  gap: 34px;
  overflow: hidden;
  margin: 0 auto 56px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 8% 20%, rgba(63, 141, 180, 0.3), transparent 34%),
    linear-gradient(125deg, var(--navy-950), var(--navy-800));
  box-shadow: var(--shadow-lg);
  color: #fff;
  padding: clamp(24px, 4vw, 42px);
}

.contact-section::after {
  position: absolute;
  bottom: -95px;
  left: -70px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 255, 255, 0.018);
  content: "";
  pointer-events: none;
}

.contact-copy {
  position: relative;
  z-index: 1;
}

.contact-copy .section-kicker {
  color: var(--gold-300);
}

.contact-copy h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(23px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.contact-copy > p:last-child {
  max-width: 540px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.9;
}

.social-links {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.social-link {
  display: grid;
  min-height: 86px;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 14px;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

.social-link:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-2px);
}

.social-mark {
  display: block;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 13px;
}

.social-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-link > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.social-link small {
  color: rgba(255, 255, 255, 0.56);
  font-size: 9px;
}

.social-link strong {
  color: #fff;
  font-size: 13px;
}

.social-arrow {
  color: var(--gold-300);
  font-size: 15px;
  transition: transform 150ms ease;
}

.social-link:hover .social-arrow {
  transform: translate(-2px, -2px);
}

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: var(--navy-950);
  color: #fff;
}

.footer-inner {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  min-height: 118px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 12px 12px 12px 4px;
  font-size: 18px;
}

.footer-brand strong {
  font-size: 12px;
}

.footer-brand span:last-child,
.footer-notes p {
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
}

.footer-notes {
  display: flex;
  max-width: 560px;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.footer-notes p {
  margin: 0;
  line-height: 1.8;
  text-align: left;
}

.footer-notes .copyright {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.footer-inner > p {
  max-width: 480px;
  margin: 0;
  text-align: left;
  line-height: 1.8;
}

.noscript-message {
  position: fixed;
  z-index: 99;
  right: 20px;
  bottom: 20px;
  left: 20px;
  border-radius: 12px;
  background: var(--danger);
  color: #fff;
  padding: 14px;
  text-align: center;
  font-weight: 800;
}

@media (max-width: 980px) {
  .filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .advanced-grid {
    grid-template-columns: 1.4fr 1fr;
  }

  .form-note {
    display: none;
  }

  .result-card {
    grid-template-columns: minmax(0, 1fr) 110px 105px;
    gap: 12px;
  }

  .private-card {
    grid-template-columns: minmax(0, 1fr) 145px 145px;
  }

  .government-fee-card {
    grid-template-columns: minmax(0, 1fr) 100px 95px 145px;
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .header-inner,
  .hero-content,
  .search-wrap,
  .results-section,
  .source-note,
  .footer-inner {
    width: min(100% - 28px, 1180px);
  }

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

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand strong {
    font-size: 13px;
  }

  .brand small,
  #themeLabel {
    display: none;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
  }

  .hero {
    min-height: 355px;
  }

  .hero-content {
    padding: 48px 0 114px;
  }

  .hero h1 {
    font-size: clamp(36px, 11vw, 50px);
  }

  .hero p {
    margin-top: 16px;
    font-size: 14px;
  }

  .hero-stats {
    gap: 8px 18px;
  }

  .hero-stats span:last-child {
    display: none;
  }

  .search-wrap {
    margin-top: -68px;
  }

  .search-card {
    border-radius: 20px;
    padding: 22px 17px;
  }

  .search-card-head {
    margin-bottom: 22px;
  }

  .verified-badge {
    display: none;
  }

  .filters-grid,
  .advanced-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .primary-button {
    width: 100%;
  }

  .initial-state,
  .loading-state,
  .error-state {
    min-height: 220px;
    flex-direction: column;
    padding: 30px 22px;
    text-align: center;
  }

  .results-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .sort-control {
    width: 100%;
    justify-content: space-between;
  }

  .sort-control select {
    flex: 1;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid article {
    min-height: 68px;
  }

  .result-card {
    grid-template-columns: 1fr 1fr;
    gap: 13px 0;
    padding: 17px 17px 15px;
  }

  .government-fee-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .result-main {
    grid-column: 1 / -1;
  }

  .result-university h3 {
    font-size: 20px;
  }

  .result-college-name {
    font-size: 17px;
  }

  .result-department-name {
    font-size: 15px;
  }

  .cutoff-block,
  .margin-block,
  .fee-block {
    min-height: 55px;
    border-top: 1px solid var(--line);
    border-right: 0;
    padding-top: 11px;
  }

  .margin-block {
    border-right: 1px solid var(--line);
  }

  .fee-block:last-child {
    border-right: 1px solid var(--line);
  }

  .source-note {
    margin-top: 30px;
    margin-bottom: 24px;
  }

  .contact-section {
    width: min(100% - 28px, 1180px);
    grid-template-columns: 1fr;
    gap: 22px;
    margin-bottom: 36px;
    padding: 26px 20px;
  }

  .contact-copy h2 {
    font-size: 23px;
  }

  .social-links {
    grid-template-columns: 1fr;
  }

  .social-link {
    min-height: 74px;
  }

  .footer-inner {
    min-height: 135px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
  }

  .footer-notes {
    align-items: flex-start;
  }

  .footer-notes p {
    text-align: right;
  }
}

@media (max-width: 420px) {
  .hero-stats {
    font-size: 10px;
  }

  .hero-stats strong {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-header,
  .hero,
  .search-wrap,
  .theme-toggle,
  .load-more,
  footer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .results-section {
    width: 100%;
    margin: 0;
  }

  .result-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* Qabole trilingual brand system */
.header-inner {
  min-height: 84px;
}

.brand-logo-frame,
.footer-logo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 24px rgba(2, 20, 34, 0.18);
  padding: 4px 8px;
}

.brand-logo {
  display: block;
  width: 156px;
  height: auto;
  max-height: 52px;
  object-fit: contain;
}

.footer-logo {
  display: block;
  width: 132px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.language-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.92);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  transition: 150ms ease;
}

.language-toggle:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.language-icon {
  display: inline-grid;
  min-width: 24px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  background: rgba(241, 214, 147, 0.15);
  color: var(--gold-300);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 0.04em;
}

html[dir="ltr"] body {
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

html[dir="ltr"] .hero-grid {
  mask-image: linear-gradient(to right, #000 0, transparent 75%);
}

html[dir="ltr"] .hero::before {
  right: -80px;
  left: auto;
}

html[dir="ltr"] .input-shell select {
  padding-right: 36px;
  padding-left: 14px;
}

html[dir="ltr"] .select-shell::after {
  right: 14px;
  left: auto;
}

html[dir="ltr"] .average-shell input {
  padding-right: 48px;
  padding-left: 14px;
  text-align: left;
}

html[dir="ltr"] .input-suffix {
  right: 14px;
  left: auto;
}

html[dir="ltr"] .search-shell input {
  padding-right: 14px;
  padding-left: 42px;
}

html[dir="ltr"] .search-symbol {
  right: auto;
  left: 15px;
}

html[dir="ltr"] .form-note {
  margin-right: 0;
  margin-left: auto;
}

html[dir="ltr"] .result-card::before {
  right: auto;
  left: 0;
}

html[dir="ltr"] .cutoff-block,
html[dir="ltr"] .margin-block,
html[dir="ltr"] .fee-block {
  border-right: 0;
  border-left: 1px solid var(--line);
}

html[dir="ltr"] .result-university h3,
html[dir="ltr"] .result-college-name,
html[dir="ltr"] .result-department-name {
  direction: rtl;
  text-align: right;
}

html[dir="ltr"] .footer-notes {
  align-items: flex-start;
}

html[dir="ltr"] .footer-notes p {
  text-align: right;
}

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

  .brand-logo-frame {
    border-radius: 11px;
    padding: 3px 6px;
  }

  .brand-logo {
    width: 124px;
    max-height: 43px;
  }

  #languageLabel {
    display: none;
  }

  .language-toggle {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
  }

  html[dir="ltr"] .margin-block,
  html[dir="ltr"] .fee-block:last-child {
    border-right: 0;
    border-left: 1px solid var(--line);
  }

  html[dir="ltr"] .footer-notes p {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .brand-logo {
    width: 108px;
  }

  .header-actions {
    gap: 5px;
  }
}
