:root {
  color-scheme: dark;
  --bg: #25292d;
  --surface: #2b3035;
  --text: #e7edf3;
  --muted: #b8c3cd;
  --line: #48515a;
  --blue: #a9d4fa;
  --green: #aad7c4;
  --gold: #e5d297;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 system-ui, sans-serif; letter-spacing: 0; }
a { color: var(--blue); text-underline-offset: 4px; }
a:hover { color: #fff; }
button, input { font: inherit; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.topic-nav { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.topic-nav-inner { max-width: 1120px; margin: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 20px; padding: 10px 28px; }
.topic-nav a { font-size: 14px; text-decoration: none; color: var(--muted); padding: 5px 0; }
.topic-nav a:hover, .topic-nav a:focus-visible { color: #fff; }
.topic-nav .back-link { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; }
.back-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
main { max-width: 1120px; margin: 0 auto; padding: 30px 28px 64px; overflow-wrap: anywhere; }
section { padding: 0 0 36px; margin: 0 0 36px; border-bottom: 1px solid var(--line); }
section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
section, article, h4 { scroll-margin-top: 112px; }
article + article { margin-top: 32px; }
h2 { font-size: 25px; line-height: 1.3; font-weight: 650; color: #fff; margin: 0 0 25px; }
h3 { font-size: 19px; line-height: 1.45; margin: 0 0 12px; font-weight: 650; color: #fff; }
[data-revision] > h2 { font-size: 19px; line-height: 1.45; margin-bottom: 12px; }
h4 { font-size: 18px; margin: 24px 0 10px; color: var(--green); }
p { margin: 0 0 13px; }
strong { font-weight: 650; color: #fff; }
ul, ol { margin: 10px 0 16px; padding-left: 24px; }
li { padding-left: 2px; margin: 6px 0; }
sub, sup { line-height: 0; font-size: .75em; }
.question-number { display: inline-block; color: var(--blue); font-size: 16px; font-weight: 600; min-width: 28px; margin-right: 7px; font-variant-numeric: tabular-nums; }
.answer-reference { font-size: 14px; }
.reaction { padding: 15px 0; margin: 12px 0 16px; border-block: 1px solid var(--line); color: var(--gold); font-size: 19px; font-weight: 600; text-align: center; }
.compact-definitions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; margin: 16px 0; }
.compact-definitions > div { display: grid; grid-template-columns: 28px 1fr; gap: 8px; }
dt { font-weight: 650; color: var(--green); }
dd { margin: 0; }
.definition-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; margin: 16px 0; }
.definition-pair dt { margin-bottom: 7px; }
.key-line { border-left: 3px solid var(--green); padding: 8px 0 8px 16px; margin: 18px 0; }
.study-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 15px; line-height: 1.55; margin: 18px 0; scroll-margin-top: 112px; }
.study-table caption { text-align: left; color: var(--muted); padding-bottom: 10px; font-size: 14px; }
.study-table th, .study-table td { text-align: left; vertical-align: top; padding: 15px 16px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.study-table thead th { color: var(--muted); background: #30363b; font-size: 13px; font-weight: 600; border-top: 1px solid var(--line); }
.study-table tbody th { color: var(--text); font-weight: 550; }
.study-table tbody tr:nth-child(even) { background: #ffffff03; }
.study-table tbody tr:hover { background: #ffffff06; }
.study-table tr > :first-child { width: 23%; padding-left: 12px; }
.marker-table tr > :first-child { width: 19%; }
.marker-table tr > :nth-child(2) { width: 29%; }
.coenzyme-table tr > :first-child { width: 18%; }
.coenzyme-table tr > :nth-child(2) { width: 25%; }
.coenzyme-table tr > :nth-child(3) { width: 27%; }
.inhibition-table tr > :nth-child(2) { width: 40%; }
.marker-code { font-size: 21px; color: var(--blue); display: block; margin-bottom: 4px; }
.full-name { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 5px; }
.cell-lead { display: block; font-weight: 650; color: #fff; margin-bottom: 6px; }
.cell-note { display: block; color: var(--muted); font-size: 14px; margin-top: 7px; }
.clinical-link { display: block; margin-bottom: 7px; }
.clinical-link.liver { color: #aacff3; }
.clinical-link.bile { color: var(--gold); }
.clinical-link.pancreas { color: var(--green); }
.clinical-link.muscle { color: #e6bbc9; }
.vitamin-code { color: var(--gold); display: block; font-size: 21px; font-weight: 650; margin-bottom: 4px; }
.kinetics-figure { margin: 20px 0; }
#kinetics-plot { display: block; width: 100%; height: 280px; }
#kinetics-plot[hidden] { display: none; }
figcaption { font-size: 15px; color: var(--muted); padding: 12px 0; }
.procedure li { padding-left: 6px; margin: 12px 0; }
.sources { font-size: 15px; }
.sources h2 { font-size: 20px; }
.reference-note { color: var(--muted); font-size: 13px; margin-top: 22px; }
.term { appearance: none; display: inline; max-width: 100%; white-space: normal; overflow-wrap: anywhere; border: 0; padding: 0; margin: 0; border-radius: 0; background: none; color: inherit; font: inherit; line-height: inherit; text-align: inherit; cursor: help; text-decoration: underline dotted #9eb4c180; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.term:hover, .term[aria-describedby] { text-decoration-color: var(--green); color: #fff; }
.term-tooltip { position: fixed; z-index: 20; width: max-content; max-width: min(350px, calc(100vw - 24px)); padding: 14px 16px; background: #171c20; color: var(--text); border: 1px solid #64747d; border-radius: 6px; box-shadow: 0 8px 28px #0006; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.term-tooltip strong { display: block; color: var(--green); margin-bottom: 6px; font-size: 14px; }
.term-tooltip[hidden] { display: none; }
@media (max-width: 760px) {
  main { padding: 24px 20px 48px; }
  .topic-nav-inner { padding: 8px 20px; gap: 4px 16px; }
  .study-table th, .study-table td { padding: 12px 10px; }
  .definition-pair { gap: 20px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding: 22px 16px 40px; }
  .topic-nav-inner { gap: 2px 14px; padding: 8px 16px; }
  .topic-nav a { font-size: 13px; }
  h2 { font-size: 22px; }
  h3 { font-size: 18px; }
  [data-revision] > h2 { font-size: 18px; }
  section { padding-bottom: 26px; margin-bottom: 28px; }
  .compact-definitions, .definition-pair { grid-template-columns: 1fr; gap: 14px; }
  .study-table, .study-table tbody { display: block; }
  .study-table caption { display: block; }
  .study-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .study-table tbody tr { display: block; padding: 16px 0; border-top: 1px solid var(--line); }
  .study-table tbody tr:last-child { border-bottom: 1px solid var(--line); }
  .study-table tbody tr > th { display: block; width: 100%; padding: 0 0 10px; border: 0; font-size: 17px; }
  .study-table tbody tr > td { display: block; width: 100%; padding: 8px 0; border: 0; }
  .study-table tbody tr > :nth-child(n) { width: 100%; }
  .study-table tbody td::before { display: block; content: attr(data-label); font-size: 11px; font-weight: 650; color: var(--muted); margin-bottom: 4px; }
  .study-table tbody tr:nth-child(even), .study-table tbody tr:hover { background: none; }
  .marker-code, .vitamin-code { display: inline; margin-right: 8px; }
  .cell-note, .full-name { margin-top: 4px; }
  .reaction { font-size: 17px; }
  #kinetics-plot { height: 260px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  :root { color-scheme: light; --text: #111; --muted: #333; --line: #bbb; --green: #164f3c; --blue: #164b75; --gold: #6d4b05; }
  body { background: white; color: #111; font-size: 10pt; line-height: 1.45; }
  main { max-width: none; padding: 0; }
  .topic-nav, .term-tooltip { display: none !important; }
  h2, h3, h4, strong, .cell-lead { color: #111; }
  h2, h3, h4, caption { break-after: avoid; }
  section { margin-bottom: 20px; padding-bottom: 20px; }
  .study-table { display: table; font-size: 9pt; }
  .study-table caption { display: table-caption; }
  .study-table thead { display: table-header-group; position: static; width: auto; height: auto; clip-path: none; white-space: normal; }
  .study-table tbody { display: table-row-group; }
  .study-table tbody tr { display: table-row; break-inside: avoid; }
  .study-table tbody tr > th, .study-table tbody tr > td { display: table-cell; font-size: 9pt; width: auto; padding: 8px; border-bottom: 1px solid #bbb; }
  .study-table tbody tr > :nth-child(n) { width: auto; }
  .study-table tbody td::before { display: none; }
  .study-table thead th { background: #eee; color: #222; padding: 8px; }
  .marker-code, .vitamin-code { font-size: 13pt; display: block; }
  .clinical-link { color: #111 !important; }
  .full-name, .cell-note { font-size: 8.5pt; }
  .term { text-decoration: none; }
  .reaction { color: #111; font-size: 12pt; }
  .kinetics-figure { break-inside: avoid; }
  a { color: #222; }
}
