/* AIDC Research — /research, /research/<slug>, /research/<slug>/paper (built by scripts/build-research.mjs).
   Site tokens from site.css (--bg, --ink, --mut, --line, --signal, --font-display, --font-mono); class prefix rs-.
   Figures are inline SVG whose colours are the --fig-* variables below, so they follow the light/dark theme. */

:root {
  --rs-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --rs-measure: 680px;
  --rs-article: 720px;
  --rs-sub-h: 52px;
  /* figure palette, dark theme (site default before theme.js runs) */
  --fig-bg: #0a0a0a;
  --fig-ink: #ececec;
  --fig-accent: #ff5a1a;
  --fig-accent-2: #ff8b52;
  --fig-accent-3: #b3542a;
  --fig-tint: rgba(255, 90, 26, 0.16);
  --fig-grey-1: #a9b0b7;
  --fig-grey-2: #7f8891;
  --fig-grey-3: #4b525a;
  --fig-grey-4: #2a2f35;
  --fig-font: "Archivo", system-ui, sans-serif;
}
[data-theme="light"] {
  --fig-bg: #ffffff;
  --fig-ink: #1f1f1f;
  --fig-accent: #e5620c;
  --fig-accent-2: #b34a08;
  --fig-accent-3: #f2a06b;
  --fig-tint: #fbe7d8;
  --fig-grey-1: #5c636a;
  --fig-grey-2: #8a949e;
  --fig-grey-3: #c9cfd5;
  --fig-grey-4: #e4e8ec;
}

body.rs { background: var(--bg); }
.rs main { display: block; }
.rs :is(h1, h2, h3) { text-wrap: balance; }
.rs a.rs-cite, .rs a.rs-xref, .rs .rs-refs a, .rs .rs-toc a, .rs .rs-note a, .rs figcaption a { border-bottom: 0; }

