/* RheumReferral — site styles
   Fonts: Fraunces (headings), DM Sans (text). Both SIL OFL, self-hosted. */

@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-italic.woff2") format("woff2"); font-weight: 300 800; font-style: italic; font-display: swap; }

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --line: #e2ddd2;
  --line-strong: #cfc8b9;
  --ink: #13212c;
  --ink-2: #3c4a55;
  --muted: #5d6a74;
  --navy: #0c2233;
  --accent: #14765f;
  --accent-ink: #0f5e4b;
  --accent-soft: #e5f2ee;
  --gold: #a8761f;
  --gold-soft: #f7efdd;
  --focus: #c08b2d;
  --link: #0f6b56;
  --shadow: 0 1px 2px rgba(12, 34, 51, .06), 0 4px 16px rgba(12, 34, 51, .05);

  --t-emergent: #b42318; --t-emergent-bg: #fef3f2; --t-emergent-line: #f9c9c5;
  --t-urgent: #b93815; --t-urgent-bg: #fff4ed; --t-urgent-line: #fbd2bd;
  --t-semiurgent: #9a5b06; --t-semiurgent-bg: #fffaeb; --t-semiurgent-line: #f6dea2;
  --t-routine: #175cd3; --t-routine-bg: #eff6ff; --t-routine-line: #c3d9fb;
  --t-maynot: #067647; --t-maynot-bg: #ecfdf3; --t-maynot-line: #b7ecd0;
  --t-elsewhere: #5b3fc4; --t-elsewhere-bg: #f4f2ff; --t-elsewhere-line: #d5ccfa;

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --measure: 70ch;
  --font-head: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1822; --surface: #11222f; --surface-2: #0e1e2a; --line: #213646; --line-strong: #2c4659;
    --ink: #e8eef2; --ink-2: #c3ced6; --muted: #93a3ae; --navy: #e8eef2;
    --accent: #3fb896; --accent-ink: #6fd0b1; --accent-soft: #123a33; --gold: #e0b05a; --gold-soft: #2c2412;
    --focus: #e0b05a; --link: #6fd0b1; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    --t-emergent: #ff8a80; --t-emergent-bg: #2d1414; --t-emergent-line: #5c2622;
    --t-urgent: #ffab70; --t-urgent-bg: #2d1b10; --t-urgent-line: #5a3418;
    --t-semiurgent: #f5c66b; --t-semiurgent-bg: #2a2210; --t-semiurgent-line: #54431b;
    --t-routine: #8fb6ff; --t-routine-bg: #121f36; --t-routine-line: #23406b;
    --t-maynot: #6ad8a0; --t-maynot-bg: #10291e; --t-maynot-line: #1f4d36;
    --t-elsewhere: #b9a6ff; --t-elsewhere-bg: #1d1934; --t-elsewhere-line: #3a3166;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1822; --surface: #11222f; --surface-2: #0e1e2a; --line: #213646; --line-strong: #2c4659;
  --ink: #e8eef2; --ink-2: #c3ced6; --muted: #93a3ae; --navy: #e8eef2;
  --accent: #3fb896; --accent-ink: #6fd0b1; --accent-soft: #123a33; --gold: #e0b05a; --gold-soft: #2c2412;
  --focus: #e0b05a; --link: #6fd0b1; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --t-emergent: #ff8a80; --t-emergent-bg: #2d1414; --t-emergent-line: #5c2622;
  --t-urgent: #ffab70; --t-urgent-bg: #2d1b10; --t-urgent-line: #5a3418;
  --t-semiurgent: #f5c66b; --t-semiurgent-bg: #2a2210; --t-semiurgent-line: #54431b;
  --t-routine: #8fb6ff; --t-routine-bg: #121f36; --t-routine-line: #23406b;
  --t-maynot: #6ad8a0; --t-maynot-bg: #10291e; --t-maynot-line: #1f4d36;
  --t-elsewhere: #b9a6ff; --t-elsewhere-bg: #1d1934; --t-elsewhere-line: #3a3166;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6;
  font-feature-settings: "kern", "liga"; text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); line-height: 1.2; text-wrap: balance; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); font-variation-settings: "opsz" 72; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem); font-variation-settings: "opsz" 48; }
