/* ==========================================================================
   Tokens — change these, everything follows (charts included)
   ========================================================================== */
:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  /* Type scale (1.25) */
  --step--2: 0.72rem;
  --step--1: 0.8rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.563rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;
  --step-5: 3.052rem;

  /* Spacing unit */
  --sp: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 2.5rem;
  --sp-6: 3rem;
  --sp-8: 4rem;

  /* Palette — black and white placeholder skin (spec S7).
     Revisit at theming; D13 (Our World in Data) still governs the real look. */
  --ink: #111111;
  --ink-2: #4a4a47;
  --ink-3: #6c6c68;
  --rule: #e0e0dd;
  --bg: #ffffff;
  --bg-2: #f6f6f4;
  --accent: #111111;
  --accent-soft: #e8e8e5;

  /* Header — dark bar */
  --header-bg: #111111;
  --header-ink: #ffffff;
  --header-ink-2: #b8b8b6;
  --header-field: #2e2e2c;
  --header-chip: #4a4a47;

  /* Chart series — charts.js reads these */
  /* check_site:hue-exempt-start */
  --c1: #1f5f8b;
  --c2: #d1793a;
  --c3: #3f8f6f;
  --c4: #8a5fa8;
  --c5: #b8474d;
  --c6: #6b7c8c;

  /* "Assay ran, nothing bound." Not a series colour -- a censored mark is a
     result about absence, and it reads as one only if it looks unlike the
     measured points around it. */
  --null-fill: #f6dcde;
  --null-ink: #b8474d;
  /* check_site:hue-exempt-end */

  /* Layout */
  --header-h: 60px;
  --sidebar-w: 248px;
  --measure: 72ch;
  --radius: 6px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--sp-2); font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); margin-top: var(--sp-6); }
h3 { font-size: var(--step-1); margin-top: var(--sp-4); }
p, ul, ol { margin: 0 0 var(--sp-2); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--bg-2); padding: 0.1em 0.35em; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--sp-6) 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--bg); padding: var(--sp) var(--sp-2); border: 1px solid var(--rule);
}
.skip-link:focus { left: var(--sp-2); top: var(--sp); }

/* ==========================================================================
   Header (every page except the splash)
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-3);
  background: var(--header-bg);
  border-bottom: 1px solid var(--rule);
}
.site-header__nav {
  display: flex; align-items: center; gap: var(--sp-4);
  margin-left: auto;
}
.site-header__nav a {
  font-family: var(--font-serif);
  font-weight: 700; font-size: var(--step-0);
  color: var(--header-ink-2); text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  line-height: 1;
}
.site-header__nav a:hover { color: var(--header-ink); }
.site-header__nav a[aria-current="true"] {
  color: var(--header-ink);
  border-bottom-color: var(--header-ink);
}
.site-header :focus-visible { outline-color: var(--header-ink); }

.sidebar-toggle {
  display: none; align-items: center; gap: 6px;
  background: var(--header-field); border: 0; border-radius: 5px;
  padding: 6px 10px; cursor: pointer;
  font-family: var(--font-serif); font-size: var(--step--1);
  color: var(--header-ink);
}

.site-search { position: relative; display: flex; align-items: center; gap: 8px;
  background: var(--header-field); border-radius: 5px; padding: 0 8px 0 10px; height: 32px; }
.site-search__icon { color: var(--header-ink-2); font-size: var(--step--1); }
.site-search input {
  flex: 1; min-width: 15rem; height: 100%;
  background: none; border: 0; outline-offset: -2px;
  font-family: var(--font-serif); font-size: var(--step--1);
  color: var(--header-ink);
}
.site-search input::placeholder { color: var(--header-ink-2); opacity: 1; }
.site-search input::-webkit-search-cancel-button { filter: invert(1); }
.site-search__kbd {
  background: var(--header-chip); color: var(--header-ink);
  font-family: var(--font-sans); font-size: 0.7rem; font-weight: 600;
  padding: 3px 6px; border-radius: 3px; line-height: 1;
}
.site-search__results {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  min-width: 100%; max-height: 60vh; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none;
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.site-search__results li { margin: 0; }
.site-search__results a {
  display: block; padding: 6px var(--sp); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-size: var(--step--1); white-space: nowrap;
}
.site-search__results a:hover { background: var(--bg-2); }
.site-search__empty { padding: 6px var(--sp); color: var(--ink-3); font-size: var(--step--1); }

/* ==========================================================================
   Section layout — header + sidebar + content
   ========================================================================== */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); align-items: start; }

.site-sidebar {
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-3);
  border-right: 1px solid var(--rule);
  background: var(--bg-2);
}
.site-sidebar ul { list-style: none; margin: 0; padding: 0; }
.site-sidebar li { margin: 0; }

.nav-toggle {
  display: flex; align-items: baseline; gap: 8px; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 5px 0; color: var(--ink); font-family: inherit;
}
.nav-sign { width: 0.75em; flex: none; color: var(--ink-3); font-weight: 400; }

.nav-toggle--l1 { font-family: var(--font-serif); font-weight: 700; font-size: var(--step-1); }
.nav-toggle--l2 { font-size: var(--step--1); font-weight: 550; color: var(--ink-2); padding-left: 14px; }
.nav-toggle--l2:hover { color: var(--ink); }

.nav-drugs { margin-bottom: var(--sp-2); }

.nav-pages a {
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px var(--sp) 4px 42px;
  color: var(--ink-2); text-decoration: none; font-size: var(--step--1);
}
.nav-pages a::before { content: ""; width: 5px; height: 5px; flex: none; border-radius: 50%; background: transparent; }
.nav-pages a:hover { color: var(--ink); background: var(--accent-soft); }
.nav-pages a[aria-current="page"] {
  color: var(--ink); font-weight: 650; background: var(--accent-soft);
}
.nav-pages a[aria-current="page"]::before { background: var(--ink); }

.site-sidebar__title {
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 650; margin: 0 0 var(--sp-2);
}

.content { padding: var(--sp-5) var(--sp-4) var(--sp-8); min-width: 0; max-width: 1400px; }

/* Prose stays at a readable measure; tables and figures use the full column,
   because a 6-column table squeezed to 72ch is what produced the wall of
   whitespace in the first pass. */
.content > p,
.content > h1,
.content > h2,
.content > .page-intro,
.content > .disclaimer,
.slot > p:not(.crumb),
.slot > h2 { max-width: var(--measure); }

/* --- Two-column article layout (Wikipedia pattern) -----------------------
   Main column carries the narrative and the tables; the aside carries the
   infobox, which is reference material a reader dips into rather than reads
   in sequence. The aside sticks so the identifiers stay available while
   scrolling a long page. */
.article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: var(--sp-6);
  align-items: start;
}

.article__main { min-width: 0; }

.article__aside {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-3));
  min-width: 0;
}

/* Below this the two columns would both be too narrow to be useful, so the
   infobox moves above the article body -- the same thing Wikipedia does. */
@media (max-width: 1080px) {
  .article { grid-template-columns: minmax(0, 1fr); }
  .article__aside { position: static; order: -1; max-width: 34rem; }
}

/* Spec B3 — <page-contents>. Sits under <drug-identity> in the aside, above
   the existing .crumb line; a hairline echoes .crumb's own top-rule
   language rather than boxing the list like .facts does. Sticky behaviour
   is inherited from .article__aside -- this rule adds no positioning of
   its own. Kept visible under @media print (below) because the generated
   list doubles as the page's print TOC. */
.contents {
  margin: var(--sp-3) 0 0;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
}

.contents ol {
  margin: 0;
  padding-left: 1.2rem;
}

.contents li { margin: 0.2rem 0; }
.contents a { color: var(--ink-2); }
.contents a:hover { color: var(--ink); }

@media print {
  .contents { display: block; }
}

.eyebrow {
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 650; margin-bottom: var(--sp);
}

/* Spec B1 ("drug is the page") -- the eyebrow/H1 pair above is retired on
   every atlas page in favour of H1 = drug name, this subtitle line, then
   the tab strip below. <drug-subtitle> (figure.js) sets this class itself
   once it has content, so an empty/failed fetch stays a contentless custom
   element with zero footprint rather than a styled blank box. */
.page-subtitle {
  display: block; font-size: var(--step-0); color: var(--ink-3);
  margin-top: calc(-1 * var(--sp-2)); margin-bottom: var(--sp-3);
}

/* Tab strip linking a drug's three pages, reusing .jtabs/.jtabs__tab
   (defined below, shared with the US/Canada panes) rather than a second
   tab pattern -- .page-tabs only adds this block's own spacing. */
.page-tabs.jtabs { margin-top: 0; margin-bottom: var(--sp-4); }

