/* Static target pages (/targets/<slug>, scripts/lib/target-pages.js). Colours come from the theme
   variables in style.css and theme-overrides.css. The potency bars and tags reuse the rc-* classes of
   receptor-profile.css, so a value looks the same here, on compound pages and on the targets list. */

.tp { padding-top: 22px; padding-bottom: 56px; }

/* The skip link focuses main. The site-wide 3px focus ring is for controls the reader chose. */
#mainContent[tabindex="-1"]:focus-visible { outline: none; }
/* A jump to an anchor (#about, #ki, a row of the targets list) must not end under the sticky site header.
   Its height follows the header breakpoints of theme-overrides.css: one row above 1180px, three rows
   between 769px and 1180px, a collapsed bar at 768px and below. */
.tp [id], .tov [id] { scroll-margin-top: 76px; }
@media (min-width: 769px) and (max-width: 1180px) {
  .tp [id], .tov [id] { scroll-margin-top: 232px; }
}

.tp-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; }
.tp-crumbs a { color: var(--text-soft); text-decoration: none; }
.tp-crumbs a:hover { color: var(--accent); text-decoration: underline; }
.tp-crumbs [aria-current="page"] { color: var(--text); }

/* Class schematics of the drawing language (design/zeichensprache, inlined by scripts/lib/target-glyphs.js):
   beside the header of a target page, at the top of a member card on a group page. The renderings take
   their colours from these tokens, so they follow the site theme. Sizes respect the minimum widths of
   the drawing language (240 px full, 80 px compact). */
.tp, .gp, .tov {
  --tg-surface: var(--bg);
  --tg-page: var(--bg);
  --tg-ink: var(--accent);
  --tg-fill: color-mix(in srgb, var(--accent) 20%, var(--bg));
  --tg-membrane: color-mix(in srgb, var(--text-muted) 13%, var(--bg));
  --tg-membrane-edge: var(--border);
  --tg-lipid: color-mix(in srgb, var(--text-muted) 30%, var(--bg));
  --tg-cargo: var(--text-soft);
  --tg-text: var(--text);
  --tg-muted: var(--text-muted);
  --tg-fold: color-mix(in srgb, var(--accent) 45%, var(--bg));
  --tg-leader: var(--text-muted);
}
.tp-glyph { margin: 0; text-align: center; }
.tp-glyph figcaption { margin-top: -6px; font-size: 0.74rem; color: var(--text-soft); }
.tp-glyph figcaption small { display: block; color: var(--text-muted); font-size: 0.68rem; }
.tg { display: block; height: auto; }
.tg--lg { width: 240px; }
.tg--sm { width: 84px; margin: -4px 0 4px -4px; }
.tg--topology { width: 100%; max-width: 320px; margin: 0 auto; font-family: inherit; }
.tp-glyph__key { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; font-size: 0.72rem; color: var(--text-soft); }
.tp-glyph__key li { display: inline-flex; align-items: center; gap: 5px; }
.tp-glyph--own figcaption { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); }
.tp-glyph--own figcaption a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.tp-eyebrow { margin: 0 0 4px; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.tp h1 { margin: 0 0 4px; font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.15; }
.tp h1 sub { font-size: 0.6em; }
.tp-sub { margin: 0 0 10px; color: var(--text-soft); }
.tp-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 0.88rem; }
.tp-facts span { margin-right: 7px; color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* The description beside a side card: the schematic, the external identifiers as a table and the way into the
   comparison. The card stays in view while the long description scrolls. */
.tp-top { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; margin-top: 26px; }
.tp-top__main > .tp-section { margin-top: 0; }
.tp-top__main .tp-about p { max-width: 76ch; }
.tp-top__main:empty { display: none; }
.tp-side { position: sticky; top: 92px; padding: 16px 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-md, 14px); background: var(--surface); }
.tp-side:not(:has(*)) { display: none; }
/* The sticky site header is three rows tall between 769 px and 1180 px and would cover a sticky card. */
@media (min-width: 769px) and (max-width: 1180px) {
  .tp-side { position: static; }
}
.tp-side .tp-glyph { margin-bottom: 14px; }
.tp-ids { margin: 0 0 14px; padding: 0; font-size: 0.86rem; }
.tp-ids > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); }
.tp-ids dt { color: var(--text-muted); }
.tp-ids dd { margin: 0; font-variant-numeric: tabular-nums; }
.tp-ids a { color: var(--accent); font-weight: 600; text-decoration: none; }
.tp-ids a:hover { text-decoration: underline; }
.tp-side__cmp { width: 100%; text-align: center; }

