/* مرجع (Marji3) · palette "نخيل وذهب" (approved 2026-10-09)
   Direction (2026-10-12): the guide as a transit system, merged with a familiar photo-and-card entry.
   Lines: palm = الرواد, gold = البحث والتطوير (fill only), ink = إمداد.
   Fonts (OFL, self-hosted): Alexandria for display and figures, Readex Pro for reading. */
:root {
  color-scheme: light;
  --paper: #F6F4EC;
  --paper-deep: #EFECE0;
  --card: #FFFFFF;
  --line: #E6E3D3;
  --line-strong: #DAD8C6;
  --ink: #1F2B25;
  --muted: #5A645D;
  --palm: #2F5D4A;
  --palm-dark: #1F4636;
  --palm-tint: #E3EBE5;
  --gold: #D8A13B;          /* fill only on light grounds; readable on ink */
  --gold-tint: #F6E8C4;
  --gold-deep: #8A6212;     /* gold as text on light: footnotes and source numbers */
  --warn-bg: #FBEFD3;
  --warn-ink: #6B4A0B;

  --l-rowad: var(--palm);
  --l-rd: var(--gold);
  --l-em: var(--ink);

  --shadow-s: 0 1px 2px rgb(31 43 37 / .05), 0 4px 14px -8px rgb(31 43 37 / .16);
  --shadow-m: 0 2px 4px rgb(31 43 37 / .05), 0 18px 40px -18px rgb(31 70 54 / .32);
  --r-l: 20px;
  --r-m: 14px;
  --r-s: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --display: 'Alexandria', 'Readex Pro', 'Noto Sans Arabic', Tahoma, sans-serif;
  --text: 'Readex Pro', 'Noto Sans Arabic', Tahoma, sans-serif;

  /* type scale: micro marks, labels, small, secondary, body, lead, then display steps */
  --fs-2xs: 11.5px;
  --fs-xs: 13px;
  --fs-s: 14px;
  --fs-m: 15.5px;
  --fs-body: 17px;
  --fs-l: 18.5px;
  --fs-h4: 1.2rem;
  --fs-h3: 1.35rem;
  --fs-h2: 1.6rem;
}

*, *::before, *::after { box-sizing: border-box; }
::selection { background: var(--gold-tint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--palm); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: var(--line-strong) var(--paper); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--fs-body);
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.3; text-wrap: balance; font-weight: 700; }
b, strong { font-weight: 600; }
dt { font-weight: 400; }
th { font-weight: 500; }
p { margin: 0 0 .8em; text-wrap: pretty; }
a { color: var(--palm); text-underline-offset: 5px; text-decoration-thickness: 1px; }
a:hover { color: var(--palm-dark); }
small { font-size: inherit; }
img { max-width: 100%; display: block; }