.lede { font-size: var(--step-1); color: var(--ink-2); line-height: 1.5; }
.under-construction {
  color: var(--ink-3);
  font-style: italic;
}

/* ==========================================================================
   Splash — no header, no sidebar
   ========================================================================== */
.splash {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: var(--sp-6) var(--sp-3);
  text-align: center;
}
.splash__inner { max-width: 46rem; }
.splash h1 { font-size: var(--step-5); letter-spacing: -0.03em; }
.splash p { font-size: var(--step-1); color: var(--ink-2); margin-bottom: var(--sp-6); }
.splash__links { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; }
.splash__link {
  display: block; text-align: left; text-decoration: none; color: inherit;
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--sp-3); min-width: 15rem; flex: 1 1 15rem; max-width: 20rem;
  transition: border-color 0.15s, transform 0.15s;
}
.splash__link:hover { border-color: var(--accent); transform: translateY(-2px); }
.splash__link strong { display: block; font-size: var(--step-1); margin-bottom: 4px; }
.splash__link span { font-size: var(--step--1); color: var(--ink-3); }

/* ==========================================================================
   Charts + tables
   ========================================================================== */
.chart-block { margin: var(--sp-6) 0; }
.chart-block__title { font-size: var(--step-1); font-weight: 650; margin: 0 0 4px; }
.chart-block__note { font-size: var(--step--1); color: var(--ink-3); margin: 0 0 var(--sp-2); }
.chart-block__frame {
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--sp-2); background: var(--bg); position: relative; height: 380px;
}
.chart-block__source { font-size: var(--step--1); color: var(--ink-3); margin-top: var(--sp); }

table { border-collapse: collapse; width: 100%; font-size: var(--step--1); margin: var(--sp-3) 0; }
th, td { text-align: left; padding: var(--sp) var(--sp-2); border-bottom: 1px solid var(--rule); }
th { font-weight: 650; color: var(--ink-2); }

.callout {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: var(--sp-2) var(--sp-3); border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--sp-3) 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar-toggle { display: inline-flex; }
  .site-sidebar {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    width: auto; height: auto; max-height: 70vh; overflow-y: auto;
    z-index: 45; display: none;
    border-right: 0; border-bottom: 1px solid var(--rule);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  }
  body.sidebar-open .site-sidebar { display: block; }
  .content { padding: var(--sp-4) var(--sp-3) var(--sp-8); }
  h1 { font-size: var(--step-3); }
  .splash h1 { font-size: var(--step-4); }

  .site-header { gap: var(--sp); padding: 0 var(--sp-2); }
  .site-header__nav { gap: var(--sp-2); }
  /* `<site-search>` (the custom-element host) is the actual flex child of
     `.site-header`, not `.site-search` (the class on the <div> inside it).
     Flex items default to `min-width: auto`, which resolves to the item's
     min-content size when nothing overrides it — so without this rule the
     host refused to shrink below ~177px (icon + its unshrunk input's
     preferred width + padding), causing a 22px page-level overflow on any
     header whose breadcrumb text left less than that much room (reproduced
     on brexpiprazole's Pharmacodynamics page: innerWidth/scrollWidth both
     397 against a 375 viewport, quetiapine's shorter breadcrumb hid it).
     `.site-search`'s own min-width: 0 below only shrinks the div; it never
     reached the host, which is what `.site-header`'s flexbox measures. */
  site-search { min-width: 0; }
  .site-search { flex: 1 1 auto; min-width: 0; }
  .site-search input { min-width: 0; }
  .site-search__kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Figures — <data-figure>. All colour comes from the tokens above, so a
   retheme moves the charts with the page. Never hardcode a colour here.
   ========================================================================== */
.figure {
  margin: var(--sp-3) 0 var(--sp-2);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg);
}

.figure__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--rule);
}

.figure__title {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.25;
}

.figure__subtitle {
  margin: calc(var(--sp) / 2) 0 0;
  font-size: var(--step--1);
  color: var(--ink-3);
  max-width: 60ch;
}

.figure__tabs {
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

.figure__tab {
  appearance: none;
  border: 0;
  background: var(--bg);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--step--1);
  padding: calc(var(--sp) * 0.75) var(--sp-2);
  cursor: pointer;
}

.figure__tab + .figure__tab { border-left: 1px solid var(--rule); }
.figure__tab:hover { background: var(--bg-2); }
.figure__tab.is-active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.figure__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.figure__controls { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.figure__control  { display: flex; align-items: center; gap: 0.35rem;
                    font-family: var(--font-sans); font-size: 0.8125rem;
                    color: var(--ink-2); cursor: pointer; }

.figure__frame { height: 380px; width: 100%; padding: var(--sp-2) var(--sp) 0; }

.figure__fallback,
.slot__empty {
  color: var(--ink-3);
  font-size: var(--step--1);
  padding: var(--sp-2);
}

.figure__tablewrap { max-height: 460px; overflow: auto; }

.figure__table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }

.figure__table th,
.figure__table td {
  text-align: left;
  padding: calc(var(--sp) * 0.75) var(--sp-2);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.figure__table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-2);
  font-weight: 600;
  z-index: 1;
}

.figure__table td.is-num,
.figure__table th.is-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Prose cells -- a verbatim source sentence, an assay description -- wrap and
   are bounded, rather than inheriting the nowrap that keeps short values tidy. */
.figure__table td.is-prose {
  white-space: normal;
  min-width: 22ch;
  max-width: 56ch;
}

.figure__table tbody tr:hover { background: var(--bg-2); }
.figure__units { font-weight: 400; color: var(--ink-3); }
.figure__rowsource { color: var(--ink-3); }

.figure__source {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--step--1);
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
}

.figure__sourcelabel { font-weight: 600; }
.figure__source a { color: inherit; }
.figure__notes { display: block; margin-top: calc(var(--sp) / 2); }

.figure--error { padding: var(--sp-3); color: var(--ink-3); }

/* Page slots -------------------------------------------------------------- */
/* scroll-margin-top on the anchor TARGET, not the link -- .site-header is
   `position: sticky; top: 0` at --header-h tall, and nothing before this
   accounted for it: a native fragment jump (or scrollIntoView) landed a
   .slot flush with the viewport top, so the header covered the target's
   own <h2>. Applied to .slot itself (not a narrower selector) because
   every in-page anchor on the site already targets a .slot id -- both
   <page-contents>'s generated list (task 10) and the fact list's
   "Metabolism ›" / "Formulations ›" jump links point at the same ids, so
   one rule on the shared class fixes every anchor uniformly rather than
   fixing task 10's own links and leaving the older jump links broken. */
.slot { margin: var(--sp-5) 0; scroll-margin-top: calc(var(--header-h) + var(--sp-2)); }
.slot h2 { margin-bottom: var(--sp); }
.slot__empty { border-left: 2px solid var(--rule); padding-left: var(--sp-2); font-style: italic; }

/* Spec B4 — "Market and regulatory" (task 11): Brand names, Formulations
   and Pack sizes collapsed into one .slot, three <h3> sub-blocks. Each
   sub-block is itself a same-page anchor target (the fact list's
   "Formulations ›" / "Brand names ›" jump links, spec B2, point at these
   same ids -- unchanged by the merge, so they need the same header-clearing
   treatment .slot's own scroll-margin-top gets above, scoped narrower since
   no other h3 on the site is an anchor target). */
.market__h3 { scroll-margin-top: calc(var(--header-h) + var(--sp-2)); }
.market__caveat { font-size: var(--step--1); color: var(--ink-3); margin: var(--sp-2) 0 0; }

/* A finding, not scaffolding -- cariprazine/lurasidone's pack-size sub-block
   states a real regulatory fact (no marketed pack sizes recorded), so it
   drops .slot__empty's italic (reserved for "not yet built") but keeps the
   same rule-and-indent framing as a quiet, secondary line. */
.market__finding {
  border-left: 2px solid var(--rule);
  padding: var(--sp-2);
  color: var(--ink-3);
  font-size: var(--step--1);
}

.page-intro { color: var(--ink-2); max-width: var(--measure); }

.disclaimer {
  margin-top: var(--sp-8);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  color: var(--ink-3);
  max-width: var(--measure);
}

/* Identity card — rendered as a Wikipedia-style infobox in the aside ------
   Vertical, compact, and self-contained. The structure sits on top; the
   identifiers read as a reference table underneath. */
.identity {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg-2);
  overflow: hidden;
}

.identity__structure {
  color: var(--ink);
  background: var(--bg);
  padding: var(--sp-2);
  border-bottom: 1px solid var(--rule);
}

.identity__structure svg { width: 100%; height: auto; display: block; aspect-ratio: 1 / 1; }