/* ---------- sub-navigation (same pattern as Academy) ---------- */
.rs-subnav {
  position: sticky; top: var(--nav-h, 64px); z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.rs-subnav .wrap { display: flex; align-items: center; gap: 26px; height: var(--rs-sub-h); }
.rs-brand { display: inline-flex; align-items: center; gap: 9px; flex: none; color: var(--ink-strong); }
.rs-brand .mark { font-size: 0.9rem; }
.rs-brand b { font-size: 0.98rem; font-weight: 700; letter-spacing: -0.01em; }
.rs-subnav-links { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.rs-subnav-links::-webkit-scrollbar { display: none; }
.rs-subnav-links a { flex: none; font-size: 0.88rem; color: var(--mut); transition: color .15s; }
.rs-subnav-links a:hover { color: var(--ink-strong); }

/* ---------- shared bits ---------- */
.rs-area-tag { font-size: 0.8rem; font-weight: 600; color: var(--ink-strong); letter-spacing: 0.01em; }
.rs-date { font-size: 0.8rem; color: var(--mut); }
.rs-feat-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.rs-art { display: block; width: 100%; height: auto; }
.rs-note { font-size: 0.92rem; color: var(--mut); }
.rs-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-filter button {
  font: inherit; font-size: 0.82rem; padding: 5px 12px; border-radius: var(--radius-full);
  border: 1px solid var(--line); background: transparent; color: var(--mut); cursor: pointer; transition: all .15s;
}
.rs-filter button:hover { color: var(--ink-strong); border-color: color-mix(in srgb, var(--ink-strong) 30%, transparent); }
.rs-filter button.on { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--bg); }
.rs-type { display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); white-space: nowrap; }
.rs-type--precision { background: var(--signal-soft); color: var(--signal); }
.rs-type--automation { background: color-mix(in srgb, var(--ink-strong) 10%, transparent); color: var(--ink-strong); }
.rs-type--asset { background: var(--bg-3); color: var(--mut); }
.rs-type--mixed { background: transparent; color: var(--mut); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- index ---------- */
.rs-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; padding-top: clamp(56px, 8vw, 104px); padding-bottom: 48px; align-items: start; }
.rs-hero h1 { font-size: clamp(3rem, 7vw, 5.4rem); margin: 0; letter-spacing: -0.04em; }
.rs-hero .kicker { margin-bottom: 1.1rem; }
.rs-hero-lede { font-family: var(--rs-serif); font-size: clamp(1.18rem, 1.7vw, 1.42rem); line-height: 1.5; color: var(--ink-strong); margin: 0 0 1.2rem; }
.rs-hero-areas { font-size: 0.86rem; color: var(--mut); display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; }
.rs-hero-areas b { color: var(--ink-strong); font-weight: 600; }
.rs-hero-areas a { color: var(--mut); border-bottom: 1px solid var(--line); }
.rs-hero-areas a:hover { color: var(--ink-strong); }
/* section rules drawn inside the .wrap gutters, aligned with the content */
.rs-rule { background: linear-gradient(var(--line), var(--line)) no-repeat center top / calc(100% - 2 * var(--pad-x)) 1px; }
.rs-areas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; padding-top: 32px; padding-bottom: 48px; }
.rs-area { color: inherit; }
.rs-area h2 { font-size: 1.12rem; letter-spacing: -0.01em; margin: 0 0 8px; }
.rs-area p { font-family: var(--rs-serif); font-size: 0.98rem; line-height: 1.5; color: var(--mut); margin: 0; }
.rs-area:hover h2 { color: var(--signal); }
.rs-featured { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 56px; }
.rs-feat-main { color: inherit; display: block; }
.rs-feat-art { border-radius: var(--radius-md); overflow: hidden; background: #fff; margin-bottom: 20px; }
.rs-feat-art img { transition: transform .5s var(--ease); }
.rs-feat-main:hover .rs-feat-art img { transform: scale(1.015); }
.rs-feat-main h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin: 0 0 12px; letter-spacing: -0.02em; }
.rs-feat-main p { font-family: var(--rs-serif); font-size: 1.1rem; line-height: 1.55; color: var(--mut); max-width: 640px; margin: 0; }
.rs-feat-main:hover h2 { color: var(--signal); }
.rs-feat-side { display: flex; flex-direction: column; }
.rs-feat-item { color: inherit; padding: 20px 0; border-bottom: 1px solid var(--line); }
.rs-feat-item:first-child { padding-top: 0; }
.rs-feat-item h3 { font-size: 1.12rem; line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.01em; }
.rs-feat-item p { font-family: var(--rs-serif); font-size: 0.98rem; line-height: 1.5; color: var(--mut); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rs-feat-item:hover h3 { color: var(--signal); }
.rs-pubs { padding-top: 48px; padding-bottom: clamp(72px, 9vw, 120px); scroll-margin-top: calc(var(--nav-h) + var(--rs-sub-h)); }
.rs-pubs-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 20px; }
.rs-pubs-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0; }
.rs-search { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; min-width: 260px; border: 1px solid var(--line); border-radius: var(--radius-full); color: var(--mut); background: var(--bg); }
.rs-search svg { width: 16px; height: 16px; flex: none; }
.rs-search input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 0.9rem; color: var(--ink-strong); width: 100%; }
.rs-pubs .rs-filter { margin-bottom: 24px; }
.rs-pub-table { width: 100%; border-collapse: collapse; }
.rs-pub-table th { text-align: left; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mut); padding: 0 16px 12px 0; border-bottom: 1px solid var(--line); }
.rs-pub-table td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.92rem; }
.rs-pub-date { width: 130px; color: var(--mut); white-space: nowrap; }
.rs-pub-area { width: 190px; color: var(--mut); }
.rs-pub-title a { color: var(--ink-strong); border-bottom: 0; font-weight: 500; }
.rs-pub-title a:hover { color: var(--signal); }
.rs-pub-type { margin-left: 10px; font-size: 0.74rem; color: var(--mut-2); white-space: nowrap; }
.rs-pub-table tr[hidden] { display: none; }
.rs-empty { color: var(--mut); padding: 24px 0; }