h3, .h3 { font-size: 1.22rem; font-variation-settings: "opsz" 24; }
h4, .label { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; line-height: 1.2; }
p { margin: 0 0 1em; max-width: var(--measure); }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; max-width: var(--measure); }
li { margin: .25em 0; }
li::marker { color: var(--muted); }
strong { font-weight: 650; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: 12px; top: -100px; z-index: 100; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-sm); border: 2px solid var(--focus); }
.skip-link:focus { top: 12px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.site-header .bar { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-family: var(--font-head); font-weight: 650; font-size: 1.28rem; letter-spacing: -.01em; margin-right: auto; }
.brand:hover { color: var(--navy); }
.brand svg { width: 30px; height: 30px; flex: none; }
:root[data-theme="dark"] .brand svg rect { fill: #1d3c52; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand svg rect { fill: #1d3c52; } }
.brand .r { color: var(--accent); }
.pathway { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .86rem; }
.pathway a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.pathway a[aria-current="true"] { background: var(--navy); color: var(--surface); font-weight: 600; }
:root[data-theme="dark"] .pathway a[aria-current="true"] { background: var(--accent); color: #062019; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pathway a[aria-current="true"] { background: var(--accent); color: #062019; } }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; }

.site-nav { border-top: 1px solid var(--line); }
.site-nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: thin; max-width: none; }
.site-nav a { display: block; padding: 11px 12px; text-decoration: none; color: var(--ink-2); font-size: .93rem; font-weight: 550; white-space: nowrap; border-bottom: 3px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---------- Layout ---------- */
main { display: block; padding-block: 28px 56px; }
.internal-bar { margin: -28px 0 22px; background: var(--gold-soft); border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; }
.internal-bar p { margin: 0; padding-block: 7px; max-width: none; }
.internal-bar strong { color: var(--ink); }
.crumbs { font-size: .86rem; color: var(--muted); margin-bottom: 14px; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; max-width: none; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--muted); }
.page-head { margin-bottom: 24px; }
.page-head .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 8px; }
.section { margin-top: 40px; }
.section > h2 { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.stack > * + * { margin-top: 14px; }
.cols { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .cols.with-aside { grid-template-columns: minmax(0, 1fr) 300px; } }
.cols > * { min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h3, .card .h3 { margin-bottom: .35em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
a.card { display: block; text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease; }
a.card:hover { border-color: var(--accent); transform: translateY(-1px); }
a.card .go { color: var(--accent-ink); font-weight: 600; font-size: .93rem; }
.kicker { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 6px; }

/* ---------- Front door ---------- */
.door { padding-block: 40px 24px; }
.door h1 { max-width: 24ch; }
.door .lede { font-size: 1.2rem; color: var(--ink-2); max-width: 60ch; }
.door-paths { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-top: 28px; }
.door-path { display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: 16px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.door-path::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--accent); }
.door-path.rheum::before { background: var(--gold); }
.door-path:hover { border-color: var(--accent); color: var(--ink); }
.door-path h2 { font-size: 1.6rem; margin: 0; border: 0; padding: 0; }
.door-path p { margin: 0; color: var(--ink-2); }
.door-path ul { margin: 4px 0 0; padding-left: 1.1em; color: var(--ink-2); font-size: .95rem; }
.door-path .go { margin-top: auto; font-weight: 650; color: var(--accent-ink); }
.door-path .kicker { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.door-note { margin-top: 22px; font-size: .95rem; color: var(--muted); }

/* ---------- Stats banner ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 18px 0 8px; }
.stat { display: flex; gap: 12px; align-items: baseline; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); text-decoration: none; color: var(--ink-2); font-size: .88rem; line-height: 1.35; }
.stat:hover { border-color: var(--line-strong); color: var(--ink); }
.stat b { font-family: var(--font-head); font-size: 1.5rem; color: var(--gold); font-weight: 650; flex: none; min-width: 2.6em; }

/* ---------- Search ---------- */
.search { position: relative; margin: 6px 0 4px; max-width: 760px; }
.search label { display: block; font-weight: 650; margin-bottom: 6px; }
.search input { width: 100%; font: inherit; font-size: 1.05rem; padding: 13px 16px 13px 44px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search .field { position: relative; }
.search .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-results { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; max-width: none; }
.search-results li { margin: 0; border-top: 1px solid var(--line); }
.search-results li:first-child { border-top: 0; }
.search-results a { display: block; padding: 11px 16px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--accent-soft); }
.search-results .r-title { font-weight: 600; }
.search-results .r-kind { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-right: 8px; }
.search-results .r-snip { display: block; font-size: .88rem; color: var(--muted); margin-top: 2px; }
.search-empty { padding: 12px 16px; color: var(--muted); }
.search-hint { font-size: .86rem; color: var(--muted); margin: 8px 0 0; }

/* ---------- Badges, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.t-emergent { color: var(--t-emergent); background: var(--t-emergent-bg); border-color: var(--t-emergent-line); }
.t-urgent { color: var(--t-urgent); background: var(--t-urgent-bg); border-color: var(--t-urgent-line); }
.t-semiurgent { color: var(--t-semiurgent); background: var(--t-semiurgent-bg); border-color: var(--t-semiurgent-line); }
.t-routine { color: var(--t-routine); background: var(--t-routine-bg); border-color: var(--t-routine-line); }
.t-maynot { color: var(--t-maynot); background: var(--t-maynot-bg); border-color: var(--t-maynot-line); }
.t-elsewhere { color: var(--t-elsewhere); background: var(--t-elsewhere-bg); border-color: var(--t-elsewhere-line); }
.pop { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.sources { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sources .label { margin: 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; max-width: none; }
.chips li { margin: 0; }
.chip { display: inline-block; font-size: .8rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); text-decoration: none; line-height: 1.35; }
a.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip.unverified { border-style: dashed; }
.links-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: .93rem; }
.links-row a { font-weight: 600; }

/* ---------- Tier sections (When to Refer) ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 18px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); }
.seg button { font: inherit; font-weight: 600; font-size: .93rem; padding: 8px 16px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--navy); color: var(--surface); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--accent); color: #062019; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: var(--accent); color: #062019; } }
.btn { font: inherit; font-size: .9rem; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #062019; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #062019; } }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn svg { width: 16px; height: 16px; }

.notice { border: 1px solid var(--line); border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 18px; color: var(--ink-2); font-size: .95rem; }
.notice p:last-child { margin-bottom: 0; }
.notice.red { border-left-color: var(--t-emergent); background: var(--t-emergent-bg); }

.tier { margin-top: 34px; }
.tier-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid; margin-bottom: 12px; }
.tier-head h2, .tier-head h3 { margin: 0; font-size: 1.35rem; border: 0; padding: 0; color: inherit; }
.tier-head .when { font-weight: 700; font-size: .95rem; }
.tier-head p { margin: 4px 0 0; flex-basis: 100%; color: var(--ink-2); font-size: .95rem; }
.cond-list { display: grid; gap: 10px; }
details.cond { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
details.cond > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; }
details.cond > summary::-webkit-details-marker { display: none; }
details.cond > summary .name { font-weight: 650; font-size: 1.05rem; color: var(--navy); }
details.cond > summary .sum { grid-column: 1 / -1; color: var(--ink-2); font-size: .95rem; }
details.cond > summary .chev { width: 22px; height: 22px; color: var(--muted); transition: transform .2s ease; }
details.cond[open] > summary .chev { transform: rotate(180deg); }
details.cond > summary:hover .name { color: var(--accent-ink); }
.cond-body { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.cond-body h4 { margin-top: 16px; }
.cond-body ul { margin-bottom: .6em; }

.elsewhere-list { display: grid; gap: 10px; }
.elsewhere-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.elsewhere-item .dest { font-weight: 650; color: var(--t-elsewhere); }

/* ---------- Condition page ---------- */
.cond-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.timeframe { font-weight: 650; color: var(--ink-2); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 1.25rem; border: 0; padding: 0; margin-bottom: .5em; }
.aside .panel { position: sticky; top: 130px; }
.aside ul { padding-left: 1.1em; }

/* ---------- Checklists ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 8px; max-width: none; }
.toc li { margin: 0; }
.toc a { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink-2); font-size: .9rem; font-weight: 550; }
.toc a:hover { border-color: var(--accent); color: var(--accent-ink); }
.check { list-style: none; padding: 0; margin: 0 0 1em; }
.check li { position: relative; padding-left: 28px; margin: .45em 0; }
.check li::before { content: ""; position: absolute; left: 2px; top: .3em; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-strong); background: var(--surface); }
.sub-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.covers { font-size: .9rem; color: var(--muted); }
.covers a { color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-top: 1px solid var(--line); }
thead th { border-top: 0; background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tbody th { font-weight: 650; color: var(--navy); min-width: 150px; }
td ul { margin: 0; padding-left: 1.1em; }
.lab-table td:nth-child(2) { min-width: 220px; } .lab-table td:nth-child(3) { min-width: 200px; } .lab-table td:nth-child(4) { min-width: 200px; }

/* ---------- DMARD cards ---------- */
.drug { scroll-margin-top: 140px; }
.drug .cls { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.drug dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 18px; margin: 10px 0 0; }
@media (min-width: 760px) { .drug dl { grid-template-columns: 170px minmax(0, 1fr); } }
.drug dt { font-weight: 700; font-size: .86rem; color: var(--ink-2); padding-top: 8px; }
.drug dd { margin: 0; padding-top: 8px; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .drug dt { border-top: 1px solid var(--line); } }
.drug dd ul { margin: 0; padding-left: 1.1em; }

/* ---------- Co-management ---------- */
.cm h3 { margin-bottom: 4px; }
.cm .three { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); margin-top: 10px; }
.cm .three > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0; }
.cm .three h4 { margin-bottom: 4px; }
.cm .three ul { margin: 0; padding-left: 1.1em; font-size: .95rem; }
.cm .contact h4 { color: var(--t-urgent); }

/* ---------- Assistant ---------- */
.cats { display: grid; gap: 22px; }
.cat h2 { font-size: 1.2rem; border: 0; padding: 0; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.cat h2 .n { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; font-family: var(--font-body); font-size: .8rem; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.cat .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.cat a.card { padding: 14px 16px; }
.cat a.card h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 650; margin: 0 0 2px; color: var(--navy); }
.cat a.card p { font-size: .9rem; color: var(--muted); margin: 0; }

.asst { max-width: 860px; }
.asst-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.asst-actions { margin: 16px 0 0; }
.asst-on .page-head .lede { display: none; }
.asst-on .page-head { margin-bottom: 14px; }
.asst-trail { font-size: .86rem; color: var(--muted); margin: 0 0 12px; }
.asst-trail ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; max-width: none; }
.asst-trail li { margin: 0; }
.asst-trail li + li::before { content: "›"; margin-right: 6px; color: var(--line-strong); }
.asst-trail a { color: var(--muted); }
.asst-node { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.asst-node h2 { font-size: clamp(1.35rem, 1.2rem + .6vw, 1.7rem); border: 0; padding: 0; outline: none; }
.asst-node .q { font-size: 1.12rem; color: var(--ink-2); margin-bottom: 14px; }
.opts { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; max-width: none; }
.opts li { margin: 0; }
.opt { width: 100%; text-align: left; font: inherit; font-size: 1rem; padding: 13px 44px 13px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; position: relative; line-height: 1.4; display: block; text-decoration: none; }
.opt::after { content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--muted); }
.opt:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.opt.escape { background: transparent; border-style: dashed; color: var(--ink-2); }
.takeaway { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--gold-soft); border-left: 4px solid var(--gold); font-weight: 600; color: var(--ink); max-width: none; }
.answer p, .answer ul { max-width: 72ch; }
.answer p.h { margin-bottom: .3em; }
.node-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.node-links a { font-size: .9rem; }
.related { margin-top: 18px; }
.related h4 { margin-bottom: 8px; }
.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; max-width: none; }
.related li { margin: 0; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--navy); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: .9rem; z-index: 50; box-shadow: var(--shadow); }
.az-index { columns: 2 260px; column-gap: 28px; list-style: none; padding: 0; max-width: none; }
.az-index li { break-inside: avoid; margin: 0 0 6px; }
.az-node { scroll-margin-top: 120px; }
.az-node + .az-node { margin-top: 16px; }