.identity__structure svg.is-spinnable {
  cursor: grab;
  /* Vertical panning stays with the page, so a drag on a phone still scrolls. */
  touch-action: pan-y;
  user-select: none;
}

.identity__structure svg.is-spinnable:active { cursor: grabbing; }

.identity__license {
  margin: var(--sp) 0 0;
  font-size: var(--step--2);
  line-height: 1.4;
  color: var(--ink-3);
  text-align: center;
}

.identity__caveat { font-style: italic; }

.identity__facts { padding: 0; }
.identity__list { margin: 0; }

.identity__row {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: var(--sp);
  padding: calc(var(--sp) * 0.6) var(--sp-2);
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.identity__row:last-child { border-bottom: 0; }

.identity__row dt {
  color: var(--ink-3);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.identity__row dd { margin: 0; font-size: var(--step--1); line-height: 1.35; }
.identity__mono { font-family: var(--font-mono); font-size: var(--step--2); overflow-wrap: anywhere; }

.identity__atcpath {
  display: block;
  margin-top: calc(var(--sp) / 4);
  font-size: var(--step--2);
  color: var(--ink-3);
  line-height: 1.3;
}

.identity__note {
  margin: 0;
  padding: var(--sp-2);
  font-size: var(--step--2);
  line-height: 1.45;
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
}

.identity__source { border-top: 0; padding: var(--sp) var(--sp-2) var(--sp-2); font-size: var(--step--2); }

/* Chemistry ---------------------------------------------------------------- */
.chem { display: grid; gap: var(--sp-2); margin-top: var(--sp-2); }

.chem__block {
  padding: var(--sp-3);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.chem__block h3 {
  margin: 0 0 var(--sp) 0;
  font-size: var(--step-0);
  display: flex;
  align-items: center;
  gap: var(--sp);
}

/* Calculated values must not read like registry facts. */
.chem__block--computed { border-style: dashed; }

.chem__tag {
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0 calc(var(--sp) * 0.6);
  text-transform: lowercase;
}

.chem__count { font-size: var(--step--1); font-weight: 400; color: var(--ink-3); }
.chem__names summary { cursor: pointer; list-style-position: outside; }
.chem__names summary h3 { display: inline-flex; }
.chem__names[open] summary { margin-bottom: var(--sp-2); }

/* Metabolite map ----------------------------------------------------------- */
.metab {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto 2fr;
  gap: var(--sp-3);
  align-items: start;
  padding: var(--sp-3);
  border: 1px solid var(--rule);
  border-radius: 3px;
  margin-top: var(--sp-2);
}

.metab__label {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metab__enzymes { list-style: none; margin: var(--sp-2) 0 0; padding: 0; font-size: var(--step--1); }
.metab__enzymes li { margin-bottom: calc(var(--sp) / 2); }
.metab__rel { color: var(--ink-3); }
.metab__arrow { color: var(--ink-3); font-size: var(--step-2); line-height: 1.2; }
.metab__list { list-style: none; margin: 0; padding: 0; }

.metab__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-2);
  padding: calc(var(--sp) * 0.75) 0;
  border-bottom: 1px solid var(--rule);
}

.metab__item:last-child { border-bottom: 0; }
.metab__name { font-size: var(--step--1); }

.metab__flag {
  flex-shrink: 0;
  font-size: var(--step--1);
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0 calc(var(--sp) * 0.6);
}

.metab__item--active .metab__name { font-weight: 600; }
.metab__item--active .metab__flag { color: var(--ink); border-color: var(--ink-2); }
.metab__item--not-stated .metab__flag { font-style: italic; }

@media (max-width: 720px) {
  .metab { grid-template-columns: 1fr; }
  .metab__arrow { display: none; }
}

/* Breadcrumb pointers between pages ---------------------------------------- */
.crumb {
  margin: var(--sp-2) 0 0;
  font-size: var(--step--1);
  color: var(--ink-3);
}

.crumb a { color: var(--ink-2); }

/* ==========================================================================
   Fact list (<drug-facts>) — spec B2. Head furniture, not a section: sits
   full-width between Warnings and Indications with no <h2> of its own (see
   make_skeletons.py's insertion comment), so it never appears in a contents
   list. Same hairline-row / uppercase-label language as .identity__row, but
   full-measure and two columns wide enough for prose values rather than the
   aside's narrow 40/60 split.
   ========================================================================== */
.facts {
  display: grid;
  margin: var(--sp-4) 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
}

.facts__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--sp-2);
  padding: var(--sp) var(--sp-3);
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  font-size: var(--step--1);
}

.facts__row:last-child { border-bottom: 0; }

.facts__row dt {
  color: var(--ink-3);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.facts__row dd { margin: 0; line-height: 1.4; }

.facts__jump {
  margin-left: var(--sp);
  font-size: var(--step--2);
  color: var(--ink-3);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .facts__row { grid-template-columns: 1fr; gap: calc(var(--sp) / 4); }
}

/* ==========================================================================
   Warnings box (<drug-warnings>) — card language ported from the archived
   standalone Overview: light card, header band with subtitle and chip,
   hairline separators. Tokens only.
   ========================================================================== */
.warnings__tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp); }
.warnings__tab { font: inherit; font-size: var(--step--1); color: var(--ink-3); background: none; border: 1px solid var(--rule); border-radius: 2px; padding: 0.15rem 0.6rem; cursor: pointer; }
.warnings__tab.is-active { color: var(--ink); border-color: var(--ink-2); font-weight: 600; }
.warnings__card { border: 1px solid var(--rule); border-radius: 3px; background: var(--bg); }
.warnings__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; padding: 1.25rem 1.5rem 0.9rem; border-bottom: 1px solid var(--rule); }
.warnings__head h3 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.25; }
.warnings__sub { margin: 0.25rem 0 0; font-size: var(--step--1); color: var(--ink-3); max-width: var(--measure); }
.warnings__chip { flex: none; font-family: var(--font-mono); font-size: var(--step--2); color: var(--ink-2); border: 1px solid var(--rule); border-radius: 2px; padding: 0.1rem 0.4rem; white-space: nowrap; }
.warnings__body { padding: 1rem 1.5rem; }
.warnings__title { margin: 0 0 0.6rem; font-weight: 650; line-height: 1.35; max-width: var(--measure); }
.warnings__text { max-width: var(--measure); line-height: 1.6; }
.warnings__text p { margin: 0 0 0.75rem; }
.warnings__text p:last-child { margin-bottom: 0; }
.warnings__prov { font-size: var(--step--2); color: var(--ink-3); margin: 0.9rem 0 0; max-width: var(--measure); }
.warnings__more { border-top: 1px solid var(--rule); padding: 0.9rem 1.5rem; }
.warnings__more summary { cursor: pointer; font-size: var(--step--1); color: var(--ink-2); font-weight: 600; }
.warnings__morewording { border-top: 1px solid var(--rule); margin-top: 0.9rem; padding-top: 0.9rem; }
.warnings__morewording .warnings__prov { margin: 0 0 0.5rem; }
.warnings__links { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: var(--step--1); line-height: 1.7; }
.warnings__source { border-top: 1px solid var(--rule); margin: 0; padding: 0.7rem 1.5rem 0.9rem; }

/* US pane redesign (Task 11): collapsed heading, click expands the modal
   wording. summary carries the label's own "WARNING: ..." text verbatim, so
   it is left-aligned prose rather than a short chip label. */
.warnings__disclosure { padding: 0; }
.warnings__disclosure summary {
  cursor: pointer;
  padding: 1rem 1.5rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink);
  list-style: none;
}
.warnings__disclosure summary::-webkit-details-marker { display: none; }
.warnings__disclosure summary::before { content: "▸ "; color: var(--ink-3); }
.warnings__disclosure[open] summary::before { content: "▾ "; }
.warnings__disclosure .warnings__body { padding: 0 1.5rem 1rem; }
.warnings__card > .warnings__sub { padding: 0 1.5rem; margin: 0.6rem 0 0; }
.warnings__updated { font-size: var(--step--2); color: var(--ink-3); padding: 0 1.5rem; margin: 0.4rem 0 0; }

/* ==========================================================================
   Shared tab shell (.jtabs) and fine-print tooltip (.fineprint) —
   figure.js's renderTabbed()/finePrint() primitives (Task 10). .jtabs echoes
   .warnings__tab's look so every US/Canada split on the site reads as one
   pattern. Tokens only.

   Reused as-is (Task 8, spec B1) for the per-drug page-tab strip
   (.page-tabs) — those tabs are <a> links, not <button>s, so this rule set
   also carries text-decoration: none and flex-wrap for a 375px head; both
   are no-ops on the existing <button> usages above.
   ========================================================================== */