/* ---------- reader page (/research/<slug>) ---------- */
.rs-post-head { max-width: 980px; margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--pad-x) 32px; text-align: center; }
.rs-post-head .rs-area-tag { display: inline-block; margin-bottom: 18px; border-bottom: 0; }
.rs-post-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); line-height: 1.08; letter-spacing: -0.03em; margin: 0 auto 18px; max-width: 920px; }
.rs-post-date, .rs-post-authors { color: var(--mut); font-size: 0.92rem; margin: 0 0 6px; }
.rs-post-actions { justify-content: center; margin-top: 24px; }
.rs-post-hero { max-width: 1100px; margin: 12px auto 56px; padding: 0 var(--pad-x); }
.rs-post-hero .rs-art--hero { border-radius: var(--radius-md); background: #fff; }
.rs-prose { max-width: calc(var(--rs-measure) + 2 * var(--pad-x)); margin: 0 auto; padding: 0 var(--pad-x) 40px; font-family: var(--rs-serif); font-size: 1.14rem; line-height: 1.62; color: var(--ink); }
.rs-prose > p, .rs-prose > ul, .rs-prose > ol { margin: 0 0 1.15em; }
.rs-prose h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.4vw, 1.95rem); margin: 2.1em 0 0.7em; letter-spacing: -0.02em; }
.rs-prose h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 1.8em 0 0.6em; }
.rs-prose a { color: var(--ink-strong); border-bottom: 1px solid color-mix(in srgb, var(--signal) 70%, transparent); }
.rs-prose strong { font-weight: 600; }
.rs-lead { font-size: 1.28rem; line-height: 1.55; color: var(--ink-strong); }
.rs-findings { margin: 2.2em 0; padding: 26px 30px 12px; border-radius: var(--radius-md); background: var(--bg-2); border: 1px solid var(--line-soft); }
.rs-findings-h { font-size: 0.78rem !important; font-family: var(--font-mono) !important; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--signal); margin: 0 0 14px !important; }
.rs-findings ul { margin: 0; padding-left: 1.1em; }
.rs-findings li { margin-bottom: 0.8em; font-size: 1.04rem; }
.rs-post-cta { margin: 3em 0 2.2em; padding: 28px 30px; border-radius: var(--radius-md); border: 1px solid var(--line); }
.rs-post-cta h2 { margin: 0 0 8px !important; font-size: 1.4rem !important; }
.rs-post-cta p { color: var(--mut); font-size: 1.02rem; }
.rs-post-cta .btn-row { font-family: var(--font-body); }
.rs-post-byline { font-family: var(--font-body); font-size: 0.9rem; color: var(--mut); }
.rs-reader .rs-fig, .rs-reader .rs-table-fig { margin: 2.2em calc(-1 * min(120px, max(0px, (100vw - var(--rs-measure)) / 2 - 24px))); }