.n { direction: ltr; unicode-bidi: isolate; }
.fig { font-family: var(--display); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-s); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 1000; background: var(--card); color: var(--palm); padding: 8px 14px; border-radius: var(--r-s); }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- masthead + footer */
.mast { background: var(--palm); color: #fff; border-bottom: 3px solid var(--gold); position: relative; z-index: 500; }
.mast .in, .foot .in, .page { max-width: 1200px; margin-inline: auto; padding-inline: 28px; }
.mast .in { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { color: #fff; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; display: inline-flex; align-items: center; gap: 10px; }
.logo:hover { color: #fff; }
.logo i { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--palm), 0 0 0 5px #fff; display: inline-block; margin-top: 6px; }
.mast nav { display: flex; gap: 4px; font-size: var(--fs-m); }
.mast nav a { color: #fff; text-decoration: none; padding: 6px 13px; border-radius: 99px; opacity: .88; white-space: nowrap; transition: background-color .3s var(--ease), opacity .3s; }
.mast nav a:hover { opacity: 1; background: rgb(255 255 255 / .1); color: #fff; }
.mast nav a[aria-current="page"] { opacity: 1; background: #fff; color: var(--palm); font-weight: 500; }
.mast :focus-visible { outline-color: #fff; }

.foot { margin-top: 32px; padding-block: 36px 48px; color: var(--muted); font-size: var(--fs-s); background: var(--paper-deep); }
.foot p { margin: 0 0 6px; max-width: 90ch; }
.foot strong { color: var(--ink); }

/* ---------------------------------------------------------------- shared atoms */
main { padding-block: 32px 80px; }
.intro { margin-bottom: 28px; }
.intro h1 { font-size: clamp(1.9rem, 1.2rem + 2.2vw, 2.9rem); color: var(--palm); margin: 0 0 10px; font-weight: 800; }
.lead { color: var(--muted); max-width: 62ch; font-size: var(--fs-l); margin-bottom: 6px; }
.checked-on { font-size: var(--fs-s); color: var(--muted); margin: 0; }
.sec-title { font-size: var(--fs-h2); margin: 0 0 4px; color: var(--ink); }
.sec-sub { color: var(--muted); margin: 0 0 18px; font-size: var(--fs-m); }

.input { position: relative; }
.input i { position: absolute; inset-inline-start: 18px; top: 50%; translate: 0 -50%; color: var(--muted); font-size: 19px; pointer-events: none; }
input, select {
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 99px;
  height: 52px; padding-inline: 20px; width: 100%;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.input input { padding-inline-start: 48px; }
input::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus { outline: none; border-color: var(--palm); box-shadow: 0 0 0 4px var(--palm-tint); }
select { appearance: none; padding-inline-end: 44px; cursor: pointer; height: 46px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: 22px 20px, 27px 20px; background-size: 5px 5px; background-repeat: no-repeat; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips-label { font-size: var(--fs-s); color: var(--muted); margin-inline-end: 4px; white-space: nowrap; }
.chip {
  font: inherit; font-size: var(--fs-s); cursor: pointer;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 99px; padding: 7px 16px; line-height: 1.5; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s, transform .2s var(--ease);
}
.chip:hover { border-color: var(--palm); color: var(--palm); }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--palm); border-color: var(--palm); color: #fff; }
.chip .count { font-size: var(--fs-xs); opacity: .7; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 500;
  background: var(--palm); color: #fff; text-decoration: none;
  border-radius: 99px; padding: 11px 24px; transition: background-color .3s var(--ease), transform .2s var(--ease);
}
.btn:hover { background: var(--palm-dark); color: #fff; }
.btn:active { transform: scale(.98); }
.btn-ghost { background: transparent; color: var(--palm); box-shadow: inset 0 0 0 1.5px var(--palm); }
.btn-ghost:hover { background: var(--palm-tint); color: var(--palm-dark); }
.btn-s { padding: 8px 18px; font-size: var(--fs-s); }

.tag { display: inline-block; font-size: var(--fs-xs); line-height: 1.7; padding: 1px 11px; border-radius: 99px; white-space: nowrap; }
.tag-required { background: var(--palm-tint); color: var(--palm); }
.tag-optional, .tag-scope { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tag-test-free { background: var(--paper); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.hl { background: var(--gold-tint); padding: 2px 10px; border-radius: 8px; }

/* line badge: the track's colour as a short bar, then its name */
.lb { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-s); font-weight: 500; white-space: nowrap; }
.lb::before { content: ""; width: 22px; height: 8px; border-radius: 99px; background: var(--c, var(--l-rowad)); flex: none; }
.lb-rowad { --c: var(--l-rowad); }
.lb-rd { --c: var(--l-rd); }
.lb-em { --c: var(--l-em); }

/* station roundel: a rank sits in it like a station number */
.rd { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff;
  box-shadow: inset 0 0 0 4px var(--c, var(--palm)); font-family: var(--display); font-weight: 700; font-size: var(--fs-s); color: var(--ink); flex: none; }
.rd.lg { width: 52px; height: 52px; font-size: 20px; box-shadow: inset 0 0 0 6px var(--c, var(--palm)); }

/* certainty marks: how sure a figure or date is */
.cert { display: inline-block; font-family: var(--text); font-size: var(--fs-2xs); font-weight: 500; line-height: 1.6; padding: 0 8px; border-radius: 99px; white-space: nowrap; vertical-align: middle; margin-inline-start: 6px; }
.cert-official { color: var(--palm); box-shadow: inset 0 0 0 1px var(--palm); }
.cert-computed { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--paper); }
.cert-estimate { color: var(--gold-deep); border: 1px dashed var(--gold-deep); }
.cert-conflict { color: var(--warn-ink); background: var(--warn-bg); }

/* service status: a line segment, solid when running, broken when not */
.svc { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-s); font-weight: 500; }
.svc::before { content: ""; width: 26px; height: 5px; border-radius: 99px; background: var(--palm); flex: none; }
.svc-open { color: var(--palm); }
.svc-rolling { color: var(--palm); }
/* broken service: the same segment cut into dashes (tiled, so the dash length stays fixed) */
.svc-rolling::before { background: linear-gradient(to left, var(--palm) 75%, transparent 75%) right / 12px 5px repeat-x; border-radius: 0; }
.svc-unclear { color: var(--warn-ink); }
.svc-unclear::before { background: linear-gradient(to left, var(--gold) 55%, transparent 55%) right / 9px 5px repeat-x; border-radius: 0; }
.svc-closed { color: var(--muted); }
.svc-closed::before { background: linear-gradient(to left, var(--line-strong) 55%, transparent 55%) right / 9px 5px repeat-x; border-radius: 0; }

.warn { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-bg); color: var(--warn-ink); padding: 12px 16px; border-radius: var(--r-s); font-size: var(--fs-m); }
.warn i { font-size: 19px; margin-top: 4px; flex: none; }
.note { margin-top: 24px; background: var(--warn-bg); color: var(--warn-ink); padding: 16px 20px; border-radius: var(--r-m); font-size: var(--fs-m); }
.note p { margin: 0; }

/* ---------------------------------------------------------------- home: hero */
.hero { position: relative; border-radius: 24px; overflow: hidden; min-height: 420px; display: grid; align-items: end; box-shadow: var(--shadow-s); background: var(--palm-dark); }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgb(20 38 30 / .86) 0%, rgb(20 38 30 / .55) 45%, rgb(20 38 30 / .08) 80%); }
.hero-in { position: relative; z-index: 1; padding: 40px 44px 38px; color: #fff; display: grid; gap: 14px; }
.hero h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem); line-height: 1.15; margin: 0; font-weight: 800; color: #fff; }
.hero p { margin: 0; font-size: var(--fs-l); color: rgb(255 255 255 / .92); max-width: 64ch; text-wrap: balance; }
.nw { white-space: nowrap; }
.hero .input input { height: 56px; border: 0; box-shadow: 0 12px 30px -12px rgb(20 38 30 / .5); }
.hero .q-hint { font-size: var(--fs-m); color: #fff; background: rgb(20 38 30 / .55); padding: 8px 16px; border-radius: var(--r-m); max-width: none; }
.hero .q-hint a { color: #fff; font-weight: 500; }
.hero .checked-on { color: rgb(255 255 255 / .82); }
.hero .checked-on a { color: #fff; }
.hero-credit { font-size: var(--fs-xs); color: var(--muted); margin: 8px 4px 0; }

/* ---------------------------------------------------------------- section heads with a line bar (majors, opportunities) */
.metro { margin-top: 34px; }
.metro-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 6px; }
.metro-head .sec-title { display: inline-flex; align-items: center; gap: 12px; }
.metro-head .sec-title::before { content: ""; width: 34px; height: 12px; border-radius: 99px; background: var(--l-rowad); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: var(--fs-s); color: var(--muted); }
@keyframes line-draw { from { transform: scaleX(0); } }
@keyframes line-draw-y { from { transform: scaleY(0); } }
@keyframes stn-settle { from { transform: scale(.55); } }
/* interchange signs: plain wayfinding rows, no card chrome */
.signs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 36px; border-block: 1px solid var(--line-strong); }
.sign { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "xc t a" ". n a"; align-items: center; gap: 0 14px; padding: 16px 6px; color: var(--ink); text-decoration: none; }
.sign + .sign { border-inline-start: 1px solid var(--line-strong); padding-inline-start: 26px; }
.sign .xc { grid-area: xc; width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 5px var(--ink); }
.sign b { grid-area: t; font-family: var(--display); font-weight: 700; font-size: var(--fs-h4); color: var(--palm); }
.sign .note-line { grid-area: n; color: var(--muted); font-size: var(--fs-m); }
.sign i { grid-area: a; font-size: 22px; color: var(--palm); transition: translate .3s var(--ease); }
.sign:hover { color: var(--ink); }
.sign:hover b { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.sign:hover i { translate: -5px 0; }

/* ---------------------------------------------------------------- home: tools + cards */
.unis-head { margin-top: 56px; }
.tools { display: grid; gap: 12px; margin-bottom: 26px; }
.uni-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px; }
.uni-card { min-width: 0; scroll-margin-top: 20px; }
.card-link {
  display: flex; flex-direction: column; height: 100%;
  background: var(--card); border-radius: var(--r-l); overflow: hidden;
  color: inherit; text-decoration: none; box-shadow: var(--shadow-s);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.card-link:hover { color: inherit; transform: translateY(-4px); box-shadow: var(--shadow-m); }
.card-link:focus-visible { outline-offset: 4px; border-radius: var(--r-l); }
.uni-card.ping .card-link { box-shadow: 0 0 0 3px var(--gold), var(--shadow-m); }
.card-photo { aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-deep); position: relative; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.card-link:hover .card-photo img { transform: scale(1.04); }
.card-body { padding: 0 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-top { display: flex; margin-top: -19px; margin-bottom: 8px; position: relative; z-index: 1; }
.card-top .rd { box-shadow: inset 0 0 0 4px var(--c, var(--palm)), 0 4px 12px -4px rgb(31 43 37 / .35); width: 40px; height: 40px; font-size: var(--fs-m); }
.card-title { font-size: var(--fs-h3); color: var(--palm); margin: 0; }
.card-en { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 2px 0 14px; color: var(--muted); font-size: var(--fs-s); }
.card-en .tag { margin-inline-start: auto; }
.card-city { font-size: var(--fs-xs); }
.card-facts { margin: auto 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.card-facts div { min-width: 0; }
.card-facts dt { font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }
.card-facts dd { margin: 2px 0 0; font-family: var(--display); font-weight: 600; font-size: var(--fs-body); line-height: 1.45; }
.card-facts small { display: block; font-family: var(--text); font-weight: 400; font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; margin-top: 2px; }
.card-facts .dl-date { white-space: nowrap; }
.card-facts .dl-left { display: block; white-space: nowrap; }
.seen-flag { position: absolute; inset-block-start: 12px; inset-inline-start: 12px; background: var(--gold); color: var(--ink); font-size: var(--fs-xs); font-weight: 500; padding: 2px 12px; border-radius: 99px; }

.empty { padding: 36px 20px; margin: 0; color: var(--muted); text-align: center; background: var(--card); border-radius: var(--r-l); }

.apparatus { margin-top: 64px; max-width: 880px; }
.apparatus h2 { font-size: var(--fs-h3); color: var(--palm); margin: 0 0 8px; scroll-margin-top: 24px; }
.sources { list-style: none; margin: 0 0 8px; padding: 0; }
.sources li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 12px; border-radius: var(--r-s); font-size: var(--fs-m); }
.src-n { color: var(--gold-deep); font-family: var(--display); font-weight: 600; }
.sources b { display: block; font-size: var(--fs-m); font-weight: 500; }
.src-link { font-size: var(--fs-s); display: inline-flex; align-items: center; gap: 4px; word-break: break-all; }
.checked { font-size: var(--fs-s); color: var(--muted); margin-top: 8px; }
.sources li:target { background: var(--gold-tint); }
@media (prefers-reduced-motion: no-preference) { .sources li:target { animation: found 2.4s var(--ease); } }
@keyframes found { from { background: var(--gold); } to { background: var(--gold-tint); } }

/* ---------------------------------------------------------------- university page */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-s); color: var(--muted); margin-bottom: 16px; }
.crumbs i { font-size: var(--fs-xs); }
.uni-head { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; margin-bottom: 24px; }
.uni-head .rd { grid-row: span 2; }
.uni-head h1 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3rem); color: var(--palm); margin: 0; font-weight: 800; }
.uni-head .en { color: var(--muted); font-size: 16px; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.uni-head .sep { width: 1px; height: 14px; background: var(--line-strong); }
.rank-line { grid-column: 1 / -1; font-size: var(--fs-body); margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }

.hero-photo { margin: 0 0 30px; }
.hero-photo img { width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--r-l); box-shadow: var(--shadow-s); background: var(--paper-deep); }
.hero-photo figcaption { font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; }

/* key facts read as one platform sign: a single surface cut by hairlines, not a row of tiles */
.summary, .facts { display: grid; gap: 1px; margin: 0; background: var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-s); }
.summary { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.summary > div, .facts > div { background: var(--card); padding: 16px 18px; min-width: 0; }
.summary dt, .facts dt { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 4px; line-height: 1.5; }
.summary dd, .facts dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.45; }
.summary dd .muted { font-family: var(--text); font-weight: 400; font-size: var(--fs-m); }
.summary dd small, .facts dd small { display: block; font-family: var(--text); font-weight: 400; color: var(--muted); font-size: var(--fs-xs); margin-top: 4px; }

.uni-body { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 56px; margin-top: 16px; }
/* the section rail: a vertical line whose station fills as its section is read */
.toc { grid-column: 2; grid-row: 1; }
.toc ol { position: sticky; top: 28px; list-style: none; margin: 44px 0 0; padding: 0; font-size: var(--fs-m); }
.toc ol::before { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 11px; width: 4px; border-radius: 99px; background: var(--palm-tint); }
.toc li { position: relative; }
.toc a { display: flex; align-items: center; gap: 14px; padding: 6px 0; color: var(--muted); text-decoration: none; transition: color .3s; }
.toc a::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 4px var(--line-strong); flex: none; position: relative; z-index: 1; transition: box-shadow .3s var(--ease), background-color .3s; }
.toc a:hover { color: var(--palm); }
.toc a:hover::before { box-shadow: inset 0 0 0 4px var(--palm); }
.toc a.on { color: var(--ink); font-weight: 500; }
.toc a.on::before { background: var(--palm); box-shadow: inset 0 0 0 4px var(--palm), 0 0 0 4px var(--palm-tint); }
.doc { grid-column: 1; grid-row: 1; max-width: 76ch; }
.doc section { padding-top: 44px; scroll-margin-top: 20px; }
.doc h2 { font-size: var(--fs-h2); color: var(--palm); margin: 0 0 14px; display: flex; align-items: center; gap: 12px; }
.doc h2::before { content: ""; width: 30px; height: 11px; border-radius: 99px; background: var(--l-rowad); flex: none; }

.kv { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r-m); overflow: hidden; margin: 8px 0 14px; font-size: 16px; box-shadow: var(--shadow-s); }
.kv th, .kv td { padding: 12px 18px; text-align: start; vertical-align: middle; }
.kv thead th { font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.kv tbody tr { border-top: 1px solid var(--line); }
.kv tbody th { width: 40%; }
.kv.lists tbody th { width: auto; }
.kv td.fig { font-size: 16px; white-space: nowrap; }

.facts { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }

/* deadlines on an entry page read as a departure board */
.dates { list-style: none; margin: 8px 0 14px; padding: 4px 20px; background: var(--card); border-radius: var(--r-m); box-shadow: var(--shadow-s); }
.dates li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; padding: 13px 0; }
.dates li + li { border-top: 1px solid var(--line); }
.dates .abbr { color: var(--muted); font-size: var(--fs-xs); margin-inline-start: 4px; }
.dates li > div:first-child { flex: 1 1 240px; min-width: 0; }
.dates li small { display: block; margin-top: 3px; font-size: var(--fs-s); line-height: 1.6; color: var(--muted); }
.dates .when { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 600; }
.dates .left { font-size: var(--fs-xs); color: var(--ink); background: var(--gold); padding: 1px 12px; border-radius: 99px; font-weight: 500; }
.dates li.past { opacity: .55; }
.dates li.past .left { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }

.map-wrap { margin: 6px 0 22px; }
.map { height: 400px; border-radius: var(--r-l); overflow: hidden; background: var(--paper-deep); box-shadow: var(--shadow-s); z-index: 0; }
.map-note { font-size: var(--fs-xs); color: var(--muted); margin: 8px 0 0; }
.map-out { display: grid; justify-items: start; gap: 4px; margin: 6px 0 22px; }
.leaflet-container { font-family: var(--text); direction: ltr; }
.leaflet-tooltip.rent-label, .map-legend { direction: rtl; }
.leaflet-tooltip.rent-label {
  font-family: var(--text); background: var(--card); color: var(--ink); border: 0;
  border-radius: 14px; padding: 8px 14px; box-shadow: var(--shadow-m); text-align: center; line-height: 1.5;
}
.leaflet-tooltip.rent-label::before { display: none; }
.rent-label b { display: block; font-family: var(--display); font-size: var(--fs-l); color: var(--palm); font-weight: 600; }
.rent-label span { font-size: var(--fs-xs); color: var(--muted); }
.map-legend { background: var(--card); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-m); font-family: var(--text); font-size: var(--fs-xs); line-height: 1.6; color: var(--ink); text-align: right; max-width: 220px; }
.map-legend b { display: block; font-family: var(--display); font-size: var(--fs-body); color: var(--palm); font-weight: 600; }
.campus-pin { width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 6px var(--palm), 0 2px 10px rgb(31 70 54 / .45); }

.rent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 14px; }
.rent-grid > div { background: var(--card); border-radius: var(--r-m); padding: 18px 20px; box-shadow: var(--shadow-s); }
.figure { display: flex; flex-direction: column; gap: 2px; }
.figure .big { font-family: var(--display); font-weight: 600; font-size: 1.8rem; line-height: 1.3; }
.figure .big.muted { font-family: var(--text); font-weight: 400; font-size: var(--fs-h3); }
.figure .big.hl { align-self: flex-start; }
.figure > span:last-child { font-size: var(--fs-s); color: var(--muted); }
.split-line { margin: 8px 0 0; font-size: var(--fs-m); }
.rent-grid .warn, .rent-grid .muted.small { margin: 10px 0 0; }