.jtabs { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp); }
.jtabs__tab { font: inherit; font-size: var(--step--1); color: var(--ink-3); background: none; border: 1px solid var(--rule); border-radius: 2px; padding: 0.15rem 0.6rem; cursor: pointer; text-decoration: none; display: inline-block; }
.jtabs__tab.is-active { color: var(--ink); border-color: var(--ink-2); font-weight: 600; }

/* Tap-first '?' — the button toggles [hidden] in JS; :hover/:focus-within
   below are sugar on top for pointer/keyboard users, not the mechanism,
   because hover has no mobile equivalent. */
.fineprint { position: relative; display: inline-block; margin-left: 0.3em; }
.fineprint__btn {
  font: inherit;
  font-size: var(--step--2);
  line-height: 1;
  color: var(--ink-3);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 50%;
  width: 1.1em;
  height: 1.1em;
  padding: 0;
  cursor: pointer;
}
.fineprint__btn:hover,
.fineprint__btn:focus-visible,
.fineprint__btn[aria-expanded="true"] { color: var(--ink); border-color: var(--ink-2); }
.fineprint__tip {
  position: absolute;
  z-index: 5;
  top: 1.4em;
  right: 0;
  max-width: 36ch;
  width: max-content;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  padding: 0.5rem 0.7rem;
  font-size: var(--step--2);
  line-height: 1.5;
  color: var(--ink-2);
  white-space: normal;
}
.fineprint__tip[hidden] { display: none; }
.fineprint:hover .fineprint__tip,
.fineprint:focus-within .fineprint__tip { display: block; }
.fineprint__note { display: block; }
.fineprint__note + .fineprint__note { margin-top: 0.4rem; }

/* ==========================================================================
   Brand-names / formulations cards (<drug-brands>, <drug-formulations>) —
   Task 12. Plain line list rather than the warnings box's header-band card,
   because these sections have no chip/subtitle to show; one bordered pane
   per jurisdiction tab, one line per row (brands) or category (formulations),
   counts and form wordings tucked behind .fineprint. Tokens only.
   ========================================================================== */
.card__pane { border: 1px solid var(--rule); border-radius: 3px; background: var(--bg); padding: 1rem 1.5rem; }
.card__list { list-style: none; margin: 0; padding: 0; }
.card__line { padding: 0.35rem 0; border-bottom: 1px solid var(--rule); line-height: 1.5; }
.card__line:last-child { border-bottom: none; }
.card__line--muted { color: var(--ink-3); font-size: var(--step--1); }
.card__pane > .figure__source { border-top: 1px solid var(--rule); margin: 0.9rem 0 0; padding-top: 0.75rem; }

/* ==========================================================================
   Practical notes (<drug-notes>) — Task 13. Verbatim contraindications /
   warnings & precautions / drug interactions, every heading a collapsed
   drop-down. Reuses .warnings__disclosure's collapsed-heading language
   (▸/▾ marker, click expands) at the block level rather than the card level,
   because a section here can be a single block (contraindications, most
   drugs) or twenty (warnings and precautions) and the disclosure has to work
   either way. Tokens only.
   ========================================================================== */
.notes__pane { border: 1px solid var(--rule); border-radius: 3px; background: var(--bg); }
.notes__section { border-bottom: 1px solid var(--rule); }
.notes__section:last-of-type { border-bottom: none; }
.notes__block { border-bottom: 1px solid var(--rule); }
.notes__section .notes__block:last-of-type { border-bottom: none; }
.notes__block summary {
  cursor: pointer;
  padding: 0.85rem 1.5rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink);
  list-style: none;
}
.notes__block summary::-webkit-details-marker { display: none; }
.notes__block summary::before { content: "▸ "; color: var(--ink-3); }
.notes__block[open] summary::before { content: "▾ "; }
.notes__body { padding: 0 1.5rem 1rem; max-width: var(--measure); line-height: 1.6; }
.notes__body p { margin: 0 0 0.75rem; }
.notes__body p:last-child { margin-bottom: 0; }
.notes__linkonly { margin: 0; color: var(--ink-3); }
/* Standalone `section="indications"` mode (spec C1): entries stacked and
   already open, plain divs rather than <details> -- the one thing a reader
   most wants should not need a click. Hairline between stacked entries;
   heading matches .notes__block summary's weight/size/spacing exactly, as
   margin rather than padding since it has no clickable box around it. */
.notes__openblock { border-bottom: 1px solid var(--rule); }
.notes__openblock:last-of-type { border-bottom: none; }
.notes__openhead { font-size: var(--step-0); font-weight: 650; line-height: 1.35; color: var(--ink); margin: 0.85rem 1.5rem; }
.notes__prov { font-size: var(--step--2); color: var(--ink-3); margin: 0; padding: 0.7rem 1.5rem; max-width: var(--measure); }
.notes__links { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: var(--step--1); line-height: 1.7; }
.notes__pane > .warnings__sub { padding: 1rem 1.5rem 0; margin: 0; }
.notes__pane > .notes__links { padding: 0 1.5rem; }
.notes__source { border-top: 1px solid var(--rule); margin: 0; padding: 0.7rem 1.5rem 0.9rem; }

/* C11: live status line under the figure head; withheld reasons as notes */
.figure__status { margin: 0; padding: var(--sp) var(--sp-3) 0; font-size: var(--step--1); color: var(--ink-3); }
.figure__table td.is-note { font-style: italic; color: var(--ink-2); }

/* C19: the figure credit -- source, retrieval date, link to the sources page. */
.figure__sep { margin: 0 0.4em; }
.figure__sourceslink { white-space: nowrap; }