/* ---------- figures and tables ---------- */
.rs-fig { margin: 2.4em 0; }
.rs-fig-media { background: var(--fig-bg); border-radius: var(--radius-md); padding: 14px 12px 8px; border: 1px solid var(--line-soft); }
.rs-fig-media .fig-svg { display: block; width: 100%; height: auto; }
.rs-fig figcaption, .rs-table-fig figcaption { font-family: var(--font-body); font-size: 0.86rem; line-height: 1.55; color: var(--mut); margin-top: 12px; }
.rs-fig-num { color: var(--ink-strong); font-weight: 600; }
.fig-svg .fig-pt { cursor: help; outline: none; }
.fig-svg .fig-pt:hover path, .fig-svg .fig-pt:focus path, .fig-svg .fig-pt:hover use, .fig-svg .fig-pt:focus use { stroke: var(--fig-ink) !important; stroke-width: 1.4px; }
.rs-tip {
  position: fixed; z-index: 90; pointer-events: none; max-width: 320px;
  font-family: var(--font-body); font-size: 0.8rem; line-height: 1.45; color: var(--bg); background: var(--ink-strong);
  padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow-menu); opacity: 0; transition: opacity .12s;
}
.rs-tip.on { opacity: 1; }
.rs-table-fig { margin: 2.2em 0; }
.rs-table-fig > figcaption { margin: 0 0 12px; }
.rs-table-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; font-family: var(--font-body); }
.rs-dl { font-size: 0.84rem; color: var(--ink-strong); border-bottom: 1px solid var(--signal); }
.rs-table-scroll { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.rs-table { width: 100%; border-collapse: separate; border-spacing: 0; font-family: var(--font-body); font-size: 0.82rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.rs-table th, .rs-table td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; font-family: var(--font-body); font-size: inherit; letter-spacing: 0; text-transform: none; color: var(--ink); }
.rs-table td:first-child { font-weight: 400; }
.rs-reg td { vertical-align: top; }
.rs-se { display: block; color: var(--mut); font-size: 0.9em; }
.rs-reg-sep th, .rs-reg-sep td { border-top: 1px solid var(--line); }
.rs-hyp td, .rs-hyp th { white-space: normal; vertical-align: top; }
.rs-hyp td:nth-child(2) { min-width: 260px; }
.rs-verdict { font-size: 0.86em; color: var(--mut); }
.rs-verdict.is-yes { color: var(--ink-strong); font-weight: 600; }
.rs-type--government { background: var(--bg-2); color: var(--mut); }
.rs-table thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-2); font-weight: 600; color: var(--ink-strong); border-bottom: 1px solid var(--line); }
.rs-table thead th button { all: unset; cursor: pointer; }
.rs-table thead th button:hover { color: var(--signal); }
.rs-table thead th[aria-sort] button::after { content: " ↓"; color: var(--signal); }
.rs-table thead th[aria-sort="ascending"] button::after { content: " ↑"; }
.rs-table tbody th { font-weight: 500; color: var(--ink-strong); max-width: 280px; white-space: normal; min-width: 200px; }
.rs-table .num { text-align: right; }
.rs-table tbody tr:hover { background: var(--bg-2); }
.rs-table tbody tr[hidden] { display: none; }
.rs-typology td { white-space: normal; min-width: 180px; }