/* ---------- Triage guide (staff) ---------- */
.triage-table tbody th { min-width: 190px; }
.triage-table td:nth-child(2) { min-width: 260px; }
.triage-table td:nth-child(3) { min-width: 220px; }
.filter-count { font-size: .9rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; max-width: none; }
.legend li { margin: 0; max-width: 100%; }
.legend .badge { white-space: normal; text-align: left; }

/* ---------- Evidence ---------- */
.timeline { list-style: none; padding: 0; margin: 0; max-width: none; }
.timeline > li { position: relative; padding: 0 0 22px 26px; margin: 0; border-left: 2px solid var(--line); }
.timeline > li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.timeline .when { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.timeline h3 { margin: 2px 0 6px; }

/* ---------- Downloads ---------- */
.dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start; }
.dl .ext { grid-row: span 2; width: 46px; height: 54px; border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 7px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--accent); position: relative; }
.dl .ext.docx { background: #2b579a; } .dl .ext.pptx { background: #c43e1c; } .dl .ext.pdf { background: #a31f34; }
.dl .ext::after { content: ""; position: absolute; top: 0; right: 0; border-width: 0 12px 12px 0; border-style: solid; border-color: var(--bg) var(--bg) rgba(255,255,255,.35) rgba(255,255,255,.35); border-top-right-radius: 8px; }
.dl h3 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 650; margin: 0; }
.dl p { margin: 0; font-size: .92rem; color: var(--muted); }
.dl .meta { grid-column: 2; font-size: .8rem; color: var(--muted); }

