:root {
  --ink: #171717;
  --muted: #66635f;
  --paper: #fffffb;
  --rule: #d8d4cc;
  --accent: #006d77;
  --warn: #9b4d00;
  --bad: #9d1c20;
  --ok: #276749;
  --pending: #6b5c92;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; font-family: Georgia, 'Times New Roman', serif; line-height: 1.55; }
header, main, footer { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
header { padding: 28px 0 13px; border-bottom: 1px solid var(--rule); }
.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.brand { font: 650 18px/1.2 system-ui, sans-serif; letter-spacing: .01em; }
.updated-at { margin: 0; color: var(--muted); font: 11px/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
nav { margin-top: 12px; font: 13px/1.3 system-ui, sans-serif; }
nav a { color: var(--muted); margin-right: 19px; text-decoration: none; }
nav a.active, nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
main { padding: 38px 0 72px; }
h1, h2, h3 { font-weight: 500; line-height: 1.16; }
h1 { font-size: clamp(34px, 5vw, 56px); max-width: 900px; margin: 0 0 18px; }
h2 { font-size: 27px; margin: 52px 0 12px; }
h3 { font: 650 16px/1.25 system-ui, sans-serif; margin: 30px 0 7px; }
p, li { max-width: 790px; }
.lede { font-size: 20px; color: #373532; max-width: 850px; }
.eyebrow, .label { font: 700 11px/1.2 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 18px; margin: 35px 0; border-block: 1px solid var(--rule); padding: 20px 0; }
.metric strong { display: block; font: 550 31px/1.1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.metric span { font: 12px/1.35 system-ui, sans-serif; color: var(--muted); }
.callout { border-left: 3px solid var(--warn); padding: 3px 0 3px 18px; margin: 26px 0; max-width: 850px; }
.callout p { margin: 5px 0; }
.decision { border-left-color: var(--pending); }
.pass { border-left-color: var(--ok); }
.pending { color: var(--pending); }
.table-wrap { max-width: 100%; overflow-x: auto; margin: 20px 0 34px; }
table { border-collapse: collapse; width: 100%; font: 12px/1.35 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
th { text-align: left; border-bottom: 1px solid var(--ink); padding: 7px 12px 7px 0; vertical-align: bottom; }
td { border-bottom: 1px solid #ebe8e1; padding: 8px 12px 8px 0; vertical-align: top; }
td.num { text-align: right; }
code { font: .88em ui-monospace, SFMono-Regular, Consolas, monospace; background: #f2f0ea; padding: .1em .28em; }
pre { max-width: 950px; overflow-x: auto; background: #f2f0ea; padding: 14px 16px; }
pre code { background: none; padding: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 14px; margin: 22px 0 36px; }
.page-link { border: 1px solid var(--rule); color: var(--ink); display: block; min-height: 148px; padding: 17px 18px; text-decoration: none; }
.page-link:hover { border-color: var(--accent); text-decoration: none; }
.page-link strong { display: block; font: 650 15px/1.3 system-ui, sans-serif; margin-bottom: 7px; }
.page-link span { color: var(--muted); display: block; font: 13px/1.45 system-ui, sans-serif; }
.result-list { max-width: 880px; padding-left: 1.4em; }
.result-list li { margin: 0 0 13px; padding-left: .35em; }
.fineprint { color: var(--muted); font-size: 13px; }
.status-list { list-style: none; padding: 0; max-width: 900px; }
.status-list li { border-bottom: 1px solid #ebe8e1; display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 11px 0; }
.status-list strong { font: 650 12px/1.4 system-ui, sans-serif; }
.status-pass { color: var(--ok); }
.status-pending { color: var(--pending); }
.chart-shell { border: 1px solid var(--rule); margin: 24px 0 12px; max-width: 1000px; padding: 18px; }
.chart-head { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; }
.chart-head h3 { margin: 0; }
.chart-note { color: var(--muted); font: 12px/1.4 system-ui, sans-serif; margin: 0; }
#loss-chart { display: block; width: 100%; height: auto; min-height: 330px; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font: 12px/1.3 system-ui, sans-serif; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 18px; border-top: 3px solid var(--accent); margin-right: 6px; vertical-align: 3px; }
.legend .validation::before { border-color: var(--warn); }
.legend .pending-key::before { border-color: var(--rule); border-top-style: dashed; }
footer { border-top: 1px solid var(--rule); padding: 18px 0 36px; color: var(--muted); font-size: 12px; }

@media (max-width: 680px) {
  .masthead { align-items: flex-start; flex-direction: column; gap: 5px; }
  h1 { font-size: 38px; }
  .status-list li { grid-template-columns: 1fr; gap: 3px; }
  .chart-head { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* OpenADMET CYP project pages */
.document { max-width: 900px; }
.document > h1 { max-width: 900px; }
.document .byline { color: var(--muted); font: 13px/1.5 system-ui, sans-serif; margin: -5px 0 34px; }
.document section > h2:first-child { margin-top: 52px; }
.document section section > h3:first-child { margin-top: 30px; }
.document p { max-width: 820px; }
.document ul { max-width: 820px; padding-left: 1.4em; }
.document li { margin-bottom: 8px; }
.document #sources ul { list-style: none; max-width: 900px; padding: 0; }
.document #sources li { border-bottom: 1px solid #ebe8e1; font-size: 14px; margin: 0; padding: 8px 0; }
.diagram-shell { border-block: 1px solid var(--rule); margin: 32px 0 38px; max-width: 900px; overflow-x: auto; padding: 24px 0; }
.diagram-shell .mermaid { background: transparent; margin: 0; min-width: 680px; padding: 0; text-align: center; }
.diagram-shell svg { display: block; height: auto; margin: 0 auto; max-width: 100%; }
.single-card { grid-template-columns: minmax(235px, 520px); }
.external-link strong::after { content: ' ↗'; color: var(--accent); }

@media (max-width: 680px) {
  header, main, footer { width: min(100% - 28px, 1120px); }
  nav a { margin-right: 14px; }
  .document .byline { margin-bottom: 28px; }
  .diagram-shell { margin-inline: -2px; }
}