/* ---------- article page (/research/<slug>/paper) ---------- */
.rs-paper-head { padding-top: clamp(40px, 6vw, 80px); max-width: 1180px; }
.rs-paper-head .rs-area-tag { display: inline-block; margin-bottom: 16px; color: var(--mut); border-bottom: 0; }
.rs-paper-head h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.1; letter-spacing: -0.03em; max-width: 960px; margin: 0 0 36px; }
.rs-toc-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 40px; }
.rs-toc-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; color: inherit; background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.rs-toc-card:hover { border-color: color-mix(in srgb, var(--ink-strong) 25%, transparent); box-shadow: var(--shadow-card); }
.rs-toc-thumb { height: 128px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
.rs-toc-thumb img { width: 92%; height: 118px; object-fit: contain; }
.rs-toc-card span { font-size: 0.8rem; font-weight: 600; color: var(--ink-strong); padding: 10px 12px; line-height: 1.3; }
.rs-toc-card span b { color: var(--mut); font-weight: 500; margin-right: 4px; }
.rs-byline { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1.2fr; gap: 20px 28px; padding: 22px 0 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rs-byline h3 { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mut); margin: 0 0 8px; }
.rs-byline p { margin: 0; font-size: 0.9rem; line-height: 1.6; }
.rs-byline a { color: var(--ink-strong); border-bottom: 1px solid var(--line); }
.rs-by-name { margin-right: 14px; white-space: nowrap; color: var(--ink-strong); font-weight: 500; }
.rs-by-name sup, .rs-by-affs sup { color: var(--signal); font-size: 0.65em; margin-left: 1px; }
.rs-by-affs span { display: block; }
.rs-by-wide { grid-column: 1 / -1; }
.rs-paper-body { display: grid; grid-template-columns: 250px minmax(0, var(--rs-article)); gap: clamp(32px, 5vw, 72px); padding-top: 36px; padding-bottom: 80px; max-width: 1180px; }
.rs-toc { position: sticky; top: calc(var(--nav-h) + var(--rs-sub-h) + 20px); align-self: start; max-height: calc(100vh - var(--nav-h) - var(--rs-sub-h) - 40px); overflow: auto; font-size: 0.82rem; scrollbar-width: thin; }
.rs-toc h2 { font-size: 0.95rem; margin: 0 0 12px; }
.rs-toc ol { list-style: none; margin: 0; padding: 0; }
.rs-toc li { margin: 0; }
.rs-toc a { display: grid; grid-template-columns: 28px 1fr; gap: 2px; padding: 4px 8px; border-radius: 6px; color: var(--mut); line-height: 1.35; }
.rs-toc li.l2 > a { color: var(--ink-strong); font-weight: 600; margin-top: 6px; }
.rs-toc li.l3 > a { padding-left: 20px; grid-template-columns: 30px 1fr; }
.rs-toc a:not(:has(span)) { grid-template-columns: 1fr; }
.rs-toc a span { color: var(--mut-2); font-weight: 500; }
.rs-toc a:hover { background: var(--bg-2); color: var(--ink-strong); }
.rs-toc a.on { background: var(--signal-soft); color: var(--signal); }
.rs-toc a.on span { color: var(--signal); }
.rs-paper-main { min-width: 0; font-family: var(--rs-serif); font-size: 1.06rem; line-height: 1.68; color: var(--ink); }
.rs-paper-main p, .rs-paper-main ul, .rs-paper-main ol { margin: 0 0 1.05em; }
.rs-paper-main li { margin-bottom: 0.35em; }
.rs-paper-main h2 { font-family: var(--font-display); font-size: clamp(1.55rem, 2.4vw, 2rem); letter-spacing: -0.02em; margin: 2.4em 0 0.8em; scroll-margin-top: calc(var(--nav-h) + var(--rs-sub-h) + 16px); }
.rs-paper-main h3 { font-family: var(--font-display); font-size: 1.22rem; margin: 2em 0 0.7em; scroll-margin-top: calc(var(--nav-h) + var(--rs-sub-h) + 16px); }
.rs-secnum { color: var(--mut-2); font-weight: 600; margin-right: 0.55em; }
.rs-paper-main h2:first-of-type { margin-top: 1.2em; }
.rs-abstract { padding: 20px 24px 6px; border-radius: var(--radius-md); background: var(--bg-2); border: 1px solid var(--line-soft); margin-bottom: 1em; }
.rs-abstract h2 { font-size: 0.78rem !important; font-family: var(--font-mono) !important; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--signal); margin: 0 0 10px !important; }
.rs-abstract p { font-size: 1rem; }
.rs-article .rs-fig, .rs-article .rs-table-fig.rs-wide { margin-left: 0; margin-right: min(0px, calc(var(--rs-article) - 100%)); }
@media (min-width: 1240px) {
  .rs-article .rs-fig, .rs-article .rs-table-fig.rs-wide { margin-right: -160px; }
}
.rs-eq { overflow-x: auto; overflow-y: hidden; margin: 1.1em 0 1.2em; padding: 2px 0; }
.rs-eq .katex-display { margin: 0; }
.rs .katex { font-size: 1.04em; }
.rs-prop { margin: 1.4em 0; padding: 16px 20px 4px; border-left: 3px solid var(--signal); background: var(--bg-2); border-radius: 0 var(--radius) var(--radius) 0; }
a.rs-cite { color: var(--mut); }
a.rs-cite:hover { color: var(--signal); }
a.rs-xref { color: var(--ink-strong); }
a.rs-xref:hover { color: var(--signal); }
.rs-refs { font-family: var(--font-body); font-size: 0.86rem; line-height: 1.55; color: var(--mut); padding-left: 0; list-style: none; }
.rs-refs li { margin-bottom: 0.7em; padding-left: 1.6em; text-indent: -1.6em; scroll-margin-top: calc(var(--nav-h) + var(--rs-sub-h) + 16px); }
.rs-refs li:target { color: var(--ink-strong); background: var(--signal-soft); border-radius: 6px; }
.rs-refs a { color: var(--ink-strong); word-break: break-word; }
.rs-refpop {
  position: absolute; z-index: 90; max-width: 420px; font-family: var(--font-body); font-size: 0.82rem; line-height: 1.5; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-menu); padding: 12px 14px;
}
.rs-refpop a { color: var(--ink-strong); border-bottom: 1px solid var(--line); }