.tp-section { margin-top: 34px; }
.tp-section h2 { margin: 0 0 6px; font-size: 1.15rem; }
.tp-section p { line-height: 1.6; max-width: 72ch; }
.tp-lede { margin: 0 0 14px; color: var(--text-soft); font-size: 0.92rem; }

/* One card per organism, Human first and open. */
.tp-org { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm, 10px); background: var(--surface-soft); }
.tp-org__sum { display: flex; align-items: baseline; gap: 12px; padding: 11px 14px; cursor: pointer; list-style: none; }
.tp-org__sum::-webkit-details-marker { display: none; }
.tp-org__sum h3 { margin: 0; font-size: 1rem; }
.tp-org__sum span { color: var(--text-muted); font-size: 0.78rem; }
.tp-org__sum::after { content: "▸"; margin-left: auto; color: var(--text-muted); transition: transform 0.12s; }
.tp-org[open] > .tp-org__sum::after { transform: rotate(90deg); }

.tp-axis, .tp-row__sum { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 8.5rem; gap: 14px; align-items: center; }
.tp-axis { padding: 0 14px 2px; }
.tp-axis__ticks { position: relative; display: block; height: 1.1rem; }
.tp-axis__ticks i { position: absolute; top: 0; transform: translateX(-50%); font-style: normal; font-size: 0.66rem; color: var(--text-muted); white-space: nowrap; }

.tp-list { list-style: none; margin: 0; padding: 0; }
.tp-list > li { border-top: 1px solid var(--border); content-visibility: auto; contain-intrinsic-size: auto 58px; }
/* The explanation of a tag such as "depends on assay" hangs over the rows below. Every row is its own paint
   container (content-visibility), which would clip it and paint the next row over it, so the row under the
   pointer or the keyboard focus is lifted above its neighbours. */
.tp-list > li:has(.rc-tag--disputed:hover, .rc-tag--untraced:hover, .rc-tag--disputed:focus-visible, .rc-tag--untraced:focus-visible) { content-visibility: visible; position: relative; z-index: 30; }
.tp-row__sum { position: relative; padding: 10px 34px 10px 14px; cursor: pointer; list-style: none; }
.tp-row__sum::-webkit-details-marker { display: none; }
.tp-row__sum::after { content: "▸"; position: absolute; right: 12px; top: 50%; margin-top: -0.6em; color: var(--text-muted); transition: transform 0.12s; }
.tp-row[open] > .tp-row__sum::after { transform: rotate(90deg); }
.tp-row__sum:hover { background: var(--surface-muted); }
.tp-row__sum:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tp-row__who { min-width: 0; }
.tp-row__name { font-weight: 500; font-size: 0.94rem; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.tp-row__name:hover { color: var(--accent); text-decoration: underline; }
.tp-row__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tp-row__tags:empty { display: none; }
.tp-row__val { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-family: var(--font-mono, monospace); line-height: 1.3; text-align: right; }
.tp-row__val strong { font-size: 0.88rem; font-weight: 600; white-space: nowrap; }
.tp-row__val small { font-size: 0.68rem; color: var(--text-muted); }

/* The evidence panel of a row: assay, the shown report, the reports behind the range. */
.tp-ev { margin: 0 14px 12px; padding: 12px 14px; background: var(--surface-muted); border-left: 2px solid var(--accent); border-radius: 0 var(--radius-sm, 10px) var(--radius-sm, 10px) 0; }
.tp-ev__facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 16px; margin: 0; font-size: 0.82rem; }
.tp-ev__facts dt { color: var(--text-muted); }
.tp-ev__facts dd { margin: 0; overflow-wrap: anywhere; }
.tp-ev__note { margin: 10px 0 0; font-size: 0.8rem; color: var(--text-soft); }
.tp-ev__table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 0.8rem; }
.tp-ev__table caption { padding-bottom: 5px; text-align: left; color: var(--text-muted); font-size: 0.74rem; }
.tp-ev__table th, .tp-ev__table td { padding: 5px 8px 5px 0; text-align: left; border-top: 1px solid var(--border); vertical-align: top; }
.tp-ev__table th { color: var(--text-muted); font-weight: 500; }

