/* GLP-1 Receptor Agonists — clinical white and teal.
 *
 * The table is the component. Everything else is rules, space and alignment:
 * no cards, no pills, no gradients, no shadows, no decorative colour. Numbers are
 * tabular and right-aligned so a column can be read down. Colour appears in exactly
 * three places: links, the current rail item, and the withheld marker.
 */

:root {
  --paper: #ffffff;
  --ink: #16211f;
  --muted: #5e6d6b;
  --faint: #7d8b89;
  --rule: #e2e8e7;
  --rule-mid: #c9d4d2;
  --rule-strong: #93a4a1;
  --teal: #0f6b64;
  --teal-dark: #0a4b46;
  --wash: #f5f8f8;
  --wash-deep: #eaf1f0;

  --sans: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mea: 0.8125rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

a { color: var(--teal); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--teal-dark); }
a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.5rem 0.875rem; z-index: 10;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--rule-strong);
}
.brand { margin: 0; font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }
.brand a { color: var(--ink); text-decoration: none; }
.brand a:hover { color: var(--teal); }

.sections ul,
.rail-list,
#site-disclaimer nav ul,
nav[aria-label="Breadcrumb"] ol {
  list-style: none; margin: 0; padding: 0;
}
.sections ul { display: flex; flex-wrap: wrap; gap: 0 1.125rem; }
.sections a {
  font-size: var(--mea);
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.sections a:hover { color: var(--teal); }
.sections a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--teal); }

/* ---------------------------------------------------------------- RUO block */

#ruo-notice {
  padding: 0.75rem 1.25rem;
  background: var(--wash);
  border-bottom: 1px solid var(--rule);
  font-size: var(--mea);
  color: var(--muted);
}
#ruo-notice p { margin: 0; max-width: 95ch; }
#ruo-notice .ruo-headline { color: var(--ink); }
#ruo-notice strong { font-weight: 600; }

/* ---------------------------------------------------------------- shell + rail */

.shell {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 0 2.5rem;
  max-width: 86rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.rail {
  padding-top: 1.75rem;
  border-right: 1px solid var(--rule);
  padding-right: 1.5rem;
  align-self: start;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}
.rail-group + .rail-group { margin-top: 1.5rem; }
.rail-label {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.rail-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--mea);
}
.rail-list li:last-child { border-bottom: 0; }
.rail-list a { text-decoration: none; }
.rail-list a:hover { text-decoration: underline; }
.rail-list a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.rail-n { color: var(--faint); font-size: 0.75rem; }

.column { min-width: 0; padding-top: 1.75rem; }

/* ---------------------------------------------------------------- breadcrumb */

nav[aria-label="Breadcrumb"] ol { display: flex; flex-wrap: wrap; gap: 0 0.5rem; }
nav[aria-label="Breadcrumb"] li { font-size: 0.75rem; color: var(--faint); }
nav[aria-label="Breadcrumb"] li + li::before { content: "/"; margin-right: 0.5rem; color: var(--rule-mid); }
nav[aria-label="Breadcrumb"] a { color: var(--muted); text-decoration: none; }
nav[aria-label="Breadcrumb"] a:hover { color: var(--teal); text-decoration: underline; }

/* ---------------------------------------------------------------- typography */

main { max-width: 100%; }

h1 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2.125rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}
h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--rule-strong);
}
h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
}
p { margin: 0 0 0.875rem; max-width: 78ch; }
.lede { font-size: 1.0625rem; color: var(--muted); max-width: 72ch; margin-top: 1rem; }
.note { font-size: var(--mea); color: var(--muted); max-width: 78ch; }
.scope-note { font-size: var(--mea); color: var(--muted); max-width: 78ch; margin-top: -0.25rem; }

ul.plain, ol.plain { padding-left: 1.125rem; margin: 0 0 0.875rem; max-width: 78ch; }
ul.plain li, ol.plain li { margin-bottom: 0.25rem; }

/* ---------------------------------------------------------------- provenance stamp */

