:root {
  --bg: #fdfcfa;
  --fg: #1f1d1a;
  --muted: #6b665e;
  --line: #e4dfd6;
  --card: #ffffff;
  --accent: #1f5fa8;
  --mark: #fff0a8;
  --soon: #b3420e;
  --chip: #f1ede6;
  --chip-on: #1f1d1a;
  --chip-on-fg: #fdfcfa;
  --phd: #2f6f4f;
  --postdoc: #1f5fa8;
  --faculty: #7a3e9d;
  --fellowship: #a0621a;
  --other: #6b665e;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --fg: #ebe7e0;
    --muted: #a39d93;
    --line: #34312d;
    --card: #1e1d1b;
    --accent: #7fb0ec;
    --mark: #5c4d10;
    --soon: #f08a5d;
    --chip: #2a2826;
    --chip-on: #ebe7e0;
    --chip-on-fg: #161514;
    --phd: #7cc49d;
    --postdoc: #7fb0ec;
    --faculty: #c79be0;
    --fellowship: #e2ad66;
    --other: #a39d93;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto;
  max-width: 52rem;
  padding: 0 16px 3rem;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 var(--sans);
}
a { color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { padding: 2.25rem 0 0.5rem; }
.top h1 { font: 600 2rem/1.2 var(--serif); margin: 0 0 0.4rem; }
.lede { margin: 0; color: var(--muted); max-width: 40rem; }

.controls { position: sticky; top: 0; z-index: 1; background: var(--bg); padding: 1rem 0 0.75rem; border-bottom: 1px solid var(--line); }
#q {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
}
#q:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.7rem 0 0.5rem; }
.cat {
  font: inherit;
  font-size: 0.92rem;
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: var(--chip);
  color: var(--fg);
  cursor: pointer;
}
.cat[aria-checked="true"], .cat[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-fg); }
.cat .n { margin-left: 0.4rem; opacity: 0.65; font-variant-numeric: tabular-nums; }
.fields { margin-top: 0; }
.fields .cat { font-size: 0.84rem; padding: 0.2rem 0.6rem; }
.fields .cat.group { font-weight: 600; }
.opts { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; font-size: 0.92rem; color: var(--muted); }
.opts select { font: inherit; margin-left: 0.3rem; padding: 0.15rem 0.3rem; background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; }
.check { display: inline-flex; gap: 0.35rem; align-items: center; cursor: pointer; }