.tp-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tp-chips li { padding: 3px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-soft); font-size: 0.82rem; }
.tp-chips a { color: var(--text-soft); text-decoration: none; }
.tp-chips a:hover { color: var(--accent); }

/* Sourced description (phase A5): numbered sources after each sentence, the list below the text. */
.tp-cite { margin-left: 1px; font-size: 0.7em; line-height: 0; }
.tp-cite a { color: var(--accent); text-decoration: none; }
.tp-cite a:hover { text-decoration: underline; }
.tp-sources { margin-top: 18px; max-width: 72ch; border-top: 1px solid var(--border); padding-top: 10px; }
.tp-sources > summary { cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--text-soft); }
.tp-sources > summary:hover { color: var(--text); }
.tp-sources[open] > summary { margin-bottom: 4px; }
.tp-refs { margin: 8px 0 0; padding-left: 22px; max-width: 72ch; font-size: 0.78rem; color: var(--text-soft); }
.tp-refs li { margin: 3px 0; }
.tp-refs li:target { color: var(--text); }
.tp-refs a { color: var(--accent); font-weight: 600; }
.tp-refs span { display: block; color: var(--text-muted); }
.tp-note { margin-top: 34px; font-size: 0.78rem; color: var(--text-muted); max-width: 72ch; }

@media (max-width: 720px) {
  .tp-axis { display: none; }
  .tp-row__sum { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .tp-row__bar { grid-column: 1 / -1; grid-row: 2; }
  .tp-row__val { grid-row: 1; grid-column: 2; }
  .tp-ev { margin-left: 8px; margin-right: 8px; }
  .tp-ev__facts { grid-template-columns: 1fr; gap: 0; }
  .tp-ev__facts dd { margin-bottom: 6px; }
  .tp-ev__table { display: block; overflow-x: auto; }
}

/* Group pages (/targets/<group>, phase A4a): member list, matrix and evidence panel. */
.gp-members { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 10px; }
.gp-member { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm, 10px); background: var(--surface-soft); }
.gp-member--unresolved { border-style: dashed; }
.gp-member__name { display: block; font-weight: 600; }
.gp-member__name a { color: var(--text); text-decoration: none; }
.gp-member__name a:hover { color: var(--accent); text-decoration: underline; }
.gp-member__meta { display: block; margin-top: 2px; font-size: 0.76rem; color: var(--text-muted); }

.gp-matrix { border-collapse: separate; border-spacing: 4px; width: 100%; font-size: 0.86rem; }
.gp-matrix thead th { padding: 4px 6px; text-align: center; font-weight: 600; white-space: nowrap; }
.gp-matrix thead th:first-child { text-align: left; padding-left: 10px; }
.gp-matrix thead th a { color: var(--text); text-decoration: none; }
.gp-matrix thead th a:hover { color: var(--accent); text-decoration: underline; }
.gp-matrix thead small { display: block; font-weight: 400; color: var(--text-muted); font-size: 0.68rem; }
.gp-matrix tbody th { padding: 4px 8px 4px 10px; text-align: left; font-weight: 500; white-space: nowrap; }
.gp-matrix tbody th a { color: var(--text); text-decoration: none; }
.gp-matrix tbody th a:hover { color: var(--accent); text-decoration: underline; }
.gp-matrix tbody th small { display: block; color: var(--text-muted); font-size: 0.68rem; font-weight: 400; }
/* Text for screen readers only, such as "not measured" in an empty cell. */
/* Wide tables scroll inside their box, never the page (the class was only defined on the A5a branch). */
.tp-tablewrap { max-width: 100%; overflow-x: auto; }
.tp-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gp-cell { position: relative; padding: 0; min-width: 5.5rem; border-radius: 8px; text-align: center; }
.gp-cell--value { background: color-mix(in srgb, var(--accent) var(--gp-shade, 20%), transparent); }
.gp-cell--weak { background: repeating-linear-gradient(135deg, var(--surface-soft) 0 6px, transparent 6px 12px); border: 1px dashed var(--border-strong); }
.gp-cell--none { background: transparent; border: 1px dotted var(--border); }
.gp-btn { width: 100%; padding: 9px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-family: var(--font-mono, monospace); font-size: 0.84rem; cursor: pointer; }
.gp-cell--weak .gp-btn { color: var(--text-muted); font-size: 0.76rem; }
.gp-btn:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.gp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gp-btn[aria-pressed="true"] { outline: 2px solid var(--accent-strong, var(--accent)); outline-offset: -2px; font-weight: 700; }
.gp-mark { margin-left: 2px; color: var(--accent); font-weight: 700; }

