/* =====================================================================
   ScholarBrief - single stylesheet
   No web fonts, no frameworks. Loads as one render-blocking file.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --paper:       #faf8f5;
  --surface:     #ffffff;
  --surface-alt: #f2efe9;
  --ink:         #16222b;
  --ink-soft:    #3d4d58;
  --muted:       #5f6f7a;
  --line:        #e2ddd3;
  --line-strong: #cdc6b8;
  --accent:      #0f3b52;
  --accent-ink:  #0b2c3e;
  --accent-soft: #e6eef2;
  --gold:        #8a5d12;
  --gold-soft:   #fbf3e2;
  --danger:      #8c2f22;
  --danger-soft: #fbeeec;
  --ok:          #1f5f3f;
  --ok-soft:     #e9f4ee;
  --shadow:      0 1px 2px rgba(20, 34, 43, .06), 0 8px 24px -12px rgba(20, 34, 43, .18);
  --radius:      10px;
  --radius-lg:   16px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --measure: 68ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:       #0c1418;
    --surface:     #121d24;
    --surface-alt: #16232b;
    --ink:         #e8eff3;
    --ink-soft:    #c3d0d8;
    --muted:       #97a8b3;
    --line:        #24343d;
    --line-strong: #354854;
    --accent:      #7cbcd8;
    --accent-ink:  #a8d6ec;
    --accent-soft: #142b38;
    --gold:        #d6a95f;
    --gold-soft:   #2a2114;
    --danger:      #f0938a;
    --danger-soft: #2c1917;
    --ok:          #7fd0a4;
    --ok-soft:     #12241b;
    --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:       #0c1418;
  --surface:     #121d24;
  --surface-alt: #16232b;
  --ink:         #e8eff3;
  --ink-soft:    #c3d0d8;
  --muted:       #97a8b3;
  --line:        #24343d;
  --line-strong: #354854;
  --accent:      #7cbcd8;
  --accent-ink:  #a8d6ec;
  --accent-soft: #142b38;
  --gold:        #d6a95f;
  --gold-soft:   #2a2114;
  --danger:      #f0938a;
  --danger-soft: #2c1917;
  --ok:          #7fd0a4;
  --ok-soft:     #12241b;
  --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.35rem + 2.1vw, 2.85rem); }
h2 { font-size: clamp(1.4rem, 1.15rem + 1.05vw, 1.85rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + .45vw, 1.32rem); }
p, ul, ol { margin: 0 0 1.05em; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---------- Utilities ---------- */
.wrap { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 20px; }
.wrap--doc { max-width: 860px; padding-block: 1.25rem 3.5rem; }
.wrap--wide { max-width: 1120px; }
.wrap--wide .prose { max-width: var(--measure); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--accent); color: #fff; padding: .6rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius); transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }
:root[data-theme="dark"] .skip-link, :root:not([data-theme="light"]) .skip-link { color: #06121a; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.site-header__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 68px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--ink); text-decoration: none; font-family: var(--serif);
  font-size: 1.3rem; letter-spacing: -.02em; margin-right: auto;
}
.brand__mark { color: var(--accent); flex: none; }
.brand__text strong { font-weight: 700; }
.brand:hover { color: var(--accent); }

.nav-toggle {
  display: none; align-items: center; gap: .5rem;
  background: var(--surface-alt); border: 1px solid var(--line);
  color: var(--ink); font: inherit; font-size: .9rem;
  padding: .5rem .8rem; border-radius: var(--radius); cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 16px; height: 2px; background: currentColor; position: relative;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.site-nav { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.site-nav ul { display: flex; gap: 1.1rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: .935rem;
  font-weight: 500; padding: .35rem 0; display: inline-block; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent); border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.site-search { display: flex; align-items: center; }
.site-search input {
  font: inherit; font-size: .875rem; padding: .45rem .7rem; width: 190px;
  border: 1px solid var(--line-strong); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--paper); color: var(--ink);
}
.site-search input::placeholder { color: var(--muted); }
.site-search button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--accent); background: var(--accent); color: var(--surface);
  padding: .45rem .7rem; border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer; min-height: 36px;
}
:root[data-theme="dark"] .site-search button, :root:not([data-theme="light"]) .site-search button { color: #06121a; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1100px 460px at 12% -20%, var(--accent-soft), transparent 62%),
    var(--surface);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.75rem);
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .78rem; letter-spacing: .09em; text-transform: uppercase;
  font-weight: 700; color: var(--gold); background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.hero h1 { max-width: 20ch; margin-bottom: .5rem; }