.summary { color: var(--muted); font-size: 0.95rem; margin: 1rem 0 0.25rem; }
.results { list-style: none; margin: 0; padding: 0; }
.job { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.job h2 { font: 600 1.12rem/1.35 var(--serif); margin: 0 0 0.2rem; overflow-wrap: anywhere; }
.job h2 a { color: var(--fg); text-decoration: none; }
.job h2 a:hover { color: var(--accent); text-decoration: underline; }
.job.expired { opacity: 0.6; }
.where { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.95rem; }
.line { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: center; margin: 0 0 0.4rem; font-size: 0.88rem; }
.dl { font-weight: 500; }
.dl.soon { color: var(--soon); }
.dl.none, .dl.past, .dl.rolling { color: var(--muted); font-weight: 400; }
.badge { border: 1px solid currentColor; border-radius: 4px; padding: 0 0.35rem; font-size: 0.8rem; line-height: 1.45; }
.badge.guessed { border-style: dashed; }
.cat-phd { color: var(--phd); }
.cat-postdoc { color: var(--postdoc); }
.cat-faculty { color: var(--faculty); }
.cat-fellowship { color: var(--fellowship); }
.cat-other { color: var(--other); }
.badge.new { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.snippet { margin: 0 0 0.35rem; font-size: 0.95rem; overflow-wrap: anywhere; }
mark { background: var(--mark); color: inherit; padding: 0 1px; border-radius: 2px; }
.why { margin: 0 0 0.2rem; font-size: 0.85rem; color: var(--muted); }
.why b { color: var(--fg); font-weight: 600; }
.via { display: inline-block; margin: 0.15rem 0.3rem 0 0; padding: 0 0.45rem; border-radius: 999px; background: var(--chip); color: var(--fg); font-size: 0.8rem; }
.via i { font-style: normal; color: var(--muted); }
.badge.approach { color: var(--muted); }
.badge.restricted { color: var(--soon); border-style: dotted; }
.general { margin-top: 2.5rem; }
.general h2 { font: 600 1.15rem/1.3 var(--serif); margin: 0 0 0.25rem; }
.general-note { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
.sources { margin: 0; font-size: 0.85rem; color: var(--muted); }
.more { display: block; margin: 1.25rem auto 0; font: inherit; padding: 0.5rem 1.2rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); cursor: pointer; }
.foot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.foot p { margin: 0 0 0.5rem; }

@media (max-width: 520px) {
  .top h1 { font-size: 1.6rem; }
  .controls { position: static; }
}

/* Status page */
.warnings { margin: 1rem 0; padding: 0.75rem 1rem 0.75rem 2rem; border: 1px solid var(--soon); border-radius: 8px; color: var(--fg); }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table.status { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.status th, table.status td { text-align: left; padding: 0.45rem 0.6rem 0.45rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.status thead th { color: var(--muted); font-weight: 500; }
table.status .num { text-align: right; font-variant-numeric: tabular-nums; }
table.status .id { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 400; }
table.status .note { color: var(--muted); }
table.status td.soon { color: var(--soon); }
.pill { border-radius: 999px; padding: 0.05rem 0.55rem; font-size: 0.82rem; white-space: nowrap; background: var(--chip); }
.pill.ok { color: var(--phd); }
.pill.warn, .pill.skip { color: var(--fellowship); }
.pill.fail { color: var(--soon); font-weight: 600; }
.pill.idle { color: var(--muted); }
.pill.fill { color: var(--postdoc, var(--phd)); font-style: italic; }
h2.sub { font: 600 1.15rem/1.3 var(--serif); margin: 2rem 0 0; }

/* Link-out row: a quiet line under the summary; a block in place of the results when nothing matches. */
.linkouts { margin: 0 0 1rem; font-size: 0.9rem; color: var(--muted); line-height: 1.6; }
.linkouts a { color: var(--accent); }
.linkouts .lo-static { display: none; margin: 0.25rem 0 0; }
.linkouts.prominent { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; color: var(--fg); font-size: 1rem; }
.linkouts.prominent .lo-head { margin: 0 0 0.6rem; font-weight: 600; }
.linkouts.prominent .lo-boards { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.linkouts.prominent .board { display: inline-block; padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--chip); text-decoration: none; }
.linkouts.prominent .board:hover, .linkouts.prominent .board:focus-visible { background: var(--chip-on); color: var(--chip-on-fg); }
.linkouts.prominent .lo-static { display: block; margin-top: 0.8rem; font-size: 0.9rem; color: var(--muted); }

/* Status page: summary, institution groups, one-line dates. */
.status-summary { font-size: 1.05rem; margin: 0 0 1rem; }
.status-summary .bad { color: var(--soon); font-weight: 600; }
tr.inst th { padding-top: 1.1rem; font-family: var(--serif); font-size: 1.02rem; border-bottom: 1px solid var(--line); }
tr.inst th .count { font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: 0.85rem; margin-left: 0.4rem; }
tr.page th { font-weight: 400; padding-left: 1rem; }
td.date { white-space: nowrap; }
.job .also { margin: 0.1rem 0 0.3rem; font-size: 0.88rem; color: var(--muted); }

/* Stale-data warning (search and status pages). */
.stale { margin: 0 0 1rem; padding: 0.7rem 0.9rem; border-radius: 8px; border: 1px solid var(--soon); color: var(--soon); background: var(--card); font-size: 0.95rem; }
.stale a { color: inherit; }
/* Advert facts and guessed values. */
.job .facts { margin: 0.25rem 0 0.3rem; font-size: 0.88rem; color: var(--muted); }
.job .facts .fact { white-space: normal; }
.job .corr { margin: 0.15rem 0 0.3rem; font-size: 0.88rem; color: var(--muted); overflow-wrap: anywhere; }
.guess { color: var(--muted); font-size: 0.85em; margin-left: 0.1em; cursor: help; }
.relax { text-decoration: underline dotted; cursor: help; }
.summary .missing { white-space: nowrap; }
.pdfnote { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.25rem; }

/* Find a supervisor (Phase 15) */
.controls select#concept { font: inherit; padding: 0.25rem 0.4rem; margin-left: 0.3rem; max-width: 100%; }
.person .counts { margin: 0.2rem 0; font-variant-numeric: tabular-nums; }
.person .share { font-weight: 600; }
.person .share.mainly { color: var(--accent); }
.person .share.partly { color: var(--muted); }
.person .links { margin: 0.2rem 0; font-size: 0.9rem; }
.person .links .removal { color: var(--muted); }
.person .jobs-here { margin-top: 0.3rem; font-size: 0.9rem; }
.person .jobs-here .lbl { color: var(--muted); }
.badge.est { color: var(--soon); border-style: dashed; font-weight: normal; font-size: 0.75rem; }
.from-papers { color: var(--muted); font-size: 0.85rem; }
.badge.norank { color: var(--muted); border-style: dashed; font-weight: normal; font-size: 0.75rem; }
.about-sup { margin-top: 2rem; max-width: 46rem; color: var(--muted); font-size: 0.92rem; }
.suplink { margin: 0.2rem 0 0.6rem; font-size: 0.92rem; }