.gp-evidence { position: sticky; bottom: 12px; z-index: 5; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: var(--radius-sm, 10px); background: var(--surface-elevated, var(--surface-soft)); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); max-height: 55vh; overflow: auto; }
.gp-evidence__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.gp-evidence__head h3 { margin: 0; font-size: 1rem; }
.gp-evidence__head a { color: var(--accent); }
.gp-evidence__close { border: 0; background: transparent; color: var(--text-muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.gp-evidence__more { margin: 10px 0 0; font-size: 0.8rem; color: var(--text-soft); }
.gp-evidence__more a, .gp-evidence dd a { color: var(--accent); }

.gp-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 0.76rem; color: var(--text-muted); }
.gp-legend b { color: var(--text-soft); font-weight: 600; }
.gp-swatch { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: middle; }
.gp-swatch--strong { background: color-mix(in srgb, var(--accent) 58%, transparent); }
.gp-swatch--weak { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Group pages: view switch, filters and the network view (A4b). The switch and the filters are form
   fields, :has() applies them without JavaScript. */
.gp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 4px 0 12px; font-size: 0.84rem; }
.gp-sec:has(.gp-in-net:checked) .gp-view--table,
.gp-sec:has(.gp-in-table:checked) .gp-view--net,
.gp-sec:has(.gp-in-table:checked) .gp-only-net { display: none; }
.gp-sec:not(:has(.gp-in-all:checked)) .gp-extra { display: none; }
.gp-sec:not(:has(.gp-in-weak:checked)) .gp-edge--weak { display: none; }
.gp:not(:has(.gp-in-table:checked)) .gp-legend--table { display: none; }
.gp-row.is-on > th { box-shadow: inset 3px 0 0 var(--accent); }

.gp-view--net { margin: 0; }
.gp-netwrap { overflow-x: auto; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm, 10px); background: var(--surface-soft); }
.gp-net { display: block; max-width: 100%; height: auto; margin: 0 auto; font-family: inherit; }
.gp-net text { font-size: 12px; fill: var(--text); }
.gp-edge__line { stroke: var(--accent); stroke-width: var(--w, 1); opacity: var(--o, 0.6); stroke-linecap: round; }
.gp-edge__hit { stroke: transparent; stroke-width: 12; cursor: pointer; }
.gp-edge--disputed .gp-edge__line { stroke-dasharray: 7 5; stroke-linecap: butt; }
.gp-edge--weak line { stroke: var(--text-muted); stroke-width: 1.5; cursor: pointer; }
.gp-edge--weak line:first-of-type { stroke-dasharray: 2 3; }
.gp-anchor { cursor: pointer; }
.gp-anchor circle { fill: var(--surface); stroke: var(--text); stroke-width: 2.5; }
.gp-anchor--unresolved circle { stroke: var(--text-muted); stroke-dasharray: 3 2; }
.gp-anchor__label { font-weight: 700; }
.gp-anchor--unresolved .gp-anchor__label { font-weight: 500; fill: var(--text-muted); }
.gp-lig { cursor: pointer; }
.gp-lig rect { fill: var(--surface-elevated, var(--surface)); stroke: var(--border-strong); }
.gp-lig text { text-anchor: middle; }
.gp-net g:focus { outline: none; }
.gp-lig:hover rect, .gp-lig:focus-visible rect, .gp-lig.is-on rect { stroke: var(--accent); stroke-width: 2; }
.gp-anchor:hover circle, .gp-anchor:focus-visible circle, .gp-anchor.is-on circle { stroke: var(--accent); }
.gp-val { display: none; pointer-events: none; }
.gp-val rect { fill: var(--surface-elevated, var(--surface)); stroke: var(--accent); }
.gp-val text { font-family: var(--font-mono, monospace); font-size: 11px; text-anchor: middle; }
.gp-net.is-focused .gp-edge, .gp-net.is-focused .gp-lig { opacity: 0.16; }
.gp-net.is-focused .gp-edge.is-on, .gp-net.is-focused .gp-lig.is-on { opacity: 1; }
.gp-net.is-focused .gp-val.is-on { display: inline; }
.gp-edge.is-picked .gp-edge__line { stroke: var(--accent-strong, var(--accent)); opacity: 1; }
.gp-legend--net { margin: 10px 0 0; }
.gp-key { width: 28px; height: 10px; vertical-align: middle; }
.gp-key line { stroke: var(--accent); stroke-linecap: round; }
.gp-key--disputed line { stroke-dasharray: 6 4; stroke-linecap: butt; }
.gp-key--weak line { stroke: var(--text-muted); stroke-width: 1.5; }
.gp-key--weak line:first-child { stroke-dasharray: 2 3; }