.stamp {
  margin: 1.25rem 0 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
}
.stamp p { margin: 0; max-width: none; }
.stamp-k {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------------------------------------------------------------- withheld banner */

.withheld-banner {
  margin: 1.5rem 0 0;
  padding: 0.875rem 0 0.875rem 0.875rem;
  border-left: 3px solid var(--teal);
  background: var(--wash);
}
.withheld-banner p { margin: 0 0 0.5rem; font-size: 0.875rem; }
.withheld-banner p:last-child { margin-bottom: 0; }
.withheld-banner strong { font-weight: 600; }

/* ---------------------------------------------------------------- tables */

.tw {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.tw:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--mea);
  line-height: 1.4;
}
caption {
  caption-side: top;
  text-align: left;
  font-size: 0.75rem;
  color: var(--faint);
  padding: 0 0 0.5rem;
}
thead th {
  text-align: left;
  vertical-align: bottom;
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.5rem 0.75rem 0.4rem 0;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
tbody th, tbody td {
  text-align: left;
  vertical-align: top;
  font-weight: 400;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}
tbody th { font-weight: 600; white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { padding-right: 0; }

/* numeric matrix: counts right-aligned so a column reads down */
.matrix td, .matrix thead th:not(:first-child) { text-align: right; }
.matrix td { white-space: nowrap; }
.matrix .zero { color: var(--rule-mid); }
.matrix .total { font-weight: 600; }
.matrix tbody tr:hover td, .matrix tbody tr:hover th { background: var(--wash); }

.records td:first-of-type, .records th[scope="row"] { white-space: nowrap; }
.records cite { font-style: normal; }
.records .desc { color: var(--muted); font-size: 0.75rem; }

.num { text-align: right; }

/* ---------------------------------------------------------------- inline markers */

.unknown { color: var(--faint); }
/* a sourced value's note is a span; inside a cell or a definition it needs its own line */
td .note, dd .note, td .derived, dd .derived {
  display: block;
  font-size: 0.75rem;
  color: var(--faint);
  margin-top: 0.2rem;
  max-width: 46ch;
}
.withheld { color: var(--teal-dark); }
.src-id {
  color: var(--faint);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ref, .cite-n { font-size: 0.6875rem; }
.ref a, .cite-n a { text-decoration: none; }
.ref a:hover, .cite-n a:hover { text-decoration: underline; }
.cite-n { display: block; color: var(--faint); font-weight: 400; }
.derived { color: var(--muted); font-size: 0.75rem; }

.tier {
  display: block;
  font-size: var(--mea);
  color: var(--muted);
  max-width: 78ch;
}
.tier-value { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- record groups */

.phase-group { margin-top: 2rem; scroll-margin-top: 1rem; }
.phase-group h3 { margin-top: 0; }

ol.sources { padding-left: 1.25rem; font-size: var(--mea); color: var(--muted); max-width: 90ch; }
ol.sources li { margin-bottom: 0.375rem; }
ol.sources cite { font-style: normal; color: var(--ink); }

dl.kv { margin: 0 0 1.25rem; font-size: var(--mea); }
dl.kv div { display: flex; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--rule); }
dl.kv dt { flex: 0 0 13rem; color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; }

/* ---------------------------------------------------------------- footer */

#site-disclaimer {
  border-top: 1px solid var(--rule-strong);
  background: var(--wash);
  padding: 1.75rem 1.25rem 2.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}
#site-disclaimer p { max-width: 90ch; margin: 0 auto 0.75rem; }
#site-disclaimer nav ul {
  display: flex; flex-wrap: wrap; gap: 0 1.25rem;
  max-width: 90ch; margin: 0 auto;
}
#site-disclaimer a { color: var(--muted); }
#site-disclaimer .tagline { color: var(--faint); }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 60rem) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-bottom: 3rem;
  }
  .rail {
    position: static;
    max-height: none;
    overflow: visible;
    border-right: 0;
    padding-right: 0;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule-strong);
  }
  .rail-group + .rail-group { margin-top: 1.125rem; }
  .rail-list { display: flex; flex-wrap: wrap; gap: 0 1rem; }
  .rail-list li { border-bottom: 0; padding: 0.125rem 0; gap: 0.3rem; }
  .column { padding-top: 1.25rem; }
  .stamp { gap: 0.625rem 1.5rem; }
  dl.kv div { flex-direction: column; gap: 0.125rem; }
  dl.kv dt { flex: none; }
}

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