/* ---------- citation block and related ---------- */
.rs-cite-block { margin-top: 3em; padding-top: 1.6em; border-top: 1px solid var(--line); font-family: var(--font-body); }
.rs-cite-block h2 { font-size: 1.2rem !important; margin: 0 0 12px !important; }
.rs-cite-text { font-size: 0.9rem; color: var(--mut); }
.rs-bib { position: relative; }
.rs-bib pre { font-size: 0.78rem; margin: 0; padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-2); border: 1px solid var(--line-soft); overflow-x: auto; }
.rs-copy { position: absolute; top: 8px; right: 8px; font: inherit; font-size: 0.74rem; padding: 4px 10px; border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--bg); color: var(--mut); cursor: pointer; }
.rs-copy:hover { color: var(--ink-strong); }
.rs-related { padding-top: 48px; padding-bottom: clamp(64px, 8vw, 112px); }
.rs-related > h2 { font-size: 1.5rem; margin: 0 0 24px; }
.rs-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.rs-related-item { color: inherit; }
.rs-related-item img { border-radius: var(--radius-md); background: #fff; margin-bottom: 14px; }
.rs-related-item h3 { font-size: 1.05rem; line-height: 1.3; margin: 0; letter-spacing: -0.01em; }
.rs-related-item:hover h3 { color: var(--signal); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .rs-paper-body { grid-template-columns: minmax(0, 1fr); }
  .rs-toc { display: none; }
  .rs-toc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rs-article .rs-fig, .rs-article .rs-table-fig.rs-wide { margin-right: 0; }
}
@media (max-width: 900px) {
  .rs-hero, .rs-featured { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .rs-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rs-byline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rs-reader .rs-fig, .rs-reader .rs-table-fig { margin-left: 0; margin-right: 0; }
}
@media (max-width: 640px) {
  .rs-subnav .wrap { gap: 14px; }
  .rs-subnav-links { gap: 16px; }
  .rs-areas { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .rs-related-grid { grid-template-columns: minmax(0, 1fr); }
  .rs-pubs-head { flex-direction: column; align-items: stretch; }
  .rs-search { min-width: 0; }
  .rs-pub-area { display: none; }
  .rs-pub-date { width: 96px; }
  .rs-byline { grid-template-columns: minmax(0, 1fr); }
  .rs-toc-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .rs-toc-thumb { height: 96px; }
  .rs-toc-thumb img { height: 88px; }
  .rs-prose { font-size: 1.06rem; }
  /* figures keep a legible size on phones and scroll sideways instead of shrinking their labels */
  .rs-fig-media { padding: 8px 4px 4px; overflow-x: auto; }
  .rs-fig-media .fig-svg { min-width: 540px; }
  .rs-findings, .rs-post-cta { padding: 20px 18px 8px; }
}
@media print {
  .rs-subnav, .rs-toc, .rs-toc-cards, .rs-related, .nav, .footer { display: none !important; }
  .rs-paper-body { display: block; }
}