@media (max-width: 720px) {
  .tp-top { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .tp-side { position: static; order: -1; padding: 12px 14px 14px; }
  .tp-side .tg--topology { max-width: 290px; }
  .tp-ids { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-bottom: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
  .tp-ids > div { border-top: 0; padding: 2px 0; gap: 8px; }
  .gp-cell { min-width: 4.4rem; }
  .gp-btn { padding: 8px 4px; font-size: 0.78rem; }
  .gp-evidence { bottom: 6px; }
  /* The network keeps a readable text size on a phone and scrolls sideways instead. */
  .gp-net { max-width: none; width: calc(var(--net-w) * 0.75); }
}

/* Organism filter, comparison choice and comparison page (phase A4c). */
.gp-organism { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 16px 0 0; padding: 0; border: 0; font-size: 0.84rem; color: var(--text-soft); }
.gp-organism legend { float: left; margin-right: 4px; padding: 0; font-weight: 600; color: var(--text); }
.gp-organism__note { flex-basis: 100%; color: var(--text-muted); }
.gp-org { font-family: inherit; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.gp-cell--multi .gp-btn { padding: 4px 6px; }
.gp-cell--multi .gp-btn + .gp-btn { border-top: 1px dashed var(--border); border-radius: 0; }
.cmp-bar { position: sticky; bottom: 12px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; width: fit-content; max-width: 100%; margin: 18px 0 0 auto; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-elevated, var(--surface)); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); font-size: 0.86rem; }
.cmp-bar[hidden], .cmp-bar__go[hidden] { display: none; }
.cmp-form { margin-top: 14px; max-width: 46rem; }
.cmp-form__label { display: block; margin-bottom: 4px; font-size: 0.8rem; font-weight: 600; }
.cmp-form__row { display: flex; gap: 8px; }
.cmp-form__row input { flex: 1; min-width: 0; }
.cmp-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.cmp .tgt-status { margin: 18px 0 0; color: var(--text-soft); }

/* Targets overview (/targets, scripts/lib/target-overview.js). */
.tgt-intro { color: var(--text-soft); line-height: 1.6; max-width: 72ch; margin: 4px 0 18px; }
/* The catalogue: a rail of classes and families on the left, the table of the chosen family on the right. Without
   JavaScript every family stays on the page one below the other and the rail jumps to them. With JavaScript
   (assets/js/targets-overview.js) the panel shows one family at a time, or every match of a filter. */
.tov-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; align-items: start; }
.tov-rail { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-md, 14px); background: var(--surface); font-size: 0.86rem; }
.tov-rail ul { margin: 0; padding: 0; list-style: none; }
.tov-rail__class + .tov-rail__class { margin-top: 6px; }
.tov-rail__link { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--text-soft); text-decoration: none; }
.tov-rail__link small { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tov-rail__link:hover { background: var(--surface-soft); color: var(--text); }
.tov-rail__link--class { font-weight: 700; color: var(--text); }
.tov-rail__fams .tov-rail__link { padding-left: 22px; }
.tov-rail__link.is-current { background: var(--accent-soft); color: var(--text); }
.tov-rail__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tov-split .tov-rail__class:not(.is-open) .tov-rail__fams { display: none; }

.tov-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; }
.tov-filter { flex: 1 1 260px; max-width: 380px; }
.tov-filter[hidden], .tov-only[hidden] { display: none; }
.tov-filter input { width: 100%; }
.tov-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tov-class { margin-top: 30px; }
.tov-class:first-child { margin-top: 0; }
.tov-class[hidden], .tov-family[hidden], .tov-group[hidden], .tov-row[hidden] { display: none; }
.tov-class__head { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.tov-class__head h2 { margin: 0; font-size: 1.2rem; }
.tov-class__head .tg--sm { width: 80px; margin: 0; }
.tov-class__count { margin-left: auto; padding: 3px 11px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 20%, transparent); font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.tov-split .tov-class { margin-top: 0; }
.tov-split .tov-class__head { display: none; }
.tov-family { margin-top: 20px; }
.tov-split .tov-family { margin-top: 0; }
.tov-split.tov-searching .tov-family { margin-top: 26px; }
.tov-split.tov-searching .tov-family:first-of-type { margin-top: 0; }
.tov-family__head { display: flex; align-items: flex-end; gap: 12px; margin: 0 0 10px; }
.tov-family__eyebrow { display: none; margin: 0 0 3px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); }
.tov-split .tov-family__eyebrow { display: block; }
.tov-family__head h3 { margin: 0; font-size: 1.3rem; letter-spacing: -0.02em; line-height: 1.2; }
.tov-family__count { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.tov-tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md, 14px); background: var(--surface); }
.tov-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.tov-col-sub { width: 104px; }
.tov-col-val { width: 176px; }
.tov-table th, .tov-table td { padding: 9px 14px; text-align: left; font-size: 0.9rem; }
.tov-table thead th { padding-top: 10px; padding-bottom: 8px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-soft); }
.tov-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tov-cell--pick { width: 76px; white-space: nowrap; }
.tov-group__row th { padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface-soft); font-size: 0.86rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.tov-group__row a { color: var(--text); }
.tov-group__row a:hover { color: var(--accent); }
.tov-group__cta { margin-left: 12px; font-size: 0.76rem; font-weight: 400; color: var(--text-muted); }
.tov-row td { vertical-align: top; border-top: 1px solid var(--border); }
.tov-row:hover td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.tov-row.is-target td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tov-row__main { display: block; min-width: 0; }
.tov-row__name { font-weight: 600; color: var(--text); text-decoration: none; }
a.tov-row__name:hover { color: var(--accent); text-decoration: underline; }
.tov-row--plain .tov-row__name { font-weight: 500; color: var(--text-soft); }
.tov-row__gene { margin-left: 8px; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--text-muted); }
.tov-row__tag { margin-left: 8px; padding: 1px 7px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.tov-row__fn { display: block; margin-top: 2px; max-width: 62ch; overflow: hidden; font-size: 0.78rem; line-height: 1.45; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; }
.tov-bar { display: inline-block; width: 84px; height: 6px; margin-right: 10px; overflow: hidden; vertical-align: middle; border-radius: 3px; background: var(--surface-muted); }
.tov-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.tov-none { font-size: 0.8rem; color: var(--text-muted); }
.tov-values { margin-top: 4px; font-size: 0.8rem; }
.tov-values summary { cursor: pointer; color: var(--accent); }
.tov-values ul { margin: 6px 0; padding-left: 18px; }
.tov-values small { color: var(--text-muted); }
.tov-values p { margin: 0; font-size: 0.74rem; color: var(--text-muted); }
.tov-empty { padding: 26px 4px; color: var(--text-muted); }

@media (max-width: 900px) {
  .tov-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tov-rail { position: static; max-height: 15rem; }
}
@media (max-width: 600px) {
  .tov-col-sub { display: none; }
  .tov-col-val { width: 118px; }
  .tov-cell--pick { width: 56px; }
  .tov-filter { max-width: none; }
  .tov-table th, .tov-table td { padding: 8px 10px; }
  .tov-bar { width: 56px; }
  .cmp-bar { margin-right: auto; }
}

/* Substance-first entry of /targets (scripts/lib/target-wheel.js, docs/TARGETS-ENTRY-ROADMAP.md phase 2): the wheel
   of the signalling systems, "Main targets" and the list of the systems. Colours come from the theme
   variables. No potency colour scale: a dot is plain, a ring or a key target (filled), nothing else. */
.te { margin: 8px 0 40px; }
.te-skip { position: absolute; left: -9999px; top: auto; }
.te-skip:focus { position: static; display: inline-block; margin-bottom: 8px; }
.te a { text-underline-offset: 3px; }

.tw { margin: 0 auto; max-width: 820px; }
.tw-svg { width: 100%; height: auto; display: block; overflow: visible; }
.tw-arc { fill: none; stroke: var(--text-muted); stroke-width: 1; opacity: 0.55; }
.tw-arc.is-hit { stroke: var(--accent); stroke-width: 2.5; opacity: 1; }
.tw-sys { font: 700 15px "Segoe UI", system-ui, -apple-system, sans-serif; letter-spacing: 0.08em; fill: var(--text-muted); stroke: none; }
.tw-sys.is-hit { fill: var(--text); }
.tw-spoke { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0; }
.tw-spoke.is-key { opacity: 1; }
.tw-dot { fill: var(--bg); stroke: var(--text-muted); stroke-width: 1.4; r: 4px; }
.tw-node.is-ring .tw-dot { stroke: var(--accent); stroke-width: 2.5; r: 5.5px; }
.tw-node.is-key .tw-dot { fill: var(--accent); stroke: var(--accent-strong); stroke-width: 2; r: 7px; }
.tw-label { font: 18px "Segoe UI", system-ui, -apple-system, sans-serif; fill: var(--text-muted); stroke: none; }
.tw-node.is-ring .tw-label { fill: var(--text-soft); }
.tw-node.is-key .tw-label { fill: var(--text); font-weight: 700; }
.tw-tick { stroke: var(--border); stroke-width: 1; }
a.tw-node { cursor: pointer; text-decoration: none; }
/* Hover and focus: the dot gets a soft ring and the name turns dark. No underline, which looked ragged on a text in a vector graphic. */
.tw-halo { fill: var(--accent-soft); opacity: 0; pointer-events: none; }
a.tw-node:hover .tw-halo, a.tw-node:focus-visible .tw-halo { opacity: 1; }
a.tw-node:hover .tw-label, a.tw-node:focus-visible .tw-label { fill: var(--text); }
a.tw-node:hover .tw-dot { stroke: var(--accent); }
a.tw-node:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.tw-node.is-nopage { cursor: default; }
.tw-core { fill: var(--surface-elevated, var(--surface)); stroke: var(--accent); stroke-width: 1.5; }
.tw-core-name { font: 700 28px "Segoe UI", system-ui, -apple-system, sans-serif; fill: var(--text); }
.tw-core-sub { font: 14px "Segoe UI", system-ui, -apple-system, sans-serif; fill: var(--text-muted); letter-spacing: 0.04em; }
.tw-cap { font-size: 0.82rem; color: var(--text-muted); line-height: 1.55; max-width: 62em; margin: 8px auto 0; text-align: center; }

.te-readout { padding: 32px 0 8px; }
.te-eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 18px; }
.te-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); border-top: 2px solid var(--accent); }
.te-key li { display: flex; flex-direction: column; padding: 16px 20px 6px 0; margin-right: 20px; border-right: 1px solid var(--border); }
.te-key li:last-child { border-right: 0; margin-right: 0; }
.te-sys { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.te-name { align-self: flex-start; font-size: 1.15rem; font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--accent); color: var(--text); }
.te-name.is-nopage { border-bottom-style: dotted; }
.te-meta { color: var(--text-soft); margin: 8px 0 4px; font-size: 0.9rem; line-height: 1.5; }
.te-count { margin-top: auto; padding-bottom: 12px; font-size: 0.82rem; color: var(--text-muted); }
.te-sub { margin: 28px 0 10px; font-size: 0.95rem; font-weight: 700; color: var(--text); }
.te-more__row { display: grid; grid-template-columns: minmax(130px, 0.22fr) minmax(0, 1fr); gap: 4px 20px; padding: 8px 0; border-top: 1px solid var(--border); align-items: baseline; }
.te-more__row .te-sys { margin: 0; }
.te-more__row p { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.95rem; }
.is-nopage { color: var(--text-muted); }