.notes { margin: 0; padding-inline-start: 1.2em; }
.notes li { margin-bottom: 8px; }
.notes li::marker { color: var(--palm); }

/* footnote markers: the source behind every number */
.fn {
  position: relative; display: inline-block; font-family: var(--display);
  font-size: var(--fs-2xs); font-weight: 600; line-height: 1; vertical-align: super;
  color: var(--gold-deep); text-decoration: none;
  padding: 3px 1px; margin-inline-start: 1px; border-radius: 4px;
}
.fn:hover { background: var(--gold-tint); color: var(--warn-ink); }
.fn::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; translate: -50% 4px;
  width: max-content; max-width: 260px; padding: 6px 10px; border-radius: 10px;
  background: var(--ink); color: var(--paper); font-family: var(--text);
  font-size: var(--fs-xs); font-weight: 400; line-height: 1.5; white-space: normal; text-align: start;
  opacity: 0; pointer-events: none; z-index: 5;
  transition: opacity .2s, translate .2s var(--ease);
}
.fn:hover::after, .fn:focus-visible::after { opacity: 1; translate: -50% 0; }

.uni .sources li { background: var(--card); margin-bottom: 8px; padding: 12px 16px; box-shadow: var(--shadow-s); }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; }
.pager a { text-decoration: none; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; background: var(--card); padding: 14px 20px; border-radius: var(--r-m); box-shadow: var(--shadow-s); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.pager a .rd { grid-row: span 2; }
.pager a:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.pager a small { font-size: var(--fs-xs); color: var(--muted); }
.pager a span { font-family: var(--display); font-weight: 600; font-size: var(--fs-body); }
.pager .next { margin-inline-start: auto; }

/* ---------------------------------------------------------------- majors */
.tracks-explain { display: grid; gap: 6px; margin-bottom: 26px; color: var(--muted); }
.tracks-explain p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tracks-explain .lb { color: var(--ink); }
.picker { display: grid; gap: 14px; margin-bottom: 8px; }
.segs { display: inline-flex; width: fit-content; max-width: 100%; background: var(--card); border-radius: 99px; padding: 5px; gap: 4px; box-shadow: var(--shadow-s); }
.seg { font: inherit; font-size: var(--fs-m); cursor: pointer; border: 0; background: transparent; color: var(--muted); padding: 8px 20px; border-radius: 99px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: background-color .3s var(--ease), color .3s; }
.seg::before { content: ""; width: 16px; height: 7px; border-radius: 99px; background: var(--c); }
.seg:hover { color: var(--ink); }
.seg[aria-selected="true"] { background: var(--ink); color: #fff; }
.seg[data-track="rowad"] { --c: var(--l-rowad); }
.seg[data-track="rd"] { --c: var(--l-rd); }
.seg[data-track="em"] { --c: #fff; }
.seg[data-track="em"]:not([aria-selected="true"])::before { background: var(--l-em); }
.field-list { padding-top: 32px; }
.field-list h2 { font-size: var(--fs-h2); color: var(--ink); margin: 0 0 4px; display: flex; align-items: center; gap: 12px; }
.field-list h2::before { content: ""; width: 30px; height: 11px; border-radius: 99px; background: var(--c, var(--l-rowad)); }
.field-list[data-track="rd"] { --c: var(--l-rd); }
.field-list[data-track="em"] { --c: var(--l-em); }
.ranked { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ranked li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--card); border-radius: var(--r-m); box-shadow: var(--shadow-s); }
.ranked .rd { --c: var(--c-list, var(--palm)); }
.field-list[data-track="rd"] .ranked .rd { --c: var(--l-rd); }
.field-list[data-track="em"] .ranked .rd { --c: var(--l-em); }
.ranked .who a { text-decoration: none; font-weight: 500; }
.ranked .who a:hover { text-decoration: underline; }
.ranked .tag-rowad { background: var(--palm-tint); color: var(--palm); font-size: var(--fs-xs); margin-inline-start: 8px; }
.lookup { margin-top: 64px; padding: 30px 34px; background: var(--card); border-radius: var(--r-l); box-shadow: var(--shadow-s); max-width: 820px; }
.lookup h2 { color: var(--palm); margin: 0 0 4px; font-size: var(--fs-h2); }
.lookup .field { max-width: 440px; margin-top: 14px; display: grid; gap: 6px; }
.lookup label { font-size: var(--fs-s); color: var(--muted); }
#uni-result { margin-top: 18px; }
#uni-result h3 { margin: 0 0 8px; font-size: var(--fs-h4); display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- opportunities */
/* the same photo-and-scrim entry as the home page, shorter, carrying the next departure */
.hero-opps { min-height: 360px; }
.hero-opps .hero-in { padding-bottom: 34px; }
.next-dep { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; justify-self: start; max-width: 100%;
  background: var(--ink); color: #fff; text-decoration: none; padding-block: 10px; padding-inline: 18px 12px;
  border-radius: var(--r-m); box-shadow: 0 12px 30px -14px rgb(20 38 30 / .6); font-size: var(--fs-m);
  transition: transform .3s var(--ease); }
.next-dep:hover { color: #fff; transform: translateY(-2px); }
.nd-label { color: var(--gold); font-weight: 500; }
.nd-name { font-family: var(--display); font-weight: 600; }
.nd-what { color: rgb(255 255 255 / .78); }
.next-dep .left { font-family: var(--display); font-size: var(--fs-s); color: var(--ink); background: var(--gold); padding: 1px 12px; border-radius: 99px; white-space: nowrap; }
.opps .hero-credit { margin-bottom: 12px; }
.opps > .checked-on { margin-bottom: 28px; }

.opp-tools { display: grid; gap: 12px; }
.opp-tools .row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.opp-tools .sel { display: flex; align-items: center; gap: 10px; font-size: var(--fs-s); color: var(--muted); }
.opp-tools select { width: auto; min-width: 200px; }
.platforms .chip { padding: 8px 18px; font-size: var(--fs-m); }

/* the year line: one column per month, every dated step a station under it */
.yearline { margin-top: 44px; }
.yl-wrap { overflow-x: auto; scrollbar-width: thin; margin-inline: -8px; padding: 6px 8px 14px; }
.yl { list-style: none; margin: 0; padding: 0; display: flex; min-width: 1000px; position: relative; }
.yl::before { content: ""; position: absolute; inset-inline: 0; top: 40px; height: 10px; margin-top: -5px; border-radius: 99px; background: var(--l-rowad); transform-origin: right center; }
.ym { flex: 1 1 0; min-width: 112px; position: relative; padding-inline-end: 12px; }
.ym.quiet { flex: 0 0 72px; min-width: 72px; }
.ym::before { content: ""; position: absolute; top: 40px; inset-inline-start: 0; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 4px var(--palm); z-index: 1; }
.ym-name { display: block; height: 26px; font-family: var(--display); font-weight: 600; font-size: var(--fs-s); white-space: nowrap; }
.ym-ev { list-style: none; margin: 0; padding: 32px 0 0; display: grid; gap: 12px; }
.ev a { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; text-decoration: none; color: var(--ink); border-radius: var(--r-s); }
.ev .rd { width: 30px; height: 30px; font-size: var(--fs-xs); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.rd.est { box-shadow: none; border: 2px dashed var(--gold-deep); background: var(--card); }
.ev-t { display: grid; line-height: 1.35; padding-top: 4px; min-width: 0; }
.ev-t b { font-family: var(--display); font-weight: 600; font-size: var(--fs-s); }
.ev-t span { font-size: var(--fs-xs); color: var(--muted); }
.ev a:hover b { color: var(--palm); }
.ev a:hover .rd { transform: scale(1.1); }
.ev.past { opacity: .4; }
.ym-none { display: none; margin: 32px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.ym.quiet .ym-none, .ym.none .ym-none { display: block; }
.ym.quiet .ym-ev { display: none; }
/* you are here: a gold tag riding the line at today's date */
.you { position: absolute; top: 40px; inset-inline-start: var(--at, 0%); translate: 50% -50%; z-index: 2;
  background: var(--gold); color: var(--ink); font-family: var(--display); font-weight: 600; font-size: var(--fs-xs);
  padding: 3px 10px; border-radius: 99px; box-shadow: 0 0 0 3px var(--paper); white-space: nowrap; line-height: 1.5; }
.legend .lg { display: inline-flex; align-items: center; gap: 8px; }
.legend .lg::before { content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none; }
.legend .lg-off::before { background: var(--card); box-shadow: inset 0 0 0 3px var(--palm); }
.legend .lg-est::before { background: var(--card); border: 2px dashed var(--gold-deep); }
.legend .lg-now::before { background: var(--gold); width: 22px; height: 12px; border-radius: 99px; }

@media (prefers-reduced-motion: no-preference) {
  .yl::before { animation: line-draw 1.1s var(--ease) backwards; }
  .yl .ev .rd { animation: stn-settle .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 60ms + 250ms); }
}

/* sections: open, all year, soon, later */
.opp-sec { margin-top: 56px; }
.opp-sec .sec-title { display: flex; align-items: center; gap: 12px; }
.opp-sec .sec-title::before { content: ""; width: 30px; height: 11px; border-radius: 99px; background: var(--l-rowad); flex: none; }
.sec-count { font-family: var(--display); font-size: var(--fs-s); font-weight: 600; color: var(--palm); background: var(--palm-tint); padding: 0 11px; border-radius: 99px; line-height: 1.75; }

/* one card for every opportunity, in every section: the same parts in the same order */
.opp { scroll-margin-top: 24px; }
.opp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; align-items: stretch; }
.opp-card { background: var(--card); border-radius: var(--r-l); box-shadow: var(--shadow-s); display: flex; flex-direction: column; transition: box-shadow .5s var(--ease); }
.opp-card:target, .opp-card.ping { box-shadow: 0 0 0 3px var(--gold), var(--shadow-m); }
.opp-body { padding: 20px 22px 18px; flex: 1; display: flex; flex-direction: column; }
.opp-head { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.opp-ico { width: 44px; height: 44px; color: var(--palm); }
.opp-ico i { font-size: 20px; }
.opp-head h3 { font-size: var(--fs-h4); margin: 0; color: var(--ink); line-height: 1.35; }
.opp-en { color: var(--muted); font-size: var(--fs-xs); margin: 2px 0 0; }
.opp-org { color: var(--muted); font-size: var(--fs-s); margin: 0; }
.opp-hook { font-size: var(--fs-m); margin: 14px 0; }

/* the state box: dates, status or expected months, always the same light box */
.opp-state { list-style: none; margin: 0 0 14px; padding: 10px 14px; background: var(--paper); border-radius: var(--r-m); font-size: var(--fs-s); }
.opp-state > small { display: block; color: var(--muted); font-size: var(--fs-s); line-height: 1.7; margin-top: 6px; }
.opp-deps { list-style: none; margin: 0; padding: 0; }
.opp-state .opp-deps { margin-top: 6px; }
.opp-deps li { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: baseline; padding: 7px 0; }
.opp-deps li + li { border-top: 1px solid var(--line); }
.opp-deps .when { font-family: var(--display); font-weight: 600; white-space: nowrap; color: var(--ink); }
.opp-deps .what { color: var(--muted); }
.opp-deps .left { font-family: var(--display); font-size: var(--fs-xs); color: var(--ink); background: var(--gold); padding: 1px 10px; border-radius: 99px; white-space: nowrap; }
.opp-deps li.past { display: none; }
.opp-est { display: grid; gap: 10px; }
.opp-est li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: var(--fs-m); }
.opp-est .rd.est { width: 20px; height: 20px; margin-top: 4px; }
.opp-est b { font-family: var(--display); font-weight: 600; }
.opp-est small { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }

.opp-key { margin: 0 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.opp-key dt { font-size: var(--fs-xs); color: var(--muted); }
.opp-key dd { margin: 2px 0 0; font-size: var(--fs-m); }
.opp .warn { margin: 0 0 12px; font-size: var(--fs-s); }
.opp-card details { border-top: 1px solid var(--line); padding-top: 10px; }
.opp-card summary { cursor: pointer; color: var(--palm); font-size: var(--fs-m); font-weight: 500; list-style: none; display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.opp-card summary::-webkit-details-marker { display: none; }
.opp-card summary::before { content: ""; width: 7px; height: 7px; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; rotate: 135deg; transition: rotate .3s var(--ease); margin-inline-end: 4px; }
.opp-card details[open] summary::before { rotate: 45deg; }
.opp-dl { margin: 10px 0 0; display: grid; gap: 10px; font-size: var(--fs-m); }
.opp-dl dt { font-size: var(--fs-xs); color: var(--muted); }
.opp-dl dd { margin: 2px 0 0; line-height: 1.75; }
.oq { margin-top: 14px; background: var(--paper); border-radius: var(--r-s); padding: 10px 14px; font-size: var(--fs-s); }
.oq ul, .opp-src ul { margin: 4px 0 0; padding-inline-start: 1.2em; }
.opp-src { margin-top: 12px; font-size: var(--fs-s); }
.opp-src a { word-break: break-all; }
.opp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
/* ---------------------------------------------------------------- «اسأل مرجع» chatbot */
.chat { position: fixed; inset-inline-end: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 900; display: grid; justify-items: end; gap: 12px; }  /* bottom-left: Netlify's badge takes bottom-right */
.chat-open { font: inherit; font-family: var(--display); font-weight: 600; font-size: var(--fs-m); display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--palm); color: #fff; border: 0; border-radius: 99px; padding: 12px 20px; box-shadow: 0 10px 28px -10px rgb(31 70 54 / .6); transition: transform .3s var(--ease), background-color .3s; }
.chat-open i { font-size: 22px; }
.chat-open:hover { background: var(--palm-dark); transform: translateY(-2px); }
.chat.open .chat-open { display: none; }
.chat-panel { order: -1; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100dvh - 120px)); display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--r-l); box-shadow: 0 2px 6px rgb(31 43 37 / .08), 0 24px 60px -20px rgb(31 70 54 / .45); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--palm); color: #fff; border-bottom: 3px solid var(--gold); }
.chat-head b { font-family: var(--display); font-weight: 700; font-size: var(--fs-body); }
.chat-close { background: none; border: 0; color: #fff; cursor: pointer; font-size: 20px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.chat-close:hover { background: rgb(255 255 255 / .14); }
.chat-log { list-style: none; margin: 0; padding: 16px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.chat-log li { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: var(--fs-m); line-height: 1.7; overflow-wrap: anywhere; }
.chat-log .bot { align-self: flex-start; background: var(--card); box-shadow: var(--shadow-s); border-start-start-radius: 4px; }
.chat-log .me { align-self: flex-end; background: var(--palm); color: #fff; border-start-end-radius: 4px; }
.chat-log .error { color: var(--warn-ink); background: var(--warn-bg); box-shadow: none; }
.chat-log a { font-weight: 500; }
.dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--card); }
.chat-form input { height: 46px; flex: 1; min-width: 0; }
.chat-form button { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--palm); color: #fff; cursor: pointer; font-size: 20px; display: grid; place-items: center; }
.chat-form button:disabled { opacity: .5; cursor: wait; }
.chat-note { margin: 0; padding: 0 14px 12px; font-size: var(--fs-2xs); color: var(--muted); background: var(--card); line-height: 1.6; }
@media (max-width: 560px) { .chat { inset-inline-end: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); } .chat-open span { display: none; } .chat-open { padding: 14px; } }

/* ---------------------------------------------------------------- about */
.about .doc { max-width: 76ch; }
.method { margin: 0; display: grid; gap: 14px; }
.method > div { background: var(--card); border-radius: var(--r-m); padding: 16px 20px; box-shadow: var(--shadow-s); }
.method dt { color: var(--palm); font-family: var(--display); font-weight: 600; }
.method dd { margin: 4px 0 0; }

/* ---------------------------------------------------------------- reveal */

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .uni-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc, .doc { grid-column: 1; grid-row: auto; }
  .toc ol { position: static; display: flex; gap: 8px; overflow-x: auto; margin: 24px -28px 0; padding: 4px 28px 8px; scrollbar-width: none; }
  .toc ol::before { display: none; }
  .toc a { white-space: nowrap; background: var(--card); box-shadow: var(--shadow-s); padding: 5px 14px 5px 12px; border-radius: 99px; font-size: var(--fs-s); gap: 8px; }
  .toc a::before { width: 14px; height: 14px; box-shadow: inset 0 0 0 3px var(--line-strong); }
  .toc a.on::before { box-shadow: inset 0 0 0 3px var(--palm), 0 0 0 0 transparent; }
  .summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .summary > div:last-child { grid-column: span 2; }
}
@media (max-width: 760px) {
  :root { --fs-body: 16.5px; --fs-l: 17px; }
  body { font-size: var(--fs-body); }
  .mast .in, .foot .in, .page { padding-inline: 16px; }
  .toc ol { margin-inline: -16px; padding-inline: 16px; }
  .logo { font-size: 26px; }
  main { padding-top: 18px; }
  .lead { font-size: var(--fs-body); }
  .hero { min-height: 400px; border-radius: var(--r-l); }
  .hero-in { padding: 26px 20px 24px; }
  .hero p { font-size: var(--fs-body); }
  .tools .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .uni-grid { grid-template-columns: 1fr; gap: 20px; }
  .card-body { padding: 0 16px 18px; }
  .card-facts dd { font-size: 16px; }
  .hero-photo img { aspect-ratio: 4 / 3; border-radius: var(--r-m); }
  .summary, .facts { grid-template-columns: 1fr 1fr; }
  .summary > div, .facts > div { padding: 14px; }
  .summary dd { font-size: var(--fs-body); }
  .signs { grid-template-columns: 1fr; }
  .sign + .sign { border-inline-start: 0; border-top: 1px solid var(--line-strong); padding-inline-start: 6px; }
  .map { height: 320px; border-radius: var(--r-m); }
  .kv tbody th { width: 38%; }
  .kv th, .kv td { padding: 11px 12px; }
  .kv.lists { font-size: var(--fs-m); }
  .uni-head .en { flex-direction: column; align-items: flex-start; gap: 0; }
  .uni-head .sep { display: none; }
  .pager { flex-direction: column; }
  .segs { width: 100%; overflow-x: auto; }
  .seg { flex: 1; padding-inline: 10px; justify-content: center; }
  .lookup { padding: 24px 20px; }
  .opp-grid { grid-template-columns: 1fr; }
  .opp-body { padding: 16px 16px 16px; }
  .hero-opps { min-height: 380px; }
  .next-dep { font-size: var(--fs-s); }
  /* on phones the year line runs down the page, months as stops */
  .yl-wrap { overflow: visible; margin: 0; padding: 0; }
  .yl { display: block; min-width: 0; padding-inline-start: 34px; }
  .yl::before { inset-inline: auto; inset-inline-start: 7px; top: 8px; bottom: 8px; width: 9px; height: auto; margin: 0; transform-origin: center top; }
  .ym, .ym.quiet { min-width: 0; padding: 0 0 20px; }
  .ym.quiet { padding-bottom: 12px; }
  .ym::before { top: 3px; inset-inline-start: -32px; margin: 0; }
  .ym-name { display: inline-block; height: auto; margin-bottom: 10px; font-size: var(--fs-m); }
  .ym-ev { padding-top: 0; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .ym-none, .ym.quiet .ym-none { margin: 0; display: inline-block; margin-inline-start: 10px; }
  .ym:not(.quiet):not(.none) .ym-none { display: none; }
  .you { position: static; display: inline-block; translate: none; margin-inline-start: 10px; vertical-align: 2px; }
  .opp-tools .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .opp-tools select { flex: 1; min-width: 0; }
  .fn::after { max-width: 200px; }
}
@media (max-width: 560px) {
  .mast .in { flex-wrap: wrap; row-gap: 4px; padding-block: 10px 8px; min-height: 0; }
  .mast nav { width: 100%; justify-content: space-between; margin-inline: -8px; }
  .mast nav a { padding: 6px 9px; font-size: var(--fs-s); }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 760px) {
  .yl::before { animation-name: line-draw-y; }
}

/* ---------------------------------------------------------------- البحث وإمداد: the second section
   Same world as the Rowad pages: the two other lines (gold البحث والتطوير, ink إمداد) and their field stations. */

/* an interchange station: the ring carries the colours of the lines that pass through it */
.rd.xr-rd { --c: var(--l-rd); }
.rd.xr-em { --c: var(--l-em); }
.rd.xr-both {
  box-shadow: none;
  background:
    radial-gradient(circle closest-side, #fff calc(100% - 4px), transparent calc(100% - 3.5px)),
    conic-gradient(from 180deg, var(--l-rd) 0 50%, var(--l-em) 0 100%);
}
.rd.lg.xr-both {
  background:
    radial-gradient(circle closest-side, #fff calc(100% - 6px), transparent calc(100% - 5.5px)),
    conic-gradient(from 180deg, var(--l-rd) 0 50%, var(--l-em) 0 100%);
}
.card-top .rd.xr-both { box-shadow: 0 4px 12px -4px rgb(31 43 37 / .35); }

.card-lines { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: -6px 0 14px; }
.card-lines .lb { font-size: var(--fs-xs); }
.card-lines .lb::before { width: 16px; height: 6px; }
.no-photo { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px;
  font-family: var(--display); font-weight: 700; font-size: var(--fs-h2); color: var(--muted); text-align: center; }
.tag-unknown { background: var(--warn-bg); color: var(--warn-ink); }

/* the network: one line per track, one station per field */
.network { margin-top: 34px; }
.net { display: grid; gap: 26px; margin-top: 22px; }
.net-line { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: start; gap: 18px; }
.net-line[data-track="rd"] { --c: var(--l-rd); }
.net-line[data-track="em"] { --c: var(--l-em); }
.net-name { display: flex; align-items: center; gap: 10px; padding-top: 5px; font-family: var(--display); font-weight: 700; font-size: var(--fs-h4); }
.net-name::before { content: ""; width: 28px; height: 10px; border-radius: 99px; background: var(--c); flex: none; }
.net-stops { list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.net-stops::before { content: ""; position: absolute; top: 12px; height: 10px; border-radius: 99px; background: var(--c);
  inset-inline: calc(100% / var(--n) / 2); transform-origin: right center; }
.nstop { width: 100%; display: grid; justify-items: center; align-content: start; gap: 8px; padding: 0 4px 4px; border: 0; background: none;
  font: inherit; color: var(--ink); cursor: pointer; border-radius: var(--r-s); }
.nstop .rd { position: relative; z-index: 1; transition: transform .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease); }
.nstop .nm { font-size: var(--fs-xs); font-weight: 500; line-height: 1.35; text-align: center; text-wrap: balance; transition: color .3s var(--ease); }
.nstop:hover .rd, .nstop:focus-visible .rd { transform: scale(1.14); }
.nstop:hover .nm { color: var(--palm); }
.nstop:active .rd { transform: scale(.96); }
.nstop[aria-pressed="true"] .rd { background: var(--c); color: var(--ink); transform: scale(1.14); }
.net-line[data-track="em"] .nstop[aria-pressed="true"] .rd { color: #fff; }
.nstop[aria-pressed="true"] .nm { font-weight: 700; }
.net.has-pick .nstop[aria-pressed="false"] .nm { color: var(--muted); }
.net-status { margin: 22px 0 0; font-size: var(--fs-m); color: var(--muted); }
.net-status b { color: var(--ink); font-weight: 600; }
.net-status a { font-weight: 500; margin-inline-start: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .net-stops::before { animation: line-draw 1s var(--ease) backwards .1s; }
  .net-stops .rd { animation: stn-settle .5s var(--ease) backwards; }
  .net-stops li:nth-child(2) .rd { animation-delay: 60ms; } .net-stops li:nth-child(3) .rd { animation-delay: 120ms; }
  .net-stops li:nth-child(4) .rd { animation-delay: 180ms; } .net-stops li:nth-child(5) .rd { animation-delay: 240ms; }
  .net-stops li:nth-child(6) .rd { animation-delay: 300ms; } .net-stops li:nth-child(7) .rd { animation-delay: 360ms; }
  .net-stops li:nth-child(8) .rd { animation-delay: 420ms; }
}
.tracks-home .signs { margin-top: 40px; }
.tracks-home .hero::after { background: linear-gradient(0deg, rgb(20 38 30 / .9) 0%, rgb(20 38 30 / .8) 50%, rgb(20 38 30 / .72) 100%); }
.signs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.field-pick select { width: auto; min-width: 300px; max-width: 100%; }

/* station page header: the lines that pass through, each field as a station chip */
.xs-line { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.xs-group { min-width: 0; }
.xs-stop:hover { color: var(--palm); transform: translateY(-2px); box-shadow: var(--shadow-m); }
.xs-stop:active { transform: scale(.97); }
.xs-line p { margin: 0; }
.xs-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.xs-stops li { display: flex; }
.xs-stop { display: inline-flex; align-items: center; gap: 9px; background: var(--card); box-shadow: var(--shadow-s); border-radius: 99px; color: var(--ink); text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  padding: 4px; padding-inline-end: 16px; font-size: var(--fs-s); font-weight: 500; }

/* the university's own English wording, kept as published */
.src-quote { margin: 4px 0 14px; padding: 10px 16px 12px; background: var(--paper-deep); border-radius: var(--r-s); }
.src-quote > span { display: block; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 2px; }
.src-quote p { margin: 0; text-align: left; font-size: var(--fs-m); line-height: 1.6; color: var(--ink); }
.rent-grid .src-quote { margin-top: 10px; }
.xs-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.xs-group > .lb { min-width: 128px; }
.en-text { font-size: var(--fs-m); unicode-bidi: isolate; }
.kv td > .en-text:only-child { display: block; text-align: left; line-height: 1.6; }
.kv th > .en-text { font-size: var(--fs-s); color: var(--muted); }
details.more { margin: 10px 0 14px; }
details.more summary { cursor: pointer; color: var(--palm); font-weight: 500; font-size: var(--fs-m); width: fit-content; }
details.more summary:hover { color: var(--palm-dark); }
details.more .kv { margin-top: 10px; }

@media (max-width: 1080px) {
  .signs-3 { grid-template-columns: 1fr; }
  .signs-3 .sign + .sign { border-inline-start: 0; border-top: 1px solid var(--line-strong); padding-inline-start: 6px; }
}
@media (max-width: 760px) {
  /* on phones the two lines stand side by side and run down the page */
  .net { grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .net-line { grid-template-columns: 1fr; gap: 12px; }
  .net-name { font-size: var(--fs-m); }
  .net-stops { grid-template-columns: 1fr; gap: 10px; }
  .net-stops::before { inset-inline: auto; inset-inline-start: 12px; top: 12px; bottom: 12px; width: 10px; height: auto; transform-origin: center top; }
  .nstop { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; gap: 8px; padding: 0; }
  .nstop .nm { text-align: start; }
  .no-photo { font-size: var(--fs-h3); }
  /* the field chips under a station's name: one scrolling row per line */
  .xs-group { flex-direction: column; align-items: stretch; gap: 6px; }
  .xs-stops { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 4px 16px 10px; scrollbar-width: none; }
  .xs-stops li, .xs-stop { flex: none; }
  .field-pick select { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 760px) {
  .net-stops::before { animation-name: line-draw-y; }
}
@media (max-width: 560px) {
  /* five links share one row on phones */
  .mast nav { flex-wrap: nowrap; justify-content: space-between; margin-inline: -6px; }
  .mast nav a { padding: 5px 6px; font-size: 13px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