.hero__lede { font-size: clamp(1.02rem, .97rem + .3vw, 1.18rem); color: var(--ink-soft); max-width: 60ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.25rem; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 1px solid var(--accent); background: var(--accent); color: var(--surface);
  transition: transform .12s ease, box-shadow .12s ease;
}
:root[data-theme="dark"] .btn, :root:not([data-theme="light"]) .btn { color: #06121a; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--surface); }
:root[data-theme="dark"] .btn:hover, :root:not([data-theme="light"]) .btn:hover { color: #06121a; }
.btn--ghost { background: transparent; color: var(--accent); border-color: var(--line-strong); }
.btn--ghost:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--surface); }

.hero__stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; margin-top: 2.5rem; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.hero__stats > div { background: var(--surface); padding: 1.1rem 1.25rem; }
.hero__stats dt { font-size: .82rem; color: var(--muted); margin-bottom: .2rem; }
.hero__stats dd { margin: 0; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(2.25rem, 1.6rem + 2.4vw, 3.6rem); }
.section--alt { background: var(--surface-alt); border-block: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.section-head p { margin: .35rem 0 0; color: var(--muted); max-width: 62ch; font-size: .96rem; }
.section-head h2, .section-title { margin: 0; }
.section-title { margin: 2.4rem 0 1.2rem; }
.section-link { font-size: .92rem; font-weight: 600; white-space: nowrap; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 1.15rem; }
.grid--cats { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.3rem;
  display: flex; flex-direction: column; gap: .5rem;
  transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.card__kicker {
  margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.card__kicker a { color: var(--muted); text-decoration: none; }
.card__kicker a:hover { color: var(--accent); text-decoration: underline; }
.card__title { margin: 0; font-size: 1.13rem; line-height: 1.32; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--accent); text-decoration: underline; }
.card__desc { margin: 0; color: var(--ink-soft); font-size: .935rem; line-height: 1.55; }
.card__meta {
  margin: auto 0 0; padding-top: .7rem; display: flex; flex-wrap: wrap; gap: .5rem;
  font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line);
}
.card--scheme { border-left: 3px solid var(--accent); }
.card--cat { background: var(--surface); }

.tagrow { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: .2rem 0 0; padding: 0; }
.tag {
  font-size: .74rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid transparent;
}
:root[data-theme="dark"] .tag, :root:not([data-theme="light"]) .tag { color: var(--accent-ink); }
.verified { color: var(--ok); font-weight: 600; }

.chiprow { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-block; padding: .4rem .85rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: .88rem; text-decoration: none; color: var(--ink-soft);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Link lists ---------- */
.link-list { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.link-list__item {
  padding: .65rem 0; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; justify-content: space-between;
}
.link-list__item a { font-weight: 500; }
.link-list__meta { color: var(--muted); font-size: .82rem; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { margin: 0 0 1.4rem; font-size: .85rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; color: var(--line-strong); margin-right: .4rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--ink-soft); }

/* ---------- Page head ---------- */
.page-head { margin-bottom: 1.8rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: .35rem; }
.page-head__sub { color: var(--ink-soft); font-size: 1.06rem; margin: 0 0 .4rem; max-width: var(--measure); }
.page-head__meta { color: var(--muted); font-size: .85rem; margin: 0; }

/* ---------- Post ---------- */
.post__head { margin-bottom: 1.8rem; }
.post__kicker {
  margin: 0 0 .55rem; font-size: .76rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold);
}
.post__kicker a { color: var(--gold); text-decoration: none; }
.post__kicker a:hover { text-decoration: underline; }
.post__standfirst {
  font-size: clamp(1.04rem, 1rem + .3vw, 1.2rem); color: var(--ink-soft);
  max-width: var(--measure); margin: .6rem 0 1.2rem; line-height: 1.5;
}
.post__byline {
  display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: baseline;
  padding: .85rem 0; border-block: 1px solid var(--line); font-size: .875rem;
}
.post__byline p { margin: 0; }
.post__dates { color: var(--muted); display: flex; flex-wrap: wrap; gap: .45rem; }
.post__foot { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.post__foot-note { font-size: .875rem; color: var(--muted); margin: 0; }

.verified-line {
  margin: 1.2rem 0 0; padding: .8rem 1rem; font-size: .89rem;
  background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
  border-radius: var(--radius); color: var(--ink-soft);
}

/* ---------- Prose ---------- */
.prose { max-width: var(--measure); font-family: var(--serif); font-size: 1.075rem; line-height: 1.72; }
.prose h2 { margin-top: 2.4rem; padding-top: .3rem; }
.prose h3 { margin-top: 1.9rem; }
.prose h4 { margin-top: 1.5rem; font-size: 1.02rem; font-family: var(--sans); font-weight: 700; }
.prose > p:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin-bottom: .5em; }
.prose li > ul, .prose li > ol { margin-top: .5em; }
.prose strong { font-weight: 700; color: var(--ink); }
.prose blockquote {
  margin: 1.6rem 0; padding: .3rem 0 .3rem 1.25rem;
  border-left: 3px solid var(--gold); color: var(--ink-soft); font-style: italic;
}
.prose code {
  font-family: var(--mono); font-size: .87em; background: var(--surface-alt);
  padding: .12em .38em; border-radius: 4px; border: 1px solid var(--line);
}
.prose figure { margin: 1.8rem 0; }
.prose figcaption { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.prose a[target="_blank"] .ext::after { content: " \2197"; font-size: .85em; }

/* ---------- Callouts ---------- */
.callout {
  margin: 1.7rem 0; padding: 1.05rem 1.2rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  border-left: 4px solid var(--accent); font-family: var(--sans);
  font-size: .95rem; line-height: 1.6;
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout__title {
  font-weight: 700; font-size: .8rem; letter-spacing: .07em; text-transform: uppercase;
  margin: 0 0 .45rem; color: var(--accent);
}
.callout--warn { border-left-color: var(--danger); background: var(--danger-soft); }
.callout--warn .callout__title { color: var(--danger); }
.callout--tip { border-left-color: var(--gold); background: var(--gold-soft); }
.callout--tip .callout__title { color: var(--gold); }
.callout--ok { border-left-color: var(--ok); background: var(--ok-soft); }
.callout--ok .callout__title { color: var(--ok); }

/* ---------- Steps & checklists ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.6rem 0; font-family: var(--sans); font-size: .98rem; }
.steps > li {
  counter-increment: step; position: relative; padding: 0 0 1.15rem 3rem; margin: 0;
  border-left: 1px solid var(--line); margin-left: 1rem;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: -1rem; top: -.1rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  display: grid; place-items: center; font-weight: 700; font-size: .88rem;
  font-family: var(--sans);
}
.steps > li > strong:first-child { display: block; font-family: var(--serif); font-size: 1.08rem; margin-bottom: .2rem; }

.checklist { list-style: none; padding: 0; margin: 1.4rem 0; font-family: var(--sans); font-size: .97rem; }
.checklist li { position: relative; padding-left: 1.9rem; margin-bottom: .6rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .38em;
  width: .78rem; height: .42rem; border-left: 2.5px solid var(--ok);
  border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg);
}
.checklist--x li::before {
  content: "\00d7"; border: 0; transform: none; color: var(--danger);
  font-size: 1.25rem; line-height: 1; top: .1em; font-weight: 700; width: auto; height: auto;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.7rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .9rem; min-width: 560px; }
.data-table th, .data-table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { background: var(--surface-alt); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table th[scope="row"] { font-weight: 600; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .92rem; }
.prose table th, .prose table td { padding: .6rem .8rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose table th { background: var(--surface-alt); }

/* ---------- Factbox ---------- */
.factbox {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); padding: 1.4rem; margin: 2rem 0;
  box-shadow: var(--shadow);
}
.factbox__title { margin: 0 0 1rem; font-size: 1.15rem; }
.factbox__list { display: grid; gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.factbox__list > div { background: var(--surface); padding: .75rem .95rem; display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: .5rem 1rem; }
.factbox__list dt { font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.factbox__list dd { margin: 0; font-size: .96rem; }
.factbox__note {
  margin: 1.1rem 0 0; font-size: .88rem; line-height: 1.55; color: var(--ink-soft);
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  border-radius: var(--radius); padding: .85rem 1rem;
}

/* ---------- Filters (scholarship table) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .9rem; align-items: flex-end; margin: 1.5rem 0 .5rem; }
.filters label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .25rem; }
.filters select, .filters input {
  font: inherit; font-size: .9rem; padding: .45rem .6rem; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); min-width: 180px;
}
.filters__status { font-size: .85rem; color: var(--muted); margin: 0 0 0 auto; }

/* ---------- Related ---------- */
.related { margin-top: 3rem; padding-top: 1.8rem; border-top: 2px solid var(--line); }
.related h2 { font-size: 1.3rem; margin-bottom: 1.1rem; }
.othercats { margin-top: 2.6rem; }

/* ---------- Forms ---------- */
.contact-form { font-family: var(--sans); margin: 1.6rem 0; max-width: 46rem; }
.contact-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; font-size: .95rem; width: 100%; padding: .6rem .75rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
.contact-form textarea { resize: vertical; min-height: 8rem; }
.contact-form button { border: 0; cursor: pointer; font-family: var(--sans); }
.contact-form .muted { font-size: .87rem; }

/* ---------- Search page ---------- */
.searchbox { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.5rem 0; }
.searchbox input {
  flex: 1 1 260px; font: inherit; padding: .7rem .9rem; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
.search-results { list-style: none; padding: 0; margin: 1.5rem 0; }
.search-results li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.search-results h3 { margin: 0 0 .25rem; font-size: 1.08rem; }
.search-results p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.search-results .result-url { font-size: .8rem; color: var(--muted); font-family: var(--mono); }
mark { background: var(--gold-soft); color: inherit; padding: 0 .12em; border-radius: 2px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding-block: 3.5rem 2rem; }
.notfound__code { font-family: var(--serif); font-size: clamp(4rem, 3rem + 8vw, 7rem); line-height: 1; color: var(--accent-soft); margin: 0; }
:root[data-theme="dark"] .notfound__code, :root:not([data-theme="light"]) .notfound__code { color: var(--accent-soft); }
.notfound .searchbox { max-width: 480px; margin-inline: auto; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem; background: var(--surface); border-top: 1px solid var(--line);
  padding-block: 2.8rem 1.5rem; font-size: .9rem;
}
.site-footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; }
.site-footer__blurb { color: var(--muted); max-width: 42ch; font-size: .875rem; }
.site-footer__col h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-family: var(--sans); color: var(--muted); margin-bottom: .8rem; }
.site-footer__col ul { list-style: none; margin: 0; padding: 0; }
.site-footer__col li { margin-bottom: .45rem; }
.site-footer__col a { color: var(--ink-soft); text-decoration: none; }
.site-footer__col a:hover { color: var(--accent); text-decoration: underline; }
.site-footer__legal {
  margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .82rem;
}
.site-footer__legal p { margin: 0 0 .5rem; max-width: 100ch; }
.theme-toggle {
  margin-top: 1rem; display: inline-flex; align-items: center; gap: .5rem;
  background: var(--surface-alt); border: 1px solid var(--line);
  color: var(--ink-soft); font: inherit; font-size: .85rem;
  padding: .45rem .8rem; border-radius: 999px; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.theme-toggle__icon { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: inset -4px -1px 0 0 var(--surface); }

/* ---------- No-JS ---------- */
html:not(.js) .theme-toggle { display: none; }
html:not(.js) .filters { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 1.8rem; }
  .factbox__list > div { grid-template-columns: 1fr; gap: .15rem; }
}

@media (max-width: 780px) {
  html.js .nav-toggle { display: inline-flex; }
  html.js .site-nav {
    display: none; width: 100%; flex-direction: column; align-items: stretch;
    gap: .75rem; padding-bottom: 1rem;
  }
  html.js .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--line); }
  .site-nav a { padding: .7rem 0; display: block; border-bottom: 0; }
  .site-search { width: 100%; }
  .site-search input { flex: 1; width: auto; }
  .site-header__inner { min-height: 60px; padding-block: .5rem; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  .grid { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .prose { font-size: 1.04rem; }
  .steps > li { padding-left: 2.6rem; }
  .filters__status { margin-left: 0; }
}

@media print {
  .site-header, .site-footer, .breadcrumbs, .related, .nav-toggle, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .prose { max-width: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
}