.te-systems { padding: 40px 0 12px; margin-top: 28px; border-top: 1px solid var(--border); }
.te-title { margin: 0 0 8px; font-size: clamp(1.5rem, 2vw, 1.9rem); letter-spacing: -0.03em; font-weight: 700; line-height: 1.15; }
.te-sub-lede { margin: 0 0 20px; color: var(--text-soft); line-height: 1.7; max-width: 46em; }
.te-srow { display: grid; grid-template-columns: minmax(180px, 0.3fr) minmax(0, 1fr); gap: 8px 40px; padding: 14px 0; border-top: 1px solid var(--border); align-items: baseline; }
.te-srow__name { font-size: 1.1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 14px; letter-spacing: -0.02em; }
.te-glyph { width: 30px; height: 30px; flex: none; }
.te-glyph circle { fill: none; stroke: var(--border); stroke-width: 2; }
.te-glyph path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.te-srow__t { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.95rem; }
.te-srow__t a { display: inline-block; line-height: 1.45; padding: 3px 0 2px; }
/* The underline of these links is a border, not a text underline: under a lowered index (5-HT2A) a text underline steps down. */
.te-srow__t a, .te-more p a { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, currentColor 55%, transparent); }
.te-more p a { display: inline-block; padding-bottom: 1px; }
.te-srow__t a:hover, .te-more p a:hover { border-bottom-color: currentColor; }
/* Body-size links: the dark accent on the dark page is a little under the AA ratio for small text. */
html[data-theme="dark"] .te-more a, html[data-theme="dark"] .te-srow__t a { color: #c4b5fd; }
html[data-theme="light"] .te-more a, html[data-theme="light"] .te-srow__t a { color: var(--accent-strong); }

@media (max-width: 768px) {
  .tw-label { font-size: 18px; }
  .te-readout { padding-top: 24px; }
  .te-key { grid-template-columns: 1fr; }
  .te-key li { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--border); padding: 14px 0; }
  .te-more__row, .te-srow { grid-template-columns: 1fr; }
}