/* ---------- Utilities ---------- */
.m-0 { margin: 0; } .mb-0 { margin-bottom: 0; } .mt-1 { margin-top: .5em; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mb-3 { margin-bottom: 18px; }
.fw-normal { font-weight: 500; }
.badge-sm { font-size: .62rem; padding: 2px 7px; }
.h-plain { font-size: 1.3rem; border: 0; padding: 0; }
.plain-list { list-style: none; padding: 0; } .plain-list li { margin: .5em 0; }
ol.steps { max-width: none; padding-left: 1.2em; }

/* ---------- Prose pages ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.6em; font-size: 1.4rem; border: 0; padding: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 28px; font-size: .9rem; color: var(--muted); }
.site-footer .cols3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.site-footer p { margin: 0 0 .6em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer li { margin: 0; }
.site-footer a { color: var(--ink-2); }
.site-footer .disclaimer { color: var(--ink-2); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --ink-2: #222; --muted: #444; --line: #bbb; --shadow: none; }
  body { font-size: 11pt; }
  .site-header, .site-nav, .skip-link, .search, .toolbar, .asst-bar, .theme-toggle, .no-print, .stats { display: none !important; }
  main { padding: 0; }
  .internal-bar { margin: 0 0 12px; border: 1px solid #bbb; }
  a { color: #000; text-decoration: underline; }
  .card, .panel, details.cond, .asst-node { box-shadow: none; break-inside: avoid; }
  details.cond > summary .chev { display: none; }
  .aside .panel { position: static; }
  .site-footer { border: 0; padding-top: 12px; }
}