/* C21: compact table -- long text behind a per-row disclosure, qualifications visible. */
.figure__tablewrap { max-height: 70vh; }
.figure__table--compact td.is-evidence { white-space: normal; min-width: 18ch; max-width: 36ch; vertical-align: top; }
.figure__table--compact td.is-prose { max-width: 40ch; vertical-align: top; }
.figure__table--compact td, .figure__table--compact th { vertical-align: top; }
.figure__table--compact th:first-child, .figure__table--compact td:first-child {
  position: sticky; left: 0; background: var(--bg, #fff); z-index: 2; box-shadow: 1px 0 0 var(--rule); }
.figure__table--compact thead th:first-child { z-index: 3; }
.figure__table--compact tbody tr:hover td:first-child { background: var(--bg-2); }
.figure__table--compact td.is-note { font-style: italic; white-space: nowrap; }
.figure__table--compact td.is-display { font-style: italic; }
.evidence__status { display: block; }
.evidence__flags { display: block; margin-top: 2px; }
.evidence__flag { display: inline-block; margin: 2px 4px 0 0; padding: 0 6px; border: 1px solid var(--rule);
  border-radius: 999px; font-size: var(--step--1); color: var(--ink-2); white-space: nowrap; }
.rowdetails { margin-top: 4px; }
.rowdetails__summary { cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 2px;
  min-height: 24px; display: inline-block; }
.rowdetails__summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rowdetails__body { margin-top: 6px; color: var(--ink-2); font-size: var(--step--1); }
.rowdetails__body p { margin: 0 0 4px; }
.rowdetails__refs { margin: 0 0 4px 1.1em; padding: 0; }
.rowdetails__refs li { margin: 0 0 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* C23: reading notes -- visible interpretation beside each figure and at the top of each drug page. */
.figure__reading { margin: calc(var(--sp) / 2) 0 0; font-size: var(--step--1); color: var(--ink-2); max-width: 70ch; }
.page-note { font-size: var(--step--1); color: var(--ink-2); margin: 0 0 var(--sp-3); }
/* C23: small text is 12.8px at the default scale; on phones raise it to 14px (WCAG has no minimum, but
   subtitles, status lines, credits and table cells are the text a reader most needs there). */
@media (max-width: 640px) { :root { --step--1: 0.875rem; --step--2: 0.78rem; } }

/* C27: the compact table's visually hidden row labels are absolutely positioned; without a positioned
   ancestor their boxes widened and lengthened the page instead of scrolling with the table. */
.figure__tablewrap { position: relative; }

/* C32: one hierarchy for PDSP medication pages. */
.drug-page { max-width: 1240px; margin: 0 auto; }
.drug-page > h1 { margin-bottom: 0.4rem; }
.drug-page .drug-workspace > .slot { margin: 0 0 0.75rem; }
.drug-page .drug-workspace > .slot > h2 { margin: 0 0 1.5rem; font-size: 1.25rem; font-weight: 450; color: var(--ink-2); }
.figure--pdsp .figure__head { align-items: center; gap: 1rem 1.5rem; background: var(--bg-2); }
.figure--pdsp .figure__head > div:first-child { flex-basis: 100%; }
.figure--pdsp .figure__subtitle { max-width: none; margin: 0; }
.figure--pdsp .figure__controls { margin: 0 0 0 auto; align-items: center; }
.figure--pdsp .figure__control { min-height: 36px; }
.figure--pdsp .figure__control[hidden] { display: none; }
.figure--pdsp .figure__status { flex-basis: 100%; padding: 0; color: var(--ink-2); }
.figure__key { padding: 1rem 1.5rem 0; color: var(--ink-2); font-size: var(--step--1); }
.figure__key p { margin: 0 0 0.3rem; max-width: none; }
.figure__bound { color: var(--null-ink); font-size: 1rem; }
.figure--pdsp .figure__source { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.figure__methods { flex-basis: 100%; margin-top: 0.25rem; }
.figure__methods summary { cursor: pointer; width: fit-content; padding: 0.5rem 0; color: var(--ink); font-weight: 600; }
.figure__methodsbody { max-width: 85ch; padding: 0.75rem 0; color: var(--ink-2); }
.figure__methodsbody p { margin-bottom: 0.75rem; }
.drug-page .clinical-note { max-width: none; font-size: var(--step--1); color: var(--ink-2); margin: 1rem 0 1.5rem; }
.drug-page > p:last-child { font-size: var(--step--1); }
#pdsp a[id] { scroll-margin-top: 2rem; }
@media (max-width: 640px) {
  .drug-page { padding: 1.5rem 1rem 2.5rem; }
  .figure--pdsp .figure__head { padding: 1rem; gap: 0.75rem; }
  .figure--pdsp .figure__controls { margin: 0; width: 100%; gap: 0.25rem 1rem; }
  .figure__key { padding: 0.75rem 1rem 0; }
  .figure--pdsp .figure__source { padding: 1rem; }
}

/* C35: dedicated filters and native segmented ordering radios. */
.figure--pdsp .figure__controls { flex-basis: 100%; margin: 0; padding: 1rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); gap: 0.75rem 1.5rem; }
.figure__controltitle { flex-basis: 100%; margin: 0; font-size: var(--step--1); font-weight: 600; }
.figure__order { border: 0; padding: 0; margin: 0 0 0 auto; min-width: 0; }
.figure__order legend { font-size: var(--step--1); margin-bottom: 0.3rem; }
.figure__orderoptions { display: flex; }
.figure__orderoptions label { position: relative; cursor: pointer; }
.figure__orderoptions input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.figure__orderoptions span { display: block; padding: 0.55rem 0.8rem; border: 1px solid var(--ink-2); font-size: var(--step--1); }
.figure__orderoptions label:first-child span { border-radius: 4px 0 0 4px; }
.figure__orderoptions label:last-child span { border-radius: 0 4px 4px 0; border-left: 0; }
.figure__orderoptions input:checked + span { background: var(--ink); color: var(--bg); }
.figure__orderoptions input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.figure__order[hidden] { display: none; }
@media (max-width: 640px) {
  .figure--pdsp .figure__controls { box-sizing: border-box; align-items: flex-start; gap: 0.5rem; }
  .figure--pdsp .figure__controls > .figure__control { width: 100%; }
  .figure__order { margin: 0.4rem 0 0; width: 100%; }
}

/* C36: live shown/total counters alongside the filters. */
.figure--pdsp .figure__head > .figure__tabs:first-child { flex-basis: auto; }
.figure--pdsp .figure__controls { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 0.4rem 1.5rem; }
.figure__controltitle { grid-column: 1 / -1; margin-bottom: 0.4rem; }
.figure--pdsp .figure__controls > .figure__control { grid-column: 1; }
.figure--pdsp .figure__controls > .figure__order { grid-column: 3; grid-row: 2 / 4; align-self: center; }
.figure--pdsp .figure__controls > .figure__status { grid-column: 2; grid-row: 2 / 4; display: flex; flex-direction: column; justify-content: center; gap: 0.4rem; margin: 0; font-variant-numeric: tabular-nums; }
.figure__count { display: block; white-space: nowrap; }
.figure__count strong { color: var(--ink); font-weight: 600; }
@media (max-width: 850px) {
  .figure--pdsp .figure__controls { grid-template-columns: minmax(0, 1fr); }
  .figure--pdsp .figure__controls > .figure__status { grid-column: 1; grid-row: 4; padding: 0.5rem 0; }
  .figure--pdsp .figure__controls > .figure__order { grid-column: 1; grid-row: 5; margin: 0; }
}

/* C37: concise data guide with a separate, inspectable audit. */
.figure__methodsbody h3 { font-size: 1rem; margin: 1.2rem 0 0.4rem; color: var(--ink); }
.figure__methodsbody h3:first-child { margin-top: 0; }
.figure__methodsbody ul { padding-left: 1.25rem; margin: 0 0 0.75rem; }
.figure__methodsbody li { margin: 0.3rem 0; }
.figure__audit { border-top: 1px solid var(--rule); margin-top: 1rem; padding-top: 0.5rem; }
.figure__audittable { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1rem; font-size: var(--step--1); }
.figure__audittable th, .figure__audittable td { padding: 0.6rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.figure__audittable th { color: var(--ink); white-space: nowrap; }
.figure__auditnote summary { font-weight: 400; padding: 0; }
.figure__auditnote p { margin: 0.5rem 0 0; }
@media (max-width: 640px) {
  .figure__audittable th, .figure__audittable td { padding: 0.5rem 0.3rem; overflow-wrap: normal; }
}

/* C38: navigation first, with a quiet clinical note below the page title. */
.drug-page .drug-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 0 0 1.25rem; font-size: var(--step--1); }
.drug-nav a { padding: 0.4rem 0; color: var(--ink-2); text-underline-offset: 0.2em; }
.drug-page > .clinical-note { margin: 0.5rem 0 1.25rem; max-width: 85ch; color: var(--ink-2); font-size: var(--step--1); line-height: 1.5; }

/* C40: row summary and every hit record, with no record selector. */
.record-tooltip { max-width: 680px; color: var(--ink); font-size: 12px; line-height: 1.5; }
.record-tooltip--details { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(230px, 1.2fr); gap: 16px; width: 620px; max-width: calc(100vw - 48px); }
.record-tooltip__summary { align-self: start; }
.record-tooltip__records { min-width: 0; }
.record-tooltip__count { font-weight: 600; margin-bottom: 6px; }
.record-tooltip__card { border: 1px solid var(--rule); border-radius: 4px; padding: 10px; margin: 0 0 8px; background: var(--bg); }
.record-tooltip__card h4 { font-size: 13px; margin: 0 0 6px; }
.record-tooltip__card dl { margin: 0; }
.record-tooltip__card dl > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; margin-top: 3px; }
.record-tooltip__card dt { color: var(--ink-2); }
.record-tooltip__card dd { margin: 0; overflow-wrap: anywhere; white-space: normal; }
@media (max-width: 640px) {
  .record-tooltip--details { grid-template-columns: minmax(0, 1fr); width: 310px; gap: 10px; }
}

/* C41: clicked record details stay open until explicitly dismissed. */
.record-tooltip__pinbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--ink-2); }
.record-tooltip__close { border: 1px solid var(--rule); border-radius: 3px; background: var(--bg); color: var(--ink); padding: 4px 8px; font: inherit; cursor: pointer; }
.record-tooltip__close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* C46: exact citation labels and counts of currently visible chart records. */
.figure__plot { min-width: 0; }
.figure__plot[hidden] { display: none; }
.figure__references { min-width: 0; margin: 0 20px 20px; border: 1px solid var(--rule); border-radius: 4px; align-self: start; font-size: var(--step--1); }
.figure__references > summary { cursor: pointer; padding: 14px; font-weight: 600; }
.figure__referencebody { padding: 0 14px 14px; }
.figure__referencebody p { color: var(--ink-2); margin: 0 0 12px; line-height: 1.5; }
.figure__reference-list { list-style: none; padding: 0; margin: 0 0 12px; max-height: 420px; overflow-y: auto; }
.figure__reference-list li { margin: 0; }
.figure__reference-list button { display: block; text-align: left; width: 100%; padding: 10px; border: 1px solid transparent; border-bottom-color: var(--rule); border-radius: 3px; background: var(--bg); color: var(--ink); font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.figure__reference-list strong { display: block; margin-top: 4px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.figure__reference-list button:hover { background: var(--bg-2); }
.figure__reference-list button[aria-pressed="true"] { background: #fff4df; border-color: #a65d00; }
.figure__references summary:focus-visible, .figure__reference-list button:focus-visible { outline: 2px solid var(--c1); outline-offset: -2px; }
@media (min-width: 1280px) {
  .figure--pdsp .figure__plot:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
  .figure__references { margin: 20px 16px 20px 0; }
}

/* C50: compact controls beside the current-drug panel. */
.figure--pdsp .figure__head { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 12px 24px; align-items: start; }
.figure--pdsp .figure__tabs { grid-column: 1; grid-row: 1; justify-self: start; }
.figure--pdsp .figure__controls { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; align-content: start; gap: 8px 20px; padding: 0; border: 0; background: transparent; min-width: 0; }
.figure--pdsp .figure__controltitle { display: none; }
.figure--pdsp .figure__controls > .figure__control { width: auto; margin: 0; min-height: 32px; }
.figure--pdsp .figure__controls > .figure__order { flex-basis: 100%; margin: 0; width: auto; }
.figure--pdsp .figure__controls > .figure__status { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 4px 16px; padding: 0; }
.drug-panel { grid-column: 2; grid-row: 1 / 3; min-width: 0; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); font-size: var(--step--1); }
.drug-panel > summary { padding: 10px 12px; cursor: pointer; font-weight: 650; }
.drug-panel__body { padding: 0 12px 12px; }
.drug-panel__model { height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px dashed var(--rule); border-radius: 4px; background: var(--bg-2); color: var(--ink-2); }
.drug-panel__model small { color: var(--ink-3); }
.drug-panel nav { margin-top: 10px; }
.drug-panel nav a { display: block; padding: 7px 10px; border-left: 3px solid var(--c1); border-radius: 3px; background: var(--accent-soft); color: var(--ink); font-weight: 600; text-decoration: none; }
@media (max-width: 999px) {
  .figure--pdsp .figure__head { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .drug-panel { grid-column: 1; grid-row: 1; }
  .figure--pdsp .figure__tabs { grid-row: 2; }
  .figure--pdsp .figure__controls { grid-row: 3; }
}
@media print { .drug-panel { display: none; } .figure--pdsp .figure__head { grid-template-columns: minmax(0, 1fr); } }

/* C51: self-contained molecular viewer, isolated from affinity chart styles. */
.drug-panel { width: 100%; }
drug-molecule { display: block; min-width: 0; }
.molecule { margin: 0; }
.molecule__frame { height: 144px; color: var(--ink); }
.molecule__frame svg { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; user-select: none; }
.molecule__frame svg:active { cursor: grabbing; }
.molecule__frame svg:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.molecule__controls { display: flex; gap: 4px; justify-content: space-between; }
.molecule__controls button { min-height: 32px; min-width: 32px; padding: 4px 6px; border: 1px solid var(--rule); border-radius: 4px; background: var(--bg); color: var(--ink); font: inherit; font-size: 11px; cursor: pointer; }
.molecule__controls button:disabled { color: var(--ink-3); cursor: default; }
.molecule figcaption { font-size: 11px; line-height: 1.45; color: var(--ink-2); }
.molecule__caption, .molecule__stereo { margin: 8px 0 0; }
.molecule__stereo { font-style: italic; }
.molecule__details { margin-top: 6px; }
.molecule__details > summary { cursor: pointer; }
.molecule__details p { margin: 8px 0; }
.molecule__details dl { margin: 8px 0; }
.molecule__details dt { font-weight: 600; }
.molecule__details dd { margin: 0 0 6px; overflow-wrap: anywhere; }
.molecule__loading, .molecule__error { font-size: var(--step--1); margin: 12px 0; }
/* The model may be taller than the controls; keep them near their tabs. */
.figure--pdsp .figure__head { grid-template-rows: min-content 1fr; }
@media (max-width: 999px) { .figure--pdsp .figure__head { grid-template-rows: auto; } }

/* C52: molecular context belongs to the page, outside the affinity figure. */
.drug-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.drug-workspace > .slot { grid-column: 1; grid-row: 1; min-width: 0; margin-top: 0; }
.drug-workspace > .drug-panel { grid-column: 2; grid-row: 1; align-self: start; }
.drug-workspace .figure--pdsp .figure__head { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
.drug-workspace .figure--pdsp .figure__tabs { grid-row: 1; }
.drug-workspace .figure--pdsp .figure__controls { grid-row: 2; }
.drug-workspace .figure--pdsp .figure__plot:not([hidden]) { display: block; }
.drug-workspace .figure__references { margin: 0 20px 20px; }
@media (max-width: 1279px) {
  .drug-workspace { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .drug-workspace > .drug-panel { grid-column: 1; grid-row: 1; }
  .drug-workspace > .slot { grid-row: 2; }
}
@media print { .drug-workspace { display: block; } }

/* C53: compact affinity controls and a readable molecular panel. */
@media (min-width: 1280px) {
  .drug-workspace { grid-template-columns: minmax(0, 1fr) 260px; }
}
.drug-workspace .figure--pdsp .figure__head { padding: 16px 20px; gap: 12px; }
.drug-workspace .figure--pdsp .figure__controls { gap: 10px 20px; align-items: center; }
.drug-workspace .figure--pdsp .figure__controls > .figure__order { flex-basis: auto; align-self: center; }
.drug-workspace .figure__order:not([hidden]) { display: flex; align-items: center; gap: 8px; }
.drug-workspace .figure__order legend { float: left; margin: 0; padding: 0; }
.drug-workspace .figure__orderoptions span { padding: 8px 10px; }
.drug-workspace .figure--pdsp .figure__controls > .figure__status { border-top: 1px solid var(--rule); padding-top: 10px; gap: 6px 20px; }
.drug-workspace .figure__key { padding: 14px 20px 0; }
.drug-workspace > .drug-panel > summary { padding: 12px 14px; font-size: 14px; }
.drug-workspace .drug-panel__body { padding: 0 14px 14px; }
.drug-workspace .molecule__frame { height: 220px; }
.drug-workspace .molecule figcaption { font-size: 12px; line-height: 1.5; }
.drug-workspace .molecule__controls { justify-content: center; gap: 8px; }
.drug-workspace .molecule__controls button { min-height: 36px; min-width: 36px; font-size: 12px; }
.drug-workspace .drug-panel nav { margin-top: 14px; }
@media (max-width: 640px) {
  .drug-workspace .figure--pdsp .figure__head { padding: 14px; }
  .drug-workspace .figure--pdsp .figure__controls { gap: 8px 16px; }
  .drug-workspace .figure__order { flex-wrap: wrap; }
  .drug-workspace .figure__order legend { float: none; width: 100%; margin-bottom: 6px; }
  .drug-workspace .figure__orderoptions span { padding: 10px; }
  .drug-workspace .figure__key { padding: 14px 14px 0; }
}

/* C54: permanent model at the page top; restore adjacent source highlighting. */
.drug-panel__title { margin: 0; padding: 12px 14px; font-size: 14px; font-weight: 650; }
@media (min-width: 1280px) {
  main.drug-page { display: grid; grid-template-columns: minmax(0, 1fr) 260px; column-gap: 24px; align-items: start; }
  .drug-page > .drug-nav { grid-column: 1 / -1; grid-row: 1; }
  .drug-page > h1 { grid-column: 1; grid-row: 2; }
  .drug-page > .clinical-note { grid-column: 1; grid-row: 3; }
  .drug-workspace { display: contents; }
  .drug-workspace > .slot { grid-column: 1; grid-row: 4; }
  .drug-workspace > .drug-panel { grid-column: 2; grid-row: 2 / 5; position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow-y: auto; }
  .drug-workspace .figure--pdsp .figure__plot:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: start; }
  .drug-workspace .figure__references { margin: 20px 12px 20px 0; }
}
@media (max-width: 1279px) {
  .drug-workspace > .drug-panel { margin-bottom: 0; }
}
@media print { main.drug-page { display: block; } }

/* C55: one master card, retaining separate chart and molecular interactions. */
main.drug-page { display: block; }
.drug-card { border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); min-width: 0; }
.drug-card > h1 { margin: 0; padding: 24px 20px 0; }
.drug-card > .clinical-note { margin: 8px 20px 20px; line-height: 1.5; }
.drug-card .drug-workspace > .slot { margin-bottom: 0; }
.drug-card .drug-workspace > .slot > h2 { margin: 0; padding: 0 20px 16px; }
.drug-card .figure--pdsp { margin: 0; border: 0; border-radius: 0; }
.drug-card .figure__head { border-top: 1px solid var(--rule); }
.drug-card .drug-panel { border: 0; border-radius: 0; background: transparent; }
.drug-card .figure__references { border: 0; border-left: 1px solid var(--rule); border-radius: 0; }
@media (min-width: 1280px) {
  .drug-card { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
  .drug-card > h1 { grid-column: 1; grid-row: 1; }
  .drug-card > .clinical-note { grid-column: 1; grid-row: 2; }
  .drug-card .drug-workspace > .slot { grid-column: 1; grid-row: 3; min-width: 0; }
  .drug-card .drug-workspace > .drug-panel { grid-column: 2; grid-row: 1 / 4; border-left: 1px solid var(--rule); margin: 12px 0; }
}
@media (max-width: 1279px) {
  .drug-card .drug-workspace { gap: 20px; }
  .drug-card .drug-workspace > .drug-panel { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
}
@media (max-width: 640px) {
  .drug-card > h1 { padding: 18px 14px 0; }
  .drug-card > .clinical-note { margin: 8px 14px 16px; }
  .drug-card .drug-workspace > .slot > h2 { padding: 0 14px 14px; }
}
@media print { .drug-card { display: block; } }


/* C56: clear controls, a generous chart, and sources beneath the figure. */
.drug-card__heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; padding: 28px 24px 0; min-width: 0; }
.drug-card__heading h1 { margin: 0; }
.drug-card__heading h2 { margin: 0; font-size: 1.25rem; font-weight: 450; color: var(--ink-2); }
.drug-page .drug-card > .clinical-note { margin: 8px 24px 24px; max-width: 85ch; }
.drug-card .drug-workspace .figure--pdsp .figure__head { padding: 0; gap: 0; border-top: 0; background: var(--bg); }
.drug-card .figure--pdsp .figure__tabs { margin: 0 24px; border-radius: 4px 4px 0 0; }
.drug-card .figure__tab { min-height: 40px; padding: 8px 20px; }
.drug-card .drug-workspace .figure--pdsp .figure__controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 32px; width: 100%; padding: 20px 24px; background: var(--bg-2); border-top: 1px solid var(--rule); }
.drug-card .figure--pdsp .figure__controltitle { display: block; grid-column: 1; grid-row: 1; margin: 0; font-size: 0.875rem; }
.drug-card .drug-workspace .figure--pdsp .figure__controls > .figure__status { grid-column: 1; grid-row: 2; display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 4px 20px; border: 0; padding: 0; margin: 0 0 4px; }
.drug-card .figure--pdsp .figure__controls > .figure__control { grid-column: 1; min-height: 28px; font-size: 0.875rem; }
.drug-card .drug-workspace .figure--pdsp .figure__controls > .figure__order:not([hidden]) { display: block; grid-column: 2; grid-row: 1 / 5; align-self: start; margin: 0; }
.drug-card .figure__order legend { float: none; font-size: 0.875rem; font-weight: 600; margin: 0 0 12px; }
.drug-card .figure__orderoptions span { padding: 10px 12px; }
.drug-card .drug-workspace .figure--pdsp .figure__plot:not([hidden]) { display: block; }
.drug-card .drug-workspace .figure__key { padding: 20px 24px 0; }
.drug-card .drug-workspace .figure__references { margin: 24px; border: 0; border-top: 1px solid var(--rule); border-radius: 0; }
.drug-card .figure__references > summary { padding: 20px 0 12px; font-size: 0.9375rem; }
.drug-card .figure__referencebody { padding: 0; }
.drug-card .figure__reference-status { min-height: 3em; }
.drug-card .figure__reference-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; max-height: none; overflow-y: visible; padding: 3px; }
.drug-card .figure__reference-list li { min-width: 0; }
.drug-card .figure__reference-list button { height: 100%; padding: 12px 10px; }
.drug-card .figure__reference-list button.is-preview { background: var(--bg-2); border-color: var(--ink-3); }
.drug-card .figure__referencebody > p:last-child { max-width: 95ch; }
@media (min-width: 1280px) {
  .drug-card { grid-template-columns: minmax(0, 1fr) 280px; }
  .drug-card__heading { grid-column: 1; grid-row: 1; }
  .drug-card > .clinical-note { grid-column: 1; grid-row: 2; }
}
@media (max-width: 1279px) {
  .drug-card .drug-workspace > .slot { grid-row: 1; }
  .drug-card .drug-workspace > .drug-panel { grid-row: 2; margin: 0; border-bottom: 0; }
  .drug-card .drug-panel__body { max-width: 420px; }
}
@media (max-width: 760px) {
  .drug-card__heading { padding: 20px 16px 0; gap: 4px 12px; }
  .drug-page .drug-card > .clinical-note { margin: 10px 16px 20px; }
  .drug-card .figure--pdsp .figure__tabs { margin: 0 16px; }
  .drug-card .drug-workspace .figure--pdsp .figure__controls { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 8px; }
  .drug-card .drug-workspace .figure--pdsp .figure__controls > .figure__order:not([hidden]) { grid-column: 1; grid-row: 5; margin-top: 8px; }
  .drug-card .figure__orderoptions span { padding: 10px; }
  .drug-card .drug-workspace .figure__key { padding: 16px 16px 0; }
  .drug-card .drug-workspace .figure__references { margin: 20px 16px; }
  .drug-card .figure__reference-list { grid-template-columns: minmax(0, 1fr); }
  .drug-card .figure--pdsp .figure__controls > .figure__control { min-height: 36px; }
}


/* C57: a molecular illustration in the article flow, without a reserved rail. */
.drug-card { display: flow-root; }
.drug-card .drug-workspace { display: block; }
.drug-card .drug-workspace > .slot { margin: 0; }
.drug-card > .drug-panel { position: static; float: right; width: 248px; max-height: none; overflow: visible; margin: 24px 24px 16px; border: 1px solid var(--rule); border-radius: 3px; background: var(--bg-2); }
.drug-card > .drug-panel .drug-panel__body { padding: 0 12px 12px; }
.drug-card > .drug-panel .molecule__frame { height: 168px; }
.drug-card > .drug-panel .molecule__controls { justify-content: center; gap: 8px; }
.drug-card > .drug-panel .molecule__controls button { min-height: 36px; min-width: 36px; font-size: 12px; }
.drug-card > .drug-panel .molecule figcaption { font-size: 12px; line-height: 1.5; }
.drug-card .figure__key, .drug-card .figure__plot, .drug-card .figure__tablewrap { clear: both; }
@media (max-width: 1279px) {
  .drug-card { display: flex; flex-direction: column; }
  .drug-card__heading { order: 0; }
  .drug-card > .clinical-note { order: 1; }
  .drug-card .drug-workspace { order: 2; width: 100%; }
  .drug-card > .drug-panel { order: 3; float: none; width: min(320px, calc(100% - 32px)); margin: 16px; align-self: center; }
}
@media print { .drug-card > .drug-panel { display: none; } }


/* C58: the live record count is the source section heading. */
.drug-card .figure__reference-count { margin: 0; padding: 20px 0 16px; font-size: 0.9375rem; font-weight: 600; }
.drug-card .figure__reference-status { min-height: 0; }


/* C60: the source list is never capped on screen; two columns on a phone. */
@media (max-width: 640px) {
  .drug-card .figure__reference-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* C62: selected workspace layout. Page chrome and rail only; plot/table styles
   above retain their scientific presentation. */
.workspace-layout { --ink: #18252d; --ink-2: #52616b; --ink-3: #5c6972; --rule: #dfe5e8; --bg-2: #f5f7f8; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px clamp(20px, 2.5vw, 48px); border-bottom: 1px solid var(--rule); background: var(--bg); }
.site-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 20px; font-weight: 650; letter-spacing: -.4px; }
.site-brand img { width: 28px; height: 34px; object-fit: contain; }
.site-brand small { padding-left: 14px; margin-left: 4px; border-left: 1px solid var(--rule); font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--ink-2); }
.site-header__actions { display: flex; align-items: center; gap: 24px; font-size: 13px; }
.site-header__actions > a { color: var(--ink-2); text-decoration: none; }
.workspace-layout > main.content { margin: 0 auto; max-width: 1600px; padding: 28px clamp(20px, 2.5vw, 48px) 56px; }
.workspace-layout .drug-card { display: block; border: 0; border-radius: 0; }
.workspace-layout .drug-card__heading { display: block; padding: 0; margin-bottom: 24px; }
.workspace-layout .drug-card__heading h1 span { color: var(--ink-2); }
.workspace-layout .figure__rail > .clinical-note { margin: 0 0 18px; padding: 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg-2); color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.workspace-layout .figure__rail > .clinical-note strong { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 600; }
.workspace-layout .figure__orderhint { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.workspace-layout .drug-card__heading h1 { font-size: 34px; letter-spacing: -1px; }
.workspace-layout .drug-card__heading h2 { margin-top: 5px; font-size: 14px; }
.workspace-layout .drug-card > .clinical-note { margin: 12px 0 22px; max-width: 85ch; font-size: 12px; color: var(--ink-2); }
.workspace-layout .drug-workspace { display: block; }
.workspace-layout .drug-card .figure--pdsp { display: grid; grid-template-columns: 224px minmax(0, 1fr); column-gap: 24px; align-items: start; }
.workspace-layout .figure__rail { grid-column: 1; grid-row: 1 / 5; padding-right: 20px; border-right: 1px solid var(--rule); min-width: 0; }
.workspace-layout .drug-card .drug-workspace .figure--pdsp .figure__head { display: block; grid-column: 2; grid-row: 1; padding: 0; border-bottom: 1px solid var(--rule); }
.workspace-layout .drug-card .figure--pdsp .figure__tabs { display: flex; gap: 20px; margin: 0; border: 0; border-radius: 0; }
.workspace-layout .drug-card .figure__tab { padding: 10px 3px; min-height: 44px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 13px; }
.workspace-layout .drug-card .figure__tab.is-active { color: var(--c1); background: transparent; border-bottom-color: var(--c1); }
.workspace-layout .drug-card .drug-workspace .figure--pdsp .figure__controls { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; padding: 10px 0 18px; border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: transparent; }
.workspace-layout .drug-card .figure--pdsp .figure__controltitle { display: none; }
.workspace-layout .drug-card .figure--pdsp .figure__controls > .figure__control { min-height: 30px; margin: 0; font-size: 12px; }
.workspace-layout .figure__control input { accent-color: var(--c1); }
.workspace-layout .drug-card .drug-workspace .figure--pdsp .figure__controls > .figure__order:not([hidden]) { display: block; flex-basis: auto; align-self: stretch; margin: 0; }
.workspace-layout .drug-card .figure__order legend { margin-bottom: 4px; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.workspace-layout .figure__orderoptions { display: block; }
.workspace-layout .figure__orderoptions label { display: flex; align-items: center; gap: 7px; min-height: 30px; }
.workspace-layout .figure__orderoptions input { position: static; opacity: 1; width: 14px; height: 14px; accent-color: var(--c1); }
.workspace-layout .drug-card .figure__orderoptions span { padding: 0; border: 0; border-radius: 0; font-size: 12px; }
.workspace-layout .figure__orderoptions input:checked + span { background: transparent; color: var(--ink); }
.workspace-layout .drug-card .drug-workspace .figure--pdsp .figure__controls > .figure__status { display: flex; flex-direction: column; flex-basis: auto; gap: 6px; padding: 0; margin: 4px 0 0; font-size: 12px; }
.workspace-layout .figure__rail .drug-panel { width: 100%; margin: 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg-2); }
.workspace-layout .drug-panel__title { padding: 12px 12px 0; font-size: 12px; }
.workspace-layout .drug-card .drug-panel__body { padding: 0 12px 12px; max-width: none; }
.workspace-layout .drug-workspace .molecule__frame { height: 160px; }
.workspace-layout .drug-workspace .molecule figcaption { font-size: 11px; line-height: 1.5; }
.workspace-layout .molecule__details { overflow-wrap: anywhere; }
.workspace-layout .drug-card .drug-workspace .figure__key { grid-column: 2; grid-row: 2; padding: 14px 0 0; }
.workspace-layout .drug-card .figure__plot { grid-column: 2; grid-row: 3; min-width: 0; }
.workspace-layout .drug-card .figure__tablewrap { grid-column: 2; grid-row: 2 / 4; min-width: 0; width: 100%; }
.workspace-layout .drug-card .figure__source { grid-column: 2; grid-row: 4; padding: 16px 0; }
.workspace-layout .drug-card .drug-workspace .figure__references { margin: 20px 0 0; }
.workspace-layout .figure__reference-heading { display: flex; align-items: baseline; gap: 12px; padding-top: 18px; }
.workspace-layout .figure__reference-heading h3 { margin: 0; font-size: 16px; }
.workspace-layout .drug-card .figure__reference-count { padding: 0; color: var(--ink-2); font-size: 12px; font-weight: 400; }
.workspace-layout .figure__reference-hint { margin: 4px 0 8px; font-size: 12px; color: var(--ink-2); }
.workspace-layout .drug-card .figure__reference-list button { padding: 10px 4px; }
.workspace-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 12px; }
.workspace-footer a { color: var(--ink-2); }
@media (max-width: 760px) {
  .site-header { padding: 12px 16px; gap: 12px; }
  .site-brand { font-size: 18px; gap: 7px; }
  .site-brand small, .site-header__actions > a { display: none; }
  .site-header__actions { gap: 0; }
  .workspace-layout > main.content { padding: 20px 16px 40px; }
  .workspace-layout .drug-card__heading h1 { font-size: 30px; }
  .workspace-layout .drug-card .figure--pdsp { display: block; }
  .workspace-layout .figure__rail { padding: 0 0 18px; border-right: 0; }
  .workspace-layout .drug-card .drug-workspace .figure--pdsp .figure__controls { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-bottom: 14px; }
  .workspace-layout .drug-card .drug-workspace .figure--pdsp .figure__controls > .figure__order:not([hidden]) { flex-basis: 100%; }
  .workspace-layout .figure__orderoptions { display: flex; flex-wrap: wrap; gap: 8px 20px; }
  .workspace-layout .drug-card .drug-workspace .figure--pdsp .figure__controls > .figure__status { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; gap: 4px 16px; }
  .workspace-layout .drug-workspace .molecule__frame { height: 150px; }
  .workspace-layout .figure__rail .drug-panel { max-width: 420px; }
}
@media print {
  .workspace-layout .site-header, .workspace-layout .figure__rail { display: none; }
  .workspace-layout .drug-card .figure--pdsp { display: block; }
  .workspace-layout > main.content { padding: 0; }
}

/* C69: restored persistent antipsychotic navigation; compact disclosure on phones. */
.workspace-layout .med-sidebar { position: fixed; top: 64px; bottom: 0; left: 0; width: 200px; overflow-y: auto; z-index: 60; background: var(--bg-2); border-right: 1px solid var(--rule); }
.med-sidebar > summary { display: none; cursor: pointer; padding: 14px 20px; font-weight: 600; }
.med-sidebar__body { padding: 24px 12px; }
.med-sidebar__heading { margin: 0 12px 12px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.med-sidebar ul { list-style: none; margin: 0; padding: 0; }
.med-sidebar li { margin: 2px 0; }
.med-sidebar li a { display: block; padding: 10px 12px; border-left: 3px solid transparent; border-radius: 4px; font-size: 14px; text-decoration: none; }
.med-sidebar li a:hover { background: var(--accent-soft); }
.med-sidebar a[aria-current="page"] { background: var(--accent-soft); border-left-color: var(--c1); font-weight: 650; }
.workspace-layout.has-med-sidebar > main.content { margin-left: 200px; }
@media (max-width: 999px) {
  .workspace-layout .med-sidebar { position: sticky; top: 0; bottom: auto; width: 100%; max-height: 80dvh; border-right: 0; border-bottom: 1px solid var(--rule); }
  .med-sidebar > summary { display: list-item; list-style-position: inside; }
  .med-sidebar__body { padding: 8px 16px 16px; }
  .med-sidebar li a { min-height: 44px; }
  .workspace-layout.has-med-sidebar > main.content { margin-left: auto; }
}
@media print {
  .workspace-layout .med-sidebar { display: none; }
  .workspace-layout.has-med-sidebar > main.content { margin-left: 0; }
}

/* C70: annotation refinements, preserving the medication sidebar. */
.has-med-sidebar .site-header { height: 64px; padding: 0 clamp(20px, 2.5vw, 48px) 0 0; }
.has-med-sidebar .site-brand { width: 200px; flex: 0 0 200px; padding: 0 12px; justify-content: center; gap: 10px; font-size: 26px; }
.has-med-sidebar .site-brand img { width: 32px; height: 38px; }
.med-sidebar .med-sidebar__heading { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.has-med-sidebar .workspace-footer { justify-content: flex-end; }
.workspace-layout .drug-card .drug-workspace .figure--pdsp .figure__controls { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 8px; padding: 16px 0; }
.workspace-layout .drug-card .figure--pdsp .figure__controls > .figure__control:not([hidden]) { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.workspace-layout .figure__control input, .workspace-layout .figure__orderoptions input { margin: 0; width: 14px; height: 14px; flex: 0 0 14px; }
.workspace-layout .drug-card .drug-workspace .figure--pdsp .figure__controls > .figure__status { flex-basis: auto; flex-direction: column; gap: 8px; margin: 8px 0; padding: 0; }
.workspace-layout .drug-card .drug-workspace .figure--pdsp .figure__controls > .figure__order:not([hidden]) { flex-basis: auto; padding: 0; margin: 8px 0 0; border: 0; }
.workspace-layout .figure__orderoptions { display: flex; flex-direction: column; gap: 8px; }
.workspace-layout .figure__orderoptions label { min-height: 32px; gap: 8px; }
.workspace-layout .drug-card .figure__order legend { margin-bottom: 8px; }