/* Choice of the substance (assets/js/target-entry.js): search over every compound and the quick chips. */
.te-pick { margin: 0 0 24px; max-width: 560px; }
.te-pick__label { display: block; font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.te-pick__field { position: relative; max-width: 420px; }
.te-pick__input { width: 100%; }
.te-suggest { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; list-style: none; max-height: 320px; overflow: auto; }
.te-suggest[hidden] { display: none; }
.te-chips { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.te-chips__more { display: inline-flex; align-items: center; min-height: 32px; font-size: 0.86rem; }
.te-chips__more a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; }
.te-status { min-height: 1.3em; margin: 8px 0 0; font-size: 0.82rem; color: var(--text-muted); }
.te-none { margin: 14px 0 0; color: var(--text-soft); }
@media (max-width: 768px) { .te-pick { max-width: none; } }

/* Phase 4: heading, lead and choice on the left, the wheel on the right, the catalogue below its own heading. */
.te-hero { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 24px 40px; align-items: start; padding: 20px 0 0; }
.te-hero .about-eyebrow { margin: 0 0 8px; }
.te-hero h1 { margin: 12px 0 0; max-width: 14ch; font-size: clamp(2.35rem, 4.4vw, 3.7rem); line-height: 1.04; letter-spacing: -0.03em; font-weight: 700; }
.te-lead { margin: 22px 0 0; max-width: 58ch; color: var(--text-soft); font-size: clamp(1.05rem, 1.5vw, 1.18rem); line-height: 1.7; }
.te-hero .te-pick { margin: 28px 0 0; }
.te-hero .tw { max-width: none; margin: 0; }
.te-hero .tw-cap { text-align: right; margin-right: 0; margin-left: auto; }
.te-quiet { padding: 28px 0 8px; margin-top: 28px; border-top: 1px solid var(--border); color: var(--text-muted); }
.te-quiet p { margin: 0 0 10px; }
.te-quiet a { color: var(--text-soft); text-underline-offset: 3px; }
.te-quiet__sep { display: inline-block; width: 1px; height: 14px; background: var(--border); margin: 0 16px; vertical-align: middle; }
.te-caveat { font-size: 0.82rem; line-height: 1.55; max-width: 82ch; }
.te-catalogue { padding-top: 36px; }
.te-catalogue h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 2vw, 1.9rem); letter-spacing: -0.03em; line-height: 1.15; }
@media (max-width: 1180px) {
  .te-hero { grid-template-columns: 1fr; gap: 8px; padding-top: 12px; }
  .te-hero .tw { max-width: 820px; margin: 0 auto; }
  .te-hero .tw-cap { text-align: left; margin-left: 0; }
}
@media (max-width: 768px) {
  .te-hero h1 { font-size: 2.3rem; }
  .te-lead { font-size: 1.02rem; }
  .te-quiet__sep { display: block; width: 0; height: 8px; }
}
.te-hero .tw { scroll-margin-top: 76px; }